diff --git a/package.json b/package.json index 831f4d143..5d1d2e747 100644 --- a/package.json +++ b/package.json @@ -197,7 +197,7 @@ "@types/mocha": "^10.0.0", "@types/morgan": "^1.7.32", "@types/multer": "^1.3.3", - "@types/node": "^14.14.31", + "@types/node": "^18.13.0", "@types/nodemailer": "^6.2.0", "@types/oauth2-server": "^3.0.8", "@types/request": "^2.0.3", diff --git a/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts b/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts index b66fa474c..8ed219e9e 100644 --- a/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts +++ b/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts @@ -1,5 +1,5 @@ import { readdir } from 'fs-extra' -import { constants, PerformanceObserver } from 'perf_hooks' +import { constants, NodeGCPerformanceDetail, PerformanceObserver } from 'perf_hooks' import * as process from 'process' import { Meter, ObservableResult } from '@opentelemetry/api' import { ExplicitBucketHistogramAggregation } from '@opentelemetry/sdk-metrics' @@ -110,9 +110,9 @@ export class NodeJSObserversBuilder { // Node < 16 uses entry.kind // Node >= 16 uses entry.detail.kind // See: https://nodejs.org/docs/latest-v16.x/api/deprecations.html#deprecations_dep0152_extension_performanceentry_properties - const kind = (entry as any).detail - ? kinds[(entry as any).detail.kind] - : kinds[entry.kind] + const kind = entry.detail + ? kinds[(entry.detail as NodeGCPerformanceDetail).kind] + : kinds[(entry as any).kind] // Convert duration from milliseconds to seconds histogram.record(entry.duration / 1000, { diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts index 5a50af040..65007193a 100644 --- a/server/tests/api/notifications/comments-notifications.ts +++ b/server/tests/api/notifications/comments-notifications.ts @@ -18,9 +18,8 @@ describe('Test comments notifications', function () { let emails: object[] = [] const commentText = '**hello** world,