Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/babel/traverse-7.23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 authored Oct 26, 2023
2 parents 3a8f52d + d365ae8 commit 1a3fbc5
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 61 deletions.
153 changes: 102 additions & 51 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"changelog": "node node_modules/standard-version/bin/cli.js --skip.commit --skip.push --skip.tag --dry-run"
},
"dependencies": {
"@cypress/request": "^3.0.1",
"@types/bluebird": "^3.5.35",
"@types/node": "^18.15.3",
"ajv": "^6.12.3",
Expand All @@ -43,7 +44,6 @@
"merge-options": "^1.0.1",
"promise-queue": "^2.2.3",
"proxy-agent": "^6.3.0",
"request": "^2.88.0",
"url-template": "^2.0.8",
"uuid": "^9.0.0"
},
Expand All @@ -53,7 +53,6 @@
"@types/lodash": "^4.14.172",
"@types/prettier": "^2.3.2",
"@types/promise-queue": "^2.2.0",
"@types/request": "^2.48.5",
"@types/shelljs": "^0.8.9",
"@types/url-template": "^2.0.28",
"@types/uuid": "^9.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/api-request-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { Promise } from 'bluebird';
import { EventEmitter } from 'events';
import errors from './util/errors';
import { PassThrough } from 'stream';
import request from 'request';

const APIRequest = require('./api-request');

Expand Down
11 changes: 6 additions & 5 deletions src/api-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
import assert from 'assert';
import { EventEmitter } from 'events';
import httpStatusCodes from 'http-status';
import request from 'request';
import Config from './util/config';
import getRetryTimeout from './util/exponential-backoff';

const request = require('@cypress/request');

// ------------------------------------------------------------------------------
// Typedefs and Callbacks
// ------------------------------------------------------------------------------
Expand Down Expand Up @@ -218,8 +219,8 @@ class APIRequest {
isRetryable: boolean;

_callback?: APIRequestCallback;
request?: request.Request;
stream?: request.Request;
request?: any; // request.Request;
stream?: any; // request.Request;
numRetries?: number;

constructor(config: Config, eventBus: EventEmitter) {
Expand Down Expand Up @@ -261,10 +262,10 @@ class APIRequest {
} else {
this.request = request(this.config.request);
this.stream = this.request;
this.stream.on('error', (err) => {
this.stream.on('error', (err: any) => {
this.eventBus.emit('response', err);
});
this.stream.on('response', (response) => {
this.stream.on('response', (response: any) => {
if (isClientErrorResponse(response)) {
this.eventBus.emit('response', createErrorForResponse(response));
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var assert = require('chai').assert,
fs = require('fs'),
path = require('path'),
crypto = require('crypto'),
request = require('request'),
request = require('@cypress/request'),
jwt = require('jsonwebtoken');

describe('Box Node SDK', function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/api-request-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('APIRequest', function() {

// Setup Mockery
mockery.enable({ warnOnUnregistered: false });
mockery.registerMock('request', requestStub);
mockery.registerMock('@cypress/request', requestStub);

// Setup File Under Test
mockery.registerAllowable(MODULE_UNDER_TEST_PATH, true);
Expand Down

0 comments on commit 1a3fbc5

Please sign in to comment.