Skip to content

Commit

Permalink
fix!: import issue with ESM (#125)
Browse files Browse the repository at this point in the history
This change involves removing runtime exports for nested page class exports, which were only recently added
so we don't expect this breakage to affect anyone.
# Migration
You can directly import the class instead of referencing it, e.g. `import { FooPage } from 'pkg/resources/foo'`
  • Loading branch information
stainless-bot authored and cleb11 committed Jul 7, 2023
1 parent 5c29ed7 commit fd9dd7f
Show file tree
Hide file tree
Showing 32 changed files with 96 additions and 32 deletions.
4 changes: 3 additions & 1 deletion src/resources/account-collection-flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export class AccountCollectionFlows extends APIResource {
}

export class AccountConnectionFlowsPage extends Page<AccountConnectionFlow> {}
// alias so we can export it in the namespace
type _AccountConnectionFlowsPage = AccountConnectionFlowsPage;

export interface AccountConnectionFlow {
/**
Expand Down Expand Up @@ -178,7 +180,7 @@ export interface AccountCollectionFlowListParams extends PageParams {

export namespace AccountCollectionFlows {
export import AccountConnectionFlow = API.AccountConnectionFlow;
export import AccountConnectionFlowsPage = API.AccountConnectionFlowsPage;
export type AccountConnectionFlowsPage = _AccountConnectionFlowsPage;
export import AccountCollectionFlowCreateParams = API.AccountCollectionFlowCreateParams;
export import AccountCollectionFlowRetrieveParams = API.AccountCollectionFlowRetrieveParams;
export import AccountCollectionFlowUpdateParams = API.AccountCollectionFlowUpdateParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/account-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export class AccountDetails extends APIResource {
}

export class AccountDetailsPage extends Page<AccountDetail> {}
// alias so we can export it in the namespace
type _AccountDetailsPage = AccountDetailsPage;

export interface AccountDetail {
id: string;
Expand Down Expand Up @@ -140,7 +142,7 @@ export interface AccountDetailListParams extends PageParams {}

export namespace AccountDetails {
export import AccountDetail = API.AccountDetail;
export import AccountDetailsPage = API.AccountDetailsPage;
export type AccountDetailsPage = _AccountDetailsPage;
export import AccountDetailCreateParams = API.AccountDetailCreateParams;
export import AccountDetailListParams = API.AccountDetailListParams;
}
4 changes: 3 additions & 1 deletion src/resources/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export class Connections extends APIResource {
}

export class ConnectionsPage extends Page<Connection> {}
// alias so we can export it in the namespace
type _ConnectionsPage = ConnectionsPage;

export interface Connection {
id: string;
Expand Down Expand Up @@ -72,6 +74,6 @@ export interface ConnectionListParams extends PageParams {

export namespace Connections {
export import Connection = API.Connection;
export import ConnectionsPage = API.ConnectionsPage;
export type ConnectionsPage = _ConnectionsPage;
export import ConnectionListParams = API.ConnectionListParams;
}
4 changes: 3 additions & 1 deletion src/resources/counterparties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export class Counterparties extends APIResource {
}

export class CounterpartiesPage extends Page<Counterparty> {}
// alias so we can export it in the namespace
type _CounterpartiesPage = CounterpartiesPage;

export interface Counterparty {
id: string;
Expand Down Expand Up @@ -684,7 +686,7 @@ export interface CounterpartyCollectAccountParams {
export namespace Counterparties {
export import Counterparty = API.Counterparty;
export import CounterpartyCollectAccountResponse = API.CounterpartyCollectAccountResponse;
export import CounterpartiesPage = API.CounterpartiesPage;
export type CounterpartiesPage = _CounterpartiesPage;
export import CounterpartyCreateParams = API.CounterpartyCreateParams;
export import CounterpartyUpdateParams = API.CounterpartyUpdateParams;
export import CounterpartyListParams = API.CounterpartyListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export class Documents extends APIResource {
}

export class DocumentsPage extends Page<Document> {}
// alias so we can export it in the namespace
type _DocumentsPage = DocumentsPage;

export interface Document {
id: string;
Expand Down Expand Up @@ -222,7 +224,7 @@ export interface DocumentListParams extends PageParams {

export namespace Documents {
export import Document = API.Document;
export import DocumentsPage = API.DocumentsPage;
export type DocumentsPage = _DocumentsPage;
export import DocumentCreateParams = API.DocumentCreateParams;
export import DocumentListParams = API.DocumentListParams;
}
4 changes: 3 additions & 1 deletion src/resources/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export class Events extends APIResource {
}

export class EventsPage extends Page<Event> {}
// alias so we can export it in the namespace
type _EventsPage = EventsPage;

export interface Event {
id: string;
Expand Down Expand Up @@ -93,6 +95,6 @@ export interface EventListParams extends PageParams {

export namespace Events {
export import Event = API.Event;
export import EventsPage = API.EventsPage;
export type EventsPage = _EventsPage;
export import EventListParams = API.EventListParams;
}
4 changes: 3 additions & 1 deletion src/resources/expected-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export class ExpectedPayments extends APIResource {
}

export class ExpectedPaymentsPage extends Page<ExpectedPayment> {}
// alias so we can export it in the namespace
type _ExpectedPaymentsPage = ExpectedPaymentsPage;

export interface ExpectedPayment {
id: string;
Expand Down Expand Up @@ -508,7 +510,7 @@ export interface ExpectedPaymentListParams extends PageParams {
export namespace ExpectedPayments {
export import ExpectedPayment = API.ExpectedPayment;
export import ExpectedPaymentType = API.ExpectedPaymentType;
export import ExpectedPaymentsPage = API.ExpectedPaymentsPage;
export type ExpectedPaymentsPage = _ExpectedPaymentsPage;
export import ExpectedPaymentCreateParams = API.ExpectedPaymentCreateParams;
export import ExpectedPaymentUpdateParams = API.ExpectedPaymentUpdateParams;
export import ExpectedPaymentListParams = API.ExpectedPaymentListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/external-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export class ExternalAccounts extends APIResource {
}

export class ExternalAccountsPage extends Page<ExternalAccount> {}
// alias so we can export it in the namespace
type _ExternalAccountsPage = ExternalAccountsPage;

export interface ExternalAccount {
id: string;
Expand Down Expand Up @@ -620,7 +622,7 @@ export interface ExternalAccountVerifyParams {
export namespace ExternalAccounts {
export import ExternalAccount = API.ExternalAccount;
export import ExternalAccountType = API.ExternalAccountType;
export import ExternalAccountsPage = API.ExternalAccountsPage;
export type ExternalAccountsPage = _ExternalAccountsPage;
export import ExternalAccountCreateParams = API.ExternalAccountCreateParams;
export import ExternalAccountUpdateParams = API.ExternalAccountUpdateParams;
export import ExternalAccountListParams = API.ExternalAccountListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/incoming-payment-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export class IncomingPaymentDetails extends APIResource {
}

export class IncomingPaymentDetailsPage extends Page<IncomingPaymentDetail> {}
// alias so we can export it in the namespace
type _IncomingPaymentDetailsPage = IncomingPaymentDetailsPage;

export interface IncomingPaymentDetail {
id: string;
Expand Down Expand Up @@ -318,7 +320,7 @@ export interface IncomingPaymentDetailCreateAsyncParams {

export namespace IncomingPaymentDetails {
export import IncomingPaymentDetail = API.IncomingPaymentDetail;
export import IncomingPaymentDetailsPage = API.IncomingPaymentDetailsPage;
export type IncomingPaymentDetailsPage = _IncomingPaymentDetailsPage;
export import IncomingPaymentDetailUpdateParams = API.IncomingPaymentDetailUpdateParams;
export import IncomingPaymentDetailListParams = API.IncomingPaymentDetailListParams;
export import IncomingPaymentDetailCreateAsyncParams = API.IncomingPaymentDetailCreateAsyncParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/internal-accounts/balance-reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export class BalanceReports extends APIResource {
}

export class BalanceReportsPage extends Page<BalanceReport> {}
// alias so we can export it in the namespace
type _BalanceReportsPage = BalanceReportsPage;

export interface BalanceReport {
id: string;
Expand Down Expand Up @@ -178,6 +180,6 @@ export interface BalanceReportListParams extends PageParams {

export namespace BalanceReports {
export import BalanceReport = API.BalanceReport;
export import BalanceReportsPage = API.BalanceReportsPage;
export type BalanceReportsPage = _BalanceReportsPage;
export import BalanceReportListParams = API.BalanceReportListParams;
}
4 changes: 3 additions & 1 deletion src/resources/internal-accounts/internal-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export class InternalAccounts extends APIResource {
}

export class InternalAccountsPage extends Page<InternalAccount> {}
// alias so we can export it in the namespace
type _InternalAccountsPage = InternalAccountsPage;

export interface InternalAccount {
id: string;
Expand Down Expand Up @@ -356,7 +358,7 @@ export interface InternalAccountListParams extends PageParams {

export namespace InternalAccounts {
export import InternalAccount = API.InternalAccount;
export import InternalAccountsPage = API.InternalAccountsPage;
export type InternalAccountsPage = _InternalAccountsPage;
export import InternalAccountCreateParams = API.InternalAccountCreateParams;
export import InternalAccountUpdateParams = API.InternalAccountUpdateParams;
export import InternalAccountListParams = API.InternalAccountListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/invoices/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export class Invoices extends APIResource {
}

export class InvoicesPage extends Page<Invoice> {}
// alias so we can export it in the namespace
type _InvoicesPage = InvoicesPage;

export interface Invoice {
id: string;
Expand Down Expand Up @@ -614,7 +616,7 @@ export interface InvoiceListParams extends PageParams {}

export namespace Invoices {
export import Invoice = API.Invoice;
export import InvoicesPage = API.InvoicesPage;
export type InvoicesPage = _InvoicesPage;
export import InvoiceCreateParams = API.InvoiceCreateParams;
export import InvoiceUpdateParams = API.InvoiceUpdateParams;
export import InvoiceListParams = API.InvoiceListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/invoices/line-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export class LineItems extends APIResource {
}

export class InvoiceLineItemsPage extends Page<InvoiceLineItem> {}
// alias so we can export it in the namespace
type _InvoiceLineItemsPage = InvoiceLineItemsPage;

export interface InvoiceLineItem {
id: string;
Expand Down Expand Up @@ -348,7 +350,7 @@ export interface LineItemListParams extends PageParams {}

export namespace LineItems {
export import InvoiceLineItem = API.InvoiceLineItem;
export import InvoiceLineItemsPage = API.InvoiceLineItemsPage;
export type InvoiceLineItemsPage = _InvoiceLineItemsPage;
export import LineItemCreateParams = API.LineItemCreateParams;
export import LineItemUpdateParams = API.LineItemUpdateParams;
export import LineItemListParams = API.LineItemListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/ledger-account-categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ export class LedgerAccountCategories extends APIResource {
}

export class LedgerAccountCategoriesPage extends Page<LedgerAccountCategory> {}
// alias so we can export it in the namespace
type _LedgerAccountCategoriesPage = LedgerAccountCategoriesPage;

export interface LedgerAccountCategory {
id: string;
Expand Down Expand Up @@ -472,7 +474,7 @@ export namespace LedgerAccountCategoryDeleteParams {

export namespace LedgerAccountCategories {
export import LedgerAccountCategory = API.LedgerAccountCategory;
export import LedgerAccountCategoriesPage = API.LedgerAccountCategoriesPage;
export type LedgerAccountCategoriesPage = _LedgerAccountCategoriesPage;
export import LedgerAccountCategoryCreateParams = API.LedgerAccountCategoryCreateParams;
export import LedgerAccountCategoryRetrieveParams = API.LedgerAccountCategoryRetrieveParams;
export import LedgerAccountCategoryUpdateParams = API.LedgerAccountCategoryUpdateParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/ledger-account-payouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export class LedgerAccountPayouts extends APIResource {
}

export class LedgerAccountPayoutsPage extends Page<LedgerAccountPayout> {}
// alias so we can export it in the namespace
type _LedgerAccountPayoutsPage = LedgerAccountPayoutsPage;

export interface LedgerAccountPayout {
id: string;
Expand Down Expand Up @@ -216,7 +218,7 @@ export interface LedgerAccountPayoutListParams extends PageParams {

export namespace LedgerAccountPayouts {
export import LedgerAccountPayout = API.LedgerAccountPayout;
export import LedgerAccountPayoutsPage = API.LedgerAccountPayoutsPage;
export type LedgerAccountPayoutsPage = _LedgerAccountPayoutsPage;
export import LedgerAccountPayoutCreateParams = API.LedgerAccountPayoutCreateParams;
export import LedgerAccountPayoutUpdateParams = API.LedgerAccountPayoutUpdateParams;
export import LedgerAccountPayoutListParams = API.LedgerAccountPayoutListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/ledger-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export class LedgerAccounts extends APIResource {
}

export class LedgerAccountsPage extends Page<LedgerAccount> {}
// alias so we can export it in the namespace
type _LedgerAccountsPage = LedgerAccountsPage;

export interface LedgerAccount {
id: string;
Expand Down Expand Up @@ -429,7 +431,7 @@ export namespace LedgerAccountListParams {

export namespace LedgerAccounts {
export import LedgerAccount = API.LedgerAccount;
export import LedgerAccountsPage = API.LedgerAccountsPage;
export type LedgerAccountsPage = _LedgerAccountsPage;
export import LedgerAccountCreateParams = API.LedgerAccountCreateParams;
export import LedgerAccountRetrieveParams = API.LedgerAccountRetrieveParams;
export import LedgerAccountUpdateParams = API.LedgerAccountUpdateParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/ledger-entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export class LedgerEntries extends APIResource {
}

export class LedgerEntriesPage extends Page<LedgerEntry> {}
// alias so we can export it in the namespace
type _LedgerEntriesPage = LedgerEntriesPage;

export interface LedgerEntry {
id: string;
Expand Down Expand Up @@ -335,7 +337,7 @@ export namespace LedgerEntryListParams {

export namespace LedgerEntries {
export import LedgerEntry = API.LedgerEntry;
export import LedgerEntriesPage = API.LedgerEntriesPage;
export type LedgerEntriesPage = _LedgerEntriesPage;
export import LedgerEntryRetrieveParams = API.LedgerEntryRetrieveParams;
export import LedgerEntryListParams = API.LedgerEntryListParams;
}
4 changes: 3 additions & 1 deletion src/resources/ledger-event-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class LedgerEventHandlers extends APIResource {
}

export class LedgerEventHandlerListResponsesPage extends Page<LedgerEventHandlerListResponse> {}
// alias so we can export it in the namespace
type _LedgerEventHandlerListResponsesPage = LedgerEventHandlerListResponsesPage;

export interface LedgerEventHandlerCreateResponse {
id: string;
Expand Down Expand Up @@ -595,7 +597,7 @@ export namespace LedgerEventHandlers {
export import LedgerEventHandlerRetrieveResponse = API.LedgerEventHandlerRetrieveResponse;
export import LedgerEventHandlerListResponse = API.LedgerEventHandlerListResponse;
export import LedgerEventHandlerDeleteResponse = API.LedgerEventHandlerDeleteResponse;
export import LedgerEventHandlerListResponsesPage = API.LedgerEventHandlerListResponsesPage;
export type LedgerEventHandlerListResponsesPage = _LedgerEventHandlerListResponsesPage;
export import LedgerEventHandlerCreateParams = API.LedgerEventHandlerCreateParams;
export import LedgerEventHandlerListParams = API.LedgerEventHandlerListParams;
}
4 changes: 3 additions & 1 deletion src/resources/ledger-transactions/ledger-transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export class LedgerTransactions extends APIResource {
}

export class LedgerTransactionsPage extends Page<LedgerTransaction> {}
// alias so we can export it in the namespace
type _LedgerTransactionsPage = LedgerTransactionsPage;

export interface LedgerTransaction {
id: string;
Expand Down Expand Up @@ -537,7 +539,7 @@ export interface LedgerTransactionCreateReversalParams {

export namespace LedgerTransactions {
export import LedgerTransaction = API.LedgerTransaction;
export import LedgerTransactionsPage = API.LedgerTransactionsPage;
export type LedgerTransactionsPage = _LedgerTransactionsPage;
export import LedgerTransactionCreateParams = API.LedgerTransactionCreateParams;
export import LedgerTransactionUpdateParams = API.LedgerTransactionUpdateParams;
export import LedgerTransactionListParams = API.LedgerTransactionListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/ledger-transactions/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export class Versions extends APIResource {
}

export class LedgerTransactionVersionsPage extends Page<LedgerTransactionVersion> {}
// alias so we can export it in the namespace
type _LedgerTransactionVersionsPage = LedgerTransactionVersionsPage;

export interface LedgerTransactionVersion {
id: string;
Expand Down Expand Up @@ -338,6 +340,6 @@ export interface VersionListParams extends PageParams {

export namespace Versions {
export import LedgerTransactionVersion = API.LedgerTransactionVersion;
export import LedgerTransactionVersionsPage = API.LedgerTransactionVersionsPage;
export type LedgerTransactionVersionsPage = _LedgerTransactionVersionsPage;
export import VersionListParams = API.VersionListParams;
}
4 changes: 3 additions & 1 deletion src/resources/ledgers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export class Ledgers extends APIResource {
}

export class LedgersPage extends Page<Ledger> {}
// alias so we can export it in the namespace
type _LedgersPage = LedgersPage;

export interface Ledger {
id: string;
Expand Down Expand Up @@ -166,7 +168,7 @@ export interface LedgerListParams extends PageParams {

export namespace Ledgers {
export import Ledger = API.Ledger;
export import LedgersPage = API.LedgersPage;
export type LedgersPage = _LedgersPage;
export import LedgerCreateParams = API.LedgerCreateParams;
export import LedgerUpdateParams = API.LedgerUpdateParams;
export import LedgerListParams = API.LedgerListParams;
Expand Down
4 changes: 3 additions & 1 deletion src/resources/line-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export class LineItems extends APIResource {
}

export class LineItemsPage extends Page<LineItem> {}
// alias so we can export it in the namespace
type _LineItemsPage = LineItemsPage;

export interface LineItem {
id: string;
Expand Down Expand Up @@ -167,7 +169,7 @@ export interface LineItemListParams extends PageParams {}

export namespace LineItems {
export import LineItem = API.LineItem;
export import LineItemsPage = API.LineItemsPage;
export type LineItemsPage = _LineItemsPage;
export import LineItemUpdateParams = API.LineItemUpdateParams;
export import LineItemListParams = API.LineItemListParams;
}
Loading

0 comments on commit fd9dd7f

Please sign in to comment.