@naturalcycles/backend-lib 4.17.4 → 4.17.6

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.
@@ -67,7 +67,6 @@ async function deployHealthCheck(url, opt = {}) {
67
67
  let currentInterval = intervalSec * 1000;
68
68
  const fetcher = (0, js_lib_1.getFetcher)();
69
69
  while (!done) {
70
- // eslint-disable-next-line no-await-in-loop
71
70
  await makeAttempt();
72
71
  }
73
72
  if (failed) {
@@ -84,7 +83,8 @@ async function deployHealthCheck(url, opt = {}) {
84
83
  attempt++;
85
84
  console.log([`>>`, (0, colors_1.dimGrey)(url), (0, node_util_1.inspect)({ attempt }, inspectOpt)].join(' '));
86
85
  const started = Date.now();
87
- const { err, fetchResponse } = await fetcher.doFetch(url, {
86
+ const { err, fetchResponse } = await fetcher.doFetch({
87
+ url,
88
88
  mode: 'json',
89
89
  timeoutSeconds: timeoutSec,
90
90
  retry: {
@@ -5,7 +5,6 @@ exports.catchWrapper = void 0;
5
5
  // https://stackoverflow.com/a/43564267/4919972
6
6
  const catchWrapper = (fn) => async (req, res, next) => {
7
7
  try {
8
- // eslint-disable-next-line @typescript-eslint/await-thenable
9
8
  await fn(req, res, next);
10
9
  }
11
10
  catch (err) {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.respondWithError = exports.genericErrorMiddleware = void 0;
4
4
  const js_lib_1 = require("@naturalcycles/js-lib");
5
5
  const { APP_ENV } = process.env;
6
- const includeErrorStack = APP_ENV !== 'prod' && APP_ENV !== 'test';
6
+ const includeErrorStack = APP_ENV === 'dev';
7
7
  // Hacky way to store the sentryService, so it's available to `respondWithError` function
8
8
  let sentryService;
9
9
  let reportOnly5xx = false;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@naturalcycles/backend-lib",
3
- "version": "4.17.4",
3
+ "version": "4.17.6",
4
4
  "scripts": {
5
- "prepare": "husky install && patch-package",
5
+ "prepare": "husky install",
6
6
  "serve": "APP_ENV=dev nodemon",
7
7
  "docs-serve": "NODE_OPTIONS=--openssl-legacy-provider vuepress dev docs",
8
8
  "docs-build": "NODE_OPTIONS=--openssl-legacy-provider vuepress build docs",
@@ -48,7 +48,6 @@
48
48
  "fastify": "^4.0.0",
49
49
  "jest": "^29.0.1",
50
50
  "nodemon": "^2.0.14",
51
- "patch-package": "^6.2.1",
52
51
  "vue-class-component": "^7.2.6",
53
52
  "vuepress": "^1.7.1",
54
53
  "vuepress-plugin-typescript": "^0.3.1"
@@ -97,7 +97,6 @@ export async function deployHealthCheck(
97
97
  const fetcher = getFetcher()
98
98
 
99
99
  while (!done) {
100
- // eslint-disable-next-line no-await-in-loop
101
100
  await makeAttempt()
102
101
  }
103
102
 
@@ -126,7 +125,8 @@ export async function deployHealthCheck(
126
125
 
127
126
  const started = Date.now()
128
127
 
129
- const { err, fetchResponse } = await fetcher.doFetch(url, {
128
+ const { err, fetchResponse } = await fetcher.doFetch({
129
+ url,
130
130
  mode: 'json',
131
131
  timeoutSeconds: timeoutSec,
132
132
  retry: {
@@ -6,7 +6,6 @@ export const catchWrapper =
6
6
  (fn: BackendRequestHandler): BackendRequestHandler =>
7
7
  async (req, res, next) => {
8
8
  try {
9
- // eslint-disable-next-line @typescript-eslint/await-thenable
10
9
  await fn(req, res, next)
11
10
  } catch (err) {
12
11
  next(err)
@@ -26,7 +26,7 @@ export interface GenericErrorMiddlewareCfg {
26
26
  }
27
27
 
28
28
  const { APP_ENV } = process.env
29
- const includeErrorStack = APP_ENV !== 'prod' && APP_ENV !== 'test'
29
+ const includeErrorStack = APP_ENV === 'dev'
30
30
 
31
31
  // Hacky way to store the sentryService, so it's available to `respondWithError` function
32
32
  let sentryService: SentrySharedService | undefined