Initial Node.js SDK v1.0.0

This commit is contained in:
garfieldheron
2026-02-19 12:07:39 -05:00
commit 6c252b7495
24 changed files with 1837 additions and 0 deletions

31
dist/api/ledger.d.ts vendored Normal file
View File

@@ -0,0 +1,31 @@
import { AxiosInstance } from 'axios';
import { LedgerAccount, LedgerEntry, ListResponse, PaginationParams } from '../types';
/**
* Ledger API client
*/
export declare class LedgerClient {
private http;
constructor(http: AxiosInstance);
/**
* List all ledger accounts
*/
listAccounts(params?: PaginationParams & {
type?: string;
}): Promise<ListResponse<LedgerAccount>>;
/**
* Retrieve a ledger account by ID
*/
retrieveAccount(accountId: string): Promise<LedgerAccount>;
/**
* List all ledger entries
*/
listEntries(params?: PaginationParams & {
account_id?: string;
payment_id?: string;
entry_type?: string;
}): Promise<ListResponse<LedgerEntry>>;
/**
* Retrieve a ledger entry by ID
*/
retrieveEntry(entryId: string): Promise<LedgerEntry>;
}

27
dist/api/payment-methods.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
import { AxiosInstance } from 'axios';
import { PaymentMethod, CreatePaymentMethodRequest, ListResponse, PaginationParams } from '../types';
/**
* Payment Methods API client
*/
export declare class PaymentMethodsClient {
private http;
constructor(http: AxiosInstance);
/**
* Create a new payment method
*/
create(params: CreatePaymentMethodRequest, idempotencyKey?: string): Promise<PaymentMethod>;
/**
* Retrieve a payment method by ID
*/
retrieve(paymentMethodId: string): Promise<PaymentMethod>;
/**
* List all payment methods
*/
list(params?: PaginationParams & {
type?: string;
}): Promise<ListResponse<PaymentMethod>>;
/**
* Delete a payment method
*/
delete(paymentMethodId: string): Promise<void>;
}

35
dist/api/payments.d.ts vendored Normal file
View File

@@ -0,0 +1,35 @@
import { AxiosInstance } from 'axios';
import { Payment, CreatePaymentRequest, ListResponse, PaginationParams, FilterParams } from '../types';
/**
* Payments API client
*/
export declare class PaymentsClient {
private http;
constructor(http: AxiosInstance);
/**
* Create a new payment
*/
create(params: CreatePaymentRequest, idempotencyKey?: string): Promise<Payment>;
/**
* Retrieve a payment by ID
*/
retrieve(paymentId: string): Promise<Payment>;
/**
* List all payments
*/
list(params?: PaginationParams & FilterParams & {
status?: string;
rail?: string;
}): Promise<ListResponse<Payment>>;
/**
* Cancel a pending payment
*/
cancel(paymentId: string, reason?: string, idempotencyKey?: string): Promise<Payment>;
/**
* Refund a settled payment
*/
refund(paymentId: string, params?: {
amount?: number;
reason?: string;
}, idempotencyKey?: string): Promise<Payment>;
}

29
dist/api/webhooks.d.ts vendored Normal file
View File

@@ -0,0 +1,29 @@
import { AxiosInstance } from 'axios';
import { WebhookEndpoint, CreateWebhookRequest, ListResponse, PaginationParams } from '../types';
/**
* Webhooks API client
*/
export declare class WebhooksClient {
private http;
constructor(http: AxiosInstance);
/**
* Create a new webhook endpoint
*/
create(params: CreateWebhookRequest, idempotencyKey?: string): Promise<WebhookEndpoint>;
/**
* Retrieve a webhook endpoint by ID
*/
retrieve(webhookId: string): Promise<WebhookEndpoint>;
/**
* List all webhook endpoints
*/
list(params?: PaginationParams): Promise<ListResponse<WebhookEndpoint>>;
/**
* Update a webhook endpoint
*/
update(webhookId: string, params: Partial<CreateWebhookRequest>): Promise<WebhookEndpoint>;
/**
* Delete a webhook endpoint
*/
delete(webhookId: string): Promise<void>;
}