Skip to content

Commit 09e0e91

Browse files
committed
refactor: stop using cookies in requests
BREAKING CHANGE: Cookies will no longer be sent or stored in requests. This should have very little impact on usage but is techincally a breaking change. This affects internal functionality but has no effect on client code.
1 parent 569b1fc commit 09e0e91

File tree

18 files changed

+26
-545
lines changed

18 files changed

+26
-545
lines changed

assistant/v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -2896,7 +2896,7 @@ namespace AssistantV1 {
28962896
}
28972897

28982898
/** The callback for a service request. */
2899-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
2899+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
29002900

29012901
/** The body of a service request that returns no response data. */
29022902
export interface Empty { }

assistant/v2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -249,7 +249,7 @@ namespace AssistantV2 {
249249
}
250250

251251
/** The callback for a service request. */
252-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
252+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
253253

254254
/** The body of a service request that returns no response data. */
255255
export interface Empty { }

compare-comply/v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -819,7 +819,7 @@ namespace CompareComplyV1 {
819819
}
820820

821821
/** The callback for a service request. */
822-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
822+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
823823

824824
/** The body of a service request that returns no response data. */
825825
export interface Empty { }

discovery/v1-generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -3743,7 +3743,7 @@ namespace DiscoveryV1 {
37433743
}
37443744

37453745
/** The callback for a service request. */
3746-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
3746+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
37473747

37483748
/** The body of a service request that returns no response data. */
37493749
export interface Empty { }

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export import NaturalLanguageClassifierV1 = require('./natural-language-classifi
3434

3535
export import NaturalLanguageUnderstandingV1 = require('./natural-language-understanding/v1-generated');
3636

37-
export import PersonalityInsightsV3 = require('./personality-insights/v3');
37+
export import PersonalityInsightsV3 = require('./personality-insights/v3-generated');
3838

3939
export import SpeechToTextV1 = require('./speech-to-text/v1');
4040

language-translator/v3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -438,7 +438,7 @@ namespace LanguageTranslatorV3 {
438438
}
439439

440440
/** The callback for a service request. */
441-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
441+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
442442

443443
/** The body of a service request that returns no response data. */
444444
export interface Empty { }

lib/base_service.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// `buffer-from` uses the new api when possible but falls back to the old one otherwise
1919
import bufferFrom = require('buffer-from');
2020
import extend = require('extend');
21-
import request = require('request');
2221
import semver = require('semver');
2322
import vcapServices = require('vcap_services');
2423
import { IamTokenManagerV1 } from '../iam-token-manager/v1';
@@ -50,7 +49,6 @@ export interface UserOptions {
5049
export interface BaseServiceOptions extends UserOptions {
5150
headers: HeaderOptions;
5251
url: string;
53-
jar?: request.CookieJar;
5452
qs: any;
5553
rejectUnauthorized?: boolean;
5654
}
@@ -289,7 +287,6 @@ export class BaseService {
289287
_options = extend(_options, options);
290288
return _options;
291289
}
292-
_options.jar = request.jar();
293290
// Get credentials from environment properties or Bluemix,
294291
// but prefer credentials provided programatically
295292
_options = extend(

natural-language-classifier/v1-generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -370,7 +370,7 @@ namespace NaturalLanguageClassifierV1 {
370370
}
371371

372372
/** The callback for a service request. */
373-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
373+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
374374

375375
/** The body of a service request that returns no response data. */
376376
export interface Empty { }

natural-language-understanding/v1-generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -252,7 +252,7 @@ namespace NaturalLanguageUnderstandingV1 {
252252
}
253253

254254
/** The callback for a service request. */
255-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
255+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
256256

257257
/** The body of a service request that returns no response data. */
258258
export interface Empty { }

package-lock.json

Lines changed: 0 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"@types/file-type": "~5.2.1",
7979
"@types/is-stream": "~1.1.0",
8080
"@types/node": "~10.3.5",
81-
"@types/request": "~2.47.1",
8281
"async": "~2.6.1",
8382
"axios": "^0.18.0",
8483
"buffer-from": "~1.1.0",

personality-insights/v3-generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { AxiosResponse } from 'axios';
1718
import * as extend from 'extend';
18-
import { RequestResponse } from 'request';
1919
import { BaseService } from '../lib/base_service';
2020
import { getDefaultHeaders } from '../lib/common';
2121
import { getMissingParams } from '../lib/helper';
@@ -303,7 +303,7 @@ namespace PersonalityInsightsV3 {
303303
}
304304

305305
/** The callback for a service request. */
306-
export type Callback<T> = (error: any, body?: T, response?: RequestResponse) => void;
306+
export type Callback<T> = (error: any, body?: T, response?: AxiosResponse<T>) => void;
307307

308308
/** The body of a service request that returns no response data. */
309309
export interface Empty { }

0 commit comments

Comments
 (0)