From 6957ed22cd9cb1aad27f589acff86416e1ab046f Mon Sep 17 00:00:00 2001 From: Yi-an Shih Date: Mon, 12 Aug 2024 17:37:39 +1000 Subject: [PATCH] feat: support elasticsearch module --- brownie/.env.example | 9 +- .../helm/templates/dev-secretstore.yaml | 22 + .../helm/templates/external-secrets.yaml | 38 + brownie/package-lock.json | 764 ++---------------- brownie/package.json | 3 +- brownie/scripts/deploy.sh | 4 + brownie/src/bootstrap.ts | 8 +- brownie/src/config.ts | 4 +- brownie/src/index.ts | 11 + brownie/src/modules/elasticsearch/config.ts | 43 + .../modules/elasticsearch/implementation.ts | 86 ++ brownie/test/elasticsearch-config.spec.ts | 79 ++ k8s-deployer/package-lock.json | 4 +- k8s-deployer/package.json | 2 +- lock-manager/package-lock.json | 4 +- lock-manager/package.json | 2 +- 16 files changed, 398 insertions(+), 685 deletions(-) create mode 100644 brownie/src/modules/elasticsearch/config.ts create mode 100644 brownie/src/modules/elasticsearch/implementation.ts create mode 100644 brownie/test/elasticsearch-config.spec.ts diff --git a/brownie/.env.example b/brownie/.env.example index 8190eba..e2d92cc 100644 --- a/brownie/.env.example +++ b/brownie/.env.example @@ -30,9 +30,16 @@ KAFKA_PASSWORD=admin POSTGRESQL_CONFIG_NAMES="server1 server2" +#Elasticsearch +ELASTICSEARCH_BROKER_PROTOCOL=http +ELASTICSEARCH_BROKERS=$LOCAL_HOST_IP +ELASTICSEARCH_PORT=9200 +ELASTICSEARCH_USERNAME=admin +ELASTICSEARCH_PASSWORD=admin + ENABLED_MODULES="postgresql=server1;server2,kafka" BROWNIE_NODE_OPTIONS=--max-heap-size=256 # Pattern with group wich extracts timestamp made of 14 digits: yyyyMMddHHmmss prefixed with "ts" -TIMESTAMP_PATTRN="^.*pit.*_(ts\d{14,14}).*" +TIMESTAMP_PATTERN="^.*pit.*_(ts\d{14,14}).*" # The format is: , where unit is "days" or "hours" or "minutes" RETENTION_PERIOD=5days \ No newline at end of file diff --git a/brownie/deployment/helm/templates/dev-secretstore.yaml b/brownie/deployment/helm/templates/dev-secretstore.yaml index 54aaa40..41f6722 100644 --- a/brownie/deployment/helm/templates/dev-secretstore.yaml +++ b/brownie/deployment/helm/templates/dev-secretstore.yaml @@ -54,4 +54,26 @@ spec: } {{- end }} {{- end }} + {{- if not .Values.ELASTICSEARCH_CONFIG_NAMES }} + - key: {{ .Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }} + value: | + { + "hostnames": {{ .Values.ELASTICSEARCH_BROKERS | quote }}, + "port": {{ .Values.ELASTICSEARCH_PORT | quote }}, + "username": {{ .Values.ELASTICSEARCH_USERNAME | quote }}, + "password": {{ .Values.ELASTICSEARCH_PASSWORD | quote }} + } + {{- end }} + {{- if .Values.ELASTICSEARCH_CONFIG_NAMES }} + {{- range $cfgName := .Values.ELASTICSEARCH_CONFIG_NAMES }} + - key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{$cfgName | lower}} + value: | + { + "hostnames": {{ (index $.Values (printf "%s_ELASTICSEARCH_BROKERS" ($cfgName | upper))) | quote }}, + "port": {{ (index $.Values (printf "%s_ELASTICSEARCH_PORT" ($cfgName | upper))) | quote }}, + "username": {{ (index $.Values (printf "%s_ELASTICSEARCH_USERNAME" ($cfgName | upper))) | quote }}, + "password": {{ (index $.Values (printf "%s_ELASTICSEARCH_PASSWORD" ($cfgName | upper))) | quote }} + } + {{- end }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/brownie/deployment/helm/templates/external-secrets.yaml b/brownie/deployment/helm/templates/external-secrets.yaml index 43fdea4..6a78512 100644 --- a/brownie/deployment/helm/templates/external-secrets.yaml +++ b/brownie/deployment/helm/templates/external-secrets.yaml @@ -104,4 +104,42 @@ spec: key: {{ $.Values.EXTERNAL_SECRET_KAFKA_PATH }}-{{ $cfgName | lower }} property: password {{- end }} + {{- end }} + {{- if not .Values.ELASTICSEARCH_CONFIG_NAMES }} + - secretKey: ELASTICSEARCH_BROKERS + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }} + property: hostnames + - secretKey: ELASTICSEARCH_PORT + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }} + property: port + - secretKey: ELASTICSEARCH_USERNAME + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }} + property: username + - secretKey: ELASTICSEARCH_PASSWORD + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }} + property: password + {{- end }} + {{- if .Values.ELASTICSEARCH_CONFIG_NAMES }} + {{- range $cfgName := .Values.ELASTICSEARCH_CONFIG_NAMES }} + - secretKey: {{ $cfgName }}_ELASTICSEARCH_BROKERS + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }} + property: hostnames + - secretKey: {{ $cfgName | upper }}_ELASTICSEARCH_PORT + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }} + property: port + - secretKey: {{ $cfgName | upper }}_ELASTICSEARCH_USERNAME + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }} + property: username + - secretKey: {{ $cfgName | upper }}_ELASTICSEARCH_PASSWORD + remoteRef: + key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }} + property: password + {{- end }} {{- end }} \ No newline at end of file diff --git a/brownie/package-lock.json b/brownie/package-lock.json index 5f4d514..a4f2e9c 100644 --- a/brownie/package-lock.json +++ b/brownie/package-lock.json @@ -1,14 +1,15 @@ { "name": "brownie", - "version": "1.3.2-dev", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "brownie", - "version": "1.3.2-dev", + "version": "1.4.0", "license": "MIT", "dependencies": { + "@elastic/elasticsearch": "^8.5.0", "kafkajs": "^2.2.4", "pg": "^8.11.3", "pg-format": "^1.0.4", @@ -17,20 +18,16 @@ }, "devDependencies": { "@types/chai": "^4.3.11", - "@types/express": "^4.17.20", "@types/mocha": "^10.0.6", "@types/node": "^20.8.9", "@types/pg-format": "^1.0.5", "@types/sinon": "^17.0.2", - "@types/swagger-ui-express": "^4.1.6", "c8": "^8.0.1", "chai": "^4.3.10", - "copyfiles": "^2.4.1", "esmock": "^2.6.0", "mocha": "^10.2.0", "node-pg-migrate": "^6.2.2", "sinon": "^17.0.1", - "supertest": "^6.3.3", "typescript": "^5.2.2" } }, @@ -58,6 +55,35 @@ "kuler": "^2.0.0" } }, + "node_modules/@elastic/elasticsearch": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-8.5.0.tgz", + "integrity": "sha512-iOgr/3zQi84WmPhAplnK2W13R89VXD2oc6WhlQmH3bARQwmI+De23ZJKBEn7bvuG/AHMAqasPXX7uJIiJa2MqQ==", + "dependencies": { + "@elastic/transport": "^8.2.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@elastic/transport": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@elastic/transport/-/transport-8.7.0.tgz", + "integrity": "sha512-IqXT7a8DZPJtqP2qmX1I2QKmxYyN27kvSW4g6pInESE1SuGwZDp2FxHJ6W2kwmYOJwQdAt+2aWwzXO5jHo9l4A==", + "dependencies": { + "@opentelemetry/api": "1.x", + "debug": "^4.3.4", + "hpagent": "^1.0.0", + "ms": "^2.1.3", + "secure-json-parse": "^2.4.0", + "tslib": "^2.4.0", + "undici": "^6.12.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -92,6 +118,14 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", @@ -136,73 +170,18 @@ "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", "dev": true }, - "node_modules/@types/body-parser": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", - "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "dev": true, - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, "node_modules/@types/chai": { "version": "4.3.13", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.13.tgz", "integrity": "sha512-+LxQEbg4BDUf88utmhpUpTyYn1zHao443aGnXIAQak9ZMt9Rtsic0Oig0OS1xyIqdDXc5uMekoC6NaiUlkT/qA==", "dev": true }, - "node_modules/@types/connect": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", - "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/express": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", - "dev": true, - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.33", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "4.17.43", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", - "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", - "dev": true, - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*", - "@types/send": "*" - } - }, - "node_modules/@types/http-errors": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "dev": true - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, - "node_modules/@types/mime": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true - }, "node_modules/@types/mocha": { "version": "10.0.6", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", @@ -235,39 +214,6 @@ "integrity": "sha512-i+oEEJEC+1I3XAhgqtVp45Faj8MBbV0Aoq4rHsHD7avgLjyDkaWKObd514g0Q/DOUkdxU0P4CQ0iq2KR4SoJcw==", "dev": true }, - "node_modules/@types/qs": { - "version": "6.9.13", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.13.tgz", - "integrity": "sha512-iLR+1vTTJ3p0QaOUq6ACbY1mzKTODFDT/XedZI8BksOotFmL4ForwDfRQ/DZeuTHR7/2i4lI1D203gdfxuqTlA==", - "dev": true - }, - "node_modules/@types/range-parser": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true - }, - "node_modules/@types/send": { - "version": "0.17.4", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", - "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "dev": true, - "dependencies": { - "@types/mime": "^1", - "@types/node": "*" - } - }, - "node_modules/@types/serve-static": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", - "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", - "dev": true, - "dependencies": { - "@types/http-errors": "*", - "@types/mime": "*", - "@types/node": "*" - } - }, "node_modules/@types/sinon": { "version": "17.0.3", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", @@ -283,16 +229,6 @@ "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", "dev": true }, - "node_modules/@types/swagger-ui-express": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/swagger-ui-express/-/swagger-ui-express-4.1.6.tgz", - "integrity": "sha512-UVSiGYXa5IzdJJG3hrc86e8KdZWLYxyEsVoUI4iPXc7CO4VZ3AfNP8d/8+hrDRIqz+HAaSMtZSqAsF3Nq2X/Dg==", - "dev": true, - "dependencies": { - "@types/express": "*", - "@types/serve-static": "*" - } - }, "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", @@ -350,12 +286,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "dev": true - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -370,12 +300,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -456,25 +380,6 @@ "node": ">=12" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -631,27 +536,6 @@ "text-hex": "1.0.x" } }, - "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==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/component-emitter": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", - "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -664,75 +548,6 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, - "node_modules/cookiejar": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", - "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", - "dev": true - }, - "node_modules/copyfiles": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", - "dev": true, - "dependencies": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" - }, - "bin": { - "copyfiles": "copyfiles", - "copyup": "copyfiles" - } - }, - "node_modules/copyfiles/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/copyfiles/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/copyfiles/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -747,6 +562,27 @@ "node": ">= 8" } }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/decamelize": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", @@ -771,42 +607,6 @@ "node": ">=6" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "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==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/dezalgo": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", - "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", - "dev": true, - "dependencies": { - "asap": "^2.0.0", - "wrappy": "1" - } - }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -827,27 +627,6 @@ "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -878,12 +657,6 @@ "node": ">=14.16.0" } }, - "node_modules/fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true - }, "node_modules/fecha": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", @@ -944,35 +717,6 @@ "node": ">=8.0.0" } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formidable": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", - "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", - "dev": true, - "dependencies": { - "dezalgo": "^1.0.4", - "hexoid": "^1.0.0", - "once": "^1.4.0", - "qs": "^6.11.0" - }, - "funding": { - "url": "https://ko-fi.com/tunnckoCore/commissions" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -993,15 +737,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1020,25 +755,6 @@ "node": "*" } }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1071,18 +787,6 @@ "node": ">= 6" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1092,54 +796,6 @@ "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -1149,13 +805,12 @@ "he": "bin/he" } }, - "node_modules/hexoid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", - "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", - "dev": true, + "node_modules/hpagent": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-1.2.0.tgz", + "integrity": "sha512-A91dYTeIB6NoXG+PxTQpCCDDnfHsW9kc06Lvpu1TEe9gnd6ZFeiBoRO9JvzEv6xK7EX97/dUE8g/vBMTqTS3CA==", "engines": { - "node": ">=8" + "node": ">=14" } }, "node_modules/html-escaper": { @@ -1267,12 +922,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1399,11 +1048,6 @@ "node": ">= 12.0.0" } }, - "node_modules/logform/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -1440,36 +1084,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1603,12 +1217,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -1651,6 +1259,11 @@ "node": ">=10" } }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, "node_modules/nise": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", @@ -1720,16 +1333,6 @@ "node": ">=12" } }, - "node_modules/noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1739,15 +1342,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -2052,27 +1646,6 @@ "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", "dev": true }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2082,18 +1655,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -2157,6 +1718,11 @@ "node": ">=10" } }, + "node_modules/secure-json-parse": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", + "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==" + }, "node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", @@ -2181,23 +1747,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2219,24 +1768,6 @@ "node": ">=8" } }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -2294,12 +1825,6 @@ "node": "*" } }, - "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==", - "dev": true - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2338,75 +1863,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/superagent": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", - "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", - "dev": true, - "dependencies": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.4", - "debug": "^4.3.4", - "fast-safe-stringify": "^2.1.1", - "form-data": "^4.0.0", - "formidable": "^2.1.2", - "methods": "^1.1.2", - "mime": "2.6.0", - "qs": "^6.11.0", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=6.4.0 <13 || >=14" - } - }, - "node_modules/superagent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/superagent/node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/superagent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/supertest": { - "version": "6.3.4", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz", - "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", - "dev": true, - "dependencies": { - "methods": "^1.1.2", - "superagent": "^8.1.2" - }, - "engines": { - "node": ">=6.4.0" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2438,52 +1894,6 @@ "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/through2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2504,6 +1914,11 @@ "node": ">= 14.0.0" } }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -2526,21 +1941,20 @@ "node": ">=14.17" } }, + "node_modules/undici": { + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.7.tgz", + "integrity": "sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A==", + "engines": { + "node": ">=18.17" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, - "node_modules/untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/brownie/package.json b/brownie/package.json index 71436e2..76f020e 100644 --- a/brownie/package.json +++ b/brownie/package.json @@ -1,6 +1,6 @@ { "name": "brownie", - "version": "1.3.2-dev", + "version": "1.4.0", "description": "The resource cleanup application of PIT toolkit", "type": "module", "main": "dist/index.js", @@ -35,6 +35,7 @@ "start": "node $BROWNIE_NODE_OPTIONS dist/index.js" }, "dependencies": { + "@elastic/elasticsearch": "^8.5.0", "kafkajs": "^2.2.4", "pg": "^8.11.3", "pg-format": "^1.0.4", diff --git a/brownie/scripts/deploy.sh b/brownie/scripts/deploy.sh index 618cab7..c671104 100755 --- a/brownie/scripts/deploy.sh +++ b/brownie/scripts/deploy.sh @@ -29,6 +29,7 @@ HELM_OVERWRITES="\ --set ENABLED_MODULES=${ENABLED_MODULES} \ --set EXTERNAL_SECRET_DB_PATH=${EXTERNAL_SECRET_DB_PATH} \ --set EXTERNAL_SECRET_KAFKA_PATH=${EXTERNAL_SECRET_KAFKA_PATH} \ + --set EXTERNAL_SECRET_ELASTICSEARCH_PATH=${EXTERNAL_SECRET_ELASTICSEARCH_PATH} \ --set SECRET_STORE_NAME=${SECRET_STORE_NAME} \ --set IMAGE_TAG=${IMAGE_TAG} \ --set SERVICE_NAME=${SERVICE_NAME} \ @@ -90,6 +91,9 @@ HELM_OVERWRITES="${HELM_OVERWRITES} ${POSTGRESQL_CONFIGS}" KAFKA_CONFIGS=$(getModuleOverwrites "${KAFKA_CONFIG_NAMES}" "KAFKA_BROKERS KAFKA_PORT KAFKA_USERNAME KAFKA_PASSWORD KAFKA_CLIENT_ID") HELM_OVERWRITES="${HELM_OVERWRITES} ${KAFKA_CONFIGS}" +ELASTICSEARCH_CONFIGS=$(getModuleOverwrites "${ELASTICSEARCH_CONFIG_NAMES}" "ELASTICSEARCH_BROKER_PROTOCOL ELASTICSEARCH_BROKERS ELASTICSEARCH_PORT ELASTICSEARCH_USERNAME ELASTICSEARCH_PASSWORD") +HELM_OVERWRITES="${HELM_OVERWRITES} ${ELASTICSEARCH_CONFIGS}" + HELM_ARGS="upgrade --install --atomic --timeout 120s --namespace ${K8S_NAMESPACE}" HELM_TEMPLATE="template --debug --namespace ${K8S_NAMESPACE}" diff --git a/brownie/src/bootstrap.ts b/brownie/src/bootstrap.ts index f66ede5..e4f7fa3 100644 --- a/brownie/src/bootstrap.ts +++ b/brownie/src/bootstrap.ts @@ -1,8 +1,8 @@ import { logger } from "./logger.js" - import * as cfg from "./config.js" import { PgConfig } from "./modules/pg/config.js" import { KafkaConfig } from "./modules/kafka/config.js" +import { ElasticsearchConfig } from "./modules/elasticsearch/config.js" import { readParameterValue } from "./utils.js" export const readParams = (): cfg.Config => { @@ -23,6 +23,7 @@ export const readParams = (): cfg.Config => { const enabledModules: Map = cfg.parseModules(readParameterValue(params, cfg.Config.PARAM_ENABLED_MODULES, true)) let pgModules = new Map() let kafkaModules = new Map() + let elasticsearchModules = new Map() if (enabledModules.has(PgConfig.MODULE_NAME)) { pgModules = PgConfig.loadAll(enabledModules.get(PgConfig.MODULE_NAME), params, readParameterValue) @@ -32,10 +33,15 @@ export const readParams = (): cfg.Config => { kafkaModules = KafkaConfig.loadAll(enabledModules.get(KafkaConfig.MODULE_NAME), params, readParameterValue) } + if (enabledModules.has(ElasticsearchConfig.MODULE_NAME)) { + elasticsearchModules = ElasticsearchConfig.loadAll(enabledModules.get(ElasticsearchConfig.MODULE_NAME), params, readParameterValue) + } + return new cfg.Config( enabledModules, pgModules, kafkaModules, + elasticsearchModules, new RegExp(readParameterValue(params, cfg.Config.PARAM_TIMESTAMP_PATTERN, true, cfg.Config.DEFAULT_TIMESTAMP_PATTERN)), cfg.Config.parseRetention(readParameterValue(params, cfg.Config.PARAM_RETENTION_PERIOD, true, cfg.Config.DEFAULT_RETENTION_PERIOD)), readParameterValue(params, cfg.Config.PARAM_DRY_RUN, false, false) === "true" diff --git a/brownie/src/config.ts b/brownie/src/config.ts index bb99e8a..9bb7436 100644 --- a/brownie/src/config.ts +++ b/brownie/src/config.ts @@ -1,3 +1,4 @@ +import { ElasticsearchConfig } from "./modules/elasticsearch/config.js" import { KafkaConfig } from "./modules/kafka/config.js" import { PgConfig } from "./modules/pg/config.js" @@ -21,6 +22,7 @@ export class Config { readonly enabledModules: Map, readonly pgModules: Map, readonly kafkaModules: Map, + readonly elasticsearchModules: Map, readonly timestampPattern: RegExp, readonly retentionMinutes: number, readonly dryRun: boolean @@ -50,7 +52,7 @@ export class ModuleConfig { export const parseModules = (rawConfig: string): Map => { // rawConfig = "postgres=pg1;pg2;pg3,kafka=k1;k2;k3,elastic" - const supportedModules = [ PgConfig.MODULE_NAME, KafkaConfig.MODULE_NAME ] + const supportedModules = [ PgConfig.MODULE_NAME, KafkaConfig.MODULE_NAME, ElasticsearchConfig.MODULE_NAME ] const rawModules = rawConfig.split(",") if (rawModules.length > 5) { // this is very unlikely scenario diff --git a/brownie/src/index.ts b/brownie/src/index.ts index 133eba2..68233eb 100644 --- a/brownie/src/index.ts +++ b/brownie/src/index.ts @@ -6,6 +6,8 @@ import { KafkaConfig } from "./modules/kafka/config.js" import { PgConfig } from "./modules/pg/config.js" import * as KafkaModule from "./modules/kafka/implementation.js" import * as PgModule from "./modules/pg/implementation.js" +import * as ElasticsearchModule from "./modules//elasticsearch/implementation.js" +import { ElasticsearchConfig } from "./modules/elasticsearch/config.js" const main = async () => { const rawParams = process.argv.slice(2) @@ -31,6 +33,12 @@ const main = async () => { await KafkaModule.clean(moduleName, config, moduleConfig) } } + + if (config.isModuleEnabled(ElasticsearchConfig.MODULE_NAME)) { + for (let [moduleName, moduleConfig] of config.elasticsearchModules.entries()) { + await ElasticsearchModule.clean(moduleName, config, moduleConfig) + } + } } const printConfig = (config: Config) => { @@ -41,6 +49,9 @@ const printConfig = (config: Config) => { for (let module of config.kafkaModules.keys()) { cleanedConfig.kafkaModules[module] = { ...config.kafkaModules.get(module), password: "*** hidden ***" } } + for (let module of config.elasticsearchModules.keys()) { + cleanedConfig.elasticsearchModules[module] = { ...config.elasticsearchModules.get(module), password: "*** hidden ***" } + } logger.info("main(), Parsed configuration: \n%s", JSON.stringify({ ...cleanedConfig, timestampPattern: config.timestampPattern.toString() }, null, 2)) } diff --git a/brownie/src/modules/elasticsearch/config.ts b/brownie/src/modules/elasticsearch/config.ts new file mode 100644 index 0000000..dda971a --- /dev/null +++ b/brownie/src/modules/elasticsearch/config.ts @@ -0,0 +1,43 @@ +import { ModuleConfig, ValueReader } from "../../config.js" + +export class ElasticsearchConfig { + static MODULE_NAME: string = "elasticsearch" + + static PARAM_BROKER_PROTOCOL: string = "--elasticsearch-broker-protocol" + static PARAM_BROKERS: string = "--elasticsearch-brokers" + static PARAM_PORT: string = "--elasticsearch-port" + static PARAM_USERNAME: string = "--elasticsearch-username" + static PARAM_PASSWORD: string = "--elasticsearch-password" + + constructor( + readonly moduleName: string, + readonly brokerProtocol: string, + readonly brokers: string, + readonly port: string, + readonly username: string, + readonly password: string, + ) {} + + static loadAll = (moduleConfig: ModuleConfig, params: Map, valueReader: ValueReader): Map => { + const result = new Map() + for (let id of moduleConfig.ids) { + result.set(id, ElasticsearchConfig.loadOne(id, params, valueReader)) + } + + return result + } + + private static loadOne = (name: string, params: Map, valueReader: ValueReader): ElasticsearchConfig => { + const getParamName = (param: string, prefix: string): string => prefix.length == 0 ? param : `--${prefix}-${param.substring(2)}` + + const prefix = name === ElasticsearchConfig.MODULE_NAME ? "" : name + return new ElasticsearchConfig( + name, + valueReader(params, getParamName(ElasticsearchConfig.PARAM_BROKER_PROTOCOL, prefix), true, "https"), + valueReader(params, getParamName(ElasticsearchConfig.PARAM_BROKERS, prefix), true), + valueReader(params, getParamName(ElasticsearchConfig.PARAM_PORT, prefix), true), + valueReader(params, getParamName(ElasticsearchConfig.PARAM_USERNAME, prefix), true), + valueReader(params, getParamName(ElasticsearchConfig.PARAM_PASSWORD, prefix), true), + ) + } +} diff --git a/brownie/src/modules/elasticsearch/implementation.ts b/brownie/src/modules/elasticsearch/implementation.ts new file mode 100644 index 0000000..d8a0120 --- /dev/null +++ b/brownie/src/modules/elasticsearch/implementation.ts @@ -0,0 +1,86 @@ +import { Client, ClientOptions } from "@elastic/elasticsearch" +import { CatIndicesResponse } from "@elastic/elasticsearch/lib/api/types.js" +import { logger } from "../../logger.js" +import { Config } from "../../config.js" +import { ResourceStatus, evaluateResource } from "../../utils.js" +import { ElasticsearchConfig } from "./config.js" + +export const clean = async (moduleName: string, config: Config, moduleConfig: ElasticsearchConfig) => { + logger.info("%s.clean(): Cleaning Elasticsearch indics...", moduleName) + + let cleanedCount = 0 + + const { brokerProtocol = "https", brokers, port, username, password } = moduleConfig + + const basicAuth: ClientOptions["auth"] = username && password ? { password, username } : undefined + + const nodes = brokers + .split(",") + .map((b) => b.trim()) + .map((hostname: string) => `${brokerProtocol}://${hostname}:${port}`) + + const client = new Client({ + auth: basicAuth, + nodes: nodes as string[], + }) + + logger.info("%s.clean(): Connecting to Elasticsearch server...", moduleName) + + try { + await client.ping() + logger.info("%s.clean(): Elasticsearch Connected", moduleName) + } catch (e) { + logger.error("%s.clean(): Unable to connect Elasticsearch. Error: %s", moduleName, e.message) + if (e.cause) logger.error(e.cause) + if (e.stack) logger.error("Stack:\n%s", e.stack) + return + } + + let indexRecords: CatIndicesResponse = [] + + try { + indexRecords = await client.cat.indices({ format: "json" }) + } catch (e) { + logger.error("%s.clean(): Unable to fetch indics. Error: %s", moduleName, e.message) + if (e.cause) logger.error(e.cause) + if (e.stack) logger.error("Stack:\n%s", e.stack) + return + } + + for (const record of indexRecords) { + const { index = "" } = record + + try { + const status = evaluateResource(index, config.timestampPattern, new Date(), config.retentionMinutes) + if (status !== ResourceStatus.CLEAN) continue + } catch (e) { + logger.error("%s.clean(): Unable to evaluate index '%s'. Error: %s", moduleName, index, e.message) + if (e.cause) logger.error(e.cause) + if (e.stack) logger.error("Stack:\n%s", e.stack) + } + + try { + logger.info("%s.clean(): Deleting the expired index: %s", moduleName, index) + + if (config.dryRun) { + logger.info("%s.clean(): Index has NOT been deleted (dry run mode): %s", moduleName, index) + } else { + await client.indices.delete({ index }) + logger.info("%s.clean(): Index has been deleted: %s", moduleName, index) + } + cleanedCount++ + const sleep = new Promise((resolve) => setTimeout(resolve, 2_000)) + await sleep + } catch (e) { + logger.error("%s.clean(): Unable to delete index '%s'. Error: %s", moduleName, index, e.message) + if (e.cause) logger.error(e.cause) + if (e.stack) logger.error("Stack:\n%s", e.stack) + } + } + + if (cleanedCount > 0) { + logger.info("%s.clean(): Deleted %s %s", moduleName, cleanedCount, cleanedCount > 1 ? "indics" : "index") + } else { + logger.info("%s.clean(): There is no index to delete", moduleName) + } +} diff --git a/brownie/test/elasticsearch-config.spec.ts b/brownie/test/elasticsearch-config.spec.ts new file mode 100644 index 0000000..a467f1b --- /dev/null +++ b/brownie/test/elasticsearch-config.spec.ts @@ -0,0 +1,79 @@ +import * as chai from "chai" +import { ElasticsearchConfig } from "../src/modules/elasticsearch/config.js" +import { ModuleConfig } from "../src/config.js" + +describe("Tests for modules/elasticsearch/config.ts", () => { + it("should load multiple elasticsearch configs", () => { + const moduleConfig = new ModuleConfig("elasticsearch", [ "server1", "server2" ]) + const makeParam = (prefix: string, param: string): string => `--${prefix}-${param.substring(2)}` + const params = new Map([ + [ makeParam("server1", ElasticsearchConfig.PARAM_BROKER_PROTOCOL), "http" ], + [ makeParam("server1", ElasticsearchConfig.PARAM_BROKERS), "localhost" ], + [ makeParam("server1", ElasticsearchConfig.PARAM_PORT), "9200" ], + [ makeParam("server1", ElasticsearchConfig.PARAM_USERNAME), "admin" ], + [ makeParam("server1", ElasticsearchConfig.PARAM_PASSWORD), "admin-pwd" ], + + [ makeParam("server2", ElasticsearchConfig.PARAM_BROKER_PROTOCOL), "http" ], + [ makeParam("server2", ElasticsearchConfig.PARAM_BROKERS), "localhost2" ], + [ makeParam("server2", ElasticsearchConfig.PARAM_PORT), "9200" ], + [ makeParam("server2", ElasticsearchConfig.PARAM_USERNAME), "admin2" ], + [ makeParam("server2", ElasticsearchConfig.PARAM_PASSWORD), "admin2-pwd" ], + + ]) + const valueReader = (_a: Map, param: string, _b?: boolean, _c?: any): any | undefined => params.get(param) + + console.log(JSON.stringify(Object.fromEntries(params), null, 2)) + + const config = ElasticsearchConfig.loadAll(moduleConfig, params, valueReader) + + chai.expect(config).be.not.null + chai.expect(config).be.not.undefined + chai.expect(config.size).eq(2) + chai.expect(config.has("server1")).be.true + chai.expect(config.has("server2")).be.true + + chai.expect(config.get("server1").moduleName).eq("server1") + chai.expect(config.get("server1").brokerProtocol).eq("http") + chai.expect(config.get("server1").brokers).deep.eq("localhost") + chai.expect(config.get("server1").port).deep.eq("9200") + chai.expect(config.get("server1").username).eq("admin") + chai.expect(config.get("server1").password).eq("admin-pwd") + + chai.expect(config.get("server2").moduleName).eq("server2") + chai.expect(config.get("server2").brokerProtocol).eq("http") + chai.expect(config.get("server2").brokers).deep.eq("localhost2") + chai.expect(config.get("server2").port).deep.eq("9200") + chai.expect(config.get("server2").username).eq("admin2") + chai.expect(config.get("server2").password).eq("admin2-pwd") + }) + + it("should load elasticsearch config for single server", () => { + const moduleConfig = new ModuleConfig("elasticsearch", [ "elasticsearch" ]) + const params = new Map([ + [ ElasticsearchConfig.PARAM_BROKER_PROTOCOL, "http" ], + [ ElasticsearchConfig.PARAM_BROKERS, "localhost" ], + [ ElasticsearchConfig.PARAM_PORT, "9200" ], + [ ElasticsearchConfig.PARAM_USERNAME, "admin" ], + [ ElasticsearchConfig.PARAM_PASSWORD, "admin-pwd" ], + + ]) + const valueReader = (_a: Map, param: string, _b?: boolean, _c?: any): any | undefined => params.get(param) + + console.log(JSON.stringify(Object.fromEntries(params), null, 2)) + + const config = ElasticsearchConfig.loadAll(moduleConfig, params, valueReader) + + chai.expect(config).be.not.null + chai.expect(config).be.not.undefined + chai.expect(config.size).eq(1) + chai.expect(config.has("elasticsearch")).be.true + + chai.expect(config.get("elasticsearch").moduleName).eq("elasticsearch") + chai.expect(config.get("elasticsearch").brokerProtocol).eq("http") + chai.expect(config.get("elasticsearch").brokers).deep.eq("localhost") + chai.expect(config.get("elasticsearch").port).deep.eq("9200") + chai.expect(config.get("elasticsearch").username).eq("admin") + chai.expect(config.get("elasticsearch").password).eq("admin-pwd") + }) + +}) \ No newline at end of file diff --git a/k8s-deployer/package-lock.json b/k8s-deployer/package-lock.json index b7360ac..91ee426 100644 --- a/k8s-deployer/package-lock.json +++ b/k8s-deployer/package-lock.json @@ -1,12 +1,12 @@ { "name": "@kindredgroup/pit-k8s-deployer", - "version": "1.3.2-dev", + "version": "1.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@kindredgroup/pit-k8s-deployer", - "version": "1.3.2-dev", + "version": "1.4.0", "license": "MIT", "dependencies": { "ajv": "^8.12.0", diff --git a/k8s-deployer/package.json b/k8s-deployer/package.json index d745eaa..8c5cd6c 100644 --- a/k8s-deployer/package.json +++ b/k8s-deployer/package.json @@ -1,6 +1,6 @@ { "name": "@kindredgroup/pit-k8s-deployer", - "version": "1.3.2-dev", + "version": "1.4.0", "description": "The deployment utility for apps designed to run in K8s clusters", "type": "module", "main": "dist/index.js", diff --git a/lock-manager/package-lock.json b/lock-manager/package-lock.json index 3ae8503..b5d52e2 100644 --- a/lock-manager/package-lock.json +++ b/lock-manager/package-lock.json @@ -1,12 +1,12 @@ { "name": "lock-manager", - "version": "1.3.2-dev", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lock-manager", - "version": "1.3.2-dev", + "version": "1.4.0", "license": "MIT", "dependencies": { "express": "^4.18.2", diff --git a/lock-manager/package.json b/lock-manager/package.json index 8c101c0..e2a5d0e 100644 --- a/lock-manager/package.json +++ b/lock-manager/package.json @@ -1,6 +1,6 @@ { "name": "lock-manager", - "version": "1.3.2-dev", + "version": "1.4.0", "description": "The lock manager application of PIT toolkit", "type": "module", "main": "dist/index.js",