Skip to content

Commit

Permalink
feat(types): auto generate api types with openapi specs (#443)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The TypeScript types for the PayPal APIs have changed. 
Now they are auto generated based on the Open API 3.0 specs.
  • Loading branch information
gregjopa authored Dec 20, 2023
1 parent 350d9d6 commit efb26f8
Show file tree
Hide file tree
Showing 13 changed files with 23,507 additions and 6,703 deletions.
18,138 changes: 13,122 additions & 5,016 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"test:e2e:debug": "PWDEBUG=1 playwright test --project=\"chromium\"",
"test:e2e:start": "node e2e-tests/http-server.js",
"typecheck": "tsc --noEmit",
"validate": "npm run check-node-version && npm run format:check && npm run typecheck && npm run build && npm run lint && npm test -- --coverage --watch=false && npm run test:bundle -- --watch=false"
"validate": "npm run check-node-version && npm run format:check && npm run typecheck && npm run build && npm run lint && npm test -- --coverage --watch=false && npm run test:bundle -- --watch=false",
"openapi": "npm run openapi-orders && npm run openapi-subscriptions",
"openapi-orders": "openapi-typescript node_modules/@paypal/paypal-rest-api-specifications/openapi/checkout_orders_v2.json -o types/apis/openapi/checkout_orders_v2.d.ts",
"openapi-subscriptions": "openapi-typescript node_modules/@paypal/paypal-rest-api-specifications/openapi/billing_subscriptions_v1.json -o types/apis/openapi/billing_subscriptions_v1.d.ts"
},
"files": [
"dist",
Expand All @@ -46,6 +49,7 @@
"devDependencies": {
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@paypal/paypal-rest-api-specifications": "^1.0.0",
"@playwright/test": "^1.40.0",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-node-resolve": "15.2.3",
Expand All @@ -62,6 +66,7 @@
"husky": "8.0.3",
"jsdom": "^23.0.0",
"lint-staged": "15.1.0",
"openapi-typescript": "^6.7.2",
"prettier": "3.1.0",
"rollup": "4.6.0",
"semver": "7.5.4",
Expand Down
120 changes: 0 additions & 120 deletions types/apis/commons.d.ts

This file was deleted.

Loading

0 comments on commit efb26f8

Please sign in to comment.