debugbear
Advanced tools
Comparing version 2.0.15 to 2.0.16
@@ -39,3 +39,3 @@ import { callApi } from "./callApi"; | ||
let timeWaited = 0; | ||
const interval = 5000 * pollIntervalAdjustmentFactor; | ||
let interval = 10000 * pollIntervalAdjustmentFactor; | ||
@@ -46,2 +46,5 @@ let resp; | ||
timeWaited += interval; | ||
if (timeWaited > 5 * 60 * 1000) { | ||
interval = 60000 * pollIntervalAdjustmentFactor; | ||
} | ||
resp = await callApi({ | ||
@@ -53,3 +56,3 @@ method: "GET", | ||
({ hasFinished } = resp); | ||
if (timeWaited > 15 * 60 * 1000) { | ||
if (timeWaited > 30 * 60 * 1000) { | ||
throw Error("Waiting for result timed out"); | ||
@@ -91,2 +94,3 @@ } | ||
region?: ServerRegion; | ||
tags?: string[]; | ||
} | ||
@@ -105,2 +109,3 @@ | ||
url: string; | ||
tags: []; | ||
device: { | ||
@@ -130,2 +135,12 @@ id: string; | ||
async get(projectId: string) { | ||
const project = await callApi({ | ||
method: "GET", | ||
path: "/projects/" + projectId, | ||
explicitApiKeyParam: this.apiKey, | ||
}); | ||
return new ProjectObject(this._apiClient, project); | ||
} | ||
async list() { | ||
@@ -132,0 +147,0 @@ const res = await callApi({ |
@@ -29,2 +29,3 @@ import { AnalysisResultObject } from "./ResponseTypes"; | ||
region?: ServerRegion; | ||
tags?: string[]; | ||
} | ||
@@ -41,2 +42,3 @@ interface GetMetricsOptions { | ||
url: string; | ||
tags: []; | ||
device: { | ||
@@ -55,2 +57,3 @@ id: string; | ||
constructor(apiKey: string, _apiClient: DebugBear); | ||
get(projectId: string): Promise<ProjectObject>; | ||
list(): Promise<any>; | ||
@@ -57,0 +60,0 @@ create({ name }: { |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -100,3 +100,3 @@ }; | ||
timeWaited = 0; | ||
interval = 5000 * pollIntervalAdjustmentFactor; | ||
interval = 10000 * pollIntervalAdjustmentFactor; | ||
_a.label = 1; | ||
@@ -109,2 +109,5 @@ case 1: | ||
timeWaited += interval; | ||
if (timeWaited > 5 * 60 * 1000) { | ||
interval = 60000 * pollIntervalAdjustmentFactor; | ||
} | ||
return [4 /*yield*/, callApi_1.callApi({ | ||
@@ -118,3 +121,3 @@ method: "GET", | ||
(hasFinished = resp.hasFinished); | ||
if (timeWaited > 15 * 60 * 1000) { | ||
if (timeWaited > 30 * 60 * 1000) { | ||
throw Error("Waiting for result timed out"); | ||
@@ -155,2 +158,19 @@ } | ||
} | ||
ProjectsApiClient.prototype.get = function (projectId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var project; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, callApi_1.callApi({ | ||
method: "GET", | ||
path: "/projects/" + projectId, | ||
explicitApiKeyParam: this.apiKey, | ||
})]; | ||
case 1: | ||
project = _a.sent(); | ||
return [2 /*return*/, new ProjectObject(this._apiClient, project)]; | ||
} | ||
}); | ||
}); | ||
}; | ||
ProjectsApiClient.prototype.list = function () { | ||
@@ -209,5 +229,5 @@ return __awaiter(this, void 0, void 0, function () { | ||
ProjectsApiClient.prototype.getPageMetrics = function (projectId, _a) { | ||
var before = (_a === void 0 ? {} : _a).before; | ||
var _b = _a === void 0 ? {} : _a, before = _b.before; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_b) { | ||
return __generator(this, function (_c) { | ||
return [2 /*return*/, callApi_1.callApi({ | ||
@@ -214,0 +234,0 @@ method: "get", |
@@ -7,3 +7,3 @@ "use strict"; | ||
function inferBuildInfo(_a) { | ||
var baseBranch = (_a === void 0 ? {} : _a).baseBranch; | ||
var _b = _a === void 0 ? {} : _a, baseBranch = _b.baseBranch; | ||
var ciEnv = envCi(); | ||
@@ -10,0 +10,0 @@ var repoName, repoOwner, commitHash, commitBranch, buildTitle; |
@@ -72,3 +72,3 @@ "use strict"; | ||
}) | ||
.option("--userFlowReplacement <replacement>", "string to be replaced in user flow, name and value separated by a colon", function collect(value, previous) { | ||
.option("--userFlowReplacement <replacement>", "string to be replaced in user/setup flow, name and value separated by a colon", function collect(value, previous) { | ||
var _a; | ||
@@ -75,0 +75,0 @@ var parts = value.split(":"); |
{ | ||
"name": "debugbear", | ||
"version": "2.0.15", | ||
"version": "2.0.16", | ||
"description": "Use DebugBear to test web performance as part of your Continuous Integration process.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -44,3 +44,3 @@ import * as commander from "commander"; | ||
"--userFlowReplacement <replacement>", | ||
"string to be replaced in user flow, name and value separated by a colon", | ||
"string to be replaced in user/setup flow, name and value separated by a colon", | ||
function collect(value, previous) { | ||
@@ -47,0 +47,0 @@ const parts = value.split(":"); |
68484
1911