diff --git a/.changeset/eighty-pears-care.md b/.changeset/eighty-pears-care.md new file mode 100644 index 0000000..ed5a728 --- /dev/null +++ b/.changeset/eighty-pears-care.md @@ -0,0 +1,5 @@ +--- +"@hyperse-io/paypal-node-sdk": patch +--- + +fix import issue diff --git a/index.js b/index.js new file mode 100644 index 0000000..2b8395c --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +export * from './dist/index.js'; diff --git a/package.json b/package.json index d704023..199a454 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,27 @@ "import": "./index.js", "types": "./dist/index.d.ts" }, + "./core": { + "import": "./dist/core/index.js", + "types": "./dist/core/index.d.ts" + }, + "./orders": { + "import": "./dist/orders/index.js", + "types": "./dist/orders/index.d.ts" + }, + "./payments": { + "import": "./dist/payments/index.js", + "types": "./dist/payments/index.d.ts" + }, + "./webhook": { + "import": "./dist/webhook/index.js", + "types": "./dist/webhook/index.d.ts" + }, "./package.json": "./package.json" }, "types": "./dist/index.d.ts", "files": [ + "./index.js", "./dist/" ], "workspaces": [ diff --git a/src/core/index.ts b/src/core/index.ts index 5025915..c5624ee 100755 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,21 +1,10 @@ -import { AccessToken } from './AccessToken.js'; -import { AccessTokenRequest } from './AccessTokenRequest.js'; -import { +export { AccessToken } from './AccessToken.js'; +export { AccessTokenRequest } from './AccessTokenRequest.js'; +export { LiveEnvironment, PayPalEnvironment, SandboxEnvironment, } from './PayPalEnvironment.js'; -import { PayPalHttpClient } from './PayPalHttpClient.js'; -import { RefreshTokenRequest } from './RefreshTokenRequest.js'; -import { TokenCache } from './TokenCache.js'; - -export const core = { - AccessToken, - AccessTokenRequest, - PayPalEnvironment, - LiveEnvironment, - SandboxEnvironment, - PayPalHttpClient, - RefreshTokenRequest, - TokenCache, -}; +export { PayPalHttpClient } from './PayPalHttpClient.js'; +export { RefreshTokenRequest } from './RefreshTokenRequest.js'; +export { TokenCache } from './TokenCache.js'; diff --git a/src/customers/index.ts b/src/customers/index.ts index aeba9c7..7fd60cd 100644 --- a/src/customers/index.ts +++ b/src/customers/index.ts @@ -1,9 +1,3 @@ -import { CustomersPartnerMerchantIntegrationGetRequest } from './customersPartnerMerchantIntegrationGetRequest.js'; -import { CustomersPartnerReferralsGetRequest } from './customersPartnerReferralsGetRequest.js'; -import { CustomersPartnerReferralsRequest } from './customersPartnerReferralsRequest.js'; - -export const Customers = { - CustomersPartnerMerchantIntegrationGetRequest, - CustomersPartnerReferralsGetRequest, - CustomersPartnerReferralsRequest, -}; +export { CustomersPartnerMerchantIntegrationGetRequest } from './customersPartnerMerchantIntegrationGetRequest.js'; +export { CustomersPartnerReferralsGetRequest } from './customersPartnerReferralsGetRequest.js'; +export { CustomersPartnerReferralsRequest } from './customersPartnerReferralsRequest.js'; diff --git a/src/index.ts b/src/index.ts index f1ee928..73bb6ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -export * from './core/index.js'; -export * from './orders/index.js'; -export * from './payments/index.js'; -export * from './customers/index.js'; -export * from './webhook/index.js'; +export * as core from './core/index.js'; +export * as orders from './orders/index.js'; +export * as payments from './payments/index.js'; +export * as customers from './customers/index.js'; +export * as webhook from './webhook/index.js'; diff --git a/src/orders/index.ts b/src/orders/index.ts index 913220c..28e43bf 100755 --- a/src/orders/index.ts +++ b/src/orders/index.ts @@ -1,13 +1,5 @@ -import { OrdersAuthorizeRequest } from './ordersAuthorizeRequest.js'; -import { OrdersCaptureRequest } from './ordersCaptureRequest.js'; -import { OrdersCreateRequest } from './ordersCreateRequest.js'; -import { OrdersGetRequest } from './ordersGetRequest.js'; -import { OrdersPatchRequest } from './ordersPatchRequest.js'; - -export const orders = { - OrdersAuthorizeRequest, - OrdersCaptureRequest, - OrdersCreateRequest, - OrdersGetRequest, - OrdersPatchRequest, -}; +export { OrdersAuthorizeRequest } from './ordersAuthorizeRequest.js'; +export { OrdersCaptureRequest } from './ordersCaptureRequest.js'; +export { OrdersCreateRequest } from './ordersCreateRequest.js'; +export { OrdersGetRequest } from './ordersGetRequest.js'; +export { OrdersPatchRequest } from './ordersPatchRequest.js'; diff --git a/src/payments/index.ts b/src/payments/index.ts index 6f1b9e6..ea6a5bc 100755 --- a/src/payments/index.ts +++ b/src/payments/index.ts @@ -1,17 +1,7 @@ -import { AuthorizationsCaptureRequest } from './authorizationsCaptureRequest.js'; -import { AuthorizationsGetRequest } from './authorizationsGetRequest.js'; -import { AuthorizationsReauthorizeRequest } from './authorizationsReauthorizeRequest.js'; -import { AuthorizationsVoidRequest } from './authorizationsVoidRequest.js'; -import { CapturesGetRequest } from './capturesGetRequest.js'; -import { CapturesRefundRequest } from './capturesRefundRequest.js'; -import { RefundsGetRequest } from './refundsGetRequest.js'; - -export const payments = { - AuthorizationsCaptureRequest, - AuthorizationsGetRequest, - AuthorizationsReauthorizeRequest, - AuthorizationsVoidRequest, - CapturesGetRequest, - CapturesRefundRequest, - RefundsGetRequest, -}; +export { AuthorizationsCaptureRequest } from './authorizationsCaptureRequest.js'; +export { AuthorizationsGetRequest } from './authorizationsGetRequest.js'; +export { AuthorizationsReauthorizeRequest } from './authorizationsReauthorizeRequest.js'; +export { AuthorizationsVoidRequest } from './authorizationsVoidRequest.js'; +export { CapturesGetRequest } from './capturesGetRequest.js'; +export { CapturesRefundRequest } from './capturesRefundRequest.js'; +export { RefundsGetRequest } from './refundsGetRequest.js'; diff --git a/src/webhook/index.ts b/src/webhook/index.ts index a31ecd1..390b444 100644 --- a/src/webhook/index.ts +++ b/src/webhook/index.ts @@ -1,5 +1 @@ -import { VerifyWebhookSignature } from './verifyWebhookSignature.js'; - -export const webhook = { - VerifyWebhookSignature, -}; +export { VerifyWebhookSignature } from './verifyWebhookSignature.js';