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

SP-1135 Add exports to Node.js SDK #130

Open
wants to merge 2 commits into
base: 7.0.x
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
"node": ">=18.0.0 <23.0.0"
},
"main": "dist/index",
"exports": {
".": "./dist/index.js",
"./client": "./dist/Client/index.js",
"./models": "./dist/Model/index.js",
"./exceptions": "./dist/Exceptions/index.js",
"./logger": "./dist/Logger/index.js"
},
"typings": "dist/index",
"bin": "./bin/index.js",
"files": [
Expand Down
5 changes: 5 additions & 0 deletions src/Logger/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BitPayLogger } from './BitPayLogger';
import { EmptyLogger } from './EmptyLogger';
import { LoggerProvider } from './LoggerProvider';

export { BitPayLogger, EmptyLogger, LoggerProvider };
72 changes: 71 additions & 1 deletion src/Model/index.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add exports for enum like consts? For example:

import * as InvoiceStatus from './Invoice/InvoiceStatus';
...
export {
  ...
  InvoiceStatus
  ...
}

This should be done in the following cases:

  • Model/Bill/BillStatus.ts
  • Model/Invoice/InvoiceStatus.ts
  • Model/Invoice/RefundParams.ts
  • Model/Invoice/RefundStatus.ts
  • Model/Payout/PayoutStatus.ts
  • Model/Payout/RecipientReferenceMethod.ts
  • Model/Payout/RecipientStatus.ts

Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,96 @@ import { Bill, BillInterface } from './Bill/Bill';
import { Item as BillItem } from './Bill/Item';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add ItemInterface too?

import { LedgerInterface } from './Ledger/Ledger';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Ledger

import { LedgerEntryInterface } from './Ledger/LedgerEntry';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add LedgerEntry

import { BuyerFieldsInterface, BuyerFields } from './Ledger/BuyerFields';
import { PayoutRecipient, PayoutRecipientInterface } from './Payout/PayoutRecipient';
import { PayoutRecipients, PayoutRecipientsInterface } from './Payout/PayoutRecipients';
import { Payout, PayoutInterface } from './Payout/Payout';
import { PayoutGroupInterface } from './Payout/PayoutGroup';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing PayoutGroup

import { CurrencyInterface, Currency } from './Currency/Currency';
import { PayoutTransaction, PayoutTransactionInterface } from './Payout/PayoutTransaction';
import { PayoutGroupFailed, PayoutGroupFailedInterface } from './Payout/PayoutGroupFailed';
import { Buyer, BuyerInterface } from './Invoice/Buyer';
import { InvoiceBuyerProvidedInfo } from './Invoice/InvoiceBuyerProvidedInfo';
import { InvoiceEventTokenInterface } from './Invoice/InvoiceEventToken';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add InvoiceEventToken

import { InvoiceRefundAddresses } from './Invoice/InvoiceRefundAddresses';
import { InvoiceTransaction } from './Invoice/InvoiceTransaction';
import { InvoiceUniversalCodes } from './Invoice/InvoiceUniversalCodes';
import { MinerFeesItem } from './Invoice/MinerFeesItem';
import { RefundInterface, Refund } from './Invoice/Refund';
import { RefundInfo } from './Invoice/RefundInfo';
import { Shopper } from './Invoice/Shopper';
import { SupportedTransactionCurrency } from './Invoice/SupportedTransactionCurrency';
import { InvoiceDataInterface, InvoiceData } from './Settlement/InvoiceData';
import { PayoutInfoInterface, PayoutInfo } from './Settlement/PayoutInfo';
import { RefundInfoInterface } from './Settlement/RefundInfo';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add RefundInfo

import { SettlementInterface, Settlement } from './Settlement/Settlement';
import { SettlementLedgerEntryInterface, SettlementLedgerEntry } from './Settlement/SettlementLedgerEntry';
import { WithHoldingsInterface, WithHoldings } from './Settlement/WithHoldings';
import { CurrenciesInterface, Currencies } from './Wallet/Currencies';
import { CurrencyQr, CurrencyQrInterface } from './Wallet/CurrencyQr';
import { Wallet, WalletInterface } from './Wallet/Wallet';
import { InvoiceWebhook } from './Webhook/InvoiceWebhook';
import { PayoutWebhookInterface } from './Webhook/PayoutWebhook';
import { RefundWebhook } from './Webhook/RefundWebhook';
import { InvoiceWebhookBuyerFieldsInterface } from './Webhook/InvoiceWebhookBuyerFields';

export {
Invoice,
InvoiceInterface,
InvoiceData,
InvoiceDataInterface,
InvoiceBuyerProvidedInfo,
InvoiceEventTokenInterface,
InvoiceRefundAddresses,
InvoiceTransaction,
InvoiceUniversalCodes,
InvoiceWebhook,
InvoiceWebhookBuyerFieldsInterface,
RateInterface,
Rates,
Bill,
BillInterface,
BillItem,
BuyerFields,
BuyerFieldsInterface,
Buyer,
BuyerInterface,
Currency,
CurrencyInterface,
Currencies,
CurrenciesInterface,
CurrencyQr,
CurrencyQrInterface,
LedgerInterface,
LedgerEntryInterface,
MinerFeesItem,
PayoutRecipient,
PayoutRecipientInterface,
PayoutRecipients,
PayoutRecipientsInterface,
Payout,
PayoutInterface,
PayoutGroupInterface
PayoutInfo,
PayoutInfoInterface,
PayoutGroupInterface,
PayoutTransaction,
PayoutTransactionInterface,
PayoutGroupFailed,
PayoutGroupFailedInterface,
PayoutWebhookInterface,
Refund,
RefundInterface,
RefundInfo,
RefundInfoInterface,
RefundWebhook,
Shopper,
Settlement,
SettlementInterface,
SettlementLedgerEntry,
SettlementLedgerEntryInterface,
SupportedTransactionCurrency,
WithHoldings,
WithHoldingsInterface,
Wallet,
WalletInterface
};