Skip to content

Commit

Permalink
chore: fix import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed May 15, 2024
1 parent 017513b commit e1cbf87
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-pears-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperse-io/paypal-node-sdk": patch
---

fix import issue
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/index.js';
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
23 changes: 6 additions & 17 deletions src/core/index.ts
Original file line number Diff line number Diff line change
@@ -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';
12 changes: 3 additions & 9 deletions src/customers/index.ts
Original file line number Diff line number Diff line change
@@ -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';
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
18 changes: 5 additions & 13 deletions src/orders/index.ts
Original file line number Diff line number Diff line change
@@ -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';
24 changes: 7 additions & 17 deletions src/payments/index.ts
Original file line number Diff line number Diff line change
@@ -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';
6 changes: 1 addition & 5 deletions src/webhook/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import { VerifyWebhookSignature } from './verifyWebhookSignature.js';

export const webhook = {
VerifyWebhookSignature,
};
export { VerifyWebhookSignature } from './verifyWebhookSignature.js';

0 comments on commit e1cbf87

Please sign in to comment.