diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index ab38d227..f8e50efc 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -19,4 +19,3 @@ jobs: bash ./bin/check-release-environment env: NPM_TOKEN: ${{ secrets.LITHIC_NPM_TOKEN || secrets.NPM_TOKEN }} - diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0ad84350..88624072 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.126.0" + ".": "0.127.0" } diff --git a/.stats.yml b/.stats.yml index 315b0f37..f9404c37 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml -openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f -config_hash: 2b2786c821f62db49cc630ba45329336 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-854de7cc8f79e150ffe98f038ce9f39367010b2bdfffc9992be2738697dc4880.yml +openapi_spec_hash: fd471b20f3eda1e00cdebf028cbfe867 +config_hash: 9dddee5f7af579864599849cb28a0770 diff --git a/CHANGELOG.md b/CHANGELOG.md index d30a0ce5..da317491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## 0.127.0 (2026-01-05) + +Full Changelog: [v0.126.0...v0.127.0](https://github.com/lithic-com/lithic-node/compare/v0.126.0...v0.127.0) + +### Features + +* **api:** add external_id to payment_event ([538d96e](https://github.com/lithic-com/lithic-node/commit/538d96e5eba1b99e56839f5b0aac87496b681279)) +* **api:** add get /v1/transfer_limits endpoint ([538d96e](https://github.com/lithic-com/lithic-node/commit/538d96e5eba1b99e56839f5b0aac87496b681279)) +* **api:** add post /v1/book_transfers/{book_transfer_token}/retry endpoint ([538d96e](https://github.com/lithic-com/lithic-node/commit/538d96e5eba1b99e56839f5b0aac87496b681279)) +* **api:** add WIRE_DRAWDOWN_REQUEST transfer type ([e7c375b](https://github.com/lithic-com/lithic-node/commit/e7c375bf328756a708d54e8a33e2ed154ebfeb93)) +* **api:** remove unnecessary X-Lithic-Pagination header ([e7c375b](https://github.com/lithic-com/lithic-node/commit/e7c375bf328756a708d54e8a33e2ed154ebfeb93)) +* **api:** remove v1/aggregate_balances and related models ([0078e74](https://github.com/lithic-com/lithic-node/commit/0078e74adc26ff15a7340684c1b07b662e500e01)) + + +### Bug Fixes + +* **docs:** remove extraneous example object fields ([3ba95e6](https://github.com/lithic-com/lithic-node/commit/3ba95e64b6eea6893359d17a21d66eab3a93219b)) + + +### Chores + +* formatting ([0b4c11e](https://github.com/lithic-com/lithic-node/commit/0b4c11edeffb476c403be5b84c1e310fd5dfc063)) +* **internal:** codegen related update ([a06ac86](https://github.com/lithic-com/lithic-node/commit/a06ac867f0c60f77fd92dfe6a7eac8e9c4967cd5)) + + +### Documentation + +* **api:** clarify description of token / retry_token when it serves as idempotency key ([e7c375b](https://github.com/lithic-com/lithic-node/commit/e7c375bf328756a708d54e8a33e2ed154ebfeb93)) + ## 0.126.0 (2025-12-11) Full Changelog: [v0.125.0...v0.126.0](https://github.com/lithic-com/lithic-node/compare/v0.125.0...v0.126.0) diff --git a/LICENSE b/LICENSE index 06eee64e..9410347b 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Lithic + Copyright 2026 Lithic Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/MIGRATION.md b/MIGRATION.md index b79795e2..4ed0a385 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -104,12 +104,10 @@ client.example.list(undefined, { headers: { ... } }); - `client.tokenizations.resendActivationCode()` - `client.tokenizations.updateDigitalCardArt()` - `client.cards.list()` -- `client.cards.aggregateBalances.list()` - `client.cards.balances.list()` - `client.cards.financialTransactions.list()` - `client.cardBulkOrders.list()` - `client.balances.list()` -- `client.aggregateBalances.list()` - `client.disputes.list()` - `client.disputes.initiateEvidenceUpload()` - `client.disputes.listEvidences()` @@ -144,27 +142,10 @@ client.example.list(undefined, { headers: { ... } }); - `client.fundingEvents.list()` - `client.networkPrograms.list()` - `client.accountActivity.list()` +- `client.transferLimits.list()` -### HTTP method naming - -Previously some methods could not be named intuitively due to an internal naming conflict. This has been fixed and the affected methods are now correctly named. - -```ts -// Before -client.authRules.v2.del(); -client.disputes.del(); -client.events.subscriptions.del(); -client.responderEndpoints.del(); - -// After -client.authRules.v2.delete(); -client.disputes.delete(); -client.events.subscriptions.delete(); -client.responderEndpoints.delete(); -``` - ### Removed `httpAgent` in favor of `fetchOptions` The `httpAgent` client option has been removed in favor of a [platform-specific `fetchOptions` property](https://github.com/lithic-com/lithic-node#fetch-options). diff --git a/README.md b/README.md index 082b77a9..736886dd 100644 --- a/README.md +++ b/README.md @@ -156,23 +156,6 @@ while (page.hasNextPage()) { } ``` -## Default Headers - -We automatically send the `X-Lithic-Pagination` header set to `cursor`. - -If you need to, you can override it by setting default headers on a per-request basis. - -```ts -import Lithic from 'lithic'; - -const client = new Lithic(); - -const card = await client.cards.create( - { type: 'SINGLE_USE' }, - { headers: { 'X-Lithic-Pagination': 'My-Custom-Value' } }, -); -``` - ## Webhooks Lithic uses webhooks to notify your application when events happen. The library provides signature verification via the `standardwebhooks` package. @@ -201,7 +184,7 @@ switch (event.event_type) { ```ts // Verify signature without parsing the event -lithic.webhooks.verifySignature(body, headers) +lithic.webhooks.verifySignature(body, headers); // Parse only - skips signature verification const event = lithic.webhooks.parseUnsafe(body); @@ -231,7 +214,6 @@ export default async function POST(req: Request) { > [!NOTE] > If you're using the pages router, you will need [this trick](https://vancelucas.com/blog/how-to-access-raw-body-data-with-next-js/) to get the raw body. - ## Advanced Usage ### Accessing raw Response data (e.g., headers) diff --git a/api.md b/api.md index 63c36ec3..0ca0a4b9 100644 --- a/api.md +++ b/api.md @@ -189,16 +189,6 @@ Methods: - client.cards.getEmbedHTML(...args) -> Promise<string> - client.cards.getEmbedURL(...args) -> string -## AggregateBalances - -Types: - -- AggregateBalanceListResponse - -Methods: - -- client.cards.aggregateBalances.list({ ...params }) -> AggregateBalanceListResponsesSinglePage - ## Balances Methods: @@ -235,16 +225,6 @@ Methods: - client.balances.list({ ...params }) -> BalancesSinglePage -# AggregateBalances - -Types: - -- AggregateBalance - -Methods: - -- client.aggregateBalances.list({ ...params }) -> AggregateBalancesSinglePage - # Disputes Types: @@ -624,6 +604,7 @@ Methods: - client.bookTransfers.create({ ...params }) -> BookTransferResponse - client.bookTransfers.retrieve(bookTransferToken) -> BookTransferResponse - client.bookTransfers.list({ ...params }) -> BookTransferResponsesCursorPage +- client.bookTransfers.retry(bookTransferToken, { ...params }) -> BookTransferResponse - client.bookTransfers.reverse(bookTransferToken, { ...params }) -> BookTransferResponse # CreditProducts @@ -737,6 +718,16 @@ Methods: - client.accountActivity.list({ ...params }) -> AccountActivityListResponsesCursorPage - client.accountActivity.retrieveTransaction(transactionToken) -> AccountActivityRetrieveTransactionResponse +# TransferLimits + +Types: + +- TransferLimitsResponse + +Methods: + +- client.transferLimits.list({ ...params }) -> TransferLimitsResponseDataSinglePage + # Webhooks Types: diff --git a/bin/cli b/bin/cli index 21b41a9a..8f314993 100755 --- a/bin/cli +++ b/bin/cli @@ -8,15 +8,21 @@ const commands = { fn: () => { const result = spawnSync( 'npx', - ['-y', 'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz', '--migrationConfig', require.resolve('./migration-config.json'), ...process.argv.slice(3)], + [ + '-y', + 'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz', + '--migrationConfig', + require.resolve('./migration-config.json'), + ...process.argv.slice(3), + ], { stdio: 'inherit' }, ); if (result.status !== 0) { process.exit(result.status); } - } - } -} + }, + }, +}; function exitWithHelp() { console.log(`Usage: lithic `); diff --git a/bin/migration-config.json b/bin/migration-config.json index 094f7b96..802f17f5 100644 --- a/bin/migration-config.json +++ b/bin/migration-config.json @@ -36,11 +36,6 @@ } ] }, - { - "base": "authRules.v2", - "name": "delete", - "oldName": "del" - }, { "base": "authRules.v2.backtests", "name": "retrieve", @@ -107,11 +102,6 @@ } ] }, - { - "base": "disputes", - "name": "delete", - "oldName": "del" - }, { "base": "disputes", "name": "deleteEvidence", @@ -178,11 +168,6 @@ } ] }, - { - "base": "events.subscriptions", - "name": "delete", - "oldName": "del" - }, { "base": "events.eventSubscriptions", "name": "resend", @@ -351,11 +336,6 @@ "type": "options" } ] - }, - { - "base": "responderEndpoints", - "name": "delete", - "oldName": "del" } ] } diff --git a/package.json b/package.json index 701cf9b0..ab8bebb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lithic", - "version": "0.126.0", + "version": "0.127.0", "description": "The official TypeScript library for the Lithic API", "author": "Lithic ", "types": "dist/index.d.ts", diff --git a/src/client.ts b/src/client.ts index 18d2201e..5cbc3a2c 100644 --- a/src/client.ts +++ b/src/client.ts @@ -64,12 +64,6 @@ import { Accounts, AccountsCursorPage, } from './resources/accounts'; -import { - AggregateBalance, - AggregateBalanceListParams, - AggregateBalances, - AggregateBalancesSinglePage, -} from './resources/aggregate-balances'; import { AuthStreamEnrollment, AuthStreamSecret } from './resources/auth-stream-enrollment'; import { Balance, BalanceListParams, Balances, BalancesSinglePage } from './resources/balances'; import { @@ -77,6 +71,7 @@ import { BookTransferListParams, BookTransferResponse, BookTransferResponsesCursorPage, + BookTransferRetryParams, BookTransferReverseParams, BookTransfers, } from './resources/book-transfers'; @@ -196,6 +191,12 @@ import { TokenizationsCursorPage, WalletDecisioningInfo, } from './resources/tokenizations'; +import { + TransferLimitListParams, + TransferLimits, + TransferLimitsResponse, + TransferLimitsResponseDataSinglePage, +} from './resources/transfer-limits'; import { Transfer, TransferCreateParams, Transfers } from './resources/transfers'; import { AccountHolderCreatedWebhookEvent, @@ -1028,7 +1029,6 @@ export class Lithic { 'X-Stainless-Retry-Count': String(retryCount), ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}), ...getPlatformHeaders(), - 'X-Lithic-Pagination': 'cursor', }, await this.authHeaders(options), this._options.defaultHeaders, @@ -1106,7 +1106,6 @@ export class Lithic { cards: API.Cards = new API.Cards(this); cardBulkOrders: API.CardBulkOrders = new API.CardBulkOrders(this); balances: API.Balances = new API.Balances(this); - aggregateBalances: API.AggregateBalances = new API.AggregateBalances(this); disputes: API.Disputes = new API.Disputes(this); disputesV2: API.DisputesV2 = new API.DisputesV2(this); events: API.Events = new API.Events(this); @@ -1129,6 +1128,7 @@ export class Lithic { fraud: API.Fraud = new API.Fraud(this); networkPrograms: API.NetworkPrograms = new API.NetworkPrograms(this); accountActivity: API.AccountActivity = new API.AccountActivity(this); + transferLimits: API.TransferLimits = new API.TransferLimits(this); webhooks: API.Webhooks = new API.Webhooks(this); } @@ -1141,7 +1141,6 @@ Lithic.Tokenizations = Tokenizations; Lithic.Cards = Cards; Lithic.CardBulkOrders = CardBulkOrders; Lithic.Balances = Balances; -Lithic.AggregateBalances = AggregateBalances; Lithic.Disputes = Disputes; Lithic.DisputesV2 = DisputesV2; Lithic.Events = Events; @@ -1164,6 +1163,7 @@ Lithic.FundingEvents = FundingEvents; Lithic.Fraud = Fraud; Lithic.NetworkPrograms = NetworkPrograms; Lithic.AccountActivity = AccountActivity; +Lithic.TransferLimits = TransferLimits; Lithic.Webhooks = Webhooks; export declare namespace Lithic { @@ -1274,13 +1274,6 @@ export declare namespace Lithic { type BalanceListParams as BalanceListParams, }; - export { - AggregateBalances as AggregateBalances, - type AggregateBalance as AggregateBalance, - type AggregateBalancesSinglePage as AggregateBalancesSinglePage, - type AggregateBalanceListParams as AggregateBalanceListParams, - }; - export { Disputes as Disputes, type Dispute as Dispute, @@ -1437,6 +1430,7 @@ export declare namespace Lithic { type BookTransferResponsesCursorPage as BookTransferResponsesCursorPage, type BookTransferCreateParams as BookTransferCreateParams, type BookTransferListParams as BookTransferListParams, + type BookTransferRetryParams as BookTransferRetryParams, type BookTransferReverseParams as BookTransferReverseParams, }; @@ -1496,6 +1490,13 @@ export declare namespace Lithic { type AccountActivityListParams as AccountActivityListParams, }; + export { + TransferLimits as TransferLimits, + type TransferLimitsResponse as TransferLimitsResponse, + type TransferLimitsResponseDataSinglePage as TransferLimitsResponseDataSinglePage, + type TransferLimitListParams as TransferLimitListParams, + }; + export { Webhooks as Webhooks, type AccountHolderCreatedWebhookEvent as AccountHolderCreatedWebhookEvent, diff --git a/src/resources/account-holders.ts b/src/resources/account-holders.ts index 8809aa58..950a5fd3 100644 --- a/src/resources/account-holders.ts +++ b/src/resources/account-holders.ts @@ -42,7 +42,6 @@ export class AccountHolders extends APIResource { * }, * control_person: { * address: { ... }, - * birthdate: '1980-04-12', * dob: '1991-03-08T08:00:00Z', * email: 'tom@middle-pluto.com', * first_name: 'Tom', diff --git a/src/resources/aggregate-balances.ts b/src/resources/aggregate-balances.ts deleted file mode 100644 index cc5094dc..00000000 --- a/src/resources/aggregate-balances.ts +++ /dev/null @@ -1,97 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../core/resource'; -import { PagePromise, SinglePage } from '../core/pagination'; -import { RequestOptions } from '../internal/request-options'; - -export class AggregateBalances extends APIResource { - /** - * Get the aggregated balance across all end-user accounts by financial account - * type - */ - list( - query: AggregateBalanceListParams | null | undefined = {}, - options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/v1/aggregate_balances', SinglePage, { - query, - ...options, - }); - } -} - -export type AggregateBalancesSinglePage = SinglePage; - -/** - * Aggregate Balance across all end-user accounts - */ -export interface AggregateBalance { - /** - * Funds available for spend in the currency's smallest unit (e.g., cents for USD) - */ - available_amount: number; - - /** - * Date and time for when the balance was first created. - */ - created: string; - - /** - * 3-character alphabetic ISO 4217 code for the local currency of the balance. - */ - currency: string; - - /** - * Type of financial account - */ - financial_account_type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; - - /** - * Globally unique identifier for the financial account that had its balance - * updated most recently - */ - last_financial_account_token: string; - - /** - * Globally unique identifier for the last transaction event that impacted this - * balance - */ - last_transaction_event_token: string; - - /** - * Globally unique identifier for the last transaction that impacted this balance - */ - last_transaction_token: string; - - /** - * Funds not available for spend due to card authorizations or pending ACH release. - * Shown in the currency's smallest unit (e.g., cents for USD) - */ - pending_amount: number; - - /** - * The sum of available and pending balance in the currency's smallest unit (e.g., - * cents for USD) - */ - total_amount: number; - - /** - * Date and time for when the balance was last updated. - */ - updated: string; -} - -export interface AggregateBalanceListParams { - /** - * Get the aggregate balance for a given Financial Account type. - */ - financial_account_type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; -} - -export declare namespace AggregateBalances { - export { - type AggregateBalance as AggregateBalance, - type AggregateBalancesSinglePage as AggregateBalancesSinglePage, - type AggregateBalanceListParams as AggregateBalanceListParams, - }; -} diff --git a/src/resources/book-transfers.ts b/src/resources/book-transfers.ts index 2fd73ae3..93880beb 100644 --- a/src/resources/book-transfers.ts +++ b/src/resources/book-transfers.ts @@ -36,6 +36,17 @@ export class BookTransfers extends APIResource { }); } + /** + * Retry a book transfer that has been declined + */ + retry( + bookTransferToken: string, + body: BookTransferRetryParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post(path`/v1/book_transfers/${bookTransferToken}/retry`, { body, ...options }); + } + /** * Reverse a book transfer */ @@ -383,6 +394,14 @@ export interface BookTransferListParams extends CursorPageParams { status?: 'DECLINED' | 'SETTLED'; } +export interface BookTransferRetryParams { + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ + retry_token: string; +} + export interface BookTransferReverseParams { /** * Optional descriptor for the reversal. @@ -396,6 +415,7 @@ export declare namespace BookTransfers { type BookTransferResponsesCursorPage as BookTransferResponsesCursorPage, type BookTransferCreateParams as BookTransferCreateParams, type BookTransferListParams as BookTransferListParams, + type BookTransferRetryParams as BookTransferRetryParams, type BookTransferReverseParams as BookTransferReverseParams, }; } diff --git a/src/resources/cards/aggregate-balances.ts b/src/resources/cards/aggregate-balances.ts deleted file mode 100644 index 1b1da61d..00000000 --- a/src/resources/cards/aggregate-balances.ts +++ /dev/null @@ -1,104 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../core/resource'; -import { PagePromise, SinglePage } from '../../core/pagination'; -import { RequestOptions } from '../../internal/request-options'; - -export class AggregateBalances extends APIResource { - /** - * Get the aggregated card balance across all end-user accounts. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const aggregateBalanceListResponse of client.cards.aggregateBalances.list()) { - * // ... - * } - * ``` - */ - list( - query: AggregateBalanceListParams | null | undefined = {}, - options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/v1/cards/aggregate_balances', SinglePage, { - query, - ...options, - }); - } -} - -export type AggregateBalanceListResponsesSinglePage = SinglePage; - -/** - * Card Aggregate Balance across all end-user accounts - */ -export interface AggregateBalanceListResponse { - /** - * Funds available for spend in the currency's smallest unit (e.g., cents for USD) - */ - available_amount: number; - - /** - * Date and time for when the balance was first created. - */ - created: string; - - /** - * 3-character alphabetic ISO 4217 code for the local currency of the balance. - */ - currency: string; - - /** - * Globally unique identifier for the card that had its balance updated most - * recently - */ - last_card_token: string; - - /** - * Globally unique identifier for the last transaction event that impacted this - * balance - */ - last_transaction_event_token: string; - - /** - * Globally unique identifier for the last transaction that impacted this balance - */ - last_transaction_token: string; - - /** - * Funds not available for spend due to card authorizations or pending ACH release. - * Shown in the currency's smallest unit (e.g., cents for USD) - */ - pending_amount: number; - - /** - * The sum of available and pending balance in the currency's smallest unit (e.g., - * cents for USD) - */ - total_amount: number; - - /** - * Date and time for when the balance was last updated. - */ - updated: string; -} - -export interface AggregateBalanceListParams { - /** - * Cardholder to retrieve aggregate balances for. - */ - account_token?: string; - - /** - * Business to retrieve aggregate balances for. - */ - business_account_token?: string; -} - -export declare namespace AggregateBalances { - export { - type AggregateBalanceListResponse as AggregateBalanceListResponse, - type AggregateBalanceListResponsesSinglePage as AggregateBalanceListResponsesSinglePage, - type AggregateBalanceListParams as AggregateBalanceListParams, - }; -} diff --git a/src/resources/cards/cards.ts b/src/resources/cards/cards.ts index 4eb4bdda..fd728399 100644 --- a/src/resources/cards/cards.ts +++ b/src/resources/cards/cards.ts @@ -2,13 +2,6 @@ import { APIResource } from '../../core/resource'; import * as Shared from '../shared'; -import * as AggregateBalancesAPI from './aggregate-balances'; -import { - AggregateBalanceListParams, - AggregateBalanceListResponse, - AggregateBalanceListResponsesSinglePage, - AggregateBalances, -} from './aggregate-balances'; import * as BalancesAPI from './balances'; import { BalanceListParams, Balances } from './balances'; import * as FinancialTransactionsAPI from './financial-transactions'; @@ -25,9 +18,6 @@ import { path } from '../../internal/utils/path'; import { createHmac } from 'crypto'; export class Cards extends APIResource { - aggregateBalances: AggregateBalancesAPI.AggregateBalances = new AggregateBalancesAPI.AggregateBalances( - this._client, - ); balances: BalancesAPI.Balances = new BalancesAPI.Balances(this._client); financialTransactions: FinancialTransactionsAPI.FinancialTransactions = new FinancialTransactionsAPI.FinancialTransactions(this._client); @@ -1523,7 +1513,6 @@ export interface CardWebProvisionParams { server_session_id?: string; } -Cards.AggregateBalances = AggregateBalances; Cards.Balances = Balances; Cards.FinancialTransactions = FinancialTransactions; @@ -1552,13 +1541,6 @@ export declare namespace Cards { type CardWebProvisionParams as CardWebProvisionParams, }; - export { - AggregateBalances as AggregateBalances, - type AggregateBalanceListResponse as AggregateBalanceListResponse, - type AggregateBalanceListResponsesSinglePage as AggregateBalanceListResponsesSinglePage, - type AggregateBalanceListParams as AggregateBalanceListParams, - }; - export { Balances as Balances, type BalanceListParams as BalanceListParams }; export { diff --git a/src/resources/cards/index.ts b/src/resources/cards/index.ts index 2ff2f8af..c857978c 100644 --- a/src/resources/cards/index.ts +++ b/src/resources/cards/index.ts @@ -1,11 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - AggregateBalances, - type AggregateBalanceListResponse, - type AggregateBalanceListParams, - type AggregateBalanceListResponsesSinglePage, -} from './aggregate-balances'; export { Balances, type BalanceListParams } from './balances'; export { Cards, diff --git a/src/resources/external-payments.ts b/src/resources/external-payments.ts index 20c6aed7..c51ffd83 100644 --- a/src/resources/external-payments.ts +++ b/src/resources/external-payments.ts @@ -211,6 +211,10 @@ export interface ExternalPaymentCreateParams { payment_type: 'DEPOSIT' | 'WITHDRAWAL'; + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ token?: string; memo?: string; diff --git a/src/resources/index.ts b/src/resources/index.ts index 416017d6..db788dcb 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -39,12 +39,6 @@ export { type AccountListParams, type AccountsCursorPage, } from './accounts'; -export { - AggregateBalances, - type AggregateBalance, - type AggregateBalanceListParams, - type AggregateBalancesSinglePage, -} from './aggregate-balances'; export { AuthRules } from './auth-rules/auth-rules'; export { AuthStreamEnrollment, type AuthStreamSecret } from './auth-stream-enrollment'; export { Balances, type Balance, type BalanceListParams, type BalancesSinglePage } from './balances'; @@ -53,6 +47,7 @@ export { type BookTransferResponse, type BookTransferCreateParams, type BookTransferListParams, + type BookTransferRetryParams, type BookTransferReverseParams, type BookTransferResponsesCursorPage, } from './book-transfers'; @@ -280,6 +275,12 @@ export { type TransactionSimulateVoidParams, type TransactionsCursorPage, } from './transactions/transactions'; +export { + TransferLimits, + type TransferLimitsResponse, + type TransferLimitListParams, + type TransferLimitsResponseDataSinglePage, +} from './transfer-limits'; export { Transfers, type Transfer, type TransferCreateParams } from './transfers'; export { Webhooks, diff --git a/src/resources/management-operations.ts b/src/resources/management-operations.ts index a7f0e833..b4ee63b2 100644 --- a/src/resources/management-operations.ts +++ b/src/resources/management-operations.ts @@ -237,6 +237,10 @@ export interface ManagementOperationCreateParams { financial_account_token: string; + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ token?: string; memo?: string; diff --git a/src/resources/payments.ts b/src/resources/payments.ts index 4ab96af0..aba57c65 100644 --- a/src/resources/payments.ts +++ b/src/resources/payments.ts @@ -317,7 +317,8 @@ export interface Payment { | 'WIRE_INBOUND_PAYMENT' | 'WIRE_INBOUND_ADMIN' | 'WIRE_OUTBOUND_PAYMENT' - | 'WIRE_OUTBOUND_ADMIN'; + | 'WIRE_OUTBOUND_ADMIN' + | 'WIRE_DRAWDOWN_REQUEST'; /** * User-defined identifier @@ -406,6 +407,11 @@ export namespace Payment { | 'PROGRAM_DAILY_LIMIT_EXCEEDED' | 'PROGRAM_MONTHLY_LIMIT_EXCEEDED' >; + + /** + * Payment event external ID, for example, ACH trace number. + */ + external_id?: string | null; } export interface ACHMethodAttributes { diff --git a/src/resources/transfer-limits.ts b/src/resources/transfer-limits.ts new file mode 100644 index 00000000..0dc70708 --- /dev/null +++ b/src/resources/transfer-limits.ts @@ -0,0 +1,226 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import { PagePromise, SinglePage } from '../core/pagination'; +import { RequestOptions } from '../internal/request-options'; + +export class TransferLimits extends APIResource { + /** + * Get transfer limits for a specified date + */ + list( + query: TransferLimitListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList('/v1/transfer_limits', SinglePage, { + query, + ...options, + }); + } +} + +export type TransferLimitsResponseDataSinglePage = SinglePage; + +export interface TransferLimitsResponse { + /** + * List of transfer limits + */ + data: Array; + + /** + * Whether there are more transfer limits + */ + has_more: boolean; +} + +export namespace TransferLimitsResponse { + export interface Data { + /** + * Company ID + */ + company_id: string; + + /** + * Daily limits with progress + */ + daily_limit: Data.DailyLimit; + + /** + * The date for the limit view (ISO format) + */ + date: string; + + /** + * Whether the company is a FBO; based on the company ID prefix + */ + is_fbo: boolean; + + /** + * Monthly limits with progress + */ + monthly_limit: Data.MonthlyLimit; + + /** + * Program transaction limits + */ + program_limit_per_transaction: Data.ProgramLimitPerTransaction; + } + + export namespace Data { + /** + * Daily limits with progress + */ + export interface DailyLimit { + /** + * Credit limits + */ + credit: DailyLimit.Credit; + + /** + * Debit limits + */ + debit: DailyLimit.Debit; + } + + export namespace DailyLimit { + /** + * Credit limits + */ + export interface Credit { + /** + * The limit amount + */ + limit: number; + + /** + * Amount originated towards limit + */ + amount_originated?: number; + } + + /** + * Debit limits + */ + export interface Debit { + /** + * The limit amount + */ + limit: number; + + /** + * Amount originated towards limit + */ + amount_originated?: number; + } + } + + /** + * Monthly limits with progress + */ + export interface MonthlyLimit { + /** + * Credit limits + */ + credit: MonthlyLimit.Credit; + + /** + * Debit limits + */ + debit: MonthlyLimit.Debit; + } + + export namespace MonthlyLimit { + /** + * Credit limits + */ + export interface Credit { + /** + * The limit amount + */ + limit: number; + + /** + * Amount originated towards limit + */ + amount_originated?: number; + } + + /** + * Debit limits + */ + export interface Debit { + /** + * The limit amount + */ + limit: number; + + /** + * Amount originated towards limit + */ + amount_originated?: number; + } + } + + /** + * Program transaction limits + */ + export interface ProgramLimitPerTransaction { + /** + * Credit limits + */ + credit: ProgramLimitPerTransaction.Credit; + + /** + * Debit limits + */ + debit: ProgramLimitPerTransaction.Debit; + } + + export namespace ProgramLimitPerTransaction { + /** + * Credit limits + */ + export interface Credit { + /** + * The limit amount + */ + limit: number; + + /** + * Amount originated towards limit + */ + amount_originated?: number; + } + + /** + * Debit limits + */ + export interface Debit { + /** + * The limit amount + */ + limit: number; + + /** + * Amount originated towards limit + */ + amount_originated?: number; + } + } + } +} + +export interface TransferLimitListParams { + /** + * Date for which to retrieve transfer limits (ISO 8601 format) + */ + date?: string; +} + +export declare namespace TransferLimits { + export { + type TransferLimitsResponse as TransferLimitsResponse, + type TransferLimitsResponseDataSinglePage as TransferLimitsResponseDataSinglePage, + type TransferLimitListParams as TransferLimitListParams, + }; +} diff --git a/src/version.ts b/src/version.ts index dc70112b..d6d8f1ad 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.126.0'; // x-release-please-version +export const VERSION = '0.127.0'; // x-release-please-version diff --git a/tests/api-resources/book-transfers.test.ts b/tests/api-resources/book-transfers.test.ts index aae73ccc..2b9a0f5d 100644 --- a/tests/api-resources/book-transfers.test.ts +++ b/tests/api-resources/book-transfers.test.ts @@ -85,6 +85,25 @@ describe('resource bookTransfers', () => { ).rejects.toThrow(Lithic.NotFoundError); }); + test('retry: only required params', async () => { + const responsePromise = client.bookTransfers.retry('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + retry_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('retry: required and optional params', async () => { + const response = await client.bookTransfers.retry('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + retry_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + }); + test('reverse', async () => { const responsePromise = client.bookTransfers.reverse('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/cards/aggregate-balances.test.ts b/tests/api-resources/cards/aggregate-balances.test.ts deleted file mode 100644 index e911373e..00000000 --- a/tests/api-resources/cards/aggregate-balances.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Lithic from 'lithic'; - -const client = new Lithic({ - apiKey: 'My Lithic API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource aggregateBalances', () => { - test('list', async () => { - const responsePromise = client.cards.aggregateBalances.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.cards.aggregateBalances.list( - { account_token: 'account_token', business_account_token: 'business_account_token' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Lithic.NotFoundError); - }); -}); diff --git a/tests/api-resources/aggregate-balances.test.ts b/tests/api-resources/transfer-limits.test.ts similarity index 79% rename from tests/api-resources/aggregate-balances.test.ts rename to tests/api-resources/transfer-limits.test.ts index 4e85cd6c..6c88b03d 100644 --- a/tests/api-resources/aggregate-balances.test.ts +++ b/tests/api-resources/transfer-limits.test.ts @@ -7,9 +7,9 @@ const client = new Lithic({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource aggregateBalances', () => { +describe('resource transferLimits', () => { test('list', async () => { - const responsePromise = client.aggregateBalances.list(); + const responsePromise = client.transferLimits.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,10 +22,7 @@ describe('resource aggregateBalances', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.aggregateBalances.list( - { financial_account_type: 'ISSUING' }, - { path: '/_stainless_unknown_path' }, - ), + client.transferLimits.list({ date: '2019-12-27' }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Lithic.NotFoundError); }); });