Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.87.0 #563

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.86.0"
".": "0.87.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 149
configured_endpoints: 151
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## 0.87.0 (2024-11-21)

Full Changelog: [v0.86.0...v0.87.0](https://github.com/lithic-com/lithic-node/compare/v0.86.0...v0.87.0)

### Features

* **api:** adds PrimeRates API ([#566](https://github.com/lithic-com/lithic-node/issues/566)) ([70adc94](https://github.com/lithic-com/lithic-node/commit/70adc94216a48b88097e4a93b9c1812bd9fe1a24))


### Bug Fixes

* **docs:** add missing await to pagination example ([#568](https://github.com/lithic-com/lithic-node/issues/568)) ([5caff62](https://github.com/lithic-com/lithic-node/commit/5caff62cf264c0d083e300600183698094d4c101))
* **internal:** add back CP ([8ea9e95](https://github.com/lithic-com/lithic-node/commit/8ea9e95a37d98a9bf0ce77982a23796a989e6de2))


### Chores

* **api:** add business_account_token param for listing Balances ([#564](https://github.com/lithic-com/lithic-node/issues/564)) ([88e2d76](https://github.com/lithic-com/lithic-node/commit/88e2d7698e7aa5984761f301ec10192952491574))
* **api:** adds replacement_account_token to Card create parameters ([#562](https://github.com/lithic-com/lithic-node/issues/562)) ([fe79fcf](https://github.com/lithic-com/lithic-node/commit/fe79fcf4370c47c726960e36369311e2859efe61))
* **client:** drop unused devDependency ([#569](https://github.com/lithic-com/lithic-node/issues/569)) ([101ac75](https://github.com/lithic-com/lithic-node/commit/101ac7570706f99336a010e51e71d2e254e635b7))
* **internal:** use reexports not destructuring ([#565](https://github.com/lithic-com/lithic-node/issues/565)) ([65e4f11](https://github.com/lithic-com/lithic-node/commit/65e4f11f83508c5b2da37beab74b435fa987089c))
* remove redundant word in comment ([#573](https://github.com/lithic-com/lithic-node/issues/573)) ([d0e1158](https://github.com/lithic-com/lithic-node/commit/d0e1158d47cb99fda3fa1c73c0b7e4c6007c1960))
* **tests:** limit array example length ([#570](https://github.com/lithic-com/lithic-node/issues/570)) ([f514713](https://github.com/lithic-com/lithic-node/commit/f5147136ff8168f5958d9a5eb54ece922b0882d7))


### Documentation

* remove suggestion to use `npm` call out ([#571](https://github.com/lithic-com/lithic-node/issues/571)) ([1ffb063](https://github.com/lithic-com/lithic-node/commit/1ffb0638814b964a60be0ff745f51dcbc79b42f0))

## 0.86.0 (2024-11-06)

Full Changelog: [v0.85.2...v0.86.0](https://github.com/lithic-com/lithic-node/compare/v0.85.2...v0.86.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ for (const card of page.data) {

// Convenience methods are provided for manually paginating:
while (page.hasNextPage()) {
page = page.getNextPage();
page = await page.getNextPage();
// ...
}
```
Expand Down Expand Up @@ -361,7 +361,7 @@ The following runtimes are supported:

- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
- Deno v1.28.0 or higher, using `import Lithic from "npm:lithic"`.
- Deno v1.28.0 or higher.
- Bun 1.0 or later.
- Cloudflare Workers.
- Vercel Edge Runtime.
Expand Down
23 changes: 23 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,29 @@ Methods:
- <code title="get /v1/book_transfers">client.bookTransfers.<a href="./src/resources/book-transfers.ts">list</a>({ ...params }) -> BookTransferResponsesCursorPage</code>
- <code title="post /v1/book_transfers/{book_transfer_token}/reverse">client.bookTransfers.<a href="./src/resources/book-transfers.ts">reverse</a>(bookTransferToken, { ...params }) -> BookTransferResponse</code>

# CreditProducts

## ExtendedCredit

Types:

- <code><a href="./src/resources/credit-products/extended-credit.ts">ExtendedCredit</a></code>

Methods:

- <code title="get /v1/credit_products/{credit_product_token}/extended_credit">client.creditProducts.extendedCredit.<a href="./src/resources/credit-products/extended-credit.ts">retrieve</a>(creditProductToken) -> ExtendedCredit</code>

## PrimeRates

Types:

- <code><a href="./src/resources/credit-products/prime-rates.ts">PrimeRateRetrieveResponse</a></code>

Methods:

- <code title="post /v1/credit_products/{credit_product_token}/prime_rates">client.creditProducts.primeRates.<a href="./src/resources/credit-products/prime-rates.ts">create</a>(creditProductToken, { ...params }) -> void</code>
- <code title="get /v1/credit_products/{credit_product_token}/prime_rates">client.creditProducts.primeRates.<a href="./src/resources/credit-products/prime-rates.ts">retrieve</a>(creditProductToken, { ...params }) -> PrimeRateRetrieveResponse</code>

# ExternalPayments

Types:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lithic",
"version": "0.86.0",
"version": "0.87.0",
"description": "The official TypeScript library for the Lithic API",
"author": "Lithic <[email protected]>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -33,6 +33,8 @@
"node-fetch": "^2.6.7"
},
"devDependencies": {
"@swc/core": "^1.3.102",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
Expand All @@ -43,7 +45,6 @@
"jest": "^29.4.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.0",
"ts-morph": "^19.0.0",
"ts-node": "^10.5.0",
"tsc-multi": "^1.1.0",
"tsconfig-paths": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm exec tsc-multi
# copy over handwritten .js/.mjs/.d.ts files
cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims
cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto
# we need to add exports = module.exports = Lithic Node to index.js;
# we need to add exports = module.exports = Lithic to index.js;
# No way to get that from index.ts because it would cause compile errors
# when building .mjs
node scripts/utils/fix-index-exports.cjs
Expand Down
39 changes: 18 additions & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ const environments = {
sandbox: 'https://sandbox.lithic.com',
};
type Environment = keyof typeof environments;

export interface ClientOptions {
/**
* Defaults to process.env['LITHIC_API_KEY'].
Expand Down Expand Up @@ -399,6 +398,7 @@ export class Lithic extends Core.APIClient {
cardPrograms: API.CardPrograms = new API.CardPrograms(this);
digitalCardArt: API.DigitalCardArtResource = new API.DigitalCardArtResource(this);
bookTransfers: API.BookTransfers = new API.BookTransfers(this);
creditProducts: API.CreditProducts = new API.CreditProducts(this);
externalPayments: API.ExternalPayments = new API.ExternalPayments(this);
managementOperations: API.ManagementOperations = new API.ManagementOperations(this);

Expand Down Expand Up @@ -450,25 +450,6 @@ export class Lithic extends Core.APIClient {
static fileFromPath = Uploads.fileFromPath;
}

export {
LithicError,
APIError,
APIConnectionError,
APIConnectionTimeoutError,
APIUserAbortError,
NotFoundError,
ConflictError,
RateLimitError,
BadRequestError,
AuthenticationError,
InternalServerError,
PermissionDeniedError,
UnprocessableEntityError,
} from './error';

export import toFile = Uploads.toFile;
export import fileFromPath = Uploads.fileFromPath;

Lithic.Accounts = Accounts;
Lithic.AccountsCursorPage = AccountsCursorPage;
Lithic.AccountHolders = AccountHolders;
Expand Down Expand Up @@ -513,7 +494,6 @@ Lithic.ExternalPayments = ExternalPayments;
Lithic.ExternalPaymentsCursorPage = ExternalPaymentsCursorPage;
Lithic.ManagementOperations = ManagementOperations;
Lithic.ManagementOperationTransactionsCursorPage = ManagementOperationTransactionsCursorPage;

export declare namespace Lithic {
export type RequestOptions = Core.RequestOptions;

Expand Down Expand Up @@ -791,4 +771,21 @@ export declare namespace Lithic {
export type VelocityLimitParamsPeriodWindow = API.VelocityLimitParamsPeriodWindow;
}

export { toFile, fileFromPath } from './uploads';
export {
LithicError,
APIError,
APIConnectionError,
APIConnectionTimeoutError,
APIUserAbortError,
NotFoundError,
ConflictError,
RateLimitError,
BadRequestError,
AuthenticationError,
InternalServerError,
PermissionDeniedError,
UnprocessableEntityError,
} from './error';

export default Lithic;
7 changes: 6 additions & 1 deletion src/resources/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SinglePage } from '../pagination';

export class Balances extends APIResource {
/**
* Get the balances for a program or a given end-user account
* Get the balances for a program, business, or a given end-user account
*/
list(
query?: BalanceListParams,
Expand Down Expand Up @@ -98,6 +98,11 @@ export interface BalanceListParams {
*/
balance_date?: string;

/**
* List balances for all financial accounts of a given business_account_token.
*/
business_account_token?: string;

/**
* List balances for a given Financial Account type.
*/
Expand Down
9 changes: 9 additions & 0 deletions src/resources/cards/cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,15 @@ export interface CardCreateParams {
*/
product_id?: string;

/**
* Restricted field limited to select use cases. Lithic will reach out directly if
* this field should be used. Globally unique identifier for the replacement card's
* account. If this field is specified, `replacement_for` must also be specified.
* If `replacement_for` is specified and this field is omitted, the replacement
* card's account will be inferred from the card being replaced.
*/
replacement_account_token?: string;

/**
* Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the
* card that this physical card will replace.
Expand Down
16 changes: 16 additions & 0 deletions src/resources/credit-products/credit-products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,31 @@
import { APIResource } from '../../resource';
import * as ExtendedCreditAPI from './extended-credit';
import { ExtendedCredit, ExtendedCreditResource } from './extended-credit';
import * as PrimeRatesAPI from './prime-rates';
import {
PrimeRateCreateParams,
PrimeRateRetrieveParams,
PrimeRateRetrieveResponse,
PrimeRates,
} from './prime-rates';

export class CreditProducts extends APIResource {
extendedCredit: ExtendedCreditAPI.ExtendedCreditResource = new ExtendedCreditAPI.ExtendedCreditResource(
this._client,
);
primeRates: PrimeRatesAPI.PrimeRates = new PrimeRatesAPI.PrimeRates(this._client);
}

CreditProducts.ExtendedCreditResource = ExtendedCreditResource;
CreditProducts.PrimeRates = PrimeRates;

export declare namespace CreditProducts {
export { ExtendedCreditResource as ExtendedCreditResource, type ExtendedCredit as ExtendedCredit };

export {
PrimeRates as PrimeRates,
type PrimeRateRetrieveResponse as PrimeRateRetrieveResponse,
type PrimeRateCreateParams as PrimeRateCreateParams,
type PrimeRateRetrieveParams as PrimeRateRetrieveParams,
};
}
4 changes: 2 additions & 2 deletions src/resources/credit-products/extended-credit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export class ExtendedCreditResource extends APIResource {
/**
* Get the extended credit for a given credit product under a program
*/
retrieve(creditProductId: string, options?: Core.RequestOptions): Core.APIPromise<ExtendedCredit> {
return this._client.get(`/v1/credit_products/${creditProductId}/extended_credit`, options);
retrieve(creditProductToken: string, options?: Core.RequestOptions): Core.APIPromise<ExtendedCredit> {
return this._client.get(`/v1/credit_products/${creditProductToken}/extended_credit`, options);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/resources/credit-products/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

export { CreditProducts } from './credit-products';
export { ExtendedCreditResource, type ExtendedCredit } from './extended-credit';
export {
PrimeRates,
type PrimeRateRetrieveResponse,
type PrimeRateCreateParams,
type PrimeRateRetrieveParams,
} from './prime-rates';
99 changes: 99 additions & 0 deletions src/resources/credit-products/prime-rates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';

export class PrimeRates extends APIResource {
/**
* Post Credit Product Prime Rate
*/
create(
creditProductToken: string,
body: PrimeRateCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<void> {
return this._client.post(`/v1/credit_products/${creditProductToken}/prime_rates`, { body, ...options });
}

/**
* Get Credit Product Prime Rates
*/
retrieve(
creditProductToken: string,
query?: PrimeRateRetrieveParams,
options?: Core.RequestOptions,
): Core.APIPromise<PrimeRateRetrieveResponse>;
retrieve(
creditProductToken: string,
options?: Core.RequestOptions,
): Core.APIPromise<PrimeRateRetrieveResponse>;
retrieve(
creditProductToken: string,
query: PrimeRateRetrieveParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<PrimeRateRetrieveResponse> {
if (isRequestOptions(query)) {
return this.retrieve(creditProductToken, {}, query);
}
return this._client.get(`/v1/credit_products/${creditProductToken}/prime_rates`, { query, ...options });
}
}

export interface PrimeRateRetrieveResponse {
/**
* List of prime rates
*/
data: Array<PrimeRateRetrieveResponse.Data>;

/**
* Whether there are more prime rates
*/
has_more: boolean;
}

export namespace PrimeRateRetrieveResponse {
export interface Data {
/**
* Date the rate goes into effect
*/
effective_date: string;

/**
* The rate in decimal format
*/
rate: string;
}
}

export interface PrimeRateCreateParams {
/**
* Date the rate goes into effect
*/
effective_date: string;

/**
* The rate in decimal format
*/
rate: string;
}

export interface PrimeRateRetrieveParams {
/**
* The effective date that the prime rates ends before
*/
ending_before?: string;

/**
* The effective date that the prime rate starts after
*/
starting_after?: string;
}

export declare namespace PrimeRates {
export {
type PrimeRateRetrieveResponse as PrimeRateRetrieveResponse,
type PrimeRateCreateParams as PrimeRateCreateParams,
type PrimeRateRetrieveParams as PrimeRateRetrieveParams,
};
}
1 change: 1 addition & 0 deletions src/resources/financial-accounts/financial-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export namespace FinancialTransaction {
| 'BALANCE_INQUIRY'
| 'BILLING_ERROR'
| 'BILLING_ERROR_REVERSAL'
| 'CARD_TO_CARD'
| 'CASH_BACK'
| 'CASH_BACK_REVERSAL'
| 'CLEARING'
Expand Down
Loading