Skip to content

Commit

Permalink
refactor: use type imports for type-only imports (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stainless Bot committed Nov 1, 2024
1 parent d7953f8 commit a0281cc
Show file tree
Hide file tree
Showing 51 changed files with 1,370 additions and 769 deletions.
957 changes: 682 additions & 275 deletions src/index.ts

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions src/resources/account-collection-flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as AccountCollectionFlowsAPI from './account-collection-flows';
import { Page, type PageParams } from '../pagination';

export class AccountCollectionFlows extends APIResource {
Expand Down Expand Up @@ -191,10 +190,14 @@ export interface AccountCollectionFlowListParams extends PageParams {
status?: string;
}

export namespace AccountCollectionFlows {
export import AccountCollectionFlow = AccountCollectionFlowsAPI.AccountCollectionFlow;
export import AccountCollectionFlowsPage = AccountCollectionFlowsAPI.AccountCollectionFlowsPage;
export import AccountCollectionFlowCreateParams = AccountCollectionFlowsAPI.AccountCollectionFlowCreateParams;
export import AccountCollectionFlowUpdateParams = AccountCollectionFlowsAPI.AccountCollectionFlowUpdateParams;
export import AccountCollectionFlowListParams = AccountCollectionFlowsAPI.AccountCollectionFlowListParams;
AccountCollectionFlows.AccountCollectionFlowsPage = AccountCollectionFlowsPage;

export declare namespace AccountCollectionFlows {
export {
type AccountCollectionFlow as AccountCollectionFlow,
AccountCollectionFlowsPage as AccountCollectionFlowsPage,
type AccountCollectionFlowCreateParams as AccountCollectionFlowCreateParams,
type AccountCollectionFlowUpdateParams as AccountCollectionFlowUpdateParams,
type AccountCollectionFlowListParams as AccountCollectionFlowListParams,
};
}
15 changes: 9 additions & 6 deletions src/resources/account-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as AccountDetailsAPI from './account-details';
import * as Shared from './shared';
import { Page, type PageParams } from '../pagination';

Expand Down Expand Up @@ -159,9 +158,13 @@ export interface AccountDetailCreateParams {

export interface AccountDetailListParams extends PageParams {}

export namespace AccountDetails {
export import AccountDetail = AccountDetailsAPI.AccountDetail;
export import AccountDetailsPage = AccountDetailsAPI.AccountDetailsPage;
export import AccountDetailCreateParams = AccountDetailsAPI.AccountDetailCreateParams;
export import AccountDetailListParams = AccountDetailsAPI.AccountDetailListParams;
AccountDetails.AccountDetailsPage = AccountDetailsPage;

export declare namespace AccountDetails {
export {
type AccountDetail as AccountDetail,
AccountDetailsPage as AccountDetailsPage,
type AccountDetailCreateParams as AccountDetailCreateParams,
type AccountDetailListParams as AccountDetailListParams,
};
}
15 changes: 9 additions & 6 deletions src/resources/bulk-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as BulkRequestsAPI from './bulk-requests';
import * as ExpectedPaymentsAPI from './expected-payments';
import * as ExternalAccountsAPI from './external-accounts';
import * as Shared from './shared';
Expand Down Expand Up @@ -2037,9 +2036,13 @@ export interface BulkRequestListParams extends PageParams {
status?: 'pending' | 'processing' | 'completed';
}

export namespace BulkRequests {
export import BulkRequest = BulkRequestsAPI.BulkRequest;
export import BulkRequestsPage = BulkRequestsAPI.BulkRequestsPage;
export import BulkRequestCreateParams = BulkRequestsAPI.BulkRequestCreateParams;
export import BulkRequestListParams = BulkRequestsAPI.BulkRequestListParams;
BulkRequests.BulkRequestsPage = BulkRequestsPage;

export declare namespace BulkRequests {
export {
type BulkRequest as BulkRequest,
BulkRequestsPage as BulkRequestsPage,
type BulkRequestCreateParams as BulkRequestCreateParams,
type BulkRequestListParams as BulkRequestListParams,
};
}
13 changes: 8 additions & 5 deletions src/resources/bulk-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as BulkResultsAPI from './bulk-results';
import * as ExpectedPaymentsAPI from './expected-payments';
import * as LedgerTransactionsAPI from './ledger-transactions/ledger-transactions';
import * as PaymentOrdersAPI from './payment-orders/payment-orders';
Expand Down Expand Up @@ -163,8 +162,12 @@ export interface BulkResultListParams extends PageParams {
status?: 'pending' | 'successful' | 'failed';
}

export namespace BulkResults {
export import BulkResult = BulkResultsAPI.BulkResult;
export import BulkResultsPage = BulkResultsAPI.BulkResultsPage;
export import BulkResultListParams = BulkResultsAPI.BulkResultListParams;
BulkResults.BulkResultsPage = BulkResultsPage;

export declare namespace BulkResults {
export {
type BulkResult as BulkResult,
BulkResultsPage as BulkResultsPage,
type BulkResultListParams as BulkResultListParams,
};
}
17 changes: 10 additions & 7 deletions src/resources/connection-legal-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as ConnectionLegalEntitiesAPI from './connection-legal-entities';
import { Page, type PageParams } from '../pagination';

export class ConnectionLegalEntities extends APIResource {
Expand Down Expand Up @@ -504,10 +503,14 @@ export interface ConnectionLegalEntityListParams extends PageParams {
status?: 'completed' | 'denied' | 'failed' | 'processing';
}

export namespace ConnectionLegalEntities {
export import ConnectionLegalEntity = ConnectionLegalEntitiesAPI.ConnectionLegalEntity;
export import ConnectionLegalEntitiesPage = ConnectionLegalEntitiesAPI.ConnectionLegalEntitiesPage;
export import ConnectionLegalEntityCreateParams = ConnectionLegalEntitiesAPI.ConnectionLegalEntityCreateParams;
export import ConnectionLegalEntityUpdateParams = ConnectionLegalEntitiesAPI.ConnectionLegalEntityUpdateParams;
export import ConnectionLegalEntityListParams = ConnectionLegalEntitiesAPI.ConnectionLegalEntityListParams;
ConnectionLegalEntities.ConnectionLegalEntitiesPage = ConnectionLegalEntitiesPage;

export declare namespace ConnectionLegalEntities {
export {
type ConnectionLegalEntity as ConnectionLegalEntity,
ConnectionLegalEntitiesPage as ConnectionLegalEntitiesPage,
type ConnectionLegalEntityCreateParams as ConnectionLegalEntityCreateParams,
type ConnectionLegalEntityUpdateParams as ConnectionLegalEntityUpdateParams,
type ConnectionLegalEntityListParams as ConnectionLegalEntityListParams,
};
}
13 changes: 8 additions & 5 deletions src/resources/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as ConnectionsAPI from './connections';
import { Page, type PageParams } from '../pagination';

export class Connections extends APIResource {
Expand Down Expand Up @@ -73,8 +72,12 @@ export interface ConnectionListParams extends PageParams {
vendor_customer_id?: string;
}

export namespace Connections {
export import Connection = ConnectionsAPI.Connection;
export import ConnectionsPage = ConnectionsAPI.ConnectionsPage;
export import ConnectionListParams = ConnectionsAPI.ConnectionListParams;
Connections.ConnectionsPage = ConnectionsPage;

export declare namespace Connections {
export {
type Connection as Connection,
ConnectionsPage as ConnectionsPage,
type ConnectionListParams as ConnectionListParams,
};
}
21 changes: 12 additions & 9 deletions src/resources/counterparties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as CounterpartiesAPI from './counterparties';
import * as AccountDetailsAPI from './account-details';
import * as ExternalAccountsAPI from './external-accounts';
import * as RoutingDetailsAPI from './routing-details';
Expand Down Expand Up @@ -1099,12 +1098,16 @@ export interface CounterpartyCollectAccountParams {
send_email?: boolean;
}

export namespace Counterparties {
export import Counterparty = CounterpartiesAPI.Counterparty;
export import CounterpartyCollectAccountResponse = CounterpartiesAPI.CounterpartyCollectAccountResponse;
export import CounterpartiesPage = CounterpartiesAPI.CounterpartiesPage;
export import CounterpartyCreateParams = CounterpartiesAPI.CounterpartyCreateParams;
export import CounterpartyUpdateParams = CounterpartiesAPI.CounterpartyUpdateParams;
export import CounterpartyListParams = CounterpartiesAPI.CounterpartyListParams;
export import CounterpartyCollectAccountParams = CounterpartiesAPI.CounterpartyCollectAccountParams;
Counterparties.CounterpartiesPage = CounterpartiesPage;

export declare namespace Counterparties {
export {
type Counterparty as Counterparty,
type CounterpartyCollectAccountResponse as CounterpartyCollectAccountResponse,
CounterpartiesPage as CounterpartiesPage,
type CounterpartyCreateParams as CounterpartyCreateParams,
type CounterpartyUpdateParams as CounterpartyUpdateParams,
type CounterpartyListParams as CounterpartyListParams,
type CounterpartyCollectAccountParams as CounterpartyCollectAccountParams,
};
}
15 changes: 9 additions & 6 deletions src/resources/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as DocumentsAPI from './documents';
import { Page, type PageParams } from '../pagination';

export class Documents extends APIResource {
Expand Down Expand Up @@ -204,9 +203,13 @@ export interface DocumentListParams extends PageParams {
| 'connections';
}

export namespace Documents {
export import Document = DocumentsAPI.Document;
export import DocumentsPage = DocumentsAPI.DocumentsPage;
export import DocumentCreateParams = DocumentsAPI.DocumentCreateParams;
export import DocumentListParams = DocumentsAPI.DocumentListParams;
Documents.DocumentsPage = DocumentsPage;

export declare namespace Documents {
export {
type Document as Document,
DocumentsPage as DocumentsPage,
type DocumentCreateParams as DocumentCreateParams,
type DocumentListParams as DocumentListParams,
};
}
9 changes: 4 additions & 5 deletions src/resources/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as EventsAPI from './events';
import { Page, type PageParams } from '../pagination';

export class Events extends APIResource {
Expand Down Expand Up @@ -91,8 +90,8 @@ export interface EventListParams extends PageParams {
resource?: string;
}

export namespace Events {
export import Event = EventsAPI.Event;
export import EventsPage = EventsAPI.EventsPage;
export import EventListParams = EventsAPI.EventListParams;
Events.EventsPage = EventsPage;

export declare namespace Events {
export { type Event as Event, EventsPage as EventsPage, type EventListParams as EventListParams };
}
21 changes: 12 additions & 9 deletions src/resources/expected-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as ExpectedPaymentsAPI from './expected-payments';
import * as Shared from './shared';
import { Page, type PageParams } from '../pagination';

Expand Down Expand Up @@ -790,12 +789,16 @@ export interface ExpectedPaymentListParams extends PageParams {
| 'zengin';
}

export namespace ExpectedPayments {
export import ExpectedPayment = ExpectedPaymentsAPI.ExpectedPayment;
export import ExpectedPaymentType = ExpectedPaymentsAPI.ExpectedPaymentType;
export import ReconciliationRule = ExpectedPaymentsAPI.ReconciliationRule;
export import ExpectedPaymentsPage = ExpectedPaymentsAPI.ExpectedPaymentsPage;
export import ExpectedPaymentCreateParams = ExpectedPaymentsAPI.ExpectedPaymentCreateParams;
export import ExpectedPaymentUpdateParams = ExpectedPaymentsAPI.ExpectedPaymentUpdateParams;
export import ExpectedPaymentListParams = ExpectedPaymentsAPI.ExpectedPaymentListParams;
ExpectedPayments.ExpectedPaymentsPage = ExpectedPaymentsPage;

export declare namespace ExpectedPayments {
export {
type ExpectedPayment as ExpectedPayment,
type ExpectedPaymentType as ExpectedPaymentType,
type ReconciliationRule as ReconciliationRule,
ExpectedPaymentsPage as ExpectedPaymentsPage,
type ExpectedPaymentCreateParams as ExpectedPaymentCreateParams,
type ExpectedPaymentUpdateParams as ExpectedPaymentUpdateParams,
type ExpectedPaymentListParams as ExpectedPaymentListParams,
};
}
25 changes: 14 additions & 11 deletions src/resources/external-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as ExternalAccountsAPI from './external-accounts';
import * as AccountDetailsAPI from './account-details';
import * as RoutingDetailsAPI from './routing-details';
import * as Shared from './shared';
Expand Down Expand Up @@ -745,14 +744,18 @@ export interface ExternalAccountVerifyParams {
priority?: 'high' | 'normal';
}

export namespace ExternalAccounts {
export import ExternalAccount = ExternalAccountsAPI.ExternalAccount;
export import ExternalAccountType = ExternalAccountsAPI.ExternalAccountType;
export import ExternalAccountVerifyResponse = ExternalAccountsAPI.ExternalAccountVerifyResponse;
export import ExternalAccountsPage = ExternalAccountsAPI.ExternalAccountsPage;
export import ExternalAccountCreateParams = ExternalAccountsAPI.ExternalAccountCreateParams;
export import ExternalAccountUpdateParams = ExternalAccountsAPI.ExternalAccountUpdateParams;
export import ExternalAccountListParams = ExternalAccountsAPI.ExternalAccountListParams;
export import ExternalAccountCompleteVerificationParams = ExternalAccountsAPI.ExternalAccountCompleteVerificationParams;
export import ExternalAccountVerifyParams = ExternalAccountsAPI.ExternalAccountVerifyParams;
ExternalAccounts.ExternalAccountsPage = ExternalAccountsPage;

export declare namespace ExternalAccounts {
export {
type ExternalAccount as ExternalAccount,
type ExternalAccountType as ExternalAccountType,
type ExternalAccountVerifyResponse as ExternalAccountVerifyResponse,
ExternalAccountsPage as ExternalAccountsPage,
type ExternalAccountCreateParams as ExternalAccountCreateParams,
type ExternalAccountUpdateParams as ExternalAccountUpdateParams,
type ExternalAccountListParams as ExternalAccountListParams,
type ExternalAccountCompleteVerificationParams as ExternalAccountCompleteVerificationParams,
type ExternalAccountVerifyParams as ExternalAccountVerifyParams,
};
}
15 changes: 9 additions & 6 deletions src/resources/foreign-exchange-quotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as ForeignExchangeQuotesAPI from './foreign-exchange-quotes';
import * as Shared from './shared';
import { Page, type PageParams } from '../pagination';

Expand Down Expand Up @@ -233,9 +232,13 @@ export interface ForeignExchangeQuoteListParams extends PageParams {
target_currency?: string;
}

export namespace ForeignExchangeQuotes {
export import ForeignExchangeQuote = ForeignExchangeQuotesAPI.ForeignExchangeQuote;
export import ForeignExchangeQuotesPage = ForeignExchangeQuotesAPI.ForeignExchangeQuotesPage;
export import ForeignExchangeQuoteCreateParams = ForeignExchangeQuotesAPI.ForeignExchangeQuoteCreateParams;
export import ForeignExchangeQuoteListParams = ForeignExchangeQuotesAPI.ForeignExchangeQuoteListParams;
ForeignExchangeQuotes.ForeignExchangeQuotesPage = ForeignExchangeQuotesPage;

export declare namespace ForeignExchangeQuotes {
export {
type ForeignExchangeQuote as ForeignExchangeQuote,
ForeignExchangeQuotesPage as ForeignExchangeQuotesPage,
type ForeignExchangeQuoteCreateParams as ForeignExchangeQuoteCreateParams,
type ForeignExchangeQuoteListParams as ForeignExchangeQuoteListParams,
};
}
17 changes: 10 additions & 7 deletions src/resources/incoming-payment-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as IncomingPaymentDetailsAPI from './incoming-payment-details';
import * as Shared from './shared';
import * as VirtualAccountsAPI from './virtual-accounts';
import { Page, type PageParams } from '../pagination';
Expand Down Expand Up @@ -342,10 +341,14 @@ export interface IncomingPaymentDetailCreateAsyncParams {
virtual_account_id?: string | null;
}

export namespace IncomingPaymentDetails {
export import IncomingPaymentDetail = IncomingPaymentDetailsAPI.IncomingPaymentDetail;
export import IncomingPaymentDetailsPage = IncomingPaymentDetailsAPI.IncomingPaymentDetailsPage;
export import IncomingPaymentDetailUpdateParams = IncomingPaymentDetailsAPI.IncomingPaymentDetailUpdateParams;
export import IncomingPaymentDetailListParams = IncomingPaymentDetailsAPI.IncomingPaymentDetailListParams;
export import IncomingPaymentDetailCreateAsyncParams = IncomingPaymentDetailsAPI.IncomingPaymentDetailCreateAsyncParams;
IncomingPaymentDetails.IncomingPaymentDetailsPage = IncomingPaymentDetailsPage;

export declare namespace IncomingPaymentDetails {
export {
type IncomingPaymentDetail as IncomingPaymentDetail,
IncomingPaymentDetailsPage as IncomingPaymentDetailsPage,
type IncomingPaymentDetailUpdateParams as IncomingPaymentDetailUpdateParams,
type IncomingPaymentDetailListParams as IncomingPaymentDetailListParams,
type IncomingPaymentDetailCreateAsyncParams as IncomingPaymentDetailCreateAsyncParams,
};
}
Loading

0 comments on commit a0281cc

Please sign in to comment.