debugbear
Advanced tools
Comparing version 2.0.12 to 2.0.13
@@ -5,2 +5,3 @@ import { callApi } from "./callApi"; | ||
import { AnalysisResultObject } from "./ResponseTypes"; | ||
import * as queryString from "querystring"; | ||
@@ -270,9 +271,16 @@ let pollIntervalAdjustmentFactor = 1; | ||
getMetrics(pageId: string, { from, to }: GetMetricsOptions): Promise<any[]> { | ||
if (!from) { | ||
throw Error("Parameter 'from' is required"); | ||
} | ||
if (!to) { | ||
throw Error("Parameter 'to' is required"); | ||
} | ||
return callApi({ | ||
method: "GET", | ||
path: `/page/${pageId}/metrics`, | ||
body: { | ||
from, | ||
to, | ||
}, | ||
path: | ||
`/page/${pageId}/metrics?` + | ||
queryString.stringify({ | ||
from: from.toISOString(), | ||
to: to.toISOString(), | ||
}), | ||
explicitApiKeyParam: this.apiKey, | ||
@@ -279,0 +287,0 @@ }); |
@@ -65,2 +65,3 @@ "use strict"; | ||
var getNgrokTunnelPublicUrl_1 = require("./getNgrokTunnelPublicUrl"); | ||
var queryString = require("querystring"); | ||
var pollIntervalAdjustmentFactor = 1; | ||
@@ -302,9 +303,15 @@ var DebugBear = /** @class */ (function () { | ||
var from = _a.from, to = _a.to; | ||
if (!from) { | ||
throw Error("Parameter 'from' is required"); | ||
} | ||
if (!to) { | ||
throw Error("Parameter 'to' is required"); | ||
} | ||
return callApi_1.callApi({ | ||
method: "GET", | ||
path: "/page/" + pageId + "/metrics", | ||
body: { | ||
from: from, | ||
to: to, | ||
}, | ||
path: "/page/" + pageId + "/metrics?" + | ||
queryString.stringify({ | ||
from: from.toISOString(), | ||
to: to.toISOString(), | ||
}), | ||
explicitApiKeyParam: this.apiKey, | ||
@@ -311,0 +318,0 @@ }); |
{ | ||
"name": "debugbear", | ||
"version": "2.0.12", | ||
"version": "2.0.13", | ||
"description": "API/CLI for DebugBearAnalyze pages with DebugBear. Analyze pages on demand on demand or as part of your Continuous Integration process.", | ||
@@ -17,2 +17,3 @@ "main": "dist/index.js", | ||
"lodash": "^4.17.11", | ||
"query-string": "^6.13.1", | ||
"request": "^2.88.0", | ||
@@ -19,0 +20,0 @@ "request-promise": "^4.2.2" |
64854
1816
7
+ Addedquery-string@^6.13.1
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addedfilter-obj@1.1.0(transitive)
+ Addedquery-string@6.14.1(transitive)
+ Addedsplit-on-first@1.1.0(transitive)
+ Addedstrict-uri-encode@2.0.0(transitive)