@honeybadger-io/js 6.6.0 → 6.7.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.
@@ -25,9 +25,9 @@ var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);
25
25
 
26
26
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
27
27
 
28
- var checkinsSyncExec = {};
28
+ var checkInsSyncExec = {};
29
29
 
30
- var checkinsSync = {};
30
+ var checkInsSync = {};
31
31
 
32
32
  var util = {};
33
33
 
@@ -178,16 +178,16 @@ function readConfigForModule(moduleName) {
178
178
  }
179
179
  }
180
180
 
181
- var checkinsManager = {};
181
+ var checkInsManager = {};
182
182
 
183
183
  var client = {};
184
184
 
185
- var checkin = {};
185
+ var checkIn = {};
186
186
 
187
- Object.defineProperty(checkin, "__esModule", { value: true });
188
- checkin.Checkin = void 0;
189
- var Checkin = /** @class */ (function () {
190
- function Checkin(props) {
187
+ Object.defineProperty(checkIn, "__esModule", { value: true });
188
+ checkIn.CheckIn = void 0;
189
+ var CheckIn = /** @class */ (function () {
190
+ function CheckIn(props) {
191
191
  this.id = props.id;
192
192
  this.name = props.name;
193
193
  this.slug = props.slug;
@@ -199,33 +199,33 @@ var Checkin = /** @class */ (function () {
199
199
  this.projectId = props.projectId;
200
200
  this.deleted = false;
201
201
  }
202
- Checkin.prototype.isDeleted = function () {
202
+ CheckIn.prototype.isDeleted = function () {
203
203
  return this.deleted;
204
204
  };
205
- Checkin.prototype.markAsDeleted = function () {
205
+ CheckIn.prototype.markAsDeleted = function () {
206
206
  this.deleted = true;
207
207
  };
208
- Checkin.prototype.validate = function () {
208
+ CheckIn.prototype.validate = function () {
209
209
  if (!this.projectId) {
210
- throw new Error('projectId is required for each checkin');
210
+ throw new Error('projectId is required for each check-in');
211
211
  }
212
212
  if (!this.name) {
213
- throw new Error('name is required for each checkin');
213
+ throw new Error('name is required for each check-in');
214
214
  }
215
215
  if (!this.scheduleType) {
216
- throw new Error('scheduleType is required for each checkin');
216
+ throw new Error('scheduleType is required for each check-in');
217
217
  }
218
218
  if (!['simple', 'cron'].includes(this.scheduleType)) {
219
219
  throw new Error("".concat(this.name, " [scheduleType] must be \"simple\" or \"cron\""));
220
220
  }
221
221
  if (this.scheduleType === 'simple' && !this.reportPeriod) {
222
- throw new Error("".concat(this.name, " [reportPeriod] is required for simple checkins"));
222
+ throw new Error("".concat(this.name, " [reportPeriod] is required for simple check-ins"));
223
223
  }
224
224
  if (this.scheduleType === 'cron' && !this.cronSchedule) {
225
- throw new Error("".concat(this.name, " [cronSchedule] is required for cron checkins"));
225
+ throw new Error("".concat(this.name, " [cronSchedule] is required for cron check-ins"));
226
226
  }
227
227
  };
228
- Checkin.prototype.asRequestPayload = function () {
228
+ CheckIn.prototype.asRequestPayload = function () {
229
229
  var _a, _b, _c;
230
230
  var payload = {
231
231
  name: this.name,
@@ -243,11 +243,11 @@ var Checkin = /** @class */ (function () {
243
243
  return payload;
244
244
  };
245
245
  /**
246
- * Compares two checkins, usually the one from the API and the one from the config file.
247
- * If the one in the config file does not match the checkin from the API,
246
+ * Compares two check-ins, usually the one from the API and the one from the config file.
247
+ * If the one in the config file does not match the check-in from the API,
248
248
  * then we issue an update request.
249
249
  */
250
- Checkin.prototype.isInSync = function (other) {
250
+ CheckIn.prototype.isInSync = function (other) {
251
251
  var _a, _b, _c, _d, _e, _f;
252
252
  return this.name === other.name
253
253
  && this.projectId === other.projectId
@@ -258,8 +258,8 @@ var Checkin = /** @class */ (function () {
258
258
  && ((_c = this.gracePeriod) !== null && _c !== void 0 ? _c : '') === ((_d = other.gracePeriod) !== null && _d !== void 0 ? _d : '')
259
259
  && ((_e = this.cronTimezone) !== null && _e !== void 0 ? _e : '') === ((_f = other.cronTimezone) !== null && _f !== void 0 ? _f : '');
260
260
  };
261
- Checkin.fromResponsePayload = function (projectId, payload) {
262
- return new Checkin({
261
+ CheckIn.fromResponsePayload = function (projectId, payload) {
262
+ return new CheckIn({
263
263
  projectId: projectId,
264
264
  id: payload.id,
265
265
  name: payload.name,
@@ -271,9 +271,9 @@ var Checkin = /** @class */ (function () {
271
271
  cronTimezone: payload.cron_timezone,
272
272
  });
273
273
  };
274
- return Checkin;
274
+ return CheckIn;
275
275
  }());
276
- checkin.Checkin = Checkin;
276
+ checkIn.CheckIn = CheckIn;
277
277
 
278
278
  var __awaiter$2 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
279
279
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -312,19 +312,19 @@ var __generator$2 = (commonjsGlobal && commonjsGlobal.__generator) || function (
312
312
  }
313
313
  };
314
314
  Object.defineProperty(client, "__esModule", { value: true });
315
- client.CheckinsClient = void 0;
316
- var checkin_1$1 = checkin;
317
- var CheckinsClient = /** @class */ (function () {
318
- function CheckinsClient(config, transport) {
315
+ client.CheckInsClient = void 0;
316
+ var check_in_1$1 = checkIn;
317
+ var CheckInsClient = /** @class */ (function () {
318
+ function CheckInsClient(config, transport) {
319
319
  this.BASE_URL = 'https://app.honeybadger.io';
320
320
  this.transport = transport;
321
321
  this.config = config;
322
322
  this.logger = config.logger;
323
323
  this.cache = {};
324
324
  }
325
- CheckinsClient.prototype.listForProject = function (projectId) {
325
+ CheckInsClient.prototype.listForProject = function (projectId) {
326
326
  return __awaiter$2(this, void 0, void 0, function () {
327
- var response, data, checkins;
327
+ var response, data, checkIns;
328
328
  return __generator$2(this, function (_a) {
329
329
  switch (_a.label) {
330
330
  case 0:
@@ -346,16 +346,16 @@ var CheckinsClient = /** @class */ (function () {
346
346
  throw new Error("Failed to fetch checkins for project[".concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
347
347
  }
348
348
  data = JSON.parse(response.body);
349
- checkins = data.results.map(function (checkin) { return checkin_1$1.Checkin.fromResponsePayload(projectId, checkin); });
350
- this.cache[projectId] = checkins;
351
- return [2 /*return*/, checkins];
349
+ checkIns = data.results.map(function (checkin) { return check_in_1$1.CheckIn.fromResponsePayload(projectId, checkin); });
350
+ this.cache[projectId] = checkIns;
351
+ return [2 /*return*/, checkIns];
352
352
  }
353
353
  });
354
354
  });
355
355
  };
356
- CheckinsClient.prototype.get = function (projectId, checkinId) {
356
+ CheckInsClient.prototype.get = function (projectId, checkInId) {
357
357
  return __awaiter$2(this, void 0, void 0, function () {
358
- var response, data, checkin;
358
+ var response, data, checkIn;
359
359
  return __generator$2(this, function (_a) {
360
360
  switch (_a.label) {
361
361
  case 0:
@@ -365,23 +365,23 @@ var CheckinsClient = /** @class */ (function () {
365
365
  return [4 /*yield*/, this.transport.send({
366
366
  method: 'GET',
367
367
  headers: this.getHeaders(),
368
- endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(projectId, "/check_ins/").concat(checkinId),
368
+ endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(projectId, "/check_ins/").concat(checkInId),
369
369
  logger: this.logger,
370
370
  })];
371
371
  case 1:
372
372
  response = _a.sent();
373
373
  if (response.statusCode !== 200) {
374
- throw new Error("Failed to fetch checkin[".concat(checkinId, "] for project[").concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
374
+ throw new Error("Failed to fetch check-in[".concat(checkInId, "] for project[").concat(projectId, "]: ").concat(this.getErrorMessage(response.body)));
375
375
  }
376
376
  data = JSON.parse(response.body);
377
- checkin = checkin_1$1.Checkin.fromResponsePayload(projectId, data);
378
- checkin.projectId = projectId;
379
- return [2 /*return*/, checkin];
377
+ checkIn = check_in_1$1.CheckIn.fromResponsePayload(projectId, data);
378
+ checkIn.projectId = projectId;
379
+ return [2 /*return*/, checkIn];
380
380
  }
381
381
  });
382
382
  });
383
383
  };
384
- CheckinsClient.prototype.create = function (checkin) {
384
+ CheckInsClient.prototype.create = function (checkIn) {
385
385
  return __awaiter$2(this, void 0, void 0, function () {
386
386
  var response, data, result;
387
387
  return __generator$2(this, function (_a) {
@@ -393,23 +393,23 @@ var CheckinsClient = /** @class */ (function () {
393
393
  return [4 /*yield*/, this.transport.send({
394
394
  method: 'POST',
395
395
  headers: this.getHeaders(),
396
- endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(checkin.projectId, "/check_ins"),
396
+ endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(checkIn.projectId, "/check_ins"),
397
397
  logger: this.logger,
398
- }, { check_in: checkin.asRequestPayload() })];
398
+ }, { check_in: checkIn.asRequestPayload() })];
399
399
  case 1:
400
400
  response = _a.sent();
401
401
  if (response.statusCode !== 201) {
402
- throw new Error("Failed to create checkin[".concat(checkin.name, "] for project[").concat(checkin.projectId, "]: ").concat(this.getErrorMessage(response.body)));
402
+ throw new Error("Failed to create check-in[".concat(checkIn.name, "] for project[").concat(checkIn.projectId, "]: ").concat(this.getErrorMessage(response.body)));
403
403
  }
404
404
  data = JSON.parse(response.body);
405
- result = checkin_1$1.Checkin.fromResponsePayload(checkin.projectId, data);
406
- result.projectId = checkin.projectId;
405
+ result = check_in_1$1.CheckIn.fromResponsePayload(checkIn.projectId, data);
406
+ result.projectId = checkIn.projectId;
407
407
  return [2 /*return*/, result];
408
408
  }
409
409
  });
410
410
  });
411
411
  };
412
- CheckinsClient.prototype.update = function (checkin) {
412
+ CheckInsClient.prototype.update = function (checkIn) {
413
413
  return __awaiter$2(this, void 0, void 0, function () {
414
414
  var response;
415
415
  return __generator$2(this, function (_a) {
@@ -421,20 +421,20 @@ var CheckinsClient = /** @class */ (function () {
421
421
  return [4 /*yield*/, this.transport.send({
422
422
  method: 'PUT',
423
423
  headers: this.getHeaders(),
424
- endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(checkin.projectId, "/check_ins/").concat(checkin.id),
424
+ endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(checkIn.projectId, "/check_ins/").concat(checkIn.id),
425
425
  logger: this.logger,
426
- }, { check_in: checkin.asRequestPayload() })];
426
+ }, { check_in: checkIn.asRequestPayload() })];
427
427
  case 1:
428
428
  response = _a.sent();
429
429
  if (response.statusCode !== 204) {
430
- throw new Error("Failed to update checkin[".concat(checkin.name, "] for project[").concat(checkin.projectId, "]: ").concat(this.getErrorMessage(response.body)));
430
+ throw new Error("Failed to update checkin[".concat(checkIn.name, "] for project[").concat(checkIn.projectId, "]: ").concat(this.getErrorMessage(response.body)));
431
431
  }
432
- return [2 /*return*/, checkin];
432
+ return [2 /*return*/, checkIn];
433
433
  }
434
434
  });
435
435
  });
436
436
  };
437
- CheckinsClient.prototype.remove = function (checkin) {
437
+ CheckInsClient.prototype.remove = function (checkIn) {
438
438
  return __awaiter$2(this, void 0, void 0, function () {
439
439
  var response;
440
440
  return __generator$2(this, function (_a) {
@@ -446,26 +446,26 @@ var CheckinsClient = /** @class */ (function () {
446
446
  return [4 /*yield*/, this.transport.send({
447
447
  method: 'DELETE',
448
448
  headers: this.getHeaders(),
449
- endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(checkin.projectId, "/check_ins/").concat(checkin.id),
449
+ endpoint: "".concat(this.BASE_URL, "/v2/projects/").concat(checkIn.projectId, "/check_ins/").concat(checkIn.id),
450
450
  logger: this.logger,
451
451
  })];
452
452
  case 1:
453
453
  response = _a.sent();
454
454
  if (response.statusCode !== 204) {
455
- throw new Error("Failed to remove checkin[".concat(checkin.name, "] for project[").concat(checkin.projectId, "]: ").concat(this.getErrorMessage(response.body)));
455
+ throw new Error("Failed to remove checkin[".concat(checkIn.name, "] for project[").concat(checkIn.projectId, "]: ").concat(this.getErrorMessage(response.body)));
456
456
  }
457
457
  return [2 /*return*/];
458
458
  }
459
459
  });
460
460
  });
461
461
  };
462
- CheckinsClient.prototype.getHeaders = function () {
462
+ CheckInsClient.prototype.getHeaders = function () {
463
463
  return {
464
464
  'Authorization': "Basic ".concat(Buffer.from("".concat(this.config.personalAuthToken, ":")).toString('base64')),
465
465
  'Content-Type': 'application/json'
466
466
  };
467
467
  };
468
- CheckinsClient.prototype.getErrorMessage = function (responseBody) {
468
+ CheckInsClient.prototype.getErrorMessage = function (responseBody) {
469
469
  var _a;
470
470
  if (!responseBody) {
471
471
  return '';
@@ -478,9 +478,9 @@ var CheckinsClient = /** @class */ (function () {
478
478
  return responseBody;
479
479
  }
480
480
  };
481
- return CheckinsClient;
481
+ return CheckInsClient;
482
482
  }());
483
- client.CheckinsClient = CheckinsClient;
483
+ client.CheckInsClient = CheckInsClient;
484
484
 
485
485
  var transport = {};
486
486
 
@@ -562,7 +562,8 @@ var ServerTransport = /** @class */ (function () {
562
562
  };
563
563
  var data = undefined;
564
564
  if (payload) {
565
- data = Buffer.from(JSON.stringify(sanitize(payload, options.maxObjectDepth)), 'utf8');
565
+ var dataStr = typeof payload === 'string' ? payload : JSON.stringify(sanitize(payload, options.maxObjectDepth));
566
+ data = Buffer.from(dataStr, 'utf8');
566
567
  httpOptions.headers['Content-Length'] = data.length;
567
568
  }
568
569
  var req = transport.request(httpOptions, function (res) {
@@ -640,14 +641,14 @@ var __spreadArray = (commonjsGlobal && commonjsGlobal.__spreadArray) || function
640
641
  }
641
642
  return to.concat(ar || Array.prototype.slice.call(from));
642
643
  };
643
- Object.defineProperty(checkinsManager, "__esModule", { value: true });
644
- checkinsManager.CheckinsManager = void 0;
644
+ Object.defineProperty(checkInsManager, "__esModule", { value: true });
645
+ checkInsManager.CheckInsManager = void 0;
645
646
  var core_1 = require$$0__default$1["default"];
646
647
  var client_1 = client;
647
648
  var transport_1 = transport;
648
- var checkin_1 = checkin;
649
- var CheckinsManager$1 = /** @class */ (function () {
650
- function CheckinsManager(config, client) {
649
+ var check_in_1 = checkIn;
650
+ var CheckInsManager$1 = /** @class */ (function () {
651
+ function CheckInsManager(config, client) {
651
652
  var _a, _b, _c, _d;
652
653
  this.config = {
653
654
  debug: (_a = config.debug) !== null && _a !== void 0 ? _a : false,
@@ -657,14 +658,14 @@ var CheckinsManager$1 = /** @class */ (function () {
657
658
  };
658
659
  var transport = new transport_1.ServerTransport();
659
660
  this.logger = core_1.Util.logger(this);
660
- this.client = client !== null && client !== void 0 ? client : new client_1.CheckinsClient({
661
+ this.client = client !== null && client !== void 0 ? client : new client_1.CheckInsClient({
661
662
  personalAuthToken: config.personalAuthToken,
662
663
  logger: this.logger
663
664
  }, transport);
664
665
  }
665
- CheckinsManager.prototype.sync = function () {
666
+ CheckInsManager.prototype.sync = function () {
666
667
  return __awaiter$1(this, void 0, void 0, function () {
667
- var localCheckins, createdOrUpdated, removed;
668
+ var localCheckIns, createdOrUpdated, removed;
668
669
  return __generator$1(this, function (_a) {
669
670
  switch (_a.label) {
670
671
  case 0:
@@ -672,11 +673,11 @@ var CheckinsManager$1 = /** @class */ (function () {
672
673
  if (!this.config.personalAuthToken || this.config.personalAuthToken === '') {
673
674
  throw new Error('personalAuthToken is required');
674
675
  }
675
- localCheckins = this.getLocalCheckins();
676
- return [4 /*yield*/, this.createOrUpdate(localCheckins)];
676
+ localCheckIns = this.getLocalCheckIns();
677
+ return [4 /*yield*/, this.createOrUpdate(localCheckIns)];
677
678
  case 1:
678
679
  createdOrUpdated = _a.sent();
679
- return [4 /*yield*/, this.remove(localCheckins)];
680
+ return [4 /*yield*/, this.remove(localCheckIns)];
680
681
  case 2:
681
682
  removed = _a.sent();
682
683
  return [2 /*return*/, __spreadArray(__spreadArray([], createdOrUpdated, true), removed, true)];
@@ -684,68 +685,68 @@ var CheckinsManager$1 = /** @class */ (function () {
684
685
  });
685
686
  });
686
687
  };
687
- CheckinsManager.prototype.getLocalCheckins = function () {
688
- // create checkins from configuration and validate them
689
- var localCheckins = this.config.checkins.map(function (dto) {
690
- var checkin = new checkin_1.Checkin(dto);
691
- checkin.validate();
692
- return checkin;
688
+ CheckInsManager.prototype.getLocalCheckIns = function () {
689
+ // create check-ins from configuration and validate them
690
+ var localCheckIns = this.config.checkins.map(function (dto) {
691
+ var checkIn = new check_in_1.CheckIn(dto);
692
+ checkIn.validate();
693
+ return checkIn;
693
694
  });
694
- // validate that we have unique checkin names
695
- // throw error if there are checkins with the same name and project id
696
- var checkinNames = localCheckins.map(function (checkin) { return "".concat(checkin.projectId, "_").concat(checkin.name); });
697
- var uniqueCheckinNames = new Set(checkinNames);
698
- if (checkinNames.length !== uniqueCheckinNames.size) {
695
+ // validate that we have unique check-in names
696
+ // throw error if there are check-ins with the same name and project id
697
+ var checkInNames = localCheckIns.map(function (checkIn) { return "".concat(checkIn.projectId, "_").concat(checkIn.name); });
698
+ var uniqueCheckInNames = new Set(checkInNames);
699
+ if (checkInNames.length !== uniqueCheckInNames.size) {
699
700
  throw new Error('check-in names must be unique per project');
700
701
  }
701
- return localCheckins;
702
+ return localCheckIns;
702
703
  };
703
- CheckinsManager.prototype.createOrUpdate = function (localCheckins) {
704
+ CheckInsManager.prototype.createOrUpdate = function (localCheckIns) {
704
705
  return __awaiter$1(this, void 0, void 0, function () {
705
- var results, _loop_1, this_1, _i, localCheckins_1, localCheckin;
706
+ var results, _loop_1, this_1, _i, localCheckIns_1, localCheckIn;
706
707
  return __generator$1(this, function (_a) {
707
708
  switch (_a.label) {
708
709
  case 0:
709
710
  results = [];
710
- _loop_1 = function (localCheckin) {
711
- var projectCheckins, remoteCheckin, _b, _c, _d, _e;
711
+ _loop_1 = function (localCheckIn) {
712
+ var projectCheckIns, remoteCheckIn, _b, _c, _d, _e;
712
713
  return __generator$1(this, function (_f) {
713
714
  switch (_f.label) {
714
- case 0: return [4 /*yield*/, this_1.client.listForProject(localCheckin.projectId)];
715
+ case 0: return [4 /*yield*/, this_1.client.listForProject(localCheckIn.projectId)];
715
716
  case 1:
716
- projectCheckins = _f.sent();
717
- remoteCheckin = projectCheckins.find(function (checkin) {
718
- return checkin.name === localCheckin.name;
717
+ projectCheckIns = _f.sent();
718
+ remoteCheckIn = projectCheckIns.find(function (checkIn) {
719
+ return checkIn.name === localCheckIn.name;
719
720
  });
720
- if (!!remoteCheckin) return [3 /*break*/, 3];
721
+ if (!!remoteCheckIn) return [3 /*break*/, 3];
721
722
  _c = (_b = results).push;
722
- return [4 /*yield*/, this_1.client.create(localCheckin)];
723
+ return [4 /*yield*/, this_1.client.create(localCheckIn)];
723
724
  case 2:
724
725
  _c.apply(_b, [_f.sent()]);
725
726
  return [3 /*break*/, 6];
726
727
  case 3:
727
- if (!!localCheckin.isInSync(remoteCheckin)) return [3 /*break*/, 5];
728
- localCheckin.id = remoteCheckin.id;
728
+ if (!!localCheckIn.isInSync(remoteCheckIn)) return [3 /*break*/, 5];
729
+ localCheckIn.id = remoteCheckIn.id;
729
730
  _e = (_d = results).push;
730
- return [4 /*yield*/, this_1.client.update(localCheckin)];
731
+ return [4 /*yield*/, this_1.client.update(localCheckIn)];
731
732
  case 4:
732
733
  _e.apply(_d, [_f.sent()]);
733
734
  return [3 /*break*/, 6];
734
735
  case 5:
735
736
  // no change - still need to add to results
736
- results.push(remoteCheckin);
737
+ results.push(remoteCheckIn);
737
738
  _f.label = 6;
738
739
  case 6: return [2 /*return*/];
739
740
  }
740
741
  });
741
742
  };
742
743
  this_1 = this;
743
- _i = 0, localCheckins_1 = localCheckins;
744
+ _i = 0, localCheckIns_1 = localCheckIns;
744
745
  _a.label = 1;
745
746
  case 1:
746
- if (!(_i < localCheckins_1.length)) return [3 /*break*/, 4];
747
- localCheckin = localCheckins_1[_i];
748
- return [5 /*yield**/, _loop_1(localCheckin)];
747
+ if (!(_i < localCheckIns_1.length)) return [3 /*break*/, 4];
748
+ localCheckIn = localCheckIns_1[_i];
749
+ return [5 /*yield**/, _loop_1(localCheckIn)];
749
750
  case 2:
750
751
  _a.sent();
751
752
  _a.label = 3;
@@ -757,33 +758,33 @@ var CheckinsManager$1 = /** @class */ (function () {
757
758
  });
758
759
  });
759
760
  };
760
- CheckinsManager.prototype.remove = function (localCheckins) {
761
+ CheckInsManager.prototype.remove = function (localCheckIns) {
761
762
  return __awaiter$1(this, void 0, void 0, function () {
762
- var projectIds, remoteCheckinsPerProject, allRemoteCheckins, checkinsToRemove;
763
+ var projectIds, remoteCheckInsPerProject, allRemoteCheckIns, checkInsToRemove;
763
764
  var _this = this;
764
765
  return __generator$1(this, function (_a) {
765
766
  switch (_a.label) {
766
767
  case 0:
767
- projectIds = Array.from(new Set(localCheckins.map(function (checkin) { return checkin.projectId; })));
768
+ projectIds = Array.from(new Set(localCheckIns.map(function (checkIn) { return checkIn.projectId; })));
768
769
  return [4 /*yield*/, Promise.all(projectIds.map(function (projectId) {
769
770
  return _this.client.listForProject(projectId);
770
771
  }))];
771
772
  case 1:
772
- remoteCheckinsPerProject = _a.sent();
773
- allRemoteCheckins = remoteCheckinsPerProject.flat();
774
- checkinsToRemove = allRemoteCheckins.filter(function (remoteCheckin) {
775
- return !localCheckins.find(function (localCheckin) {
776
- return localCheckin.name === remoteCheckin.name;
773
+ remoteCheckInsPerProject = _a.sent();
774
+ allRemoteCheckIns = remoteCheckInsPerProject.flat();
775
+ checkInsToRemove = allRemoteCheckIns.filter(function (remoteCheckIn) {
776
+ return !localCheckIns.find(function (localCheckIn) {
777
+ return localCheckIn.name === remoteCheckIn.name;
777
778
  });
778
779
  });
779
- return [2 /*return*/, Promise.all(checkinsToRemove.map(function (checkin) { return __awaiter$1(_this, void 0, void 0, function () {
780
+ return [2 /*return*/, Promise.all(checkInsToRemove.map(function (checkIn) { return __awaiter$1(_this, void 0, void 0, function () {
780
781
  return __generator$1(this, function (_a) {
781
782
  switch (_a.label) {
782
- case 0: return [4 /*yield*/, this.client.remove(checkin)];
783
+ case 0: return [4 /*yield*/, this.client.remove(checkIn)];
783
784
  case 1:
784
785
  _a.sent();
785
- checkin.markAsDeleted();
786
- return [2 /*return*/, checkin];
786
+ checkIn.markAsDeleted();
787
+ return [2 /*return*/, checkIn];
787
788
  }
788
789
  });
789
790
  }); }))];
@@ -791,9 +792,9 @@ var CheckinsManager$1 = /** @class */ (function () {
791
792
  });
792
793
  });
793
794
  };
794
- return CheckinsManager;
795
+ return CheckInsManager;
795
796
  }());
796
- checkinsManager.CheckinsManager = CheckinsManager$1;
797
+ checkInsManager.CheckInsManager = CheckInsManager$1;
797
798
 
798
799
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
799
800
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -831,13 +832,13 @@ var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (th
831
832
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
832
833
  }
833
834
  };
834
- Object.defineProperty(checkinsSync, "__esModule", { value: true });
835
- checkinsSync.syncCheckins = void 0;
835
+ Object.defineProperty(checkInsSync, "__esModule", { value: true });
836
+ checkInsSync.syncCheckIns = void 0;
836
837
  var readConfigFromFileSystem = util.readConfigFromFileSystem;
837
- var CheckinsManager = checkinsManager.CheckinsManager;
838
- function syncCheckins$1() {
838
+ var CheckInsManager = checkInsManager.CheckInsManager;
839
+ function syncCheckIns$1() {
839
840
  return __awaiter(this, void 0, void 0, function () {
840
- var config, checkinsManager, checkins, table;
841
+ var config, checkInsManager, checkIns, table;
841
842
  return __generator(this, function (_a) {
842
843
  switch (_a.label) {
843
844
  case 0:
@@ -845,15 +846,15 @@ function syncCheckins$1() {
845
846
  if (!config) {
846
847
  throw new Error('Could not find a Honeybadger configuration file.');
847
848
  }
848
- checkinsManager = new CheckinsManager(config);
849
- return [4 /*yield*/, checkinsManager.sync()];
849
+ checkInsManager = new CheckInsManager(config);
850
+ return [4 /*yield*/, checkInsManager.sync()];
850
851
  case 1:
851
- checkins = _a.sent();
852
- if (!checkins.length) {
852
+ checkIns = _a.sent();
853
+ if (!checkIns.length) {
853
854
  console.log('No check-ins found to synchronize with Honeybadger.');
854
855
  return [2 /*return*/];
855
856
  }
856
- table = checkins.map(function (c) {
857
+ table = checkIns.map(function (c) {
857
858
  return {
858
859
  'Id': c.id,
859
860
  'Name': c.name,
@@ -873,13 +874,13 @@ function syncCheckins$1() {
873
874
  });
874
875
  });
875
876
  }
876
- checkinsSync.syncCheckins = syncCheckins$1;
877
+ checkInsSync.syncCheckIns = syncCheckIns$1;
877
878
 
878
- var syncCheckins = checkinsSync.syncCheckins;
879
- syncCheckins().catch(function (err) {
879
+ var syncCheckIns = checkInsSync.syncCheckIns;
880
+ syncCheckIns().catch(function (err) {
880
881
  console.error(err);
881
882
  process.exit(1);
882
883
  });
883
884
 
884
- exports["default"] = checkinsSyncExec;
885
- //# sourceMappingURL=checkins-sync-exec.js.map
885
+ exports["default"] = checkInsSyncExec;
886
+ //# sourceMappingURL=check-ins-sync-exec.js.map