From 643af5aece0cf0558fff26ef04ef7dbd6e70e804 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Thu, 7 Nov 2024 10:18:05 +0200 Subject: [PATCH 1/8] feat: relay services --- package-lock.json | 179 +++++++++++++++++++++++++++++++- package.json | 5 +- src/interfaces/iRelayService.ts | 3 + src/services/natsService.ts | 5 +- src/services/rabbitMQService.ts | 21 ++++ src/services/relayService.ts | 0 src/services/restService.ts | 32 ++++++ 7 files changed, 239 insertions(+), 6 deletions(-) create mode 100644 src/interfaces/iRelayService.ts create mode 100644 src/services/rabbitMQService.ts create mode 100644 src/services/relayService.ts create mode 100644 src/services/restService.ts diff --git a/package-lock.json b/package-lock.json index fd0241b..4e352b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,15 @@ "license": "Apache-2.0", "dependencies": { "@tazama-lf/frms-coe-lib": "^5.0.0-rc.4", + "@types/amqplib": "^0.10.5", + "amqplib": "^0.10.4", + "axios": "^1.7.7", "nats": "^2.28.2" }, "devDependencies": { "@stylistic/eslint-plugin": "^2.1.0", "@types/jest": "^29.5.1", - "@types/node": "^20.14.2", + "@types/node": "^20.17.6", "@typescript-eslint/eslint-plugin": "^7.12.0", "@typescript-eslint/parser": "^7.12.0", "dotenv": "^16.1.2", @@ -32,6 +35,20 @@ "typescript": "^5.0.4" } }, + "node_modules/@acuminous/bitsyntax": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@acuminous/bitsyntax/-/bitsyntax-0.1.2.tgz", + "integrity": "sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==", + "license": "MIT", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "debug": "^4.3.4", + "safe-buffer": "~5.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -1731,6 +1748,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/amqplib": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.5.tgz", + "integrity": "sha512-/cSykxROY7BWwDoi4Y4/jLAuZTshZxd8Ey1QYa/VaXriMotBDoou7V/twJiOSHzU6t1Kp1AHAUXGCgqq+6DNeg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -1832,9 +1858,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", - "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", + "version": "20.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", + "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -2311,6 +2337,45 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/amqplib": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.4.tgz", + "integrity": "sha512-DMZ4eCEjAVdX1II2TfIUpJhfKAuoCeDIo/YyETbfAqehHTXxxs7WOOd+N1Xxr4cKhx12y23zk8/os98FxlZHrw==", + "license": "MIT", + "dependencies": { + "@acuminous/bitsyntax": "^0.1.2", + "buffer-more-ints": "~1.0.0", + "readable-stream": "1.x >=1.1.9", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/amqplib/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "license": "MIT" + }, + "node_modules/amqplib/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/amqplib/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "license": "MIT" + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -2573,6 +2638,12 @@ "async-value": "^1.2.2" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -2598,6 +2669,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -2897,6 +2979,12 @@ "dev": true, "license": "MIT" }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==", + "license": "MIT" + }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -3160,6 +3248,18 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", @@ -3386,6 +3486,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/denque": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", @@ -4609,6 +4718,26 @@ "dev": true, "license": "ISC" }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -4619,6 +4748,20 @@ "is-callable": "^1.1.3" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded-parse": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz", @@ -7795,6 +7938,12 @@ "node": ">=12.0.0" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, "node_modules/pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", @@ -7831,6 +7980,12 @@ ], "license": "MIT" }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -7973,6 +8128,12 @@ "node": ">=8.6.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -9240,6 +9401,16 @@ "punycode": "^2.1.0" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index 1c21800..4da1dee 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,9 @@ }, "dependencies": { "@tazama-lf/frms-coe-lib": "^5.0.0-rc.4", + "@types/amqplib": "^0.10.5", + "amqplib": "^0.10.4", + "axios": "^1.7.7", "nats": "^2.28.2" }, "keywords": [], @@ -37,7 +40,7 @@ "devDependencies": { "@stylistic/eslint-plugin": "^2.1.0", "@types/jest": "^29.5.1", - "@types/node": "^20.14.2", + "@types/node": "^20.17.6", "@typescript-eslint/eslint-plugin": "^7.12.0", "@typescript-eslint/parser": "^7.12.0", "dotenv": "^16.1.2", diff --git a/src/interfaces/iRelayService.ts b/src/interfaces/iRelayService.ts new file mode 100644 index 0000000..e18a35c --- /dev/null +++ b/src/interfaces/iRelayService.ts @@ -0,0 +1,3 @@ +export interface IRelay { + relay: (data: Uint8Array) => Promise; +} diff --git a/src/services/natsService.ts b/src/services/natsService.ts index 78e6e14..36bd55e 100644 --- a/src/services/natsService.ts +++ b/src/services/natsService.ts @@ -6,8 +6,9 @@ import { startupConfig } from '../interfaces/iStartupConfig'; import { type onMessageFunction } from '../types/onMessageFunction'; import { type IStartupService } from '..'; import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; +import { type IRelay } from '../interfaces/iRelayService'; -export class NatsService implements IStartupService { +export class NatsService implements IStartupService, IRelay { server = { servers: startupConfig.serverUrl, }; @@ -182,4 +183,6 @@ export class NatsService implements IStartupService { } } } + + async relay(payload: Uint8Array): Promise {} } diff --git a/src/services/rabbitMQService.ts b/src/services/rabbitMQService.ts new file mode 100644 index 0000000..5df9324 --- /dev/null +++ b/src/services/rabbitMQService.ts @@ -0,0 +1,21 @@ +import { type IRelay } from '../interfaces/iRelayService'; +import type { Connection, Channel } from 'amqplib'; +import amqplib from 'amqplib'; + +export class RabbitMQ implements IRelay { + private connection?: Connection; + private channel?: Channel; + async init(): Promise { + // validate rabbit env here + this.connection = await amqplib.connect(''); + this.channel = await this.connection.createChannel(); + + await this.channel.assertQueue('', { durable: false }); + } + async relay(data: Uint8Array): Promise { + if (!this.channel || !this.connection) { + throw new Error('RabbitMQ is not initialised. Call init()'); + } + this.channel.sendToQueue('config.queue', Buffer.from(data)); + } +} diff --git a/src/services/relayService.ts b/src/services/relayService.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/services/restService.ts b/src/services/restService.ts new file mode 100644 index 0000000..8fec1b7 --- /dev/null +++ b/src/services/restService.ts @@ -0,0 +1,32 @@ +import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; +import { type IRelay } from '../interfaces/iRelayService'; +import axios from 'axios'; +import http from 'http'; +import https from 'https'; +import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; + +export class RabbitMQ implements IRelay { + private readonly destinationUrl: string; + private readonly httpAgent: http.Agent; + private readonly httpsAgent: https.Agent; + private readonly jsonPayload: boolean; + + constructor() { + this.destinationUrl = validateEnvVar('RELAY_DESTINATION_URL', 'string'); + const maxSockets = validateEnvVar('RELAY_MAX_SOCKETS', 'number'); + this.httpAgent = new http.Agent({ keepAlive: true, maxSockets: Number(maxSockets) }); + this.httpsAgent = new https.Agent({ keepAlive: true, maxSockets: Number(maxSockets) }); + this.jsonPayload = validateEnvVar('RELAY_JSON_PAYLOAD', 'boolean'); + } + + async relay(data: Uint8Array): Promise { + const opts = { httpAgent: this.httpAgent, httpsAgent: this.httpsAgent }; + if (this.jsonPayload) { + const decodedMessage = FRMSMessage.decode(data); + const messageObject = FRMSMessage.toObject(decodedMessage); + await axios.post(this.destinationUrl, { messageObject }, opts); + } else { + await axios.post(this.destinationUrl, { message: data }, opts); + } + } +} From 720a18d962fae929ac864303d6fcaba37daee166 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Thu, 7 Nov 2024 16:16:38 +0200 Subject: [PATCH 2/8] feat: impl Relay Service --- package-lock.json | 4 +- package.json | 2 +- src/interfaces/iRelayConfig.ts | 16 +++ src/services/natsRelayService.ts | 31 +++++ src/services/natsService.ts | 5 +- src/services/rabbitMQRelayService.ts | 43 +++++++ src/services/rabbitMQService.ts | 21 ---- src/services/relayService | 168 +++++++++++++++++++++++++++ src/services/restRelayService.ts | 44 +++++++ src/services/restService.ts | 32 ----- 10 files changed, 306 insertions(+), 60 deletions(-) create mode 100644 src/interfaces/iRelayConfig.ts create mode 100644 src/services/natsRelayService.ts create mode 100644 src/services/rabbitMQRelayService.ts delete mode 100644 src/services/rabbitMQService.ts create mode 100644 src/services/relayService create mode 100644 src/services/restRelayService.ts delete mode 100644 src/services/restService.ts diff --git a/package-lock.json b/package-lock.json index 4e352b6..efc9a43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tazama-lf/frms-coe-startup-lib", - "version": "2.3.0-rc.5", + "version": "2.3.0-rc.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tazama-lf/frms-coe-startup-lib", - "version": "2.3.0-rc.5", + "version": "2.3.0-rc.6", "license": "Apache-2.0", "dependencies": { "@tazama-lf/frms-coe-lib": "^5.0.0-rc.4", diff --git a/package.json b/package.json index 4da1dee..3302e09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tazama-lf/frms-coe-startup-lib", - "version": "2.3.0-rc.5", + "version": "2.3.0-rc.6", "description": "FRMS Center of Excellence startup package library", "main": "lib/index.js", "repository": { diff --git a/src/interfaces/iRelayConfig.ts b/src/interfaces/iRelayConfig.ts new file mode 100644 index 0000000..002ca9f --- /dev/null +++ b/src/interfaces/iRelayConfig.ts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 + +import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; +import { startupConfig } from './iStartupConfig'; + +export interface IRelayConfig { + destinationType: 'nats' | 'rabbitmq' | 'rest'; + destinationUrl: string; + producerStream: string; +} + +export const relayConfig: IRelayConfig = { + destinationType: validateEnvVar('DESTINATION_TYPE', 'string'), + destinationUrl: validateEnvVar('DESTINATION_URL', 'string'), + producerStream: startupConfig.producerStreamName, +}; diff --git a/src/services/natsRelayService.ts b/src/services/natsRelayService.ts new file mode 100644 index 0000000..71fcc08 --- /dev/null +++ b/src/services/natsRelayService.ts @@ -0,0 +1,31 @@ +import { connect, type NatsConnection } from 'nats'; +import { relayConfig } from '../interfaces/iRelayConfig'; +import { type IRelay } from '../interfaces/iRelayService'; +import { type ILoggerService } from '../interfaces'; +import { startupConfig } from '../interfaces/iStartupConfig'; + +export class NatsRelay implements IRelay { + private readonly config = relayConfig; + private NatsConn_Producer?: NatsConnection; + private logger?: ILoggerService | Console; + + async init(loggerService?: ILoggerService): Promise { + if (loggerService) { + this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; + } else { + this.logger = console; + } + + this.NatsConn_Producer = await connect({ + servers: this.config.destinationUrl, + }); + this.logger.log(`[TRS]: Connected to Client NATS: ${JSON.stringify(this.NatsConn_Producer.info, null, 4)}`); + } + async relay(data: Uint8Array): Promise { + try { + this.NatsConn_Producer?.publish(relayConfig.producerStream, data); + } catch (error) { + this.logger?.error(`[TRS]: Connected to Client NATS: ${JSON.stringify(this.NatsConn_Producer?.info, null, 4)}`); + } + } +} diff --git a/src/services/natsService.ts b/src/services/natsService.ts index 36bd55e..78e6e14 100644 --- a/src/services/natsService.ts +++ b/src/services/natsService.ts @@ -6,9 +6,8 @@ import { startupConfig } from '../interfaces/iStartupConfig'; import { type onMessageFunction } from '../types/onMessageFunction'; import { type IStartupService } from '..'; import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; -import { type IRelay } from '../interfaces/iRelayService'; -export class NatsService implements IStartupService, IRelay { +export class NatsService implements IStartupService { server = { servers: startupConfig.serverUrl, }; @@ -183,6 +182,4 @@ export class NatsService implements IStartupService, IRelay { } } } - - async relay(payload: Uint8Array): Promise {} } diff --git a/src/services/rabbitMQRelayService.ts b/src/services/rabbitMQRelayService.ts new file mode 100644 index 0000000..c0ef083 --- /dev/null +++ b/src/services/rabbitMQRelayService.ts @@ -0,0 +1,43 @@ +import type { Channel, Connection } from 'amqplib'; +import amqplib from 'amqplib'; +import { relayConfig } from '../interfaces/iRelayConfig'; +import { type IRelay } from '../interfaces/iRelayService'; +import { type ProcessorConfig } from '@tazama-lf/frms-coe-lib/lib/config/processor.config'; +import { startupConfig } from '../interfaces/iStartupConfig'; +import type { ILoggerService } from '../interfaces'; +import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; + +export class RabbitRelay implements IRelay { + private readonly config = relayConfig; + private RabbitConn?: Connection; + private RabbitChannel?: Channel; + private logger?: ILoggerService | Console; + private queue?: string; + + async init(config: ProcessorConfig, loggerService?: ILoggerService): Promise { + this.queue = validateEnvVar('QUEUE', 'string'); + if (loggerService) { + this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; + } else { + this.logger = console; + } + + this.RabbitConn = await amqplib.connect(this.config.destinationUrl); + this.RabbitChannel = await this.RabbitConn.createChannel(); + + this.logger.log('[TRS]: Connected to Client RabbitMQ'); + + await this.RabbitChannel.assertQueue(config.functionName, { + durable: false, + }); + } + async relay(data: Uint8Array): Promise { + try { + this.RabbitChannel?.sendToQueue(this.queue!, Buffer.from(data)); + + this.logger?.log(`Message relayed to RabbitMQ on ${this.queue}`); + } catch (error) { + this.logger?.error(`Error relaying to RabbitMQ ${JSON.stringify(error)}`); + } + } +} diff --git a/src/services/rabbitMQService.ts b/src/services/rabbitMQService.ts deleted file mode 100644 index 5df9324..0000000 --- a/src/services/rabbitMQService.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type IRelay } from '../interfaces/iRelayService'; -import type { Connection, Channel } from 'amqplib'; -import amqplib from 'amqplib'; - -export class RabbitMQ implements IRelay { - private connection?: Connection; - private channel?: Channel; - async init(): Promise { - // validate rabbit env here - this.connection = await amqplib.connect(''); - this.channel = await this.connection.createChannel(); - - await this.channel.assertQueue('', { durable: false }); - } - async relay(data: Uint8Array): Promise { - if (!this.channel || !this.connection) { - throw new Error('RabbitMQ is not initialised. Call init()'); - } - this.channel.sendToQueue('config.queue', Buffer.from(data)); - } -} diff --git a/src/services/relayService b/src/services/relayService new file mode 100644 index 0000000..897c144 --- /dev/null +++ b/src/services/relayService @@ -0,0 +1,168 @@ +// Developed By Paysys Labs + +import { connect } from 'nats'; +import type { NatsConnection } from 'nats'; +import axios from 'axios'; +import http from 'http'; +import https from 'https'; +import amqplib from 'amqplib'; +import type { Channel, Connection } from 'amqplib'; +import type { ProcessorConfig } from '@tazama-lf/frms-coe-lib/lib/config/processor.config'; +import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; +import { relayConfig } from '../interfaces/iRelayConfig'; +import type { ILoggerService } from '../interfaces'; +import { startupConfig } from '../interfaces/iStartupConfig'; + +export class MessageRelayService { + private NatsConn!: NatsConnection; + private NatsConn_Producer?: NatsConnection; + private RabbitConn?: Connection; + private RabbitChannel?: Channel; + private functionName?: string; + readonly agent = new http.Agent({ keepAlive: true, maxSockets: Number(relayConfig.maxSockets) }); + readonly httpsAgent = new https.Agent({ keepAlive: true, maxSockets: Number(relayConfig.maxSockets) }); + logger?: ILoggerService | Console; + + async start(processorConfig: ProcessorConfig, loggerService?: ILoggerService): Promise { + this.functionName = processorConfig.functionName; + if (loggerService) { + this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; + } else { + this.logger = console; + } + this.logger.log('[TRS]: Initializing...'); + try { + this.NatsConn = await connect({ servers: startupConfig.serverUrl }); + if (!this.NatsConn) return await Promise.resolve(false); + this.logger?.log(`[TRS]: Connected to Tazama NATS: ${JSON.stringify(this.NatsConn.info, null, 4)}`); + this.logger?.log(`[TRS]: Consumer Stream Set To: ${relayConfig.consumerStream}`); + + await this.initProducer(); // Establish connection with client broker|stream + let messageCount = 0; + + for (let i = 0; i < Number(relayConfig.subscribers); i++) { + // Subscribe to the configured stream + this.NatsConn.subscribe(relayConfig.consumerStream, { + queue: processorConfig.functionName, // Makes sure of at most once delivery in case of multiple subscribers. + // Callback to init producers and relay messages + callback: (err, msg) => { + if (err) { + this.logger?.error(`[TRS]: Error receiving message: ${err.message}`); + return; + } + if (msg && msg.data) { + messageCount++; + this.logger?.log(`[TRS]: Received message ${messageCount} from Tazama NATS on ${i}`); + + // Relay message to the configured broker|stream. + void this.relayMessage(msg.data); + } + }, + }); + } + return true; + } catch (error) { + this.logger.error(`[TRS]: MessageRelayService Failed: ${error instanceof Error ? error.message : 'Unknown error'}`); + return false; + } + } + + // Establishes Producer Connections + async initProducer(): Promise { + switch (relayConfig.destinationType.toLowerCase()) { + case 'nats': + try { + this.NatsConn_Producer = await connect({ + servers: relayConfig.destinationUrl, + }); + if (!this.NatsConn_Producer) return await Promise.resolve(false); + this.logger?.log(`[TRS]: Connected to Client NATS: ${JSON.stringify(this.NatsConn_Producer.info, null, 4)}`); + return true; + } catch (error) { + this.logger?.error(`[TRS]: Failed to relay message: ${error instanceof Error ? error.message : 'Connection error'}`); + } + return false; + case 'rabbitmq': + try { + this.RabbitConn = await amqplib.connect(relayConfig.destinationUrl); + if (!this.RabbitConn) return await Promise.resolve(false); + this.RabbitChannel = await this.RabbitConn.createChannel(); + this.logger?.log('[TRS]: Connected to Client RabbitMQ'); + await this.RabbitChannel.assertQueue(this.functionName!, { + durable: false, + }); + return true; + } catch (error) { + this.logger?.error(`[TRS]: Failed to relay message: ${error instanceof Error ? error.message : 'Connection error'}`); + } + return false; + case 'rest': + this.logger?.log(`[TRS]: Will publish on ${relayConfig.destinationUrl}`); + return true; + default: + throw new Error(`[TRS]: Unknown destination type: ${relayConfig.destinationType}`); + } + } + + async relayMessage(message: Uint8Array): Promise { + try { + switch (relayConfig.destinationType.toLowerCase()) { + case 'nats': + await this.relayToNats(message); + break; + case 'rabbitmq': + await this.relayToRabbitMQ(message); + break; + case 'rest': + await this.relayToRestAPI(message); + break; + default: + throw new Error(`Unknown destination type: ${relayConfig.destinationType}`); + } + } catch (error) { + this.logger?.error('Failed to relayMessage'/*, error, message*/); + } + } + + async relayToNats(message: Uint8Array): Promise { + try { + if (!this.NatsConn_Producer) return await Promise.resolve(false); + this.NatsConn_Producer.publish(relayConfig.producerStream, message); + + this.logger?.log(`Message relayed to NATS on ${relayConfig.producerStream}`); + return true; + } catch (error) { + this.logger?.error(`Error relaying to NATS: ${JSON.stringify(error)}` ); + return false; + } + } + + async relayToRabbitMQ(message: Uint8Array): Promise { + try { + if (!this.RabbitConn || !this.RabbitChannel) return await Promise.resolve(false); + this.RabbitChannel?.sendToQueue(relayConfig.queue, Buffer.from(message)); + + this.logger?.log(`Message relayed to RabbitMQ on ${relayConfig.queue}`); + return true; + } catch (error) { + this.logger?.error(`Error relaying to RabbitMQ: ${JSON.stringify(error)}` ); + return false; + } + } + + async relayToRestAPI(message: Uint8Array): Promise { + try { + if (relayConfig.jsonPayload) { + const decodedMessage = FRMSMessage.decode(message); + const messageObject = FRMSMessage.toObject(decodedMessage); + await axios.post(relayConfig.destinationUrl, { messageObject }, { httpAgent: this.agent, httpsAgent: this.httpsAgent }); + this.logger?.log('Message relayed to REST API'); + } else { + await axios.post(relayConfig.destinationUrl, { message }, { httpAgent: this.agent, httpsAgent: this.httpsAgent }); + this.logger?.log('Message relayed to REST API'); + } + } catch (error) { + this.logger?.error(`Error relaying to REST API: ${JSON.stringify(error)}` ); + } + } +} diff --git a/src/services/restRelayService.ts b/src/services/restRelayService.ts new file mode 100644 index 0000000..ce8f720 --- /dev/null +++ b/src/services/restRelayService.ts @@ -0,0 +1,44 @@ +import { relayConfig } from '../interfaces/iRelayConfig'; +import { type IRelay } from '../interfaces/iRelayService'; +import http from 'http'; +import https from 'https'; +import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; +import axios from 'axios'; +import { type ILoggerService } from '../interfaces'; +import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; +import { startupConfig } from '../interfaces/iStartupConfig'; + +export class RestRelay implements IRelay { + private readonly config = relayConfig; + private httpAgent?: http.Agent; + private httpsAgent?: https.Agent; + private logger?: ILoggerService | Console; + private jsonPayload?: boolean; + + async init(loggerService?: ILoggerService): Promise { + if (loggerService) { + this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; + } else { + this.logger = console; + } + const sockets = validateEnvVar('MAX_SOCKETS', 'number'); + this.jsonPayload = validateEnvVar('JSON_PAYLOAD', 'boolean'); + this.httpAgent = new http.Agent({ keepAlive: true, maxSockets: Number(sockets) }); + this.httpsAgent = new https.Agent({ keepAlive: true, maxSockets: Number(sockets) }); + } + async relay(data: Uint8Array): Promise { + try { + const agent = { httpAgent: this.httpAgent, httpsAgent: this.httpsAgent }; + if (this.jsonPayload) { + const decodedMessage = FRMSMessage.decode(data); + const messageObject = FRMSMessage.toObject(decodedMessage); + await axios.post(this.config.destinationUrl, { messageObject }, agent); + } else { + await axios.post(this.config.destinationUrl, { message: data }, agent); + } + this.logger?.log('Message relayed to REST API'); + } catch (error) { + this.logger?.error(`Error relaying to REST API ${JSON.stringify(error)}`); + } + } +} diff --git a/src/services/restService.ts b/src/services/restService.ts deleted file mode 100644 index 8fec1b7..0000000 --- a/src/services/restService.ts +++ /dev/null @@ -1,32 +0,0 @@ -import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; -import { type IRelay } from '../interfaces/iRelayService'; -import axios from 'axios'; -import http from 'http'; -import https from 'https'; -import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; - -export class RabbitMQ implements IRelay { - private readonly destinationUrl: string; - private readonly httpAgent: http.Agent; - private readonly httpsAgent: https.Agent; - private readonly jsonPayload: boolean; - - constructor() { - this.destinationUrl = validateEnvVar('RELAY_DESTINATION_URL', 'string'); - const maxSockets = validateEnvVar('RELAY_MAX_SOCKETS', 'number'); - this.httpAgent = new http.Agent({ keepAlive: true, maxSockets: Number(maxSockets) }); - this.httpsAgent = new https.Agent({ keepAlive: true, maxSockets: Number(maxSockets) }); - this.jsonPayload = validateEnvVar('RELAY_JSON_PAYLOAD', 'boolean'); - } - - async relay(data: Uint8Array): Promise { - const opts = { httpAgent: this.httpAgent, httpsAgent: this.httpsAgent }; - if (this.jsonPayload) { - const decodedMessage = FRMSMessage.decode(data); - const messageObject = FRMSMessage.toObject(decodedMessage); - await axios.post(this.destinationUrl, { messageObject }, opts); - } else { - await axios.post(this.destinationUrl, { message: data }, opts); - } - } -} From 416d29cb29876c1d5539eea6df75d6afc7791c9e Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Mon, 11 Nov 2024 09:56:56 +0200 Subject: [PATCH 3/8] feat(nats): allow opting out of message decoding --- src/interfaces/iStartupConfig.ts | 9 ++ src/services/natsService.ts | 13 ++- src/services/relayService | 168 ------------------------------- src/services/relayService.ts | 0 4 files changed, 18 insertions(+), 172 deletions(-) delete mode 100644 src/services/relayService delete mode 100644 src/services/relayService.ts diff --git a/src/interfaces/iStartupConfig.ts b/src/interfaces/iStartupConfig.ts index f21b9da..d51472d 100644 --- a/src/interfaces/iStartupConfig.ts +++ b/src/interfaces/iStartupConfig.ts @@ -67,6 +67,14 @@ export interface IStartupConfig { * @memberof IStartupConfig */ streamSubject: string; + + /** + *functionName: process.env.NATS_DECODE_RESPONSE + * + * @type {boolean} + * @memberof IStartupConfig + */ + natsDecodeResponse?: boolean; } export const startupConfig: IStartupConfig = { @@ -80,4 +88,5 @@ export const startupConfig: IStartupConfig = { producerRetentionPolicy: (process.env.PRODUCER_RETENTION_POLICY as 'Limits' | 'Interest' | 'Workqueue') || 'Workqueue', ackPolicy: (process.env.ACK_POLICY as 'All' | 'Explicit') || 'Explicit', producerStorage: (process.env.PRODUCER_STORAGE as 'File' | 'Memory') || 'Memory', + natsDecodeResponse: validateEnvVar('NATS_DECODE_RESPONSE', 'boolean', true), }; diff --git a/src/services/natsService.ts b/src/services/natsService.ts index 78e6e14..98c4da7 100644 --- a/src/services/natsService.ts +++ b/src/services/natsService.ts @@ -83,10 +83,15 @@ export class NatsService implements IStartupService { async subscribe(subscription: Subscription, onMessage: onMessageFunction): Promise { for await (const message of subscription) { console.debug(`${Date.now().toLocaleString()} sid:[${message?.sid}] subject:[${message.subject}]: ${message.data.length}`); - const messageDecoded = FRMSMessage.decode(message.data); - const messageObject = FRMSMessage.toObject(messageDecoded); - // eslint-disable-next-line @typescript-eslint/unbound-method - await onMessage(messageObject, this.handleResponse); + if (startupConfig.natsDecodeResponse === false) { + // eslint-disable-next-line @typescript-eslint/unbound-method + await onMessage(message.data, this.handleResponse); + } else { + const messageDecoded = FRMSMessage.decode(message.data); + const messageObject = FRMSMessage.toObject(messageDecoded); + // eslint-disable-next-line @typescript-eslint/unbound-method + await onMessage(messageObject, this.handleResponse); + } } } diff --git a/src/services/relayService b/src/services/relayService deleted file mode 100644 index 897c144..0000000 --- a/src/services/relayService +++ /dev/null @@ -1,168 +0,0 @@ -// Developed By Paysys Labs - -import { connect } from 'nats'; -import type { NatsConnection } from 'nats'; -import axios from 'axios'; -import http from 'http'; -import https from 'https'; -import amqplib from 'amqplib'; -import type { Channel, Connection } from 'amqplib'; -import type { ProcessorConfig } from '@tazama-lf/frms-coe-lib/lib/config/processor.config'; -import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; -import { relayConfig } from '../interfaces/iRelayConfig'; -import type { ILoggerService } from '../interfaces'; -import { startupConfig } from '../interfaces/iStartupConfig'; - -export class MessageRelayService { - private NatsConn!: NatsConnection; - private NatsConn_Producer?: NatsConnection; - private RabbitConn?: Connection; - private RabbitChannel?: Channel; - private functionName?: string; - readonly agent = new http.Agent({ keepAlive: true, maxSockets: Number(relayConfig.maxSockets) }); - readonly httpsAgent = new https.Agent({ keepAlive: true, maxSockets: Number(relayConfig.maxSockets) }); - logger?: ILoggerService | Console; - - async start(processorConfig: ProcessorConfig, loggerService?: ILoggerService): Promise { - this.functionName = processorConfig.functionName; - if (loggerService) { - this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; - } else { - this.logger = console; - } - this.logger.log('[TRS]: Initializing...'); - try { - this.NatsConn = await connect({ servers: startupConfig.serverUrl }); - if (!this.NatsConn) return await Promise.resolve(false); - this.logger?.log(`[TRS]: Connected to Tazama NATS: ${JSON.stringify(this.NatsConn.info, null, 4)}`); - this.logger?.log(`[TRS]: Consumer Stream Set To: ${relayConfig.consumerStream}`); - - await this.initProducer(); // Establish connection with client broker|stream - let messageCount = 0; - - for (let i = 0; i < Number(relayConfig.subscribers); i++) { - // Subscribe to the configured stream - this.NatsConn.subscribe(relayConfig.consumerStream, { - queue: processorConfig.functionName, // Makes sure of at most once delivery in case of multiple subscribers. - // Callback to init producers and relay messages - callback: (err, msg) => { - if (err) { - this.logger?.error(`[TRS]: Error receiving message: ${err.message}`); - return; - } - if (msg && msg.data) { - messageCount++; - this.logger?.log(`[TRS]: Received message ${messageCount} from Tazama NATS on ${i}`); - - // Relay message to the configured broker|stream. - void this.relayMessage(msg.data); - } - }, - }); - } - return true; - } catch (error) { - this.logger.error(`[TRS]: MessageRelayService Failed: ${error instanceof Error ? error.message : 'Unknown error'}`); - return false; - } - } - - // Establishes Producer Connections - async initProducer(): Promise { - switch (relayConfig.destinationType.toLowerCase()) { - case 'nats': - try { - this.NatsConn_Producer = await connect({ - servers: relayConfig.destinationUrl, - }); - if (!this.NatsConn_Producer) return await Promise.resolve(false); - this.logger?.log(`[TRS]: Connected to Client NATS: ${JSON.stringify(this.NatsConn_Producer.info, null, 4)}`); - return true; - } catch (error) { - this.logger?.error(`[TRS]: Failed to relay message: ${error instanceof Error ? error.message : 'Connection error'}`); - } - return false; - case 'rabbitmq': - try { - this.RabbitConn = await amqplib.connect(relayConfig.destinationUrl); - if (!this.RabbitConn) return await Promise.resolve(false); - this.RabbitChannel = await this.RabbitConn.createChannel(); - this.logger?.log('[TRS]: Connected to Client RabbitMQ'); - await this.RabbitChannel.assertQueue(this.functionName!, { - durable: false, - }); - return true; - } catch (error) { - this.logger?.error(`[TRS]: Failed to relay message: ${error instanceof Error ? error.message : 'Connection error'}`); - } - return false; - case 'rest': - this.logger?.log(`[TRS]: Will publish on ${relayConfig.destinationUrl}`); - return true; - default: - throw new Error(`[TRS]: Unknown destination type: ${relayConfig.destinationType}`); - } - } - - async relayMessage(message: Uint8Array): Promise { - try { - switch (relayConfig.destinationType.toLowerCase()) { - case 'nats': - await this.relayToNats(message); - break; - case 'rabbitmq': - await this.relayToRabbitMQ(message); - break; - case 'rest': - await this.relayToRestAPI(message); - break; - default: - throw new Error(`Unknown destination type: ${relayConfig.destinationType}`); - } - } catch (error) { - this.logger?.error('Failed to relayMessage'/*, error, message*/); - } - } - - async relayToNats(message: Uint8Array): Promise { - try { - if (!this.NatsConn_Producer) return await Promise.resolve(false); - this.NatsConn_Producer.publish(relayConfig.producerStream, message); - - this.logger?.log(`Message relayed to NATS on ${relayConfig.producerStream}`); - return true; - } catch (error) { - this.logger?.error(`Error relaying to NATS: ${JSON.stringify(error)}` ); - return false; - } - } - - async relayToRabbitMQ(message: Uint8Array): Promise { - try { - if (!this.RabbitConn || !this.RabbitChannel) return await Promise.resolve(false); - this.RabbitChannel?.sendToQueue(relayConfig.queue, Buffer.from(message)); - - this.logger?.log(`Message relayed to RabbitMQ on ${relayConfig.queue}`); - return true; - } catch (error) { - this.logger?.error(`Error relaying to RabbitMQ: ${JSON.stringify(error)}` ); - return false; - } - } - - async relayToRestAPI(message: Uint8Array): Promise { - try { - if (relayConfig.jsonPayload) { - const decodedMessage = FRMSMessage.decode(message); - const messageObject = FRMSMessage.toObject(decodedMessage); - await axios.post(relayConfig.destinationUrl, { messageObject }, { httpAgent: this.agent, httpsAgent: this.httpsAgent }); - this.logger?.log('Message relayed to REST API'); - } else { - await axios.post(relayConfig.destinationUrl, { message }, { httpAgent: this.agent, httpsAgent: this.httpsAgent }); - this.logger?.log('Message relayed to REST API'); - } - } catch (error) { - this.logger?.error(`Error relaying to REST API: ${JSON.stringify(error)}` ); - } - } -} diff --git a/src/services/relayService.ts b/src/services/relayService.ts deleted file mode 100644 index e69de29..0000000 From ff85076bb5f9a2d4e3372712dac30db9b98d1ce7 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Mon, 11 Nov 2024 16:43:22 +0200 Subject: [PATCH 4/8] revert: opt out of decode --- src/interfaces/iStartupConfig.ts | 9 --------- src/services/natsService.ts | 13 ++++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/interfaces/iStartupConfig.ts b/src/interfaces/iStartupConfig.ts index d51472d..f21b9da 100644 --- a/src/interfaces/iStartupConfig.ts +++ b/src/interfaces/iStartupConfig.ts @@ -67,14 +67,6 @@ export interface IStartupConfig { * @memberof IStartupConfig */ streamSubject: string; - - /** - *functionName: process.env.NATS_DECODE_RESPONSE - * - * @type {boolean} - * @memberof IStartupConfig - */ - natsDecodeResponse?: boolean; } export const startupConfig: IStartupConfig = { @@ -88,5 +80,4 @@ export const startupConfig: IStartupConfig = { producerRetentionPolicy: (process.env.PRODUCER_RETENTION_POLICY as 'Limits' | 'Interest' | 'Workqueue') || 'Workqueue', ackPolicy: (process.env.ACK_POLICY as 'All' | 'Explicit') || 'Explicit', producerStorage: (process.env.PRODUCER_STORAGE as 'File' | 'Memory') || 'Memory', - natsDecodeResponse: validateEnvVar('NATS_DECODE_RESPONSE', 'boolean', true), }; diff --git a/src/services/natsService.ts b/src/services/natsService.ts index 98c4da7..78e6e14 100644 --- a/src/services/natsService.ts +++ b/src/services/natsService.ts @@ -83,15 +83,10 @@ export class NatsService implements IStartupService { async subscribe(subscription: Subscription, onMessage: onMessageFunction): Promise { for await (const message of subscription) { console.debug(`${Date.now().toLocaleString()} sid:[${message?.sid}] subject:[${message.subject}]: ${message.data.length}`); - if (startupConfig.natsDecodeResponse === false) { - // eslint-disable-next-line @typescript-eslint/unbound-method - await onMessage(message.data, this.handleResponse); - } else { - const messageDecoded = FRMSMessage.decode(message.data); - const messageObject = FRMSMessage.toObject(messageDecoded); - // eslint-disable-next-line @typescript-eslint/unbound-method - await onMessage(messageObject, this.handleResponse); - } + const messageDecoded = FRMSMessage.decode(message.data); + const messageObject = FRMSMessage.toObject(messageDecoded); + // eslint-disable-next-line @typescript-eslint/unbound-method + await onMessage(messageObject, this.handleResponse); } } From 84b9fee12069d437dfd7db0648f4000c33668323 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Tue, 12 Nov 2024 15:04:17 +0200 Subject: [PATCH 5/8] fix: set types as dev dep --- package-lock.json | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index efc9a43..284bf20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,13 @@ "license": "Apache-2.0", "dependencies": { "@tazama-lf/frms-coe-lib": "^5.0.0-rc.4", - "@types/amqplib": "^0.10.5", "amqplib": "^0.10.4", "axios": "^1.7.7", "nats": "^2.28.2" }, "devDependencies": { "@stylistic/eslint-plugin": "^2.1.0", + "@types/amqplib": "^0.10.5", "@types/jest": "^29.5.1", "@types/node": "^20.17.6", "@typescript-eslint/eslint-plugin": "^7.12.0", @@ -1752,6 +1752,7 @@ "version": "0.10.5", "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.5.tgz", "integrity": "sha512-/cSykxROY7BWwDoi4Y4/jLAuZTshZxd8Ey1QYa/VaXriMotBDoou7V/twJiOSHzU6t1Kp1AHAUXGCgqq+6DNeg==", + "dev": true, "license": "MIT", "dependencies": { "@types/node": "*" diff --git a/package.json b/package.json index 3302e09..8c9ac53 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ }, "dependencies": { "@tazama-lf/frms-coe-lib": "^5.0.0-rc.4", - "@types/amqplib": "^0.10.5", "amqplib": "^0.10.4", "axios": "^1.7.7", "nats": "^2.28.2" @@ -39,6 +38,7 @@ "license": "Apache-2.0", "devDependencies": { "@stylistic/eslint-plugin": "^2.1.0", + "@types/amqplib": "^0.10.5", "@types/jest": "^29.5.1", "@types/node": "^20.17.6", "@typescript-eslint/eslint-plugin": "^7.12.0", From e1c56ccf63bb54a384de88d53b4f9e6f58b0e9cd Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Tue, 12 Nov 2024 15:04:41 +0200 Subject: [PATCH 6/8] refactor: reuse setlogger func --- src/services/jetstreamService.ts | 7 ++----- src/services/natsRelayService.ts | 7 ++----- src/services/natsService.ts | 8 +++----- src/services/rabbitMQRelayService.ts | 8 +++----- src/services/restRelayService.ts | 8 +++----- src/utils.ts | 9 +++++++++ 6 files changed, 22 insertions(+), 25 deletions(-) create mode 100644 src/utils.ts diff --git a/src/services/jetstreamService.ts b/src/services/jetstreamService.ts index ffec037..69fc58e 100644 --- a/src/services/jetstreamService.ts +++ b/src/services/jetstreamService.ts @@ -16,6 +16,7 @@ import { type ILoggerService } from '../interfaces'; import { startupConfig } from '../interfaces/iStartupConfig'; import { type onMessageFunction } from '../types/onMessageFunction'; import { type IStartupService } from '../interfaces/iStartupService'; +import { getLogger } from '../utils'; export class JetstreamService implements IStartupService { server = { @@ -98,11 +99,7 @@ export class JetstreamService implements IStartupService { */ async initProducer(loggerService?: ILoggerService): Promise { await this.validateEnvironment(); - if (loggerService) { - this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; - } else { - this.logger = console; - } + this.logger = getLogger(startupConfig, loggerService); try { // Connect to NATS Server diff --git a/src/services/natsRelayService.ts b/src/services/natsRelayService.ts index 71fcc08..7e0cc61 100644 --- a/src/services/natsRelayService.ts +++ b/src/services/natsRelayService.ts @@ -3,6 +3,7 @@ import { relayConfig } from '../interfaces/iRelayConfig'; import { type IRelay } from '../interfaces/iRelayService'; import { type ILoggerService } from '../interfaces'; import { startupConfig } from '../interfaces/iStartupConfig'; +import { getLogger } from '../utils'; export class NatsRelay implements IRelay { private readonly config = relayConfig; @@ -10,11 +11,7 @@ export class NatsRelay implements IRelay { private logger?: ILoggerService | Console; async init(loggerService?: ILoggerService): Promise { - if (loggerService) { - this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; - } else { - this.logger = console; - } + this.logger = getLogger(startupConfig, loggerService); this.NatsConn_Producer = await connect({ servers: this.config.destinationUrl, diff --git a/src/services/natsService.ts b/src/services/natsService.ts index 78e6e14..c454ba6 100644 --- a/src/services/natsService.ts +++ b/src/services/natsService.ts @@ -6,6 +6,7 @@ import { startupConfig } from '../interfaces/iStartupConfig'; import { type onMessageFunction } from '../types/onMessageFunction'; import { type IStartupService } from '..'; import FRMSMessage from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; +import { getLogger } from '../utils'; export class NatsService implements IStartupService { server = { @@ -108,11 +109,8 @@ export class NatsService implements IStartupService { async initProducer(loggerService?: ILoggerService, parProducerStreamName?: string): Promise { await this.validateEnvironment(parProducerStreamName); - if (loggerService) { - this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; - } else { - this.logger = console; - } + + this.logger = getLogger(startupConfig, loggerService); try { // Connect to NATS Server diff --git a/src/services/rabbitMQRelayService.ts b/src/services/rabbitMQRelayService.ts index c0ef083..1e348ef 100644 --- a/src/services/rabbitMQRelayService.ts +++ b/src/services/rabbitMQRelayService.ts @@ -6,6 +6,7 @@ import { type ProcessorConfig } from '@tazama-lf/frms-coe-lib/lib/config/process import { startupConfig } from '../interfaces/iStartupConfig'; import type { ILoggerService } from '../interfaces'; import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; +import { getLogger } from '../utils'; export class RabbitRelay implements IRelay { private readonly config = relayConfig; @@ -16,11 +17,8 @@ export class RabbitRelay implements IRelay { async init(config: ProcessorConfig, loggerService?: ILoggerService): Promise { this.queue = validateEnvVar('QUEUE', 'string'); - if (loggerService) { - this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; - } else { - this.logger = console; - } + + this.logger = getLogger(startupConfig, loggerService); this.RabbitConn = await amqplib.connect(this.config.destinationUrl); this.RabbitChannel = await this.RabbitConn.createChannel(); diff --git a/src/services/restRelayService.ts b/src/services/restRelayService.ts index ce8f720..3b39af5 100644 --- a/src/services/restRelayService.ts +++ b/src/services/restRelayService.ts @@ -7,6 +7,7 @@ import axios from 'axios'; import { type ILoggerService } from '../interfaces'; import { validateEnvVar } from '@tazama-lf/frms-coe-lib/lib/config'; import { startupConfig } from '../interfaces/iStartupConfig'; +import { getLogger } from '../utils'; export class RestRelay implements IRelay { private readonly config = relayConfig; @@ -16,11 +17,8 @@ export class RestRelay implements IRelay { private jsonPayload?: boolean; async init(loggerService?: ILoggerService): Promise { - if (loggerService) { - this.logger = startupConfig.env === 'dev' || startupConfig.env === 'test' ? console : loggerService; - } else { - this.logger = console; - } + this.logger = getLogger(startupConfig, loggerService); + const sockets = validateEnvVar('MAX_SOCKETS', 'number'); this.jsonPayload = validateEnvVar('JSON_PAYLOAD', 'boolean'); this.httpAgent = new http.Agent({ keepAlive: true, maxSockets: Number(sockets) }); diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..a0289c8 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,9 @@ +import type { ILoggerService, IStartupConfig } from './interfaces'; + +export const getLogger = (config: IStartupConfig, loggerService?: ILoggerService): ILoggerService | Console => { + if (loggerService) { + return config.env === 'dev' || config.env === 'test' ? console : loggerService; + } else { + return console; + } +}; From f5158c5e64fe7058bd91bf7b594a4960a345dd5b Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Wed, 13 Nov 2024 12:48:18 +0200 Subject: [PATCH 7/8] docs: update readme --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 1e0ad88..987a2c1 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,15 @@ If provided in the call to `init()`, this will be a subject to listen for messag - `warn(message: string): void`: Logs a warning message. - `error(message: string | Error): void`: Logs an error message. + - **Interface**: IRelayService + - **Methods**: + - `relay(data: Uint8Array): void'`: Relays a message + + - **Interface**: IRelayConfig + - **Properties**: + - `destinationType: 'nats' | 'rabbitmq' | 'rest'`: The type of service to relay to. + - `destinationUrl: string`: Endpoint to relay messages to + - `producerStream: string`: Read from the startup config 4. **Types** - **onMessageFunction** @@ -244,6 +253,21 @@ The `frms-coe-startup-lib` library uses environment variables to configure the s - `PRODUCER_STREAM`: The name of the producer stream. - `CONSUMER_STREAM`: The name of the consumer stream. +### Relay Environment Variables + +- `DESTINATION_URL`: Specifies the startup type (`nats`). +- `DESTINATION_TYPE`: The node environment (`development`, `production`, etc.). + +#### NATS-Specific Relay Variables +- `PRODUCER_STREAM`: The destination to relay messages to + +#### Rest-Specific Relay Variables +- `JSON_PAYLOAD`: Convert the message to json before relaying +- `MAX_SOCKETS`: Max http/https sockets limit + +#### RabbitMQ-Specific Relay Variables +- `QUEUE`: Name of the queue for the RabbitMQ producer + ### Configuration Files The library supports configuration through [`.env`](.env.template.nats) files or other configuration file formats. These files can be used to set environment variables and other settings. From e6fcc2450414e5b1259583f964a39893833e5b12 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Thu, 14 Nov 2024 13:53:49 +0200 Subject: [PATCH 8/8] build: update lockfile --- package-lock.json | 799 ++++++++++++++++++++++------------------------ 1 file changed, 390 insertions(+), 409 deletions(-) diff --git a/package-lock.json b/package-lock.json index 284bf20..e372178 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,13 +64,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -78,9 +79,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", - "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", + "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", "dev": true, "license": "MIT", "engines": { @@ -88,22 +89,22 @@ } }, "node_modules/@babel/core": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", - "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/helper-compilation-targets": "^7.25.7", - "@babel/helper-module-transforms": "^7.25.7", - "@babel/helpers": "^7.25.7", - "@babel/parser": "^7.25.8", - "@babel/template": "^7.25.7", - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.8", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -129,13 +130,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", + "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7", + "@babel/parser": "^7.26.2", + "@babel/types": "^7.26.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -145,14 +147,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", - "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", + "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.7", - "@babel/helper-validator-option": "^7.25.7", + "@babel/compat-data": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -182,30 +184,29 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", - "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", - "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.7", - "@babel/helper-simple-access": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "@babel/traverse": "^7.25.7" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -215,33 +216,19 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", - "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", - "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, "license": "MIT", "engines": { @@ -249,9 +236,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, "license": "MIT", "engines": { @@ -259,9 +246,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", - "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "dev": true, "license": "MIT", "engines": { @@ -269,121 +256,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", - "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", - "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.8" + "@babel/types": "^7.26.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -448,13 +341,13 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.7.tgz", - "integrity": "sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -490,13 +383,13 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.7.tgz", - "integrity": "sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -616,13 +509,13 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.7.tgz", - "integrity": "sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -632,32 +525,32 @@ } }, "node_modules/@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -676,15 +569,14 @@ } }, "node_modules/@babel/types": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", - "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -743,12 +635,12 @@ } }, "node_modules/@elastic/elasticsearch": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-8.15.0.tgz", - "integrity": "sha512-mG90EMdTDoT6GFSdqpUAhWK9LGuiJo6tOWqs0Usd/t15mPQDj7ZqHXfCBqNkASZpwPZpbAYVjd57S6nbUBINCg==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-8.15.2.tgz", + "integrity": "sha512-DTvjK4bs4WkgdQkXZJx2eVcwKzF1it/PyGT3rl1ReUNIWbkzMEKksiDQK3wY1U3WHT4zTuWQi4GrDOC1w5ej8Q==", "license": "Apache-2.0", "dependencies": { - "@elastic/transport": "^8.7.0", + "@elastic/transport": "^8.8.1", "tslib": "^2.4.0" }, "engines": { @@ -756,9 +648,9 @@ } }, "node_modules/@elastic/transport": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@elastic/transport/-/transport-8.8.1.tgz", - "integrity": "sha512-4RQIiChwNIx3B0O+2JdmTq/Qobj6+1g2RQnSv1gt4V2SVfAYjGwOKu0ZMKEHQOXYNG6+j/Chero2G9k3/wXLEw==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@elastic/transport/-/transport-8.9.1.tgz", + "integrity": "sha512-jasKNQeOb1vNf9aEYg+8zXmetaFjApDTSCC4QTl6aTixvyiRiSLcCiB8P6Q0lY9JIII/BhqNl8WbpFnsKitntw==", "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "1.x", @@ -774,17 +666,20 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } @@ -803,9 +698,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { @@ -1520,9 +1415,9 @@ } }, "node_modules/@opentelemetry/core": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", - "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.27.0.tgz", + "integrity": "sha512-yQPKnK5e+76XuiqUH/gKyS8wv/7qITd5ln56QkBTf3uggr0VkXOXfcaAuG330UfdYu83wsyoBwqwxigpIG+Jkg==", "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" @@ -1535,12 +1430,12 @@ } }, "node_modules/@opentelemetry/resources": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", - "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.27.0.tgz", + "integrity": "sha512-jOwt2VJ/lUD5BLc+PMNymDrUCpm5PKi1E9oSVYAvz01U/VdndGmrtV3DU1pG4AwlYhJRHbHfOUIlpBeXCPw6QQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.26.0", + "@opentelemetry/core": "1.27.0", "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { @@ -1551,13 +1446,13 @@ } }, "node_modules/@opentelemetry/sdk-metrics": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", - "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.27.0.tgz", + "integrity": "sha512-JzWgzlutoXCydhHWIbLg+r76m+m3ncqvkCcsswXAQ4gqKS+LOHKhq+t6fx1zNytvLuaOUBur7EvWxECc4jPQKg==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.26.0", - "@opentelemetry/resources": "1.26.0" + "@opentelemetry/core": "1.27.0", + "@opentelemetry/resources": "1.27.0" }, "engines": { "node": ">=14" @@ -1674,15 +1569,15 @@ } }, "node_modules/@stylistic/eslint-plugin": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.9.0.tgz", - "integrity": "sha512-OrDyFAYjBT61122MIY1a3SfEgy3YCMgt2vL4eoPmvTwDBwyQhAXurxNQznlRD/jESNfYWfID8Ej+31LljvF7Xg==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.10.1.tgz", + "integrity": "sha512-U+4yzNXElTf9q0kEfnloI9XbOyD4cnEQCxjUI94q0+W++0GAEQvJ/slwEj9lwjDHfGADRSr+Tco/z0XJvmDfCQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "^8.8.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", + "@typescript-eslint/utils": "^8.12.2", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "estraverse": "^5.3.0", "picomatch": "^4.0.2" }, @@ -1841,9 +1736,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.13", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.13.tgz", - "integrity": "sha512-wd+MVEZCHt23V0/L642O5APvspWply/rGY5BcW4SUETo2UzPU3Z26qr8jC2qxpimI2jjx9h7+2cj2FwIr01bXg==", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1877,7 +1772,8 @@ "node_modules/@types/uuid": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==" + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "license": "MIT" }, "node_modules/@types/yargs": { "version": "17.0.33", @@ -2095,16 +1991,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz", - "integrity": "sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.14.0.tgz", + "integrity": "sha512-OGqj6uB8THhrHj0Fk27DcHPojW7zKwKkPmHXHvQ58pLYp4hy8CSUdTKykKeh+5vFqTTVmjz0zCOOPKRovdsgHA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1" + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/typescript-estree": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2118,14 +2014,14 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", - "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.14.0.tgz", + "integrity": "sha512-aBbBrnW9ARIDn92Zbo7rguLnqQ/pOrUguVpbUwzOhkFg2npFDwTgPGqFqE0H5feXcOoJOfX3SxlJaKEVtq54dw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1" + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2136,9 +2032,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", - "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.14.0.tgz", + "integrity": "sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==", "dev": true, "license": "MIT", "engines": { @@ -2150,14 +2046,14 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", - "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.14.0.tgz", + "integrity": "sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2179,13 +2075,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", - "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.14.0.tgz", + "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/types": "8.14.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -2260,9 +2156,9 @@ } }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2353,30 +2249,6 @@ "node": ">=10" } }, - "node_modules/amqplib/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT" - }, - "node_modules/amqplib/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/amqplib/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "license": "MIT" - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -2894,9 +2766,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", - "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "funding": [ { @@ -2914,10 +2786,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001663", - "electron-to-chromium": "^1.5.28", + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -3026,9 +2898,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001668", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz", - "integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==", + "version": "1.0.30001680", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", + "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", "dev": true, "funding": [ { @@ -3336,9 +3208,9 @@ "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", "dev": true, "license": "MIT", "dependencies": { @@ -3595,9 +3467,9 @@ } }, "node_modules/elastic-apm-node": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/elastic-apm-node/-/elastic-apm-node-4.8.0.tgz", - "integrity": "sha512-XEfkWWQlIyv72QTCgScFzXWYM2znm/mA+6I8e2DMmr3lBdwemOTxBZw9jExu4OQ2uMc+Ld8wc5bbikkAYp4nng==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/elastic-apm-node/-/elastic-apm-node-4.8.1.tgz", + "integrity": "sha512-gryl5pJWd9Cp7qK+McHIFm9VlsqKipoXWIsKOGyPGzrddIVKKA8ONnLBwymQ1A2x4uXuk1HnIVwBvyk56vukaw==", "license": "BSD-2-Clause", "dependencies": { "@elastic/ecs-pino-format": "^1.5.0", @@ -3664,6 +3536,32 @@ "pino": "bin.js" } }, + "node_modules/elastic-apm-node/node_modules/pino-abstract-transport": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", + "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "license": "MIT", + "dependencies": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, + "node_modules/elastic-apm-node/node_modules/pino-abstract-transport/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/elastic-apm-node/node_modules/pino-std-serializers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", @@ -3676,6 +3574,40 @@ "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", "license": "MIT" }, + "node_modules/elastic-apm-node/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/elastic-apm-node/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/elastic-apm-node/node_modules/sonic-boom": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", @@ -3685,6 +3617,15 @@ "atomic-sleep": "^1.0.0" } }, + "node_modules/elastic-apm-node/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/elastic-apm-node/node_modules/thread-stream": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz", @@ -3695,9 +3636,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.36", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.36.tgz", - "integrity": "sha512-HYTX8tKge/VNp6FGO+f/uVDmUkq+cEfcxYhKf15Akc4M5yxt5YmorwlAitKWjWhWQnKcDRBAQKXkhqqXMqcrjw==", + "version": "1.5.58", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.58.tgz", + "integrity": "sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA==", "dev": true, "license": "ISC" }, @@ -3786,9 +3727,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "version": "1.23.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.4.tgz", + "integrity": "sha512-HR1gxH5OaiN7XH7uiWH0RLw0RcFySiSoW1ctxmD1ahTw3uGBtkmm/ng0tDU1OtYx5OK6EOL5Y6O21cDflG3Jcg==", "dev": true, "license": "MIT", "dependencies": { @@ -3807,7 +3748,7 @@ "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.4", "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", + "globalthis": "^1.0.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", @@ -3823,10 +3764,10 @@ "is-string": "^1.0.7", "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "object-inspect": "^1.13.3", "object-keys": "^1.1.1", "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", + "regexp.prototype.flags": "^1.5.3", "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", "string.prototype.trim": "^1.2.9", @@ -4227,20 +4168,20 @@ } }, "node_modules/eslint-plugin-n": { - "version": "17.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.11.1.tgz", - "integrity": "sha512-93IUD82N6tIEgjztVI/l3ElHtC2wTa9boJHrD8iN+NyDxjxz/daZUZKfkedjBZNdg6EqDk4irybUsiPwDqXAEA==", + "version": "17.13.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.13.1.tgz", + "integrity": "sha512-97qzhk1z3DdSJNCqT45EslwCu5+LB9GDadSyBItgKUfGsXAmN/aa7LRQ0ZxHffUxUzvgbTPJL27/pE9ZQWHy7A==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "enhanced-resolve": "^5.17.0", - "eslint-plugin-es-x": "^7.5.0", - "get-tsconfig": "^4.7.0", - "globals": "^15.8.0", - "ignore": "^5.2.4", + "@eslint-community/eslint-utils": "^4.4.1", + "enhanced-resolve": "^5.17.1", + "eslint-plugin-es-x": "^7.8.0", + "get-tsconfig": "^4.8.1", + "globals": "^15.11.0", + "ignore": "^5.3.2", "minimatch": "^9.0.5", - "semver": "^7.5.3" + "semver": "^7.6.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4253,9 +4194,9 @@ } }, "node_modules/eslint-plugin-n/node_modules/globals": { - "version": "15.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.11.0.tgz", - "integrity": "sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==", + "version": "15.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", + "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", "dev": true, "license": "MIT", "engines": { @@ -4299,9 +4240,9 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -4367,15 +4308,15 @@ } }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5717,10 +5658,9 @@ } }, "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "license": "MIT" }, "node_modules/isexe": { @@ -7323,9 +7263,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true, "license": "MIT", "engines": { @@ -7642,9 +7582,9 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, @@ -7675,15 +7615,15 @@ } }, "node_modules/pino": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-9.4.0.tgz", - "integrity": "sha512-nbkQb5+9YPhQRz/BeQmrWpEknAaqjpAqRK8NwJpmrX/JHu7JuZC5G1CeAwJDJfGes4h+YihC6in3Q2nGb+Y09w==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.5.0.tgz", + "integrity": "sha512-xSEmD4pLnV54t0NOUN16yCl7RIB1c5UUOse5HSyEXtBp+FgFQyPeDutc+Q2ZO7/22vImV7VfEjH/1zV2QuqvYw==", "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "^1.2.0", + "pino-abstract-transport": "^2.0.0", "pino-std-serializers": "^7.0.0", "process-warning": "^4.0.0", "quick-format-unescaped": "^4.0.3", @@ -7697,41 +7637,24 @@ } }, "node_modules/pino-abstract-transport": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", - "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", + "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", "license": "MIT", "dependencies": { - "readable-stream": "^4.0.0", "split2": "^4.0.0" } }, - "node_modules/pino-abstract-transport/node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/pino-elasticsearch": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pino-elasticsearch/-/pino-elasticsearch-8.0.0.tgz", - "integrity": "sha512-Q9plUD1r+NaD+LgrWB50VyYKlIRlx0U6RYcUTa/XkYFEKBWk0vePnuPaIRawPsu6/T+YVJzRnloJBQwYdiLrHA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/pino-elasticsearch/-/pino-elasticsearch-8.1.0.tgz", + "integrity": "sha512-noIBaNfEGPglMcZDP2aE3/e4bL1AqS05vmbftNA6ml7f9yaEfv4CEe1PRGr0CxwjYG3/rOAPXgzFDbfPH1GKcg==", "license": "MIT", "dependencies": { - "@elastic/elasticsearch": "^8.0.0", - "minimist": "^1.2.5", + "@elastic/elasticsearch": "^8.13.1", + "minimist": "^1.2.8", "pump": "^3.0.0", - "split2": "^4.0.0" + "split2": "^4.2.0" }, "bin": { "pino-elasticsearch": "cli.js" @@ -8022,17 +7945,15 @@ "license": "MIT" }, "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", "license": "MIT", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" } }, "node_modules/readable-web-to-node-stream": { @@ -8051,6 +7972,49 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/readable-web-to-node-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readable-web-to-node-stream/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/readable-web-to-node-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/real-require": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", @@ -8329,6 +8293,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -8516,9 +8487,9 @@ } }, "node_modules/sonic-boom": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.1.0.tgz", - "integrity": "sha512-NGipjjRicyJJ03rPiZCJYjwlsuP2d1/5QUviozRXC7S3WdVWNK5e3Ojieb9CCyfhq2UC+3+SRd9nG3I2lPRvUw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", + "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" @@ -8623,16 +8594,21 @@ "readable-stream": "^3.0.6" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "node_modules/stream-chopper/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { - "safe-buffer": "~5.2.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, - "node_modules/string_decoder/node_modules/safe-buffer": { + "node_modules/stream-chopper/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", @@ -8652,6 +8628,21 @@ ], "license": "MIT" }, + "node_modules/stream-chopper/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "license": "MIT" + }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -8934,16 +8925,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -8984,9 +8965,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz", + "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==", "dev": true, "license": "MIT", "engines": { @@ -9126,9 +9107,9 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, "node_modules/tweetnacl": { @@ -9331,9 +9312,9 @@ } }, "node_modules/undici": { - "version": "6.20.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.20.1.tgz", - "integrity": "sha512-AjQF1QsmqfJys+LXfGTNum+qw4S88CojRInG/6t31W/1fk6G59s92bnAvGz5Cmur+kQv2SURXEvvudLmbrE8QA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", + "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", "license": "MIT", "engines": { "node": ">=18.17"