@google-cloud/profiler
Advanced tools
Comparing version 1.0.0 to 1.0.1-alpha.0
@@ -52,6 +52,10 @@ "use strict"; | ||
/** | ||
* @return the message of the response body, if that field exists. Otherwise, | ||
* returns the response status message. | ||
* @return the error's message, if present. Otherwise returns the | ||
* message of the response body, if that field exists, or the response status | ||
* message. | ||
*/ | ||
function getResponseErrorMessage(response) { | ||
function getResponseErrorMessage(response, err) { | ||
if (err && err.message) { | ||
return err.message; | ||
} | ||
// tslint:disable-next-line: no-any | ||
@@ -68,3 +72,3 @@ const body = response.body; | ||
*/ | ||
function getServerResponseBackoff(response) { | ||
function getServerResponseBackoff(response, err) { | ||
// The response currently does not have field containing the server-specified | ||
@@ -75,3 +79,3 @@ // backoff. As a workaround, response body's message is parsed to get the | ||
// body.error.details. | ||
const message = getResponseErrorMessage(response); | ||
const message = getResponseErrorMessage(response, err); | ||
if (message) { | ||
@@ -187,4 +191,4 @@ return parseBackoffDuration(message); | ||
if (response && isErrorResponseStatusCode(response.statusCode)) { | ||
const message = getResponseErrorMessage(response); | ||
const delayMillis = getServerResponseBackoff(response); | ||
const message = getResponseErrorMessage(response, err); | ||
const delayMillis = getServerResponseBackoff(response, err); | ||
if (delayMillis) { | ||
@@ -390,3 +394,3 @@ throw new BackoffResponseError(message, delayMillis); | ||
try { | ||
const res = yield this.request(options); | ||
const [, res] = yield this.request(options); | ||
if (isErrorResponseStatusCode(res.statusCode)) { | ||
@@ -393,0 +397,0 @@ let message = res.statusCode; |
{ | ||
"name": "@google-cloud/profiler", | ||
"version": "1.0.0", | ||
"version": "1.0.1-alpha.0", | ||
"description": "Adds support for Stackdriver Profiler to Node.js applications", | ||
@@ -9,3 +9,3 @@ "repository": "googleapis/cloud-profiler-nodejs", | ||
"scripts": { | ||
"install": "node-pre-gyp install --build-from-source", | ||
"install": "node-pre-gyp install --fallback-to-build", | ||
"test": "nyc mocha out/test/test-*.js", | ||
@@ -27,3 +27,5 @@ "system-test": "nyc --no-clean mocha out/system-test/test-*.js --timeout=60000", | ||
"proto:profiler": "mkdir -p proto && pbjs -t static-module -w commonjs -o proto/profiler.js third_party/googleapis/google/devtools/cloudprofiler/v2/profiler.proto && pbts -o proto/profiler.d.ts proto/profiler.js", | ||
"license-check": "jsgl --local ." | ||
"license-check": "jsgl --local .", | ||
"docs-test": "linkinator docs -r --skip www.googleapis.com", | ||
"predocs-test": "npm run docs" | ||
}, | ||
@@ -35,3 +37,3 @@ "author": { | ||
"dependencies": { | ||
"@google-cloud/common": "^0.27.0", | ||
"@google-cloud/common": "^0.31.0", | ||
"@types/console-log-level": "^1.4.0", | ||
@@ -44,5 +46,5 @@ "@types/semver": "^5.5.0", | ||
"findit2": "^2.2.3", | ||
"gcp-metadata": "^0.9.0", | ||
"gcp-metadata": "^1.0.0", | ||
"lodash.pickby": "^4.6.0", | ||
"nan": "^2.12.0", | ||
"nan": "^2.12.1", | ||
"node-pre-gyp": "^0.12.0", | ||
@@ -71,3 +73,3 @@ "p-limit": "^2.0.0", | ||
"@types/sinon": "^7.0.3", | ||
"@types/tmp": "0.0.33", | ||
"@types/tmp": "0.0.34", | ||
"codecov": "^3.0.0", | ||
@@ -78,3 +80,3 @@ "deep-copy": "^1.4.2", | ||
"js-green-licenses": "^0.5.0", | ||
"mocha": "^5.0.0", | ||
"mocha": "^6.0.0", | ||
"nock": "^10.0.0", | ||
@@ -86,3 +88,4 @@ "nyc": "^13.0.0", | ||
"ts-mockito": "^2.2.5", | ||
"typescript": "~3.2.0" | ||
"typescript": "~3.3.0", | ||
"linkinator": "^1.1.2" | ||
}, | ||
@@ -112,5 +115,6 @@ "files": [ | ||
"module_path": "./build/{node_abi}-{platform}-{arch}-{libc}", | ||
"host": "https://storage.googleapis.com/cloud-profiler-e2e/cprof-e2e-artifacts/nodejs/release", | ||
"host": "https://storage.googleapis.com/cloud-profiler/nodejs/release", | ||
"remote_path": "v{version}", | ||
"package_name": "{node_abi}-{platform}-{arch}-{libc}.tar.gz" | ||
} | ||
} |
@@ -224,3 +224,3 @@ # Google Cloud Profiler | ||
[Application Default Credentials][app-default-credentials]. This is the | ||
reccomended method. | ||
recommended method. | ||
1. [Create a new JSON service account key][service-account]. | ||
@@ -227,0 +227,0 @@ 2. Copy the key somewhere your application can access it. Be sure not |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
1281271
25038
26
2
+ Added@google-cloud/common@0.31.1(transitive)
+ Added@google-cloud/promisify@0.4.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedfast-text-encoding@1.0.6(transitive)
+ Addedgcp-metadata@1.0.0(transitive)
+ Addedgoogle-auth-library@3.1.2(transitive)
- Removed@google-cloud/common@0.27.0(transitive)
- Removed@google-cloud/promisify@0.3.1(transitive)
- Removedaxios@0.18.1(transitive)
- Removedfollow-redirects@1.5.10(transitive)
- Removedgcp-metadata@0.7.00.9.3(transitive)
- Removedgoogle-auth-library@2.0.2(transitive)
- Removedis-buffer@2.0.5(transitive)
- Removedretry-axios@0.3.2(transitive)
Updated@google-cloud/common@^0.31.0
Updatedgcp-metadata@^1.0.0
Updatednan@^2.12.1