@honeybadger-io/js 6.7.1 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/browser/honeybadger.js +2 -2
- package/dist/browser/honeybadger.min.js +1 -1
- package/dist/server/check-ins-manager/check-in.d.ts +7 -4
- package/dist/server/check-ins-manager/client.d.ts +6 -8
- package/dist/server/check-ins-manager/types.d.ts +5 -8
- package/dist/server/check-ins-sync-exec.js +136 -123
- package/dist/server/check-ins-sync-exec.js.map +1 -1
- package/dist/server/honeybadger.d.ts +4 -2
- package/dist/server/honeybadger.js +121 -101
- package/dist/server/honeybadger.js.map +1 -1
- package/dist/server/util.d.ts +1 -1
- package/package.json +4 -4
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var require$$0$2 = require('os');
|
|
4
4
|
var require$$1$1 = require('domain');
|
|
5
5
|
var require$$1 = require('fs');
|
|
6
|
-
var require$$2 = require('
|
|
7
|
-
var require$$3 = require('
|
|
6
|
+
var require$$2 = require('path');
|
|
7
|
+
var require$$3 = require('util');
|
|
8
8
|
var require$$0$3 = require('url');
|
|
9
9
|
var require$$3$1 = require('http');
|
|
10
10
|
var require$$4 = require('https');
|
|
@@ -1105,7 +1105,7 @@ var Client = /** @class */ (function () {
|
|
|
1105
1105
|
this.__notifier = {
|
|
1106
1106
|
name: '@honeybadger-io/core',
|
|
1107
1107
|
url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/core',
|
|
1108
|
-
version: '6.
|
|
1108
|
+
version: '6.8.0'
|
|
1109
1109
|
};
|
|
1110
1110
|
this.config = __assign$1(__assign$1({}, defaults_1.CONFIG), opts);
|
|
1111
1111
|
this.__initStore();
|
|
@@ -1551,8 +1551,8 @@ Object.defineProperty(util, "__esModule", { value: true });
|
|
|
1551
1551
|
util.readConfigFromFileSystem = util.getSourceFile = util.getStats = util.fatallyLogAndExit = void 0;
|
|
1552
1552
|
var os_1 = __importDefault$3(require$$0__default["default"]);
|
|
1553
1553
|
var fs_1 = __importDefault$3(require$$1__default["default"]);
|
|
1554
|
-
var
|
|
1555
|
-
var
|
|
1554
|
+
var path_1 = __importDefault$3(require$$2__default["default"]);
|
|
1555
|
+
var util_1$3 = require$$3__default["default"];
|
|
1556
1556
|
var readFile = (0, util_1$3.promisify)(fs_1.default.readFile);
|
|
1557
1557
|
function fatallyLogAndExit(err) {
|
|
1558
1558
|
console.error('[Honeybadger] Exiting process due to uncaught exception');
|
|
@@ -1639,21 +1639,18 @@ function getSourceFile(path) {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
util.getSourceFile = getSourceFile;
|
|
1641
1641
|
function readConfigFromFileSystem() {
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
return (_a = result === null || result === void 0 ? void 0 : result.config) !== null && _a !== void 0 ? _a : null;
|
|
1651
|
-
}
|
|
1652
|
-
catch (e) {
|
|
1653
|
-
console.debug("[Honeybadger] Could not read config for module ".concat(moduleName, ": ").concat(e.message));
|
|
1654
|
-
return null;
|
|
1642
|
+
var options = ['honeybadger.config.js', 'honeybadger.config.ts'];
|
|
1643
|
+
var config = null;
|
|
1644
|
+
while (config === null && options.length > 0) {
|
|
1645
|
+
var configPath = options.shift();
|
|
1646
|
+
try {
|
|
1647
|
+
config = require(path_1.default.join(process.cwd(), configPath));
|
|
1648
|
+
}
|
|
1649
|
+
catch (_e) { /* empty */ }
|
|
1655
1650
|
}
|
|
1651
|
+
return config;
|
|
1656
1652
|
}
|
|
1653
|
+
util.readConfigFromFileSystem = readConfigFromFileSystem;
|
|
1657
1654
|
|
|
1658
1655
|
var uncaught_exception_plugin = {};
|
|
1659
1656
|
|
|
@@ -2234,7 +2231,6 @@ var CheckIn = /** @class */ (function () {
|
|
|
2234
2231
|
this.gracePeriod = props.gracePeriod;
|
|
2235
2232
|
this.cronSchedule = props.cronSchedule;
|
|
2236
2233
|
this.cronTimezone = props.cronTimezone;
|
|
2237
|
-
this.projectId = props.projectId;
|
|
2238
2234
|
this.deleted = false;
|
|
2239
2235
|
}
|
|
2240
2236
|
CheckIn.prototype.isDeleted = function () {
|
|
@@ -2244,39 +2240,36 @@ var CheckIn = /** @class */ (function () {
|
|
|
2244
2240
|
this.deleted = true;
|
|
2245
2241
|
};
|
|
2246
2242
|
CheckIn.prototype.validate = function () {
|
|
2247
|
-
if (!this.
|
|
2248
|
-
throw new Error('
|
|
2249
|
-
}
|
|
2250
|
-
if (!this.name) {
|
|
2251
|
-
throw new Error('name is required for each check-in');
|
|
2243
|
+
if (!this.slug) {
|
|
2244
|
+
throw new Error('slug is required for each check-in');
|
|
2252
2245
|
}
|
|
2253
2246
|
if (!this.scheduleType) {
|
|
2254
2247
|
throw new Error('scheduleType is required for each check-in');
|
|
2255
2248
|
}
|
|
2256
2249
|
if (!['simple', 'cron'].includes(this.scheduleType)) {
|
|
2257
|
-
throw new Error("".concat(this.
|
|
2250
|
+
throw new Error("".concat(this.slug, " [scheduleType] must be \"simple\" or \"cron\""));
|
|
2258
2251
|
}
|
|
2259
2252
|
if (this.scheduleType === 'simple' && !this.reportPeriod) {
|
|
2260
|
-
throw new Error("".concat(this.
|
|
2253
|
+
throw new Error("".concat(this.slug, " [reportPeriod] is required for simple check-ins"));
|
|
2261
2254
|
}
|
|
2262
2255
|
if (this.scheduleType === 'cron' && !this.cronSchedule) {
|
|
2263
|
-
throw new Error("".concat(this.
|
|
2256
|
+
throw new Error("".concat(this.slug, " [cronSchedule] is required for cron check-ins"));
|
|
2264
2257
|
}
|
|
2265
2258
|
};
|
|
2266
2259
|
CheckIn.prototype.asRequestPayload = function () {
|
|
2267
|
-
var _a, _b
|
|
2260
|
+
var _a, _b;
|
|
2268
2261
|
var payload = {
|
|
2269
2262
|
name: this.name,
|
|
2270
2263
|
schedule_type: this.scheduleType,
|
|
2271
|
-
slug:
|
|
2272
|
-
grace_period: (
|
|
2264
|
+
slug: this.slug,
|
|
2265
|
+
grace_period: (_a = this.gracePeriod) !== null && _a !== void 0 ? _a : '' // default is empty string
|
|
2273
2266
|
};
|
|
2274
2267
|
if (this.scheduleType === 'simple') {
|
|
2275
2268
|
payload.report_period = this.reportPeriod;
|
|
2276
2269
|
}
|
|
2277
2270
|
else {
|
|
2278
2271
|
payload.cron_schedule = this.cronSchedule;
|
|
2279
|
-
payload.cron_timezone = (
|
|
2272
|
+
payload.cron_timezone = (_b = this.cronTimezone) !== null && _b !== void 0 ? _b : ''; // default is empty string
|
|
2280
2273
|
}
|
|
2281
2274
|
return payload;
|
|
2282
2275
|
};
|
|
@@ -2284,21 +2277,25 @@ var CheckIn = /** @class */ (function () {
|
|
|
2284
2277
|
* Compares two check-ins, usually the one from the API and the one from the config file.
|
|
2285
2278
|
* If the one in the config file does not match the check-in from the API,
|
|
2286
2279
|
* then we issue an update request.
|
|
2280
|
+
*
|
|
2281
|
+
* `name`, `gracePeriod` and `cronTimezone` are optional fields that are automatically
|
|
2282
|
+
* set to a value from the server if one is not provided,
|
|
2283
|
+
* so we ignore their values if they are not set locally.
|
|
2287
2284
|
*/
|
|
2288
2285
|
CheckIn.prototype.isInSync = function (other) {
|
|
2289
|
-
var
|
|
2290
|
-
|
|
2291
|
-
|
|
2286
|
+
var ignoreNameCheck = this.name === undefined;
|
|
2287
|
+
var ignoreGracePeriodCheck = this.gracePeriod === undefined;
|
|
2288
|
+
var ignoreCronTimezoneCheck = this.cronTimezone === undefined;
|
|
2289
|
+
return this.slug === other.slug
|
|
2292
2290
|
&& this.scheduleType === other.scheduleType
|
|
2293
2291
|
&& this.reportPeriod === other.reportPeriod
|
|
2294
2292
|
&& this.cronSchedule === other.cronSchedule
|
|
2295
|
-
&& (
|
|
2296
|
-
&& (
|
|
2297
|
-
&& (
|
|
2293
|
+
&& (ignoreNameCheck || this.name === other.name)
|
|
2294
|
+
&& (ignoreGracePeriodCheck || this.gracePeriod === other.gracePeriod)
|
|
2295
|
+
&& (ignoreCronTimezoneCheck || this.cronTimezone === other.cronTimezone);
|
|
2298
2296
|
};
|
|
2299
|
-
CheckIn.fromResponsePayload = function (
|
|
2297
|
+
CheckIn.fromResponsePayload = function (payload) {
|
|
2300
2298
|
return new CheckIn({
|
|
2301
|
-
projectId: projectId,
|
|
2302
2299
|
id: payload.id,
|
|
2303
2300
|
name: payload.name,
|
|
2304
2301
|
slug: payload.slug,
|
|
@@ -2358,17 +2355,40 @@ var CheckInsClient = /** @class */ (function () {
|
|
|
2358
2355
|
this.transport = transport;
|
|
2359
2356
|
this.config = config;
|
|
2360
2357
|
this.logger = config.logger;
|
|
2361
|
-
this.cache = {};
|
|
2362
2358
|
}
|
|
2359
|
+
CheckInsClient.prototype.getProjectId = function (projectApiKey) {
|
|
2360
|
+
var _a;
|
|
2361
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2362
|
+
var response, data;
|
|
2363
|
+
return __generator(this, function (_b) {
|
|
2364
|
+
switch (_b.label) {
|
|
2365
|
+
case 0:
|
|
2366
|
+
if (!this.config.personalAuthToken || this.config.personalAuthToken === '') {
|
|
2367
|
+
throw new Error('personalAuthToken is required');
|
|
2368
|
+
}
|
|
2369
|
+
return [4 /*yield*/, this.transport.send({
|
|
2370
|
+
method: 'GET',
|
|
2371
|
+
headers: this.getHeaders(),
|
|
2372
|
+
endpoint: "".concat(this.BASE_URL, "/v2/project_keys/").concat(projectApiKey),
|
|
2373
|
+
logger: this.logger,
|
|
2374
|
+
})];
|
|
2375
|
+
case 1:
|
|
2376
|
+
response = _b.sent();
|
|
2377
|
+
if (response.statusCode !== 200) {
|
|
2378
|
+
throw new Error("Failed to fetch project[".concat(projectApiKey, "]: ").concat(this.getErrorMessage(response.body)));
|
|
2379
|
+
}
|
|
2380
|
+
data = JSON.parse(response.body);
|
|
2381
|
+
return [2 /*return*/, (_a = data === null || data === void 0 ? void 0 : data.project) === null || _a === void 0 ? void 0 : _a.id];
|
|
2382
|
+
}
|
|
2383
|
+
});
|
|
2384
|
+
});
|
|
2385
|
+
};
|
|
2363
2386
|
CheckInsClient.prototype.listForProject = function (projectId) {
|
|
2364
2387
|
return __awaiter(this, void 0, void 0, function () {
|
|
2365
|
-
var response, data
|
|
2388
|
+
var response, data;
|
|
2366
2389
|
return __generator(this, function (_a) {
|
|
2367
2390
|
switch (_a.label) {
|
|
2368
2391
|
case 0:
|
|
2369
|
-
if (this.cache[projectId]) {
|
|
2370
|
-
return [2 /*return*/, this.cache[projectId]];
|
|
2371
|
-
}
|
|
2372
2392
|
if (!this.config.personalAuthToken || this.config.personalAuthToken === '') {
|
|
2373
2393
|
throw new Error('personalAuthToken is required');
|
|
2374
2394
|
}
|
|
@@ -2384,16 +2404,14 @@ var CheckInsClient = /** @class */ (function () {
|
|
|
2384
2404
|
throw new Error("Failed to fetch checkins for project[".concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
|
|
2385
2405
|
}
|
|
2386
2406
|
data = JSON.parse(response.body);
|
|
2387
|
-
|
|
2388
|
-
this.cache[projectId] = checkIns;
|
|
2389
|
-
return [2 /*return*/, checkIns];
|
|
2407
|
+
return [2 /*return*/, data.results.map(function (checkin) { return check_in_1.CheckIn.fromResponsePayload(checkin); })];
|
|
2390
2408
|
}
|
|
2391
2409
|
});
|
|
2392
2410
|
});
|
|
2393
2411
|
};
|
|
2394
2412
|
CheckInsClient.prototype.get = function (projectId, checkInId) {
|
|
2395
2413
|
return __awaiter(this, void 0, void 0, function () {
|
|
2396
|
-
var response, data
|
|
2414
|
+
var response, data;
|
|
2397
2415
|
return __generator(this, function (_a) {
|
|
2398
2416
|
switch (_a.label) {
|
|
2399
2417
|
case 0:
|
|
@@ -2412,16 +2430,14 @@ var CheckInsClient = /** @class */ (function () {
|
|
|
2412
2430
|
throw new Error("Failed to fetch check-in[".concat(checkInId, "] for project[").concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
|
|
2413
2431
|
}
|
|
2414
2432
|
data = JSON.parse(response.body);
|
|
2415
|
-
|
|
2416
|
-
checkIn.projectId = projectId;
|
|
2417
|
-
return [2 /*return*/, checkIn];
|
|
2433
|
+
return [2 /*return*/, check_in_1.CheckIn.fromResponsePayload(data)];
|
|
2418
2434
|
}
|
|
2419
2435
|
});
|
|
2420
2436
|
});
|
|
2421
2437
|
};
|
|
2422
|
-
CheckInsClient.prototype.create = function (checkIn) {
|
|
2438
|
+
CheckInsClient.prototype.create = function (projectId, checkIn) {
|
|
2423
2439
|
return __awaiter(this, void 0, void 0, function () {
|
|
2424
|
-
var response, data
|
|
2440
|
+
var response, data;
|
|
2425
2441
|
return __generator(this, function (_a) {
|
|
2426
2442
|
switch (_a.label) {
|
|
2427
2443
|
case 0:
|
|
@@ -2431,23 +2447,21 @@ var CheckInsClient = /** @class */ (function () {
|
|
|
2431
2447
|
return [4 /*yield*/, this.transport.send({
|
|
2432
2448
|
method: 'POST',
|
|
2433
2449
|
headers: this.getHeaders(),
|
|
2434
|
-
endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(
|
|
2450
|
+
endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(projectId, "/check_ins"),
|
|
2435
2451
|
logger: this.logger,
|
|
2436
2452
|
}, { check_in: checkIn.asRequestPayload() })];
|
|
2437
2453
|
case 1:
|
|
2438
2454
|
response = _a.sent();
|
|
2439
2455
|
if (response.statusCode !== 201) {
|
|
2440
|
-
throw new Error("Failed to create check-in[".concat(checkIn.
|
|
2456
|
+
throw new Error("Failed to create check-in[".concat(checkIn.slug, "] for project[").concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
|
|
2441
2457
|
}
|
|
2442
2458
|
data = JSON.parse(response.body);
|
|
2443
|
-
|
|
2444
|
-
result.projectId = checkIn.projectId;
|
|
2445
|
-
return [2 /*return*/, result];
|
|
2459
|
+
return [2 /*return*/, check_in_1.CheckIn.fromResponsePayload(data)];
|
|
2446
2460
|
}
|
|
2447
2461
|
});
|
|
2448
2462
|
});
|
|
2449
2463
|
};
|
|
2450
|
-
CheckInsClient.prototype.update = function (checkIn) {
|
|
2464
|
+
CheckInsClient.prototype.update = function (projectId, checkIn) {
|
|
2451
2465
|
return __awaiter(this, void 0, void 0, function () {
|
|
2452
2466
|
var response;
|
|
2453
2467
|
return __generator(this, function (_a) {
|
|
@@ -2459,20 +2473,20 @@ var CheckInsClient = /** @class */ (function () {
|
|
|
2459
2473
|
return [4 /*yield*/, this.transport.send({
|
|
2460
2474
|
method: 'PUT',
|
|
2461
2475
|
headers: this.getHeaders(),
|
|
2462
|
-
endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(
|
|
2476
|
+
endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(projectId, "/check_ins/").concat(checkIn.id),
|
|
2463
2477
|
logger: this.logger,
|
|
2464
2478
|
}, { check_in: checkIn.asRequestPayload() })];
|
|
2465
2479
|
case 1:
|
|
2466
2480
|
response = _a.sent();
|
|
2467
2481
|
if (response.statusCode !== 204) {
|
|
2468
|
-
throw new Error("Failed to update checkin[".concat(checkIn.
|
|
2482
|
+
throw new Error("Failed to update checkin[".concat(checkIn.slug, "] for project[").concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
|
|
2469
2483
|
}
|
|
2470
2484
|
return [2 /*return*/, checkIn];
|
|
2471
2485
|
}
|
|
2472
2486
|
});
|
|
2473
2487
|
});
|
|
2474
2488
|
};
|
|
2475
|
-
CheckInsClient.prototype.remove = function (checkIn) {
|
|
2489
|
+
CheckInsClient.prototype.remove = function (projectId, checkIn) {
|
|
2476
2490
|
return __awaiter(this, void 0, void 0, function () {
|
|
2477
2491
|
var response;
|
|
2478
2492
|
return __generator(this, function (_a) {
|
|
@@ -2484,13 +2498,13 @@ var CheckInsClient = /** @class */ (function () {
|
|
|
2484
2498
|
return [4 /*yield*/, this.transport.send({
|
|
2485
2499
|
method: 'DELETE',
|
|
2486
2500
|
headers: this.getHeaders(),
|
|
2487
|
-
endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(
|
|
2501
|
+
endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(projectId, "/check_ins/").concat(checkIn.id),
|
|
2488
2502
|
logger: this.logger,
|
|
2489
2503
|
})];
|
|
2490
2504
|
case 1:
|
|
2491
2505
|
response = _a.sent();
|
|
2492
2506
|
if (response.statusCode !== 204) {
|
|
2493
|
-
throw new Error("Failed to remove checkin[".concat(checkIn.
|
|
2507
|
+
throw new Error("Failed to remove checkin[".concat(checkIn.slug, "] for project[").concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
|
|
2494
2508
|
}
|
|
2495
2509
|
return [2 /*return*/];
|
|
2496
2510
|
}
|
|
@@ -2657,66 +2671,72 @@ client.CheckInsClient = CheckInsClient;
|
|
|
2657
2671
|
Honeybadger.prototype.showUserFeedbackForm = function () {
|
|
2658
2672
|
throw new Error('Honeybadger.showUserFeedbackForm() is not supported on the server-side');
|
|
2659
2673
|
};
|
|
2660
|
-
Honeybadger.prototype.checkIn = function (
|
|
2674
|
+
Honeybadger.prototype.checkIn = function (idOrSlug) {
|
|
2675
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2676
|
+
return __generator(this, function (_a) {
|
|
2677
|
+
if (this.isCheckInSlug(idOrSlug)) {
|
|
2678
|
+
return [2 /*return*/, this.checkInWithSlug(idOrSlug)];
|
|
2679
|
+
}
|
|
2680
|
+
return [2 /*return*/, this.checkInWithId(idOrSlug)];
|
|
2681
|
+
});
|
|
2682
|
+
});
|
|
2683
|
+
};
|
|
2684
|
+
Honeybadger.prototype.checkInWithSlug = function (slug) {
|
|
2661
2685
|
return __awaiter(this, void 0, void 0, function () {
|
|
2662
|
-
var
|
|
2686
|
+
var err_1;
|
|
2663
2687
|
return __generator(this, function (_a) {
|
|
2664
2688
|
switch (_a.label) {
|
|
2665
2689
|
case 0:
|
|
2666
|
-
_a.trys.push([0,
|
|
2667
|
-
return [4 /*yield*/, this.getCheckInId(idOrName)];
|
|
2668
|
-
case 1:
|
|
2669
|
-
id = _a.sent();
|
|
2690
|
+
_a.trys.push([0, 2, , 3]);
|
|
2670
2691
|
return [4 /*yield*/, this.__transport
|
|
2671
2692
|
.send({
|
|
2672
2693
|
method: 'GET',
|
|
2673
|
-
endpoint: endpoint(this.config.endpoint, "v1/check_in/".concat(
|
|
2694
|
+
endpoint: endpoint(this.config.endpoint, "v1/check_in/".concat(this.config.apiKey, "/").concat(slug)),
|
|
2674
2695
|
logger: this.logger,
|
|
2675
2696
|
})];
|
|
2676
|
-
case
|
|
2697
|
+
case 1:
|
|
2677
2698
|
_a.sent();
|
|
2678
|
-
this.logger.info(
|
|
2679
|
-
return [3 /*break*/,
|
|
2680
|
-
case
|
|
2699
|
+
this.logger.info("Check-In with slug[".concat(slug, "] sent"));
|
|
2700
|
+
return [3 /*break*/, 3];
|
|
2701
|
+
case 2:
|
|
2681
2702
|
err_1 = _a.sent();
|
|
2682
|
-
this.logger.error("CheckIn[".concat(
|
|
2683
|
-
return [3 /*break*/,
|
|
2684
|
-
case
|
|
2703
|
+
this.logger.error("CheckIn with slug[".concat(slug, "] failed: an unknown error occurred."), "message=".concat(err_1.message));
|
|
2704
|
+
return [3 /*break*/, 3];
|
|
2705
|
+
case 3: return [2 /*return*/];
|
|
2685
2706
|
}
|
|
2686
2707
|
});
|
|
2687
2708
|
});
|
|
2688
2709
|
};
|
|
2689
|
-
Honeybadger.prototype.
|
|
2710
|
+
Honeybadger.prototype.checkInWithId = function (id) {
|
|
2690
2711
|
return __awaiter(this, void 0, void 0, function () {
|
|
2691
|
-
var
|
|
2712
|
+
var err_2;
|
|
2692
2713
|
return __generator(this, function (_a) {
|
|
2693
2714
|
switch (_a.label) {
|
|
2694
2715
|
case 0:
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
if (localCheckIn.id) {
|
|
2703
|
-
return [2 /*return*/, localCheckIn.id];
|
|
2704
|
-
}
|
|
2705
|
-
return [4 /*yield*/, this.__checkInsClient.listForProject(localCheckIn.projectId)];
|
|
2716
|
+
_a.trys.push([0, 2, , 3]);
|
|
2717
|
+
return [4 /*yield*/, this.__transport
|
|
2718
|
+
.send({
|
|
2719
|
+
method: 'GET',
|
|
2720
|
+
endpoint: endpoint(this.config.endpoint, "v1/check_in/".concat(id)),
|
|
2721
|
+
logger: this.logger,
|
|
2722
|
+
})];
|
|
2706
2723
|
case 1:
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
return [2 /*return*/, localCheckIn.id];
|
|
2724
|
+
_a.sent();
|
|
2725
|
+
this.logger.info("Check-In with id[".concat(id, "] sent"));
|
|
2726
|
+
return [3 /*break*/, 3];
|
|
2727
|
+
case 2:
|
|
2728
|
+
err_2 = _a.sent();
|
|
2729
|
+
this.logger.error("Check-In with id[".concat(id, "] failed: an unknown error occurred."), "message=".concat(err_2.message));
|
|
2730
|
+
return [3 /*break*/, 3];
|
|
2731
|
+
case 3: return [2 /*return*/];
|
|
2716
2732
|
}
|
|
2717
2733
|
});
|
|
2718
2734
|
});
|
|
2719
2735
|
};
|
|
2736
|
+
Honeybadger.prototype.isCheckInSlug = function (idOrSlug) {
|
|
2737
|
+
var _a, _b;
|
|
2738
|
+
return (_b = (_a = this.config.checkins) === null || _a === void 0 ? void 0 : _a.some(function (c) { return c.slug === idOrSlug; })) !== null && _b !== void 0 ? _b : false;
|
|
2739
|
+
};
|
|
2720
2740
|
// This method is intended for web frameworks.
|
|
2721
2741
|
// It allows us to track context for individual requests without leaking to other requests
|
|
2722
2742
|
// by doing two things:
|
|
@@ -2749,7 +2769,7 @@ client.CheckInsClient = CheckInsClient;
|
|
|
2749
2769
|
var NOTIFIER = {
|
|
2750
2770
|
name: '@honeybadger-io/js',
|
|
2751
2771
|
url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/js',
|
|
2752
|
-
version: '6.
|
|
2772
|
+
version: '6.8.0'
|
|
2753
2773
|
};
|
|
2754
2774
|
var userAgent = function () {
|
|
2755
2775
|
return "Honeybadger JS Server Client ".concat(NOTIFIER.version, ", ").concat(os_1.default.version(), "; ").concat(os_1.default.platform());
|