@google-cloud/common
Advanced tools
Comparing version 2.0.5 to 2.1.0
@@ -18,3 +18,3 @@ /*! | ||
import { EventEmitter } from 'events'; | ||
import * as r from 'request'; | ||
import * as r from 'teeny-request'; | ||
import { ApiError, BodyResponseCallback, DecorateRequestOptions } from './util'; | ||
@@ -21,0 +21,0 @@ export declare type RequestResponse = [Metadata, r.Response]; |
@@ -17,3 +17,3 @@ /*! | ||
import { GoogleAuth, GoogleAuthOptions } from 'google-auth-library'; | ||
import * as r from 'request'; | ||
import * as r from 'teeny-request'; | ||
import { Interceptor } from './service-object'; | ||
@@ -50,2 +50,3 @@ import { BodyResponseCallback, DecorateRequestOptions, MakeAuthenticatedRequest, PackageJson } from './util'; | ||
token?: string; | ||
timeout?: number; | ||
} | ||
@@ -64,2 +65,3 @@ export declare class Service { | ||
readonly apiEndpoint: string; | ||
timeout: number; | ||
/** | ||
@@ -66,0 +68,0 @@ * Service is a base class, meant to be inherited from by a "service," like |
@@ -44,2 +44,3 @@ "use strict"; | ||
this.apiEndpoint = config.apiEndpoint; | ||
this.timeout = options.timeout; | ||
this.globalInterceptors = arrify(options.interceptors_); | ||
@@ -86,3 +87,3 @@ this.interceptors = []; | ||
request_(reqOpts, callback) { | ||
reqOpts = extend(true, {}, reqOpts); | ||
reqOpts = extend(true, {}, reqOpts, { timeout: this.timeout }); | ||
const isAbsoluteUrl = reqOpts.uri.indexOf('http') === 0; | ||
@@ -89,0 +90,0 @@ const uriComponents = [this.baseUrl]; |
@@ -18,4 +18,4 @@ /** | ||
import { GoogleAuth, GoogleAuthOptions } from 'google-auth-library'; | ||
import { CredentialBody } from 'google-auth-library/build/src/auth/credentials'; | ||
import * as r from 'request'; | ||
import { CredentialBody } from 'google-auth-library'; | ||
import * as r from 'teeny-request'; | ||
import { Duplex, DuplexOptions, Readable, Writable } from 'stream'; | ||
@@ -22,0 +22,0 @@ import { Interceptor } from './service-object'; |
@@ -7,2 +7,14 @@ # Changelog | ||
## [2.1.0](https://www.github.com/googleapis/nodejs-common/compare/v2.0.5...v2.1.0) (2019-08-05) | ||
### Bug Fixes | ||
* **deps:** upgrade to the latest version of teeny-request ([#448](https://www.github.com/googleapis/nodejs-common/issues/448)) ([bb76f07](https://www.github.com/googleapis/nodejs-common/commit/bb76f07)) | ||
### Features | ||
* adds timeout to options and use it in reqOpts ([#455](https://www.github.com/googleapis/nodejs-common/issues/455)) ([90a6097](https://www.github.com/googleapis/nodejs-common/commit/90a6097)) | ||
### [2.0.5](https://www.github.com/googleapis/nodejs-common/compare/v2.0.4...v2.0.5) (2019-07-29) | ||
@@ -9,0 +21,0 @@ |
{ | ||
"name": "@google-cloud/common", | ||
"description": "Common components for Cloud APIs Node.js Client Libraries", | ||
"version": "2.0.5", | ||
"version": "2.1.0", | ||
"license": "Apache-2.0", | ||
@@ -36,3 +36,2 @@ "author": "Google Inc.", | ||
"@google-cloud/promisify": "^1.0.0", | ||
"@types/request": "^2.48.1", | ||
"arrify": "^2.0.0", | ||
@@ -44,3 +43,3 @@ "duplexify": "^3.6.0", | ||
"retry-request": "^4.0.0", | ||
"teeny-request": "^4.0.0" | ||
"teeny-request": "^5.1.1" | ||
}, | ||
@@ -57,2 +56,3 @@ "devDependencies": { | ||
"@types/proxyquire": "^1.3.28", | ||
"@types/request": "^2.48.1", | ||
"@types/sinon": "^7.0.10", | ||
@@ -59,0 +59,0 @@ "@types/tmp": "0.1.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108086
9
1846
29
+ Addedagent-base@5.1.1(transitive)
+ Addedhttp-proxy-agent@3.0.0(transitive)
+ Addedhttps-proxy-agent@4.0.0(transitive)
+ Addedstream-events@1.0.5(transitive)
+ Addedstubs@3.0.0(transitive)
+ Addedteeny-request@5.3.3(transitive)
- Removed@types/request@^2.48.1
- Removed@types/caseless@0.12.5(transitive)
- Removed@types/node@22.7.4(transitive)
- Removed@types/request@2.48.12(transitive)
- Removed@types/tough-cookie@4.0.5(transitive)
- Removedagent-base@4.3.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removeddebug@3.2.7(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedes6-promise@4.2.8(transitive)
- Removedes6-promisify@5.0.0(transitive)
- Removedform-data@2.5.1(transitive)
- Removedhttps-proxy-agent@2.2.4(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedteeny-request@4.0.0(transitive)
- Removedundici-types@6.19.8(transitive)
Updatedteeny-request@^5.1.1