triqai 0.1.17 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +34 -0
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +575 -1
- package/dist/index.d.ts +575 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/openapi-public.yaml +169 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/http-client.ts","../src/resources/categories.ts","../src/resources/intermediaries.ts","../src/pagination.ts","../src/resources/issue-reports.ts","../src/resources/locations.ts","../src/resources/merchants.ts","../src/resources/transactions.ts","../src/client.ts","../src/index.ts"],"names":[],"mappings":";AAeO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA;AAAA,EAE5B,UAAA;AAAA;AAAA,EAEA,IAAA;AAAA;AAAA,EAEA,SAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,IAAA;AAAA,EAET,WAAA,CACE,OAAA,EACA,UAAA,EACA,IAAA,EAMA;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AACZ,IAAA,IAAA,CAAK,UAAA,GAAa,UAAA;AAClB,IAAA,IAAA,CAAK,IAAA,GAAO,MAAM,IAAA,IAAQ,eAAA;AAC1B,IAAA,IAAA,CAAK,YAAY,IAAA,EAAM,SAAA;AACvB,IAAA,IAAA,CAAK,WAAW,IAAA,EAAM,QAAA;AACtB,IAAA,IAAA,CAAK,OAAO,IAAA,EAAM,IAAA;AAAA,EACpB;AACF;AAEO,IAAM,mBAAA,GAAN,cAAkC,WAAA,CAAY;AAAA,EACnD,WAAA,CAAY,SAAiB,IAAA,EAAqD;AAChF,IAAA,KAAA,CAAM,SAAS,GAAA,EAAK,EAAE,M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AAA,EAUA,MAAM,OAAA,CACJ,IAAA,EACA,IAAA,EAC0B;AAC1B,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,IAAA,CAAQ,IAAA,EAAM,IAAI,CAAA;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,UAAuB,IAAA,EAAwC;AACnE,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,MAAA,CAAU,IAAI,CAAA;AAAA,EACjC;AACF;;;ACrIA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["import type { RateLimitInfo } from \"./types/index.js\";\n\nexport interface RawErrorObject {\n code: string;\n message: string;\n details?: Record<string, unknown>;\n}\n\nexport interface RawResponseMeta {\n generatedAt: string;\n requestId: string;\n version: string;\n [key: string]: unknown;\n}\n\nexport class TriqaiError extends Error {\n /** HTTP status code from the API response. */\n readonly statusCode: number;\n /** Machine-readable error code from the API (e.g. \"validation_error\"). */\n readonly code: string;\n /** Correlation ID for support inquiries. */\n readonly requestId: string | undefined;\n /** The raw error body returned by the API. */\n readonly rawError: RawErrorObject | undefined;\n /** Response metadata. */\n readonly meta: RawResponseMeta | undefined;\n\n constructor(\n message: string,\n statusCode: number,\n opts?: {\n code?: string;\n requestId?: string;\n rawError?: RawErrorObject;\n meta?: RawResponseMeta;\n },\n ) {\n super(message);\n this.name = \"TriqaiError\";\n this.statusCode = statusCode;\n this.code = opts?.code ?? \"unknown_error\";\n this.requestId = opts?.requestId;\n this.rawError = opts?.rawError;\n this.meta = opts?.meta;\n }\n}\n\nexport class AuthenticationError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 401, { code: \"authentication_error\", ...opts });\n this.name = \"AuthenticationError\";\n }\n}\n\nexport class AuthorizationError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 403, { code: \"authorization_error\", ...opts });\n this.name = \"AuthorizationError\";\n }\n}\n\nexport class InsufficientCreditsError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 402, { code: \"insufficient_credits\", ...opts });\n this.name = \"InsufficientCreditsError\";\n }\n}\n\nexport class NotFoundError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 404, { code: \"not_found\", ...opts });\n this.name = \"NotFoundError\";\n }\n}\n\nexport class ValidationError extends TriqaiError {\n readonly fieldErrors: Record<string, string[]>;\n\n constructor(\n message: string,\n fieldErrors?: Record<string, string[]>,\n opts?: ConstructorParameters<typeof TriqaiError>[2],\n ) {\n super(message, 422, { code: \"validation_error\", ...opts });\n this.name = \"ValidationError\";\n this.fieldErrors = fieldErrors ?? {};\n }\n}\n\nexport class ClientDisconnectedError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 499, { code: \"client_disconnected\", ...opts });\n this.name = \"ClientDisconnectedError\";\n }\n}\n\nexport class DuplicateRequestError extends TriqaiError {\n readonly state: \"in_progress\" | \"completed\" | undefined;\n readonly duplicateRequestId: string | undefined;\n readonly retryAfter: number | undefined;\n\n constructor(\n message: string,\n opts?: ConstructorParameters<typeof TriqaiError>[2] & {\n state?: \"in_progress\" | \"completed\";\n duplicateRequestId?: string;\n retryAfter?: number;\n },\n ) {\n super(message, 409, { code: \"DUPLICATE_REQUEST\", ...opts });\n this.name = \"DuplicateRequestError\";\n this.state = opts?.state;\n this.duplicateRequestId = opts?.duplicateRequestId;\n this.retryAfter = opts?.retryAfter;\n }\n}\n\nexport class RateLimitError extends TriqaiError {\n readonly rateLimitInfo: RateLimitInfo;\n\n constructor(\n message: string,\n rateLimitInfo: RateLimitInfo,\n opts?: ConstructorParameters<typeof TriqaiError>[2],\n ) {\n super(message, 429, { code: \"rate_limited\", ...opts });\n this.name = \"RateLimitError\";\n this.rateLimitInfo = rateLimitInfo;\n }\n}\n\nexport class InternalServerError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 500, { code: \"internal_error\", ...opts });\n this.name = \"InternalServerError\";\n }\n}\n\nexport class ServiceUnavailableError extends TriqaiError {\n readonly retryAfter: number | undefined;\n\n constructor(\n message: string,\n retryAfter?: number,\n opts?: ConstructorParameters<typeof TriqaiError>[2],\n ) {\n super(message, 503, { code: \"service_unavailable\", ...opts });\n this.name = \"ServiceUnavailableError\";\n this.retryAfter = retryAfter;\n }\n}\n\nexport class GatewayTimeoutError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 504, { code: \"gateway_timeout\", ...opts });\n this.name = \"GatewayTimeoutError\";\n }\n}\n\nexport class ConnectionError extends TriqaiError {\n constructor(message: string) {\n super(message, 0, { code: \"connection_error\" });\n this.name = \"ConnectionError\";\n }\n}\n\nexport class TimeoutError extends TriqaiError {\n constructor(message: string) {\n super(message, 0, { code: \"timeout\" });\n this.name = \"TimeoutError\";\n }\n}\n","import {\n AuthenticationError,\n AuthorizationError,\n ClientDisconnectedError,\n ConnectionError,\n DuplicateRequestError,\n GatewayTimeoutError,\n InsufficientCreditsError,\n InternalServerError,\n NotFoundError,\n RateLimitError,\n ServiceUnavailableError,\n TimeoutError,\n TriqaiError,\n ValidationError,\n} from \"./errors.js\";\nimport type { RawErrorObject, RawResponseMeta } from \"./errors.js\";\nimport type {\n RateLimitInfo,\n RequestInfo,\n ResponseInfo,\n TriqaiConfig,\n} from \"./types/index.js\";\n\nconst DEFAULT_BASE_URL = \"https://api.triqai.com\";\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_DELAY = 500;\nconst DEFAULT_MAX_RETRY_DELAY = 30_000;\nconst DEFAULT_TIMEOUT = 60_000;\nconst RETRYABLE_STATUS_CODES = new Set([429, 500, 503, 504]);\nconst SDK_VERSION = \"0.1.1\";\n\nexport interface HttpResponse<T> {\n data: T;\n status: number;\n headers: Record<string, string>;\n rateLimitInfo: RateLimitInfo;\n}\n\nexport class HttpClient {\n private readonly apiKey: string;\n private readonly baseUrl: string;\n private readonly maxRetries: number;\n private readonly retryDelay: number;\n private readonly maxRetryDelay: number;\n private readonly timeout: number;\n private readonly defaultHeaders: Record<string, string>;\n private readonly onRequest?: (info: RequestInfo) => void;\n private readonly onResponse?: (info: ResponseInfo) => void;\n\n constructor(apiKey: string, config: TriqaiConfig = {}) {\n if (!apiKey) {\n throw new Error(\n \"API key is required. Get yours at https://triqai.com/dashboard\",\n );\n }\n this.apiKey = apiKey;\n this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;\n this.retryDelay = config.retryDelay ?? DEFAULT_RETRY_DELAY;\n this.maxRetryDelay = config.maxRetryDelay ?? DEFAULT_MAX_RETRY_DELAY;\n this.timeout = config.timeout ?? DEFAULT_TIMEOUT;\n this.defaultHeaders = config.defaultHeaders ?? {};\n this.onRequest = config.onRequest;\n this.onResponse = config.onResponse;\n }\n\n async get<T>(path: string, query?: Record<string, unknown>): Promise<HttpResponse<T>> {\n return this.request<T>(\"GET\", path, undefined, query);\n }\n\n async post<T>(path: string, body?: unknown): Promise<HttpResponse<T>> {\n return this.request<T>(\"POST\", path, body);\n }\n\n async delete<T>(path: string): Promise<HttpResponse<T>> {\n return this.request<T>(\"DELETE\", path);\n }\n\n private async request<T>(\n method: string,\n path: string,\n body?: unknown,\n query?: Record<string, unknown>,\n extraHeaders?: Record<string, string>,\n ): Promise<HttpResponse<T>> {\n const url = this.buildUrl(path, query);\n const headers: Record<string, string> = {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": `triqai-node/${SDK_VERSION}`,\n Accept: \"application/json\",\n ...this.defaultHeaders,\n ...extraHeaders,\n };\n\n if (body !== undefined) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.maxRetries; attempt++) {\n if (attempt > 0) {\n const delay = this.calculateDelay(attempt, lastError);\n await sleep(delay);\n }\n\n const startMs = Date.now();\n\n this.onRequest?.({ method, url, headers: { ...headers }, body });\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n let response: Response;\n try {\n response = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n } finally {\n clearTimeout(timeoutId);\n }\n\n const responseHeaders = parseHeaders(response.headers);\n const responseBody = await response.json().catch(() => null);\n const durationMs = Date.now() - startMs;\n\n this.onResponse?.({\n status: response.status,\n headers: responseHeaders,\n body: responseBody,\n durationMs,\n retryCount: attempt,\n });\n\n if (response.ok) {\n return {\n data: responseBody as T,\n status: response.status,\n headers: responseHeaders,\n rateLimitInfo: parseRateLimitHeaders(responseHeaders),\n };\n }\n\n const shouldRetry = this.canRetry(\n attempt,\n method,\n headers,\n RETRYABLE_STATUS_CODES.has(response.status),\n );\n\n lastError = this.mapError(response.status, responseBody, responseHeaders);\n\n if (!shouldRetry) {\n throw lastError;\n }\n } catch (err) {\n if (err instanceof TriqaiError) {\n const canRetry = this.canRetry(\n attempt,\n method,\n headers,\n RETRYABLE_STATUS_CODES.has(err.statusCode),\n );\n if (!canRetry) {\n throw err;\n }\n lastError = err;\n continue;\n }\n\n if (err instanceof DOMException && err.name === \"AbortError\") {\n lastError = new TimeoutError(\n `Request timed out after ${this.timeout}ms: ${method} ${path}`,\n );\n if (!this.canRetry(attempt, method, headers, true)) {\n throw lastError;\n }\n continue;\n }\n\n if (isNetworkError(err)) {\n lastError = new ConnectionError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n );\n if (!this.canRetry(attempt, method, headers, true)) {\n throw lastError;\n }\n continue;\n }\n\n throw err;\n }\n }\n\n throw lastError ?? new TriqaiError(\"Request failed after retries\", 0);\n }\n\n /**\n * Variant that injects custom headers (used by resources for Idempotency-Key etc.).\n */\n async postWithHeaders<T>(\n path: string,\n body: unknown,\n headers: Record<string, string>,\n query?: Record<string, unknown>,\n ): Promise<HttpResponse<T>> {\n return this.request<T>(\"POST\", path, body, query, headers);\n }\n\n private buildUrl(path: string, query?: Record<string, unknown>): string {\n const isAbsoluteUrl = /^https?:\\/\\//i.test(path);\n const normalizedPath = path.startsWith(\"/\") ? path : `/${path}`;\n const base = isAbsoluteUrl ? path : `${this.baseUrl}${normalizedPath}`;\n if (!query) return base;\n\n const params = new URLSearchParams();\n for (const [k, v] of Object.entries(query)) {\n if (v !== undefined && v !== null) {\n if (v instanceof Date) {\n params.set(k, v.toISOString());\n } else {\n params.set(k, String(v));\n }\n }\n }\n const qs = params.toString();\n return qs ? `${base}?${qs}` : base;\n }\n\n private calculateDelay(attempt: number, lastError?: Error): number {\n if (lastError instanceof RateLimitError && lastError.rateLimitInfo.retryAfter) {\n return lastError.rateLimitInfo.retryAfter * 1000;\n }\n if (lastError instanceof ServiceUnavailableError && lastError.retryAfter) {\n return lastError.retryAfter * 1000;\n }\n const exponential = this.retryDelay * Math.pow(2, attempt - 1);\n const jitter = exponential * 0.2 * Math.random();\n return Math.min(exponential + jitter, this.maxRetryDelay);\n }\n\n private canRetry(\n attempt: number,\n method: string,\n headers: Record<string, string>,\n retryableSignal: boolean,\n ): boolean {\n return (\n retryableSignal &&\n attempt < this.maxRetries &&\n isIdempotent(method, headers)\n );\n }\n\n private mapError(\n status: number,\n body: unknown,\n headers: Record<string, string>,\n ): TriqaiError {\n const parsed = parseErrorBody(body);\n const opts = {\n code: parsed.code,\n requestId: parsed.requestId,\n rawError: parsed.error,\n meta: parsed.meta,\n };\n\n switch (status) {\n case 401:\n return new AuthenticationError(parsed.message, opts);\n case 402:\n return new InsufficientCreditsError(parsed.message, opts);\n case 403:\n return new AuthorizationError(parsed.message, opts);\n case 404:\n return new NotFoundError(parsed.message, opts);\n case 499:\n return new ClientDisconnectedError(parsed.message, opts);\n case 409: {\n const details = (parsed.error?.details ?? {}) as\n { state?: \"in_progress\" | \"completed\"; requestId?: string; retryAfterSeconds?: number };\n return new DuplicateRequestError(parsed.message, {\n ...opts,\n state: details?.state,\n duplicateRequestId: details?.requestId,\n retryAfter: details?.retryAfterSeconds,\n });\n }\n case 422: {\n const fieldErrors = (parsed.error?.details as { fieldErrors?: Record<string, string[]> } | undefined)\n ?.fieldErrors;\n return new ValidationError(parsed.message, fieldErrors, opts);\n }\n case 429:\n return new RateLimitError(\n parsed.message,\n parseRateLimitHeaders(headers),\n opts,\n );\n case 503: {\n const retryAfter = parseRetryAfterHeader(headers[\"retry-after\"]);\n return new ServiceUnavailableError(parsed.message, retryAfter, opts);\n }\n case 504:\n return new GatewayTimeoutError(parsed.message, opts);\n default:\n if (status >= 500) {\n return new InternalServerError(parsed.message, opts);\n }\n return new TriqaiError(parsed.message, status, opts);\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction parseHeaders(headers: Headers): Record<string, string> {\n const out: Record<string, string> = {};\n headers.forEach((value, key) => {\n out[key.toLowerCase()] = value;\n });\n return out;\n}\n\nfunction parseRateLimitHeaders(headers: Record<string, string>): RateLimitInfo {\n return {\n limit: maybeInt(headers[\"x-ratelimit-limit\"]),\n remaining: maybeInt(headers[\"x-ratelimit-remaining\"]),\n reset: headers[\"x-ratelimit-reset\"] ?? undefined,\n scope: headers[\"x-ratelimit-scope\"] as RateLimitInfo[\"scope\"],\n concurrencyLimit: maybeInt(headers[\"x-ratelimit-concurrency-limit\"]),\n concurrencyRemaining: maybeInt(headers[\"x-ratelimit-concurrency-remaining\"]),\n retryAfter: parseRetryAfterHeader(headers[\"retry-after\"]),\n };\n}\n\nfunction maybeInt(val: string | undefined): number | undefined {\n if (val === undefined) return undefined;\n const n = parseInt(val, 10);\n return Number.isNaN(n) ? undefined : n;\n}\n\nfunction parseRetryAfterHeader(val: string | undefined): number | undefined {\n if (val === undefined) return undefined;\n\n const seconds = maybeInt(val);\n if (seconds !== undefined && seconds >= 0) {\n return seconds;\n }\n\n const timestamp = Date.parse(val);\n if (Number.isNaN(timestamp)) {\n return undefined;\n }\n\n const secondsUntil = Math.ceil((timestamp - Date.now()) / 1000);\n return Math.max(secondsUntil, 0);\n}\n\ninterface ParsedError {\n message: string;\n code: string;\n requestId: string | undefined;\n error: RawErrorObject | undefined;\n meta: RawResponseMeta | undefined;\n}\n\nfunction parseErrorBody(body: unknown): ParsedError {\n if (!body || typeof body !== \"object\") {\n return {\n message: \"Unknown error\",\n code: \"unknown_error\",\n requestId: undefined,\n error: undefined,\n meta: undefined,\n };\n }\n\n const b = body as Record<string, unknown>;\n const error = b.error as { code?: string; message?: string; details?: Record<string, unknown> } | undefined;\n const meta = b.meta as Record<string, unknown> | undefined;\n\n return {\n message: error?.message ?? \"Unknown error\",\n code: error?.code ?? \"unknown_error\",\n requestId: meta?.requestId as string | undefined,\n error: error?.code\n ? { code: error.code, message: error.message ?? \"Unknown error\", details: error.details }\n : undefined,\n meta: meta?.generatedAt\n ? (meta as RawResponseMeta)\n : undefined,\n };\n}\n\nfunction isIdempotent(method: string, headers: Record<string, string>): boolean {\n if (method === \"GET\" || method === \"DELETE\") return true;\n const normalized = normalizeHeaderKeyMap(headers);\n if (normalized.has(\"idempotency-key\") || normalized.has(\"x-idempotency-key\")) {\n return true;\n }\n return false;\n}\n\nfunction normalizeHeaderKeyMap(headers: Record<string, string>): Set<string> {\n return new Set(Object.keys(headers).map((key) => key.toLowerCase()));\n}\n\nfunction isNetworkError(err: unknown): boolean {\n if (!(err instanceof Error)) return false;\n\n const message = err.message.toLowerCase();\n const hasNetworkSignal =\n message.includes(\"fetch\") ||\n message.includes(\"network\") ||\n message.includes(\"econnreset\") ||\n message.includes(\"enotfound\") ||\n message.includes(\"econnrefused\") ||\n message.includes(\"etimedout\");\n\n if (err instanceof TypeError) {\n return hasNetworkSignal;\n }\n\n if (err.name === \"NetworkError\") {\n return true;\n }\n\n if (err.cause instanceof Error) {\n const causeMessage = err.cause.message.toLowerCase();\n return (\n causeMessage.includes(\"fetch\") ||\n causeMessage.includes(\"network\") ||\n causeMessage.includes(\"econnreset\") ||\n causeMessage.includes(\"enotfound\") ||\n causeMessage.includes(\"econnrefused\") ||\n causeMessage.includes(\"etimedout\")\n );\n }\n\n return false;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { CategoryInfo, CategoryListResponse } from \"../types/index.js\";\n\nexport class Categories {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * List all available transaction categories.\n *\n * Returns the full category tree used for transaction classification,\n * including MCC, SIC, and NAICS codes.\n *\n * @returns Array of category info objects and the total count.\n *\n * @example\n * ```ts\n * const { categories, total } = await triqai.categories.list();\n * console.log(`${total} categories available`);\n * ```\n */\n async list(): Promise<{ categories: CategoryInfo[]; total: number; categoryVersion: string }> {\n const resp = await this.http.get<CategoryListResponse>(\"/v1/categories\");\n return {\n categories: resp.data.data.categories,\n total: resp.data.data.total,\n categoryVersion: resp.data.meta.categoryVersion,\n };\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { IntermediaryData, IntermediaryResponse } from \"../types/index.js\";\n\nexport class Intermediaries {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get an intermediary (payment processor / platform) by ID.\n *\n * @param id - Intermediary UUID.\n * @returns The intermediary data (name, icon, description, website, domain, etc.).\n *\n * @example\n * ```ts\n * const intermediary = await triqai.intermediaries.get(\"550e8400-...\");\n * console.log(intermediary.name); // \"PayPal\", \"Square\", etc.\n * ```\n */\n async get(id: string): Promise<IntermediaryData> {\n const resp = await this.http.get<IntermediaryResponse>(\n `/v1/intermediaries/${encodeURIComponent(id)}`,\n );\n return resp.data.data.intermediary;\n }\n}\n","/**\n * Pagination helpers for list endpoints.\n *\n * Provides a `Page<T>` type with metadata and an `autoPaginate()` method\n * that returns an async iterator walking through all pages automatically.\n */\n\nexport interface PageInfo {\n page: number;\n size: number;\n total: number;\n totalPages: number;\n}\n\nexport class Page<T> {\n readonly data: T[];\n readonly pageInfo: PageInfo;\n\n private readonly _fetchPage: (page: number, size: number) => Promise<Page<T>>;\n\n constructor(\n data: T[],\n pageInfo: PageInfo,\n fetchPage: (page: number, size: number) => Promise<Page<T>>,\n ) {\n this.data = data;\n this.pageInfo = pageInfo;\n this._fetchPage = fetchPage;\n }\n\n get hasNextPage(): boolean {\n return this.pageInfo.page < this.pageInfo.totalPages;\n }\n\n get hasPreviousPage(): boolean {\n return this.pageInfo.page > 1;\n }\n\n async nextPage(): Promise<Page<T>> {\n if (!this.hasNextPage) {\n return new Page<T>([], this.pageInfo, this._fetchPage);\n }\n return this._fetchPage(this.pageInfo.page + 1, this.pageInfo.size);\n }\n\n async previousPage(): Promise<Page<T>> {\n if (!this.hasPreviousPage) {\n return new Page<T>([], this.pageInfo, this._fetchPage);\n }\n return this._fetchPage(this.pageInfo.page - 1, this.pageInfo.size);\n }\n\n /**\n * Returns an async iterator that yields every item across all pages,\n * starting from the current page.\n *\n * ```ts\n * for await (const item of page.autoPaginate()) {\n * console.log(item);\n * }\n * ```\n */\n async *autoPaginate(): AsyncGenerator<T, void, unknown> {\n // eslint-disable-next-line @typescript-eslint/no-this-alias -- Cursor advances to a different Page on each request.\n let current: Page<T> = this;\n while (true) {\n for (const item of current.data) {\n yield item;\n }\n if (!current.hasNextPage) break;\n current = await current.nextPage();\n }\n }\n\n /**\n * Symbol.asyncIterator so `Page` itself can be used in `for await...of`.\n */\n [Symbol.asyncIterator](): AsyncIterableIterator<T> {\n return this.autoPaginate();\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport { Page } from \"../pagination.js\";\nimport type {\n EnrichmentFieldPath,\n IssueReport,\n IssueReportListResponse,\n IssueReportResponse,\n ListIssueReportsParams,\n} from \"../types/index.js\";\n\nexport interface CreateIssueReportParams {\n /** The transaction ID to report an issue for. */\n transactionId: string;\n /** A description of what is wrong with the enrichment result. */\n description: string;\n /** Which enrichment fields are incorrect. */\n fields: EnrichmentFieldPath[];\n}\n\nexport class IssueReports {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Report an issue with an enrichment result.\n *\n * @param params - The issue report details.\n * @returns The created issue report.\n *\n * @example\n * ```ts\n * const report = await triqai.issueReports.create({\n * transactionId: \"tx-uuid\",\n * description: \"Merchant was identified incorrectly\",\n * fields: [\"entities.merchant.data.name\"],\n * });\n * console.log(report.id, report.status);\n * ```\n */\n async create(params: CreateIssueReportParams): Promise<IssueReport> {\n const resp = await this.http.post<IssueReportResponse>(\"/v1/report-issue\", {\n transaction_id: params.transactionId,\n description: params.description,\n fields: params.fields,\n });\n return resp.data.data.issueReport;\n }\n\n /**\n * List issue reports with pagination.\n *\n * @returns A `Page` of issue reports. Use `.autoPaginate()` or\n * `for await...of` to iterate through all pages automatically.\n *\n * @example\n * ```ts\n * const page = await triqai.issueReports.list({ status: \"pending\" });\n * for (const report of page.data) {\n * console.log(report.id, report.status);\n * }\n * ```\n */\n async list(params?: ListIssueReportsParams): Promise<Page<IssueReport>> {\n const fetchPage = async (page: number, size: number): Promise<Page<IssueReport>> => {\n const query: Record<string, unknown> = { page, size };\n if (params?.status) query.status = params.status;\n if (params?.transactionId) query.transaction_id = params.transactionId;\n\n const resp = await this.http.get<IssueReportListResponse>(\"/v1/report-issue\", query);\n const pageInfo = {\n page: resp.data.meta.page,\n size: resp.data.meta.size,\n total: resp.data.meta.total,\n totalPages: resp.data.meta.totalPages,\n };\n return new Page(resp.data.data, pageInfo, fetchPage);\n };\n\n return fetchPage(params?.page ?? 1, params?.size ?? 25);\n }\n\n /**\n * Get a single issue report by ID.\n *\n * @param id - Issue report UUID.\n * @returns The issue report details.\n */\n async get(id: string): Promise<IssueReport> {\n const resp = await this.http.get<IssueReportResponse>(\n `/v1/report-issue/${encodeURIComponent(id)}`,\n );\n return resp.data.data.issueReport;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { LocationData, LocationResponse } from \"../types/index.js\";\n\nexport class Locations {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get a location by ID.\n *\n * @param id - Location UUID.\n * @returns The location data (name, formatted address, coordinates, phone, rating, etc.).\n *\n * @example\n * ```ts\n * const location = await triqai.locations.get(\"550e8400-e29b-41d4-a716-446655440000\");\n * console.log(location.formatted, location.structured.city);\n * ```\n */\n async get(id: string): Promise<LocationData> {\n const resp = await this.http.get<LocationResponse>(\n `/v1/locations/${encodeURIComponent(id)}`,\n );\n return resp.data.data.location;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { MerchantData, MerchantResponse } from \"../types/index.js\";\n\nexport class Merchants {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get a merchant by ID.\n *\n * @param id - Merchant UUID.\n * @returns The merchant data (name, icon, website, domain, aliases, etc.).\n *\n * @example\n * ```ts\n * const merchant = await triqai.merchants.get(\"550e8400-e29b-41d4-a716-446655440000\");\n * console.log(merchant.name, merchant.website);\n * ```\n */\n async get(id: string): Promise<MerchantData> {\n const resp = await this.http.get<MerchantResponse>(\n `/v1/merchants/${encodeURIComponent(id)}`,\n );\n return resp.data.data.merchant;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport { Page } from \"../pagination.js\";\nimport type {\n DeleteTransactionResponse,\n EnrichedTransaction,\n EnrichOptions,\n EnrichRequest,\n EnrichSuccessResponse,\n ListTransactionsParams,\n TransactionDetailResponse,\n TransactionListResponse,\n} from \"../types/index.js\";\n\nasync function createIdempotencyKey(): Promise<string> {\n if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID();\n // Node 18 does not always expose Web Crypto globally. Keep its fallback lazy\n // and the module name dynamic so Worker bundlers need no Node compatibility.\n const nodeCrypto = \"node:crypto\";\n const { randomUUID } = await import(/* webpackIgnore: true */ nodeCrypto) as typeof import(\"node:crypto\");\n return randomUUID();\n}\n\nexport class Transactions {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Enrich a transaction with merchant, category, location, and entity data.\n *\n * @param request - The transaction to enrich (title, country, type, and optional options).\n * @param options - Optional enrichment controls (force bypass cache, idempotency key).\n * @returns The enriched transaction data.\n *\n * @example\n * ```ts\n * const result = await triqai.transactions.enrich({\n * title: \"STARBUCKS SEATTLE WA\",\n * country: \"US\",\n * type: \"expense\",\n * });\n * console.log(result.data.entities);\n * ```\n */\n async enrich(\n request: EnrichRequest,\n options?: EnrichOptions,\n ): Promise<EnrichSuccessResponse> {\n const headers: Record<string, string> = {\n \"Idempotency-Key\": options?.idempotencyKey ?? await createIdempotencyKey(),\n };\n const query: Record<string, unknown> = {};\n\n if (options?.force) {\n query.force = \"true\";\n }\n\n const resp = await this.http.postWithHeaders<EnrichSuccessResponse>(\n \"/v1/transactions/enrich\",\n request,\n headers,\n Object.keys(query).length > 0 ? query : undefined,\n );\n return resp.data;\n }\n\n /**\n * List enriched transactions with pagination.\n *\n * @returns A `Page` of enriched transactions. Use `.autoPaginate()` or\n * `for await...of` to iterate through all pages automatically.\n *\n * @example\n * ```ts\n * const page = await triqai.transactions.list({ size: 10 });\n * console.log(page.data); // first 10 transactions\n *\n * // Auto-paginate through all:\n * for await (const tx of page) {\n * console.log(tx.id, tx.raw);\n * }\n * ```\n */\n async list(params?: ListTransactionsParams): Promise<Page<EnrichedTransaction>> {\n const fetchPage = async (page: number, size: number): Promise<Page<EnrichedTransaction>> => {\n const query: Record<string, unknown> = {\n page,\n size,\n };\n if (params?.startDate) {\n query.startDate =\n params.startDate instanceof Date\n ? params.startDate.toISOString()\n : params.startDate;\n }\n if (params?.endDate) {\n query.endDate =\n params.endDate instanceof Date\n ? params.endDate.toISOString()\n : params.endDate;\n }\n\n const resp = await this.http.get<TransactionListResponse>(\"/v1/transactions\", query);\n const { transactions, pagination } = resp.data.data;\n return new Page(transactions, pagination, fetchPage);\n };\n\n return fetchPage(params?.page ?? 1, params?.size ?? 25);\n }\n\n /**\n * Get a single transaction by ID.\n *\n * @param id - Transaction UUID.\n * @returns The enriched transaction record.\n */\n async get(id: string): Promise<EnrichedTransaction> {\n const resp = await this.http.get<TransactionDetailResponse>(\n `/v1/transactions/${encodeURIComponent(id)}`,\n );\n return resp.data.data.transaction;\n }\n\n /**\n * Delete a transaction by ID.\n *\n * @param id - Transaction UUID.\n * @returns Confirmation with the deleted transaction ID.\n */\n async delete(id: string): Promise<{ deleted: true; transactionId: string }> {\n const resp = await this.http.delete<DeleteTransactionResponse>(\n `/v1/transactions/${encodeURIComponent(id)}`,\n );\n return resp.data.data;\n }\n}\n","import type { HttpResponse } from \"./http-client.js\";\nimport { HttpClient } from \"./http-client.js\";\nimport { Categories } from \"./resources/categories.js\";\nimport { Intermediaries } from \"./resources/intermediaries.js\";\nimport { IssueReports } from \"./resources/issue-reports.js\";\nimport { Locations } from \"./resources/locations.js\";\nimport { Merchants } from \"./resources/merchants.js\";\nimport { Transactions } from \"./resources/transactions.js\";\nimport type {\n ApiInfoResponse,\n HealthResponse,\n TriqaiConfig,\n} from \"./types/index.js\";\n\n/**\n * The Triqai SDK client.\n *\n * @example\n * ```ts\n * import Triqai from \"triqai\";\n *\n * const triqai = new Triqai(\"triq_your_api_key\");\n *\n * const result = await triqai.transactions.enrich({\n * title: \"STARBUCKS SEATTLE WA\",\n * country: \"US\",\n * type: \"expense\",\n * });\n * ```\n */\nexport class Triqai {\n /** Enrich, list, get, and delete transactions. */\n readonly transactions: Transactions;\n /** List the full category taxonomy. */\n readonly categories: Categories;\n /** Look up merchant details by ID. */\n readonly merchants: Merchants;\n /** Look up location details by ID. */\n readonly locations: Locations;\n /** Look up intermediary (payment processor) details by ID. */\n readonly intermediaries: Intermediaries;\n /** Create and manage enrichment issue reports. */\n readonly issueReports: IssueReports;\n\n private readonly http: HttpClient;\n\n /**\n * Create a new Triqai SDK client.\n *\n * @param apiKey - Your Triqai API key (starts with `triq_`). Get one at https://triqai.com/dashboard\n * @param config - Optional configuration (base URL, retry settings, hooks).\n */\n constructor(apiKey: string, config?: TriqaiConfig) {\n this.http = new HttpClient(apiKey, config);\n this.transactions = new Transactions(this.http);\n this.categories = new Categories(this.http);\n this.merchants = new Merchants(this.http);\n this.locations = new Locations(this.http);\n this.intermediaries = new Intermediaries(this.http);\n this.issueReports = new IssueReports(this.http);\n }\n\n /**\n * Check the API health status.\n *\n * @returns Health status including service name and version.\n *\n * @example\n * ```ts\n * const health = await triqai.health();\n * console.log(health.data.status); // \"healthy\"\n * console.log(health.data.version); // \"1.1.9\"\n * ```\n */\n async health(): Promise<HealthResponse> {\n const resp = await this.http.get<HealthResponse>(\"/health\");\n return resp.data;\n }\n\n /**\n * Get API version and endpoint directory.\n *\n * @returns API version info and available endpoint paths.\n *\n * @example\n * ```ts\n * const info = await triqai.apiInfo();\n * console.log(info.data.version); // \"v1\"\n * console.log(info.data.endpoints);\n * ```\n */\n async apiInfo(): Promise<ApiInfoResponse> {\n const resp = await this.http.get<ApiInfoResponse>(\"/v1\");\n return resp.data;\n }\n\n /**\n * Make a raw GET request to any API path.\n * Useful for accessing endpoints not yet covered by a resource class.\n *\n * @param path - API path (e.g. \"/v1/some-endpoint\").\n * @param query - Optional query parameters.\n * @returns The full HTTP response including headers and rate limit info.\n */\n async rawGet<T = unknown>(\n path: string,\n query?: Record<string, unknown>,\n ): Promise<HttpResponse<T>> {\n return this.http.get<T>(path, query);\n }\n\n /**\n * Make a raw POST request to any API path.\n * Useful for accessing endpoints not yet covered by a resource class.\n *\n * @param path - API path (e.g. \"/v1/some-endpoint\").\n * @param body - Request body.\n * @returns The full HTTP response including headers and rate limit info.\n */\n async rawPost<T = unknown>(\n path: string,\n body?: unknown,\n ): Promise<HttpResponse<T>> {\n return this.http.post<T>(path, body);\n }\n\n /**\n * Make a raw DELETE request to any API path.\n * Useful for accessing endpoints not yet covered by a resource class.\n *\n * @param path - API path (e.g. \"/v1/some-resource/uuid\").\n * @returns The full HTTP response including headers and rate limit info.\n */\n async rawDelete<T = unknown>(path: string): Promise<HttpResponse<T>> {\n return this.http.delete<T>(path);\n }\n}\n","import { Triqai } from \"./client.js\";\n\nexport { Triqai };\nexport default Triqai;\n\nexport {\n TriqaiError,\n AuthenticationError,\n AuthorizationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n ClientDisconnectedError,\n DuplicateRequestError,\n RateLimitError,\n InternalServerError,\n ServiceUnavailableError,\n GatewayTimeoutError,\n ConnectionError,\n TimeoutError,\n} from \"./errors.js\";\nexport type { RawErrorObject, RawResponseMeta } from \"./errors.js\";\n\nexport type { HttpResponse } from \"./http-client.js\";\n\nexport { Page } from \"./pagination.js\";\nexport type { PageInfo } from \"./pagination.js\";\n\nexport type { CreateIssueReportParams } from \"./resources/issue-reports.js\";\n\nexport type {\n // SDK config types\n TriqaiConfig,\n RequestInfo,\n ResponseInfo,\n RateLimitInfo,\n EnrichOptions,\n ListTransactionsParams,\n ListIssueReportsParams,\n // Enrichment request types\n EnrichRequest,\n EnrichRequestOptions,\n EnrichmentFilterOptions,\n PrefilledMerchant,\n PrefilledLocation,\n PrefilledIntermediary,\n // Enrichment response types\n EnrichSuccessResponse,\n EnrichmentData,\n EnrichMeta,\n EnrichmentErrorCode,\n // Transaction types\n TransactionData,\n TransactionType,\n TransactionRecord,\n EnrichedTransaction,\n TransactionPagination,\n TransactionListResponse,\n TransactionDetailResponse,\n DeleteTransactionResponse,\n // Category types\n CategoryStructure,\n Category,\n CategoryCode,\n CategoryInfo,\n CategoryListResponse,\n // Confidence\n ConfidenceWithReasons,\n // Entity types\n EntityResult,\n MerchantData,\n LocationData,\n IntermediaryData,\n IntermediaryRecord,\n PersonData,\n Coordinates,\n StructuredAddress,\n LocationRating,\n // Entity response types\n MerchantResponse,\n LocationResponse,\n IntermediaryResponse,\n // Issue report types\n IssueReport,\n IssueReportStatus,\n IssueReportResponse,\n IssueReportListResponse,\n ReportIssueRequest,\n EnrichmentFieldPath,\n // Error response types\n ErrorResponse,\n ErrorObject,\n DuplicateRequestErrorResponse,\n ClientDisconnectedErrorResponse,\n // Meta types\n ResponseMeta,\n PaginationMeta,\n // Utility response types\n HealthResponse,\n ApiInfoResponse,\n} from \"./types/index.js\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/http-client.ts","../src/resources/banks.ts","../src/resources/categories.ts","../src/resources/intermediaries.ts","../src/pagination.ts","../src/resources/issue-reports.ts","../src/resources/locations.ts","../src/resources/merchants.ts","../src/resources/transactions.ts","../src/client.ts","../src/index.ts"],"names":[],"mappings":";AAeO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA;AAAA,EAE5B,UAAA;AAAA;AAAA,EAEA,IAAA;AAAA;AAAA,EAEA,SAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,IAAA;AAAA,EAET,WAAA,CACE,OAAA,EACA,UAAA,EACA,IAAA,EAMA;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AACZ,IAAA,IAAA,CAAK,UAAA,GAAa,UAAA;AAClB,IAAA,IAAA,CAAK,IAAA,GAAO,MAAM,IAAA,IAAQ,eAAA;AAC1B,IAAA,IAAA,CAAK,YAAY,IAAA,EAAM,SAAA;AACvB,IAAA,IAAA,CAAK,WAAW,IAAA,EAAM,QAAA;AACtB,IAAA,IAAA,CAAK,OAAO,IAAA,EAAM,IAAA;AAAA,EACpB;AACF;AAEO,IAAM,mBAAA,GAAN,cAAkC,WAAA,CAAY;AAAA,EACnD,WAAA,CAAY,SAAiB,IAAA,EAAqD;AAChF,IAAA,KAAA,CAAM,SAAS,GAAA,EAAK,EAAE,MAAM,sBAAA,EAAwB,GAAG,MAAM,CAAA;AAC7D,IAAA,IAAA,CAAK,IAAA,GAAO,qBAAA;AAAA,EACd;AACF;AAEO,IAAM,kBAAA,GAAN,cAAiC,WAAA,CAAY;AAAA,EAClD,WAAA,CAAY,SAAiB,IAAA,EAAqD;AAChF,IAAA,KAAA,CAAM,SAAS,GAAA,EAAK,EAAE,MAAM,qBAAA,EAAuB,GAAG,MAAM,CAAA;AAC5D,IAAA,IAAA,CAAK,IAAA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,GAAoC;AACxC,IAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,IAAA,CAAK,IAAqB,KAAK,CAAA;AACvD,IAAA,OAAO,IAAA,CAAK,IAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,IAAA,EACA,KAAA,EAC0B;AAC1B,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,GAAA,CAAO,IAAA,EAAM,KAAK,CAAA;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,OAAA,CACJ,IAAA,EACA,IAAA,EAC0B;AAC1B,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,IAAA,CAAQ,IAAA,EAAM,IAAI,CAAA;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,UAAuB,IAAA,EAAwC;AACnE,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,MAAA,CAAU,IAAI,CAAA;AAAA,EACjC;AACF;;;ACzIA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["import type { RateLimitInfo } from \"./types/index.js\";\n\nexport interface RawErrorObject {\n code: string;\n message: string;\n details?: Record<string, unknown>;\n}\n\nexport interface RawResponseMeta {\n generatedAt: string;\n requestId: string;\n version: string;\n [key: string]: unknown;\n}\n\nexport class TriqaiError extends Error {\n /** HTTP status code from the API response. */\n readonly statusCode: number;\n /** Machine-readable error code from the API (e.g. \"validation_error\"). */\n readonly code: string;\n /** Correlation ID for support inquiries. */\n readonly requestId: string | undefined;\n /** The raw error body returned by the API. */\n readonly rawError: RawErrorObject | undefined;\n /** Response metadata. */\n readonly meta: RawResponseMeta | undefined;\n\n constructor(\n message: string,\n statusCode: number,\n opts?: {\n code?: string;\n requestId?: string;\n rawError?: RawErrorObject;\n meta?: RawResponseMeta;\n },\n ) {\n super(message);\n this.name = \"TriqaiError\";\n this.statusCode = statusCode;\n this.code = opts?.code ?? \"unknown_error\";\n this.requestId = opts?.requestId;\n this.rawError = opts?.rawError;\n this.meta = opts?.meta;\n }\n}\n\nexport class AuthenticationError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 401, { code: \"authentication_error\", ...opts });\n this.name = \"AuthenticationError\";\n }\n}\n\nexport class AuthorizationError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 403, { code: \"authorization_error\", ...opts });\n this.name = \"AuthorizationError\";\n }\n}\n\nexport class InsufficientCreditsError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 402, { code: \"insufficient_credits\", ...opts });\n this.name = \"InsufficientCreditsError\";\n }\n}\n\nexport class NotFoundError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 404, { code: \"not_found\", ...opts });\n this.name = \"NotFoundError\";\n }\n}\n\nexport class ValidationError extends TriqaiError {\n readonly fieldErrors: Record<string, string[]>;\n\n constructor(\n message: string,\n fieldErrors?: Record<string, string[]>,\n opts?: ConstructorParameters<typeof TriqaiError>[2],\n ) {\n super(message, 422, { code: \"validation_error\", ...opts });\n this.name = \"ValidationError\";\n this.fieldErrors = fieldErrors ?? {};\n }\n}\n\nexport class ClientDisconnectedError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 499, { code: \"client_disconnected\", ...opts });\n this.name = \"ClientDisconnectedError\";\n }\n}\n\nexport class DuplicateRequestError extends TriqaiError {\n readonly state: \"in_progress\" | \"completed\" | undefined;\n readonly duplicateRequestId: string | undefined;\n readonly retryAfter: number | undefined;\n\n constructor(\n message: string,\n opts?: ConstructorParameters<typeof TriqaiError>[2] & {\n state?: \"in_progress\" | \"completed\";\n duplicateRequestId?: string;\n retryAfter?: number;\n },\n ) {\n super(message, 409, { code: \"DUPLICATE_REQUEST\", ...opts });\n this.name = \"DuplicateRequestError\";\n this.state = opts?.state;\n this.duplicateRequestId = opts?.duplicateRequestId;\n this.retryAfter = opts?.retryAfter;\n }\n}\n\nexport class RateLimitError extends TriqaiError {\n readonly rateLimitInfo: RateLimitInfo;\n\n constructor(\n message: string,\n rateLimitInfo: RateLimitInfo,\n opts?: ConstructorParameters<typeof TriqaiError>[2],\n ) {\n super(message, 429, { code: \"rate_limited\", ...opts });\n this.name = \"RateLimitError\";\n this.rateLimitInfo = rateLimitInfo;\n }\n}\n\nexport class InternalServerError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 500, { code: \"internal_error\", ...opts });\n this.name = \"InternalServerError\";\n }\n}\n\nexport class ServiceUnavailableError extends TriqaiError {\n readonly retryAfter: number | undefined;\n\n constructor(\n message: string,\n retryAfter?: number,\n opts?: ConstructorParameters<typeof TriqaiError>[2],\n ) {\n super(message, 503, { code: \"service_unavailable\", ...opts });\n this.name = \"ServiceUnavailableError\";\n this.retryAfter = retryAfter;\n }\n}\n\nexport class GatewayTimeoutError extends TriqaiError {\n constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]) {\n super(message, 504, { code: \"gateway_timeout\", ...opts });\n this.name = \"GatewayTimeoutError\";\n }\n}\n\nexport class ConnectionError extends TriqaiError {\n constructor(message: string) {\n super(message, 0, { code: \"connection_error\" });\n this.name = \"ConnectionError\";\n }\n}\n\nexport class TimeoutError extends TriqaiError {\n constructor(message: string) {\n super(message, 0, { code: \"timeout\" });\n this.name = \"TimeoutError\";\n }\n}\n","import {\n AuthenticationError,\n AuthorizationError,\n ClientDisconnectedError,\n ConnectionError,\n DuplicateRequestError,\n GatewayTimeoutError,\n InsufficientCreditsError,\n InternalServerError,\n NotFoundError,\n RateLimitError,\n ServiceUnavailableError,\n TimeoutError,\n TriqaiError,\n ValidationError,\n} from \"./errors.js\";\nimport type { RawErrorObject, RawResponseMeta } from \"./errors.js\";\nimport type {\n RateLimitInfo,\n RequestInfo,\n ResponseInfo,\n TriqaiConfig,\n} from \"./types/index.js\";\n\nconst DEFAULT_BASE_URL = \"https://api.triqai.com\";\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_DELAY = 500;\nconst DEFAULT_MAX_RETRY_DELAY = 30_000;\nconst DEFAULT_TIMEOUT = 60_000;\nconst RETRYABLE_STATUS_CODES = new Set([429, 500, 503, 504]);\nconst SDK_VERSION = \"0.1.1\";\n\nexport interface HttpResponse<T> {\n data: T;\n status: number;\n headers: Record<string, string>;\n rateLimitInfo: RateLimitInfo;\n}\n\nexport class HttpClient {\n private readonly apiKey: string;\n private readonly baseUrl: string;\n private readonly maxRetries: number;\n private readonly retryDelay: number;\n private readonly maxRetryDelay: number;\n private readonly timeout: number;\n private readonly defaultHeaders: Record<string, string>;\n private readonly onRequest?: (info: RequestInfo) => void;\n private readonly onResponse?: (info: ResponseInfo) => void;\n\n constructor(apiKey: string, config: TriqaiConfig = {}) {\n if (!apiKey) {\n throw new Error(\n \"API key is required. Get yours at https://triqai.com/dashboard\",\n );\n }\n this.apiKey = apiKey;\n this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;\n this.retryDelay = config.retryDelay ?? DEFAULT_RETRY_DELAY;\n this.maxRetryDelay = config.maxRetryDelay ?? DEFAULT_MAX_RETRY_DELAY;\n this.timeout = config.timeout ?? DEFAULT_TIMEOUT;\n this.defaultHeaders = config.defaultHeaders ?? {};\n this.onRequest = config.onRequest;\n this.onResponse = config.onResponse;\n }\n\n async get<T>(path: string, query?: Record<string, unknown>): Promise<HttpResponse<T>> {\n return this.request<T>(\"GET\", path, undefined, query);\n }\n\n async post<T>(path: string, body?: unknown): Promise<HttpResponse<T>> {\n return this.request<T>(\"POST\", path, body);\n }\n\n async delete<T>(path: string): Promise<HttpResponse<T>> {\n return this.request<T>(\"DELETE\", path);\n }\n\n private async request<T>(\n method: string,\n path: string,\n body?: unknown,\n query?: Record<string, unknown>,\n extraHeaders?: Record<string, string>,\n ): Promise<HttpResponse<T>> {\n const url = this.buildUrl(path, query);\n const headers: Record<string, string> = {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": `triqai-node/${SDK_VERSION}`,\n Accept: \"application/json\",\n ...this.defaultHeaders,\n ...extraHeaders,\n };\n\n if (body !== undefined) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.maxRetries; attempt++) {\n if (attempt > 0) {\n const delay = this.calculateDelay(attempt, lastError);\n await sleep(delay);\n }\n\n const startMs = Date.now();\n\n this.onRequest?.({ method, url, headers: { ...headers }, body });\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n let response: Response;\n try {\n response = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n } finally {\n clearTimeout(timeoutId);\n }\n\n const responseHeaders = parseHeaders(response.headers);\n const responseBody = await response.json().catch(() => null);\n const durationMs = Date.now() - startMs;\n\n this.onResponse?.({\n status: response.status,\n headers: responseHeaders,\n body: responseBody,\n durationMs,\n retryCount: attempt,\n });\n\n if (response.ok) {\n return {\n data: responseBody as T,\n status: response.status,\n headers: responseHeaders,\n rateLimitInfo: parseRateLimitHeaders(responseHeaders),\n };\n }\n\n const shouldRetry = this.canRetry(\n attempt,\n method,\n headers,\n RETRYABLE_STATUS_CODES.has(response.status),\n );\n\n lastError = this.mapError(response.status, responseBody, responseHeaders);\n\n if (!shouldRetry) {\n throw lastError;\n }\n } catch (err) {\n if (err instanceof TriqaiError) {\n const canRetry = this.canRetry(\n attempt,\n method,\n headers,\n RETRYABLE_STATUS_CODES.has(err.statusCode),\n );\n if (!canRetry) {\n throw err;\n }\n lastError = err;\n continue;\n }\n\n if (err instanceof DOMException && err.name === \"AbortError\") {\n lastError = new TimeoutError(\n `Request timed out after ${this.timeout}ms: ${method} ${path}`,\n );\n if (!this.canRetry(attempt, method, headers, true)) {\n throw lastError;\n }\n continue;\n }\n\n if (isNetworkError(err)) {\n lastError = new ConnectionError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n );\n if (!this.canRetry(attempt, method, headers, true)) {\n throw lastError;\n }\n continue;\n }\n\n throw err;\n }\n }\n\n throw lastError ?? new TriqaiError(\"Request failed after retries\", 0);\n }\n\n /**\n * Variant that injects custom headers (used by resources for Idempotency-Key etc.).\n */\n async postWithHeaders<T>(\n path: string,\n body: unknown,\n headers: Record<string, string>,\n query?: Record<string, unknown>,\n ): Promise<HttpResponse<T>> {\n return this.request<T>(\"POST\", path, body, query, headers);\n }\n\n private buildUrl(path: string, query?: Record<string, unknown>): string {\n const isAbsoluteUrl = /^https?:\\/\\//i.test(path);\n const normalizedPath = path.startsWith(\"/\") ? path : `/${path}`;\n const base = isAbsoluteUrl ? path : `${this.baseUrl}${normalizedPath}`;\n if (!query) return base;\n\n const params = new URLSearchParams();\n for (const [k, v] of Object.entries(query)) {\n if (v !== undefined && v !== null) {\n if (v instanceof Date) {\n params.set(k, v.toISOString());\n } else {\n params.set(k, String(v));\n }\n }\n }\n const qs = params.toString();\n return qs ? `${base}?${qs}` : base;\n }\n\n private calculateDelay(attempt: number, lastError?: Error): number {\n if (lastError instanceof RateLimitError && lastError.rateLimitInfo.retryAfter) {\n return lastError.rateLimitInfo.retryAfter * 1000;\n }\n if (lastError instanceof ServiceUnavailableError && lastError.retryAfter) {\n return lastError.retryAfter * 1000;\n }\n const exponential = this.retryDelay * Math.pow(2, attempt - 1);\n const jitter = exponential * 0.2 * Math.random();\n return Math.min(exponential + jitter, this.maxRetryDelay);\n }\n\n private canRetry(\n attempt: number,\n method: string,\n headers: Record<string, string>,\n retryableSignal: boolean,\n ): boolean {\n return (\n retryableSignal &&\n attempt < this.maxRetries &&\n isIdempotent(method, headers)\n );\n }\n\n private mapError(\n status: number,\n body: unknown,\n headers: Record<string, string>,\n ): TriqaiError {\n const parsed = parseErrorBody(body);\n const opts = {\n code: parsed.code,\n requestId: parsed.requestId,\n rawError: parsed.error,\n meta: parsed.meta,\n };\n\n switch (status) {\n case 401:\n return new AuthenticationError(parsed.message, opts);\n case 402:\n return new InsufficientCreditsError(parsed.message, opts);\n case 403:\n return new AuthorizationError(parsed.message, opts);\n case 404:\n return new NotFoundError(parsed.message, opts);\n case 499:\n return new ClientDisconnectedError(parsed.message, opts);\n case 409: {\n const details = (parsed.error?.details ?? {}) as\n { state?: \"in_progress\" | \"completed\"; requestId?: string; retryAfterSeconds?: number };\n return new DuplicateRequestError(parsed.message, {\n ...opts,\n state: details?.state,\n duplicateRequestId: details?.requestId,\n retryAfter: details?.retryAfterSeconds,\n });\n }\n case 422: {\n const fieldErrors = (parsed.error?.details as { fieldErrors?: Record<string, string[]> } | undefined)\n ?.fieldErrors;\n return new ValidationError(parsed.message, fieldErrors, opts);\n }\n case 429:\n return new RateLimitError(\n parsed.message,\n parseRateLimitHeaders(headers),\n opts,\n );\n case 503: {\n const retryAfter = parseRetryAfterHeader(headers[\"retry-after\"]);\n return new ServiceUnavailableError(parsed.message, retryAfter, opts);\n }\n case 504:\n return new GatewayTimeoutError(parsed.message, opts);\n default:\n if (status >= 500) {\n return new InternalServerError(parsed.message, opts);\n }\n return new TriqaiError(parsed.message, status, opts);\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction parseHeaders(headers: Headers): Record<string, string> {\n const out: Record<string, string> = {};\n headers.forEach((value, key) => {\n out[key.toLowerCase()] = value;\n });\n return out;\n}\n\nfunction parseRateLimitHeaders(headers: Record<string, string>): RateLimitInfo {\n return {\n limit: maybeInt(headers[\"x-ratelimit-limit\"]),\n remaining: maybeInt(headers[\"x-ratelimit-remaining\"]),\n reset: headers[\"x-ratelimit-reset\"] ?? undefined,\n scope: headers[\"x-ratelimit-scope\"] as RateLimitInfo[\"scope\"],\n concurrencyLimit: maybeInt(headers[\"x-ratelimit-concurrency-limit\"]),\n concurrencyRemaining: maybeInt(headers[\"x-ratelimit-concurrency-remaining\"]),\n retryAfter: parseRetryAfterHeader(headers[\"retry-after\"]),\n };\n}\n\nfunction maybeInt(val: string | undefined): number | undefined {\n if (val === undefined) return undefined;\n const n = parseInt(val, 10);\n return Number.isNaN(n) ? undefined : n;\n}\n\nfunction parseRetryAfterHeader(val: string | undefined): number | undefined {\n if (val === undefined) return undefined;\n\n const seconds = maybeInt(val);\n if (seconds !== undefined && seconds >= 0) {\n return seconds;\n }\n\n const timestamp = Date.parse(val);\n if (Number.isNaN(timestamp)) {\n return undefined;\n }\n\n const secondsUntil = Math.ceil((timestamp - Date.now()) / 1000);\n return Math.max(secondsUntil, 0);\n}\n\ninterface ParsedError {\n message: string;\n code: string;\n requestId: string | undefined;\n error: RawErrorObject | undefined;\n meta: RawResponseMeta | undefined;\n}\n\nfunction parseErrorBody(body: unknown): ParsedError {\n if (!body || typeof body !== \"object\") {\n return {\n message: \"Unknown error\",\n code: \"unknown_error\",\n requestId: undefined,\n error: undefined,\n meta: undefined,\n };\n }\n\n const b = body as Record<string, unknown>;\n const error = b.error as { code?: string; message?: string; details?: Record<string, unknown> } | undefined;\n const meta = b.meta as Record<string, unknown> | undefined;\n\n return {\n message: error?.message ?? \"Unknown error\",\n code: error?.code ?? \"unknown_error\",\n requestId: meta?.requestId as string | undefined,\n error: error?.code\n ? { code: error.code, message: error.message ?? \"Unknown error\", details: error.details }\n : undefined,\n meta: meta?.generatedAt\n ? (meta as RawResponseMeta)\n : undefined,\n };\n}\n\nfunction isIdempotent(method: string, headers: Record<string, string>): boolean {\n if (method === \"GET\" || method === \"DELETE\") return true;\n const normalized = normalizeHeaderKeyMap(headers);\n if (normalized.has(\"idempotency-key\") || normalized.has(\"x-idempotency-key\")) {\n return true;\n }\n return false;\n}\n\nfunction normalizeHeaderKeyMap(headers: Record<string, string>): Set<string> {\n return new Set(Object.keys(headers).map((key) => key.toLowerCase()));\n}\n\nfunction isNetworkError(err: unknown): boolean {\n if (!(err instanceof Error)) return false;\n\n const message = err.message.toLowerCase();\n const hasNetworkSignal =\n message.includes(\"fetch\") ||\n message.includes(\"network\") ||\n message.includes(\"econnreset\") ||\n message.includes(\"enotfound\") ||\n message.includes(\"econnrefused\") ||\n message.includes(\"etimedout\");\n\n if (err instanceof TypeError) {\n return hasNetworkSignal;\n }\n\n if (err.name === \"NetworkError\") {\n return true;\n }\n\n if (err.cause instanceof Error) {\n const causeMessage = err.cause.message.toLowerCase();\n return (\n causeMessage.includes(\"fetch\") ||\n causeMessage.includes(\"network\") ||\n causeMessage.includes(\"econnreset\") ||\n causeMessage.includes(\"enotfound\") ||\n causeMessage.includes(\"econnrefused\") ||\n causeMessage.includes(\"etimedout\")\n );\n }\n\n return false;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { BankData, BankResponse, BankSearchParams, BankSearchResponse } from \"../types/index.js\";\n\nexport class Banks {\n constructor(private readonly http: HttpClient) {}\n\n /** Exact, case-insensitive name lookup with an optional country of origin. Costs zero credits. */\n async search(params: BankSearchParams): Promise<BankSearchResponse[\"data\"]> {\n const resp = await this.http.get<BankSearchResponse>(\"/v1/banks\", { ...params });\n return resp.data.data;\n }\n\n /** Retrieve stored bank details by UUID. */\n async get(id: string): Promise<BankData> {\n const resp = await this.http.get<BankResponse>(`/v1/banks/${encodeURIComponent(id)}`);\n return resp.data.data.bank;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { CategoryInfo, CategoryListResponse } from \"../types/index.js\";\n\nexport class Categories {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * List all available transaction categories.\n *\n * Returns the full category tree used for transaction classification,\n * including MCC, SIC, and NAICS codes.\n *\n * @returns Array of category info objects and the total count.\n *\n * @example\n * ```ts\n * const { categories, total } = await triqai.categories.list();\n * console.log(`${total} categories available`);\n * ```\n */\n async list(): Promise<{ categories: CategoryInfo[]; total: number; categoryVersion: string }> {\n const resp = await this.http.get<CategoryListResponse>(\"/v1/categories\");\n return {\n categories: resp.data.data.categories,\n total: resp.data.data.total,\n categoryVersion: resp.data.meta.categoryVersion,\n };\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { IntermediaryData, IntermediaryResponse } from \"../types/index.js\";\n\nexport class Intermediaries {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get an intermediary (payment processor / platform) by ID.\n *\n * @param id - Intermediary UUID.\n * @returns The intermediary data (name, icon, description, website, domain, etc.).\n *\n * @example\n * ```ts\n * const intermediary = await triqai.intermediaries.get(\"550e8400-...\");\n * console.log(intermediary.name); // \"PayPal\", \"Square\", etc.\n * ```\n */\n async get(id: string): Promise<IntermediaryData> {\n const resp = await this.http.get<IntermediaryResponse>(\n `/v1/intermediaries/${encodeURIComponent(id)}`,\n );\n return resp.data.data.intermediary;\n }\n}\n","/**\n * Pagination helpers for list endpoints.\n *\n * Provides a `Page<T>` type with metadata and an `autoPaginate()` method\n * that returns an async iterator walking through all pages automatically.\n */\n\nexport interface PageInfo {\n page: number;\n size: number;\n total: number;\n totalPages: number;\n}\n\nexport class Page<T> {\n readonly data: T[];\n readonly pageInfo: PageInfo;\n\n private readonly _fetchPage: (page: number, size: number) => Promise<Page<T>>;\n\n constructor(\n data: T[],\n pageInfo: PageInfo,\n fetchPage: (page: number, size: number) => Promise<Page<T>>,\n ) {\n this.data = data;\n this.pageInfo = pageInfo;\n this._fetchPage = fetchPage;\n }\n\n get hasNextPage(): boolean {\n return this.pageInfo.page < this.pageInfo.totalPages;\n }\n\n get hasPreviousPage(): boolean {\n return this.pageInfo.page > 1;\n }\n\n async nextPage(): Promise<Page<T>> {\n if (!this.hasNextPage) {\n return new Page<T>([], this.pageInfo, this._fetchPage);\n }\n return this._fetchPage(this.pageInfo.page + 1, this.pageInfo.size);\n }\n\n async previousPage(): Promise<Page<T>> {\n if (!this.hasPreviousPage) {\n return new Page<T>([], this.pageInfo, this._fetchPage);\n }\n return this._fetchPage(this.pageInfo.page - 1, this.pageInfo.size);\n }\n\n /**\n * Returns an async iterator that yields every item across all pages,\n * starting from the current page.\n *\n * ```ts\n * for await (const item of page.autoPaginate()) {\n * console.log(item);\n * }\n * ```\n */\n async *autoPaginate(): AsyncGenerator<T, void, unknown> {\n // eslint-disable-next-line @typescript-eslint/no-this-alias -- Cursor advances to a different Page on each request.\n let current: Page<T> = this;\n while (true) {\n for (const item of current.data) {\n yield item;\n }\n if (!current.hasNextPage) break;\n current = await current.nextPage();\n }\n }\n\n /**\n * Symbol.asyncIterator so `Page` itself can be used in `for await...of`.\n */\n [Symbol.asyncIterator](): AsyncIterableIterator<T> {\n return this.autoPaginate();\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport { Page } from \"../pagination.js\";\nimport type {\n EnrichmentFieldPath,\n IssueReport,\n IssueReportListResponse,\n IssueReportResponse,\n ListIssueReportsParams,\n} from \"../types/index.js\";\n\nexport interface CreateIssueReportParams {\n /** The transaction ID to report an issue for. */\n transactionId: string;\n /** A description of what is wrong with the enrichment result. */\n description: string;\n /** Which enrichment fields are incorrect. */\n fields: EnrichmentFieldPath[];\n}\n\nexport class IssueReports {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Report an issue with an enrichment result.\n *\n * @param params - The issue report details.\n * @returns The created issue report.\n *\n * @example\n * ```ts\n * const report = await triqai.issueReports.create({\n * transactionId: \"tx-uuid\",\n * description: \"Merchant was identified incorrectly\",\n * fields: [\"entities.merchant.data.name\"],\n * });\n * console.log(report.id, report.status);\n * ```\n */\n async create(params: CreateIssueReportParams): Promise<IssueReport> {\n const resp = await this.http.post<IssueReportResponse>(\"/v1/report-issue\", {\n transaction_id: params.transactionId,\n description: params.description,\n fields: params.fields,\n });\n return resp.data.data.issueReport;\n }\n\n /**\n * List issue reports with pagination.\n *\n * @returns A `Page` of issue reports. Use `.autoPaginate()` or\n * `for await...of` to iterate through all pages automatically.\n *\n * @example\n * ```ts\n * const page = await triqai.issueReports.list({ status: \"pending\" });\n * for (const report of page.data) {\n * console.log(report.id, report.status);\n * }\n * ```\n */\n async list(params?: ListIssueReportsParams): Promise<Page<IssueReport>> {\n const fetchPage = async (page: number, size: number): Promise<Page<IssueReport>> => {\n const query: Record<string, unknown> = { page, size };\n if (params?.status) query.status = params.status;\n if (params?.transactionId) query.transaction_id = params.transactionId;\n\n const resp = await this.http.get<IssueReportListResponse>(\"/v1/report-issue\", query);\n const pageInfo = {\n page: resp.data.meta.page,\n size: resp.data.meta.size,\n total: resp.data.meta.total,\n totalPages: resp.data.meta.totalPages,\n };\n return new Page(resp.data.data, pageInfo, fetchPage);\n };\n\n return fetchPage(params?.page ?? 1, params?.size ?? 25);\n }\n\n /**\n * Get a single issue report by ID.\n *\n * @param id - Issue report UUID.\n * @returns The issue report details.\n */\n async get(id: string): Promise<IssueReport> {\n const resp = await this.http.get<IssueReportResponse>(\n `/v1/report-issue/${encodeURIComponent(id)}`,\n );\n return resp.data.data.issueReport;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { LocationData, LocationResponse } from \"../types/index.js\";\n\nexport class Locations {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get a location by ID.\n *\n * @param id - Location UUID.\n * @returns The location data (name, formatted address, coordinates, phone, rating, etc.).\n *\n * @example\n * ```ts\n * const location = await triqai.locations.get(\"550e8400-e29b-41d4-a716-446655440000\");\n * console.log(location.formatted, location.structured.city);\n * ```\n */\n async get(id: string): Promise<LocationData> {\n const resp = await this.http.get<LocationResponse>(\n `/v1/locations/${encodeURIComponent(id)}`,\n );\n return resp.data.data.location;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport type { MerchantData, MerchantResponse } from \"../types/index.js\";\n\nexport class Merchants {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get a merchant by ID.\n *\n * @param id - Merchant UUID.\n * @returns The merchant data (name, icon, website, domain, aliases, etc.).\n *\n * @example\n * ```ts\n * const merchant = await triqai.merchants.get(\"550e8400-e29b-41d4-a716-446655440000\");\n * console.log(merchant.name, merchant.website);\n * ```\n */\n async get(id: string): Promise<MerchantData> {\n const resp = await this.http.get<MerchantResponse>(\n `/v1/merchants/${encodeURIComponent(id)}`,\n );\n return resp.data.data.merchant;\n }\n}\n","import type { HttpClient } from \"../http-client.js\";\nimport { Page } from \"../pagination.js\";\nimport type {\n DeleteTransactionResponse,\n EnrichedTransaction,\n EnrichOptions,\n EnrichRequest,\n EnrichSuccessResponse,\n ListTransactionsParams,\n TransactionDetailResponse,\n TransactionListResponse,\n} from \"../types/index.js\";\n\nasync function createIdempotencyKey(): Promise<string> {\n if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID();\n // Node 18 does not always expose Web Crypto globally. Keep its fallback lazy\n // and the module name dynamic so Worker bundlers need no Node compatibility.\n const nodeCrypto = \"node:crypto\";\n const { randomUUID } = await import(/* webpackIgnore: true */ nodeCrypto) as typeof import(\"node:crypto\");\n return randomUUID();\n}\n\nexport class Transactions {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Enrich a transaction with merchant, category, location, and entity data.\n *\n * @param request - The transaction to enrich (title, country, type, and optional options).\n * @param options - Optional enrichment controls (force bypass cache, idempotency key).\n * @returns The enriched transaction data.\n *\n * @example\n * ```ts\n * const result = await triqai.transactions.enrich({\n * title: \"STARBUCKS SEATTLE WA\",\n * country: \"US\",\n * type: \"expense\",\n * });\n * console.log(result.data.entities);\n * ```\n */\n async enrich(\n request: EnrichRequest,\n options?: EnrichOptions,\n ): Promise<EnrichSuccessResponse> {\n const headers: Record<string, string> = {\n \"Idempotency-Key\": options?.idempotencyKey ?? await createIdempotencyKey(),\n };\n const query: Record<string, unknown> = {};\n\n if (options?.force) {\n query.force = \"true\";\n }\n\n const resp = await this.http.postWithHeaders<EnrichSuccessResponse>(\n \"/v1/transactions/enrich\",\n request,\n headers,\n Object.keys(query).length > 0 ? query : undefined,\n );\n return resp.data;\n }\n\n /**\n * List enriched transactions with pagination.\n *\n * @returns A `Page` of enriched transactions. Use `.autoPaginate()` or\n * `for await...of` to iterate through all pages automatically.\n *\n * @example\n * ```ts\n * const page = await triqai.transactions.list({ size: 10 });\n * console.log(page.data); // first 10 transactions\n *\n * // Auto-paginate through all:\n * for await (const tx of page) {\n * console.log(tx.id, tx.raw);\n * }\n * ```\n */\n async list(params?: ListTransactionsParams): Promise<Page<EnrichedTransaction>> {\n const fetchPage = async (page: number, size: number): Promise<Page<EnrichedTransaction>> => {\n const query: Record<string, unknown> = {\n page,\n size,\n };\n if (params?.startDate) {\n query.startDate =\n params.startDate instanceof Date\n ? params.startDate.toISOString()\n : params.startDate;\n }\n if (params?.endDate) {\n query.endDate =\n params.endDate instanceof Date\n ? params.endDate.toISOString()\n : params.endDate;\n }\n\n const resp = await this.http.get<TransactionListResponse>(\"/v1/transactions\", query);\n const { transactions, pagination } = resp.data.data;\n return new Page(transactions, pagination, fetchPage);\n };\n\n return fetchPage(params?.page ?? 1, params?.size ?? 25);\n }\n\n /**\n * Get a single transaction by ID.\n *\n * @param id - Transaction UUID.\n * @returns The enriched transaction record.\n */\n async get(id: string): Promise<EnrichedTransaction> {\n const resp = await this.http.get<TransactionDetailResponse>(\n `/v1/transactions/${encodeURIComponent(id)}`,\n );\n return resp.data.data.transaction;\n }\n\n /**\n * Delete a transaction by ID.\n *\n * @param id - Transaction UUID.\n * @returns Confirmation with the deleted transaction ID.\n */\n async delete(id: string): Promise<{ deleted: true; transactionId: string }> {\n const resp = await this.http.delete<DeleteTransactionResponse>(\n `/v1/transactions/${encodeURIComponent(id)}`,\n );\n return resp.data.data;\n }\n}\n","import type { HttpResponse } from \"./http-client.js\";\nimport { HttpClient } from \"./http-client.js\";\nimport { Banks } from \"./resources/banks.js\";\nimport { Categories } from \"./resources/categories.js\";\nimport { Intermediaries } from \"./resources/intermediaries.js\";\nimport { IssueReports } from \"./resources/issue-reports.js\";\nimport { Locations } from \"./resources/locations.js\";\nimport { Merchants } from \"./resources/merchants.js\";\nimport { Transactions } from \"./resources/transactions.js\";\nimport type {\n ApiInfoResponse,\n HealthResponse,\n TriqaiConfig,\n} from \"./types/index.js\";\n\n/**\n * The Triqai SDK client.\n *\n * @example\n * ```ts\n * import Triqai from \"triqai\";\n *\n * const triqai = new Triqai(\"triq_your_api_key\");\n *\n * const result = await triqai.transactions.enrich({\n * title: \"STARBUCKS SEATTLE WA\",\n * country: \"US\",\n * type: \"expense\",\n * });\n * ```\n */\nexport class Triqai {\n /** Enrich, list, get, and delete transactions. */\n readonly transactions: Transactions;\n /** List the full category taxonomy. */\n readonly categories: Categories;\n /** Look up merchant details by ID. */\n readonly merchants: Merchants;\n /** Search stored bank profiles or retrieve them by ID. */\n readonly banks: Banks;\n /** Look up location details by ID. */\n readonly locations: Locations;\n /** Look up intermediary (payment processor) details by ID. */\n readonly intermediaries: Intermediaries;\n /** Create and manage enrichment issue reports. */\n readonly issueReports: IssueReports;\n\n private readonly http: HttpClient;\n\n /**\n * Create a new Triqai SDK client.\n *\n * @param apiKey - Your Triqai API key (starts with `triq_`). Get one at https://triqai.com/dashboard\n * @param config - Optional configuration (base URL, retry settings, hooks).\n */\n constructor(apiKey: string, config?: TriqaiConfig) {\n this.http = new HttpClient(apiKey, config);\n this.transactions = new Transactions(this.http);\n this.categories = new Categories(this.http);\n this.merchants = new Merchants(this.http);\n this.banks = new Banks(this.http);\n this.locations = new Locations(this.http);\n this.intermediaries = new Intermediaries(this.http);\n this.issueReports = new IssueReports(this.http);\n }\n\n /**\n * Check the API health status.\n *\n * @returns Health status including service name and version.\n *\n * @example\n * ```ts\n * const health = await triqai.health();\n * console.log(health.data.status); // \"healthy\"\n * console.log(health.data.version); // \"1.1.9\"\n * ```\n */\n async health(): Promise<HealthResponse> {\n const resp = await this.http.get<HealthResponse>(\"/health\");\n return resp.data;\n }\n\n /**\n * Get API version and endpoint directory.\n *\n * @returns API version info and available endpoint paths.\n *\n * @example\n * ```ts\n * const info = await triqai.apiInfo();\n * console.log(info.data.version); // \"v1\"\n * console.log(info.data.endpoints);\n * ```\n */\n async apiInfo(): Promise<ApiInfoResponse> {\n const resp = await this.http.get<ApiInfoResponse>(\"/v1\");\n return resp.data;\n }\n\n /**\n * Make a raw GET request to any API path.\n * Useful for accessing endpoints not yet covered by a resource class.\n *\n * @param path - API path (e.g. \"/v1/some-endpoint\").\n * @param query - Optional query parameters.\n * @returns The full HTTP response including headers and rate limit info.\n */\n async rawGet<T = unknown>(\n path: string,\n query?: Record<string, unknown>,\n ): Promise<HttpResponse<T>> {\n return this.http.get<T>(path, query);\n }\n\n /**\n * Make a raw POST request to any API path.\n * Useful for accessing endpoints not yet covered by a resource class.\n *\n * @param path - API path (e.g. \"/v1/some-endpoint\").\n * @param body - Request body.\n * @returns The full HTTP response including headers and rate limit info.\n */\n async rawPost<T = unknown>(\n path: string,\n body?: unknown,\n ): Promise<HttpResponse<T>> {\n return this.http.post<T>(path, body);\n }\n\n /**\n * Make a raw DELETE request to any API path.\n * Useful for accessing endpoints not yet covered by a resource class.\n *\n * @param path - API path (e.g. \"/v1/some-resource/uuid\").\n * @returns The full HTTP response including headers and rate limit info.\n */\n async rawDelete<T = unknown>(path: string): Promise<HttpResponse<T>> {\n return this.http.delete<T>(path);\n }\n}\n","import { Triqai } from \"./client.js\";\n\nexport { Triqai };\nexport default Triqai;\n\nexport {\n TriqaiError,\n AuthenticationError,\n AuthorizationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n ClientDisconnectedError,\n DuplicateRequestError,\n RateLimitError,\n InternalServerError,\n ServiceUnavailableError,\n GatewayTimeoutError,\n ConnectionError,\n TimeoutError,\n} from \"./errors.js\";\nexport type { RawErrorObject, RawResponseMeta } from \"./errors.js\";\n\nexport type { HttpResponse } from \"./http-client.js\";\n\nexport { Page } from \"./pagination.js\";\nexport type { PageInfo } from \"./pagination.js\";\n\nexport type { CreateIssueReportParams } from \"./resources/issue-reports.js\";\n\nexport type {\n // SDK config types\n TriqaiConfig,\n RequestInfo,\n ResponseInfo,\n RateLimitInfo,\n EnrichOptions,\n ListTransactionsParams,\n ListIssueReportsParams,\n // Enrichment request types\n EnrichRequest,\n EnrichRequestOptions,\n EnrichmentFilterOptions,\n PrefilledMerchant,\n PrefilledLocation,\n PrefilledIntermediary,\n // Enrichment response types\n EnrichSuccessResponse,\n EnrichmentData,\n EnrichMeta,\n EnrichmentErrorCode,\n // Transaction types\n TransactionData,\n TransactionType,\n TransactionRecord,\n EnrichedTransaction,\n TransactionPagination,\n TransactionListResponse,\n TransactionDetailResponse,\n DeleteTransactionResponse,\n // Category types\n CategoryStructure,\n Category,\n CategoryCode,\n CategoryInfo,\n CategoryListResponse,\n // Confidence\n ConfidenceWithReasons,\n // Entity types\n EntityResult,\n BankData,\n BankResponse,\n BankSearchResponse,\n BankSearchParams,\n MerchantData,\n LocationData,\n IntermediaryData,\n IntermediaryRecord,\n PersonData,\n Coordinates,\n StructuredAddress,\n LocationRating,\n // Entity response types\n MerchantResponse,\n LocationResponse,\n IntermediaryResponse,\n // Issue report types\n IssueReport,\n IssueReportStatus,\n IssueReportResponse,\n IssueReportListResponse,\n ReportIssueRequest,\n EnrichmentFieldPath,\n // Error response types\n ErrorResponse,\n ErrorObject,\n DuplicateRequestErrorResponse,\n ClientDisconnectedErrorResponse,\n // Meta types\n ResponseMeta,\n PaginationMeta,\n // Utility response types\n HealthResponse,\n ApiInfoResponse,\n} from \"./types/index.js\";\n"]}
|
package/openapi-public.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.1.0
|
|
2
2
|
info:
|
|
3
3
|
title: Triqai Transaction Enrichment API
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.63
|
|
5
5
|
description: |
|
|
6
6
|
The Triqai API provides transaction enrichment capabilities for financial applications.
|
|
7
7
|
|
|
@@ -413,6 +413,82 @@ paths:
|
|
|
413
413
|
'500':
|
|
414
414
|
$ref: '#/components/responses/InternalError'
|
|
415
415
|
|
|
416
|
+
/v1/banks:
|
|
417
|
+
get:
|
|
418
|
+
tags: [Entities]
|
|
419
|
+
summary: Search banks by name
|
|
420
|
+
operationId: searchBanks
|
|
421
|
+
description: |
|
|
422
|
+
Search stored banks by exact, case-insensitive name (surrounding whitespace is ignored).
|
|
423
|
+
Optionally filter by ISO country of origin, not a country where the bank operates.
|
|
424
|
+
Requires an API key, is rate limited, and costs zero credits. No enrichment or creation occurs.
|
|
425
|
+
Returns all matching candidates in pages ordered by country (unknown last), then ID.
|
|
426
|
+
No match returns an empty array. Results are read directly from the database so backfilled
|
|
427
|
+
details are available immediately. Pagination is not a snapshot across requests.
|
|
428
|
+
parameters:
|
|
429
|
+
- name: name
|
|
430
|
+
in: query
|
|
431
|
+
required: true
|
|
432
|
+
description: Bank name; 1–200 characters after trimming. No fuzzy or alias matching.
|
|
433
|
+
schema: { type: string, minLength: 1, maxLength: 200 }
|
|
434
|
+
example: ING
|
|
435
|
+
- name: country
|
|
436
|
+
in: query
|
|
437
|
+
description: ISO 3166-1 alpha-2 country of origin; case-insensitive. Unknown countries do not match a filter.
|
|
438
|
+
schema: { type: string, pattern: '^[A-Za-z]{2}$' }
|
|
439
|
+
example: NL
|
|
440
|
+
- name: page
|
|
441
|
+
in: query
|
|
442
|
+
schema: { type: integer, minimum: 1, maximum: 10000, default: 1 }
|
|
443
|
+
- name: size
|
|
444
|
+
in: query
|
|
445
|
+
schema: { type: integer, minimum: 1, maximum: 100, default: 20 }
|
|
446
|
+
responses:
|
|
447
|
+
'200':
|
|
448
|
+
description: Matching bank candidates (possibly empty)
|
|
449
|
+
content:
|
|
450
|
+
application/json:
|
|
451
|
+
schema:
|
|
452
|
+
$ref: '#/components/schemas/BankSearchResponse'
|
|
453
|
+
'401':
|
|
454
|
+
$ref: '#/components/responses/Unauthorized'
|
|
455
|
+
'403':
|
|
456
|
+
$ref: '#/components/responses/Forbidden'
|
|
457
|
+
'422':
|
|
458
|
+
$ref: '#/components/responses/ValidationError'
|
|
459
|
+
'429':
|
|
460
|
+
$ref: '#/components/responses/RateLimited'
|
|
461
|
+
'500':
|
|
462
|
+
$ref: '#/components/responses/InternalError'
|
|
463
|
+
|
|
464
|
+
/v1/banks/{id}:
|
|
465
|
+
get:
|
|
466
|
+
tags: [Entities]
|
|
467
|
+
summary: Get bank
|
|
468
|
+
operationId: getBank
|
|
469
|
+
description: Retrieve a stored bank by ID. Requires an API key, is rate limited, and costs zero credits.
|
|
470
|
+
parameters:
|
|
471
|
+
- $ref: '#/components/parameters/IdPath'
|
|
472
|
+
responses:
|
|
473
|
+
'200':
|
|
474
|
+
description: Bank found
|
|
475
|
+
content:
|
|
476
|
+
application/json:
|
|
477
|
+
schema:
|
|
478
|
+
$ref: '#/components/schemas/BankResponse'
|
|
479
|
+
'401':
|
|
480
|
+
$ref: '#/components/responses/Unauthorized'
|
|
481
|
+
'403':
|
|
482
|
+
$ref: '#/components/responses/Forbidden'
|
|
483
|
+
'404':
|
|
484
|
+
$ref: '#/components/responses/NotFound'
|
|
485
|
+
'422':
|
|
486
|
+
$ref: '#/components/responses/ValidationError'
|
|
487
|
+
'429':
|
|
488
|
+
$ref: '#/components/responses/RateLimited'
|
|
489
|
+
'500':
|
|
490
|
+
$ref: '#/components/responses/InternalError'
|
|
491
|
+
|
|
416
492
|
/v1/merchants/{id}:
|
|
417
493
|
get:
|
|
418
494
|
tags:
|
|
@@ -805,6 +881,8 @@ components:
|
|
|
805
881
|
required:
|
|
806
882
|
- transactions
|
|
807
883
|
- categories
|
|
884
|
+
- banks
|
|
885
|
+
- bank
|
|
808
886
|
- merchants
|
|
809
887
|
- locations
|
|
810
888
|
- intermediaries
|
|
@@ -816,6 +894,12 @@ components:
|
|
|
816
894
|
categories:
|
|
817
895
|
type: string
|
|
818
896
|
example: /v1/categories
|
|
897
|
+
banks:
|
|
898
|
+
type: string
|
|
899
|
+
example: /v1/banks
|
|
900
|
+
bank:
|
|
901
|
+
type: string
|
|
902
|
+
example: /v1/banks/{id}
|
|
819
903
|
merchants:
|
|
820
904
|
type: string
|
|
821
905
|
example: /v1/merchants/{id}
|
|
@@ -1715,6 +1799,90 @@ components:
|
|
|
1715
1799
|
meta:
|
|
1716
1800
|
$ref: '#/components/schemas/CategoryListMeta'
|
|
1717
1801
|
|
|
1802
|
+
BankData:
|
|
1803
|
+
type: object
|
|
1804
|
+
description: Shared bank reference data. Unknown profile values are null; icon is the bank logo URL.
|
|
1805
|
+
required: [id, name, country, foundedYear, foundedOn, description, icon, color, website, domain]
|
|
1806
|
+
properties:
|
|
1807
|
+
id:
|
|
1808
|
+
type: string
|
|
1809
|
+
format: uuid
|
|
1810
|
+
name:
|
|
1811
|
+
type: string
|
|
1812
|
+
minLength: 1
|
|
1813
|
+
maxLength: 200
|
|
1814
|
+
country:
|
|
1815
|
+
type: [string, 'null']
|
|
1816
|
+
pattern: '^[A-Z]{2}$'
|
|
1817
|
+
description: ISO 3166-1 alpha-2 country of origin, not countries of operation.
|
|
1818
|
+
example: NL
|
|
1819
|
+
foundedYear:
|
|
1820
|
+
type: [integer, 'null']
|
|
1821
|
+
minimum: 1
|
|
1822
|
+
maximum: 9999
|
|
1823
|
+
description: Founding year when known. May be populated without an exact date.
|
|
1824
|
+
foundedOn:
|
|
1825
|
+
type: [string, 'null']
|
|
1826
|
+
format: date
|
|
1827
|
+
description: Exact founding date when known (YYYY-MM-DD). Never inferred from the year alone.
|
|
1828
|
+
description:
|
|
1829
|
+
type: [string, 'null']
|
|
1830
|
+
icon:
|
|
1831
|
+
type: [string, 'null']
|
|
1832
|
+
description: Bank logo URL, consistent with merchant icon fields.
|
|
1833
|
+
color:
|
|
1834
|
+
type: [string, 'null']
|
|
1835
|
+
description: Brand color.
|
|
1836
|
+
website:
|
|
1837
|
+
type: [string, 'null']
|
|
1838
|
+
domain:
|
|
1839
|
+
type: [string, 'null']
|
|
1840
|
+
|
|
1841
|
+
BankResponse:
|
|
1842
|
+
type: object
|
|
1843
|
+
required: [success, data, meta]
|
|
1844
|
+
properties:
|
|
1845
|
+
success:
|
|
1846
|
+
type: boolean
|
|
1847
|
+
enum: [true]
|
|
1848
|
+
data:
|
|
1849
|
+
type: object
|
|
1850
|
+
required: [bank]
|
|
1851
|
+
properties:
|
|
1852
|
+
bank:
|
|
1853
|
+
$ref: '#/components/schemas/BankData'
|
|
1854
|
+
meta:
|
|
1855
|
+
$ref: '#/components/schemas/ResponseMeta'
|
|
1856
|
+
|
|
1857
|
+
BankSearchResponse:
|
|
1858
|
+
type: object
|
|
1859
|
+
required: [success, data, meta]
|
|
1860
|
+
properties:
|
|
1861
|
+
success:
|
|
1862
|
+
type: boolean
|
|
1863
|
+
enum: [true]
|
|
1864
|
+
data:
|
|
1865
|
+
type: object
|
|
1866
|
+
required: [banks, pagination]
|
|
1867
|
+
properties:
|
|
1868
|
+
banks:
|
|
1869
|
+
type: array
|
|
1870
|
+
items:
|
|
1871
|
+
$ref: '#/components/schemas/BankData'
|
|
1872
|
+
pagination:
|
|
1873
|
+
type: object
|
|
1874
|
+
required: [page, size, hasMore]
|
|
1875
|
+
properties:
|
|
1876
|
+
page:
|
|
1877
|
+
type: integer
|
|
1878
|
+
size:
|
|
1879
|
+
type: integer
|
|
1880
|
+
hasMore:
|
|
1881
|
+
type: boolean
|
|
1882
|
+
description: More candidates exist; request the next page with the same filters and size.
|
|
1883
|
+
meta:
|
|
1884
|
+
$ref: '#/components/schemas/ResponseMeta'
|
|
1885
|
+
|
|
1718
1886
|
MerchantResponse:
|
|
1719
1887
|
type: object
|
|
1720
1888
|
required:
|