Skip to content

Commit

Permalink
fix: Update proxy-agent usage, drop support Node 12 (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 authored Nov 3, 2023
1 parent 86255fd commit e229d3f
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['12', '14', '16', '18', '20']
node: ['14', '16', '18', '20']
name: Node ${{ matrix.node }}
steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Box Node.js SDK
===============

[![Greenkeeper badge](https://badges.greenkeeper.io/box/box-node-sdk.svg)](https://greenkeeper.io/)
![Platform](https://img.shields.io/badge/node-12--20-blue)
[![Known Vulnerabilities](https://snyk.io/test/github/box/box-node-sdk/badge.svg)](https://snyk.io/test/github/box/box-node-sdk)
![Platform](https://img.shields.io/badge/node-14--20-blue)
[![Project Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges)
[![Coverage](https://coveralls.io/repos/github/box/box-node-sdk/badge.svg?branch=main)](https://coveralls.io/github/box/box-node-sdk?branch=main)

Expand Down Expand Up @@ -253,7 +253,7 @@ We highly recommend upgrading to the latest SDK major release at the earliest co

| Version | Supported Environments | State | First Release | EOL/Terminated |
|---------|------------------------|-----------|---------------|----------------|
| 3 | Node.js >= 12 and <= 20| Supported | 23 May 2023 | TBD |
| 3 | Node.js >= 14 and <= 20| Supported | 23 May 2023 | TBD |
| 2 | Node.js >= 8 and <= 14 | Maintained | 29 Sep 2021 | 23 Jul 2023 |
| 1 | | EOL | 28 Mar 2019 | 29 Sep 2021 |

Expand Down
136 changes: 49 additions & 87 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"sdk"
],
"engines": {
"node": ">= 12.0.0"
"node": ">= 14.0.0"
},
"main": "./lib/box-node-sdk.js",
"scripts": {
Expand All @@ -43,7 +43,7 @@
"jsonwebtoken": "^9.0.2",
"merge-options": "^1.0.1",
"promise-queue": "^2.2.3",
"proxy-agent": "^6.3.0",
"proxy-agent": "^6.3.1",
"url-template": "^2.0.8",
"uuid": "^9.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/util/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function updateRequestAgent(
Required<Pick<UserConfigurationOptions, 'proxy'>>
) {
if (params.proxy.url) {
const ProxyAgent = require('proxy-agent');
const ProxyAgent = require('proxy-agent').ProxyAgent;
params.request.agentClass = ProxyAgent;
params.request.agentOptions = Object.assign(
{},
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_test/__tests__/sign-request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ test('test sign request', async() => {
await file1.dispose();
await file2.dispose();
}
});
}, 120000);

0 comments on commit e229d3f

Please sign in to comment.