From 88790a08c315b44fdab6c0f1a4e0c28b098ef1e7 Mon Sep 17 00:00:00 2001 From: Thomas Hoppe Date: Wed, 13 Nov 2024 07:45:26 +0100 Subject: [PATCH] chore: upgrade deps --- .eslintrc.cjs | 11 - package-lock.json | 617 ++++++++++++++++++++++++++++++--------- package.json | 30 +- src/schedulingService.ts | 134 +++++---- src/utilts.ts | 5 +- src/worker.ts | 47 +-- 6 files changed, 580 insertions(+), 264 deletions(-) delete mode 100644 .eslintrc.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 1cde600..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - extends: './node_modules/@restorecommerce/dev/.eslintrc.cjs', - parserOptions: { - project: [ - 'tsconfig.json', - ], - }, - rules: { - '@typescript-eslint/consistent-type-imports': 0 - } -}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 52e4c02..f2b7b4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,24 +9,24 @@ "version": "1.2.7", "license": "MIT", "dependencies": { - "@bull-board/api": "6.3.3", - "@bull-board/express": "6.3.3", - "@bull-board/koa": "6.3.3", - "@restorecommerce/acs-client": "3.0.5", - "@restorecommerce/chassis-srv": "^1.6.2", - "@restorecommerce/kafka-client": "1.2.18", + "@bull-board/api": "6.4.0", + "@bull-board/express": "6.4.0", + "@bull-board/koa": "6.4.0", + "@restorecommerce/acs-client": "3.0.6", + "@restorecommerce/chassis-srv": "1.6.4", + "@restorecommerce/kafka-client": "1.2.19", "@restorecommerce/logger": "1.3.2", - "@restorecommerce/rc-grpc-clients": "5.1.40", - "@restorecommerce/scs-jobs": "0.1.45", + "@restorecommerce/rc-grpc-clients": "5.1.41", + "@restorecommerce/scs-jobs": "0.1.46", "@restorecommerce/service-config": "1.0.16", - "bullmq": "5.25.3", - "cache-manager": "6.1.2", + "bullmq": "5.25.6", + "cache-manager": "6.1.3", "cache-manager-redis": "^0.6.0", "cron-parser": "^4.9.0", "crypto": "^1.0.1", "express": "5.0.1", "lodash-es": "^4.17.21", - "uuid": "11.0.2" + "uuid": "11.0.3" }, "devDependencies": { "@alenon/grpc-mock-server": "3.1.15", @@ -48,13 +48,14 @@ "esbuild": "0.24.0", "eslint": "9.14.0", "husky": "9.1.6", - "mocha": "10.8.2", + "mocha": "11.0.0", "nodemon": "3.1.7", "npm-run-all": "^4.1.5", - "rimraf": "^5.0.7", + "rimraf": "6.0.1", "should": "^13.2.3", "ts-node": "^10.9.2", - "typescript": "5.6.3" + "typescript": "^5.6.3", + "typescript-eslint": "8.14.0" }, "engines": { "node": ">= 20.8.0" @@ -76,6 +77,20 @@ "protobufjs": "^7.2.5" } }, + "node_modules/@alenon/grpc-mock-server/node_modules/@grpc/grpc-js": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.11.3.tgz", + "integrity": "sha512-i9UraDzFHMR+Iz/MhFLljT+fCpgxZ3O6CxwGJ8YuNYHJItIHUzKJpW2LvoFZNnGPwqc9iWy9RAucxV0JoR9aUQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -300,25 +315,25 @@ "license": "(Apache-2.0 AND BSD-3-Clause)" }, "node_modules/@bull-board/api": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/@bull-board/api/-/api-6.3.3.tgz", - "integrity": "sha512-HtdFE53zC0o5QyYR7u0j+R06Iid6USZatai+s4scDlmanLh2/Ic+8zkzMcHGOM8urC2g49EasOMXB5eBXp9lnA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@bull-board/api/-/api-6.4.0.tgz", + "integrity": "sha512-ZWYesBlvmOzpSLTvTElbMLLNzNNtINITHCqyfM2Oh7eOkxZtixyj3NrJWw9YSH4zpJbXBaWhtDQ7/9FAE7HDwg==", "license": "MIT", "dependencies": { "redis-info": "^3.0.8" }, "peerDependencies": { - "@bull-board/ui": "6.3.3" + "@bull-board/ui": "6.4.0" } }, "node_modules/@bull-board/express": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/@bull-board/express/-/express-6.3.3.tgz", - "integrity": "sha512-UKNR+ud0XuENSERmuLFYA4HqchrlTBPEXLw0dA25CA7CRWrRDp/jj8bAnmuMtThHqI/YTw2MNozR7PyXB3I5Eg==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@bull-board/express/-/express-6.4.0.tgz", + "integrity": "sha512-7a1w2yzDLJJLq4SsuoK6YXm5YUJq8tzM9uOf6uRej76d8U5NfyPFq48HZjOdZ67ANkefQiqwx+2naHdQhfoMkA==", "license": "MIT", "dependencies": { - "@bull-board/api": "6.3.3", - "@bull-board/ui": "6.3.3", + "@bull-board/api": "6.4.0", + "@bull-board/ui": "6.4.0", "ejs": "^3.1.10", "express": "^4.19.2" } @@ -556,13 +571,13 @@ } }, "node_modules/@bull-board/koa": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/@bull-board/koa/-/koa-6.3.3.tgz", - "integrity": "sha512-nADw8Ok6sN2hhu40weR1u+iycgZr07DO1IeKDSWxZM9Mvy0JAjrTUY5U8y5/mIvJsxxd6Xe02Zl1jcBulWIyIg==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@bull-board/koa/-/koa-6.4.0.tgz", + "integrity": "sha512-gWRLm57akmZu/vCUixyKQ6rTToBCOSyVGoU05OnvfmE2rw0ZkXZE0tih9N3egsSvdJYjGZdjgsorX0z++/bo4g==", "license": "MIT", "dependencies": { - "@bull-board/api": "6.3.3", - "@bull-board/ui": "6.3.3", + "@bull-board/api": "6.4.0", + "@bull-board/ui": "6.4.0", "@koa/bodyparser": "^5.1.1", "ejs": "^3.1.10", "koa": "^2.15.3", @@ -573,12 +588,12 @@ } }, "node_modules/@bull-board/ui": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-6.3.3.tgz", - "integrity": "sha512-5tEJUQyw0ezTKlG8Kko0S4kVQE0a1OfyUUy7VciiXlVW8D3mvPgm2r628iBB9x/aDJPf6QSu3xyAva49eoROZA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-6.4.0.tgz", + "integrity": "sha512-oFbYE5bFvlFXqYm+23LNoq8pHFGz9tAaj5DYeeZ7MubRi+Cwyj1BFbTtA/rmizt6iOg4V7Hro4mYzVWw8gJxmw==", "license": "MIT", "dependencies": { - "@bull-board/api": "6.3.3" + "@bull-board/api": "6.4.0" } }, "node_modules/@colors/colors": { @@ -1657,11 +1672,12 @@ } }, "node_modules/@grpc/grpc-js": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.6.tgz", - "integrity": "sha512-xP58G7wDQ4TCmN/cMUHh00DS7SRDv/+lC+xFLrTkMIN8h55X5NhZMLYbvy7dSELP15qlI6hPhNCRWVMtZMwqLA==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.12.2.tgz", + "integrity": "sha512-bgxdZmgTrJZX50OjyVwz3+mNEnCTNkh3cIqGPWVNeW9jX6bn1ZkU80uPd+67/ZpIJIjRQ9qaHCjhavyoWYxumg==", + "license": "Apache-2.0", "dependencies": { - "@grpc/proto-loader": "^0.7.10", + "@grpc/proto-loader": "^0.7.13", "@js-sdsl/ordered-map": "^4.4.2" }, "engines": { @@ -2525,15 +2541,15 @@ } }, "node_modules/@restorecommerce/acs-client": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@restorecommerce/acs-client/-/acs-client-3.0.5.tgz", - "integrity": "sha512-KnkaVBtt52fOKUi5osEfUCQArfPXxaSEMGRB9F8u9NvX+zDkMIqv3ic2KwTBxGrNw398w6BQS01v9QwD1CPB3Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@restorecommerce/acs-client/-/acs-client-3.0.6.tgz", + "integrity": "sha512-EwDmlEZiSTQZxQMA3cCMM2Ra2M3BlIuysL8YHcJpPjx/M0BS2N4jSZK1tb1mVdPO8F7dwQYhxr8kmQmrUu8oug==", "license": "MIT", "dependencies": { "@restorecommerce/grpc-client": "^2.2.5", - "@restorecommerce/kafka-client": "^1.2.18", + "@restorecommerce/kafka-client": "^1.2.19", "@restorecommerce/logger": "^1.3.2", - "@restorecommerce/rc-grpc-clients": "^5.1.40", + "@restorecommerce/rc-grpc-clients": "^5.1.41", "@restorecommerce/service-config": "^1.0.16", "deepdash": "^5.3.9", "lodash": "^4.17.21", @@ -2544,9 +2560,10 @@ } }, "node_modules/@restorecommerce/chassis-srv": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@restorecommerce/chassis-srv/-/chassis-srv-1.6.2.tgz", - "integrity": "sha512-eAcqN7JDyr58WsxN1pHQWoc41dFH5On+v9JIXQqnnYErs1cRKmlGg+jEHRBxmTpryNhtIjJRDeEcRjoA3hEIVA==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@restorecommerce/chassis-srv/-/chassis-srv-1.6.4.tgz", + "integrity": "sha512-VTsBdVHrO5Ij9lL6ZKig+hK8EVVSB00kEXPbRM+FY+ILq/mYyTod44rPiWJMY1YGVpT+LbZuAxMV2UkuWfYkaQ==", + "license": "MIT", "dependencies": { "@grpc/grpc-js": "^1.10.10", "@restorecommerce/grpc-client": "^2.2.4", @@ -2625,6 +2642,259 @@ "typescript": ">=5.0.0" } }, + "node_modules/@restorecommerce/dev/node_modules/@typescript-eslint/scope-manager": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", + "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@restorecommerce/dev/node_modules/@typescript-eslint/type-utils": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.11.0.tgz", + "integrity": "sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/utils": "8.11.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@restorecommerce/dev/node_modules/@typescript-eslint/types": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", + "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@restorecommerce/dev/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", + "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@restorecommerce/dev/node_modules/@typescript-eslint/utils": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.11.0.tgz", + "integrity": "sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@restorecommerce/dev/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", + "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.11.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@restorecommerce/dev/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@restorecommerce/dev/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@restorecommerce/dev/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@restorecommerce/dev/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@restorecommerce/dev/node_modules/typescript-eslint": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.11.0.tgz", + "integrity": "sha512-cBRGnW3FSlxaYwU8KfAewxFK5uzeOAp0l2KebIlPDOT5olVi65KDG/yjBooPBG0kGW/HLkoz1c/iuBFehcS3IA==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.11.0", + "@typescript-eslint/parser": "8.11.0", + "@typescript-eslint/utils": "8.11.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@restorecommerce/dev/node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz", + "integrity": "sha512-KhGn2LjW1PJT2A/GfDpiyOfS4a8xHQv2myUagTM5+zsormOmBlYsnQ6pobJ8XxJmh6hnHwa2Mbe3fPrDJoDhbA==", + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/type-utils": "8.11.0", + "@typescript-eslint/utils": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@restorecommerce/dev/node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", + "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@restorecommerce/grpc-client": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/@restorecommerce/grpc-client/-/grpc-client-2.2.5.tgz", @@ -2649,14 +2919,27 @@ "node": ">= 20.0.0" } }, + "node_modules/@restorecommerce/grpc-client/node_modules/uuid": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.2.tgz", + "integrity": "sha512-14FfcOJmqdjbBPdDjFQyk/SdT4NySW4eM0zcG+HqbHP5jzuH56xO3J1DGhgs/cEMCfwYi3HQI1gnTO62iaG+tQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/@restorecommerce/kafka-client": { - "version": "1.2.18", - "resolved": "https://registry.npmjs.org/@restorecommerce/kafka-client/-/kafka-client-1.2.18.tgz", - "integrity": "sha512-EWog2Is1Sborx3FxH48kXdrLGlAg86Bae3j5fYzJzMgqWOz9vfT0iaOYZoHxUp1TZAfCczqMPNkebt2aWPN7Ww==", + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@restorecommerce/kafka-client/-/kafka-client-1.2.19.tgz", + "integrity": "sha512-WIvXJETAZRvxrcBgfIJxrCGm8n5qfPdh7EtO9Ip5YofYUwv/aNJOzY4V9BZ4z0xmqft/mJkRvV/wImywivd2FQ==", "license": "MIT", "dependencies": { "@restorecommerce/logger": "^1.3.2", - "@restorecommerce/rc-grpc-clients": "^5.1.40", + "@restorecommerce/rc-grpc-clients": "^5.1.41", "async": "^3.2.6", "cls-rtracer": "^2.6.3", "events": "^3.3.0", @@ -2693,9 +2976,9 @@ "integrity": "sha512-J/GspWIGoosderB5IRpWrVRZV/rhYl4eiS5lQsNi4VkR2F3vf5uZx63jlyU+0GdD9hwsLZ9p6YhB0vY4ZcwajQ==" }, "node_modules/@restorecommerce/rc-grpc-clients": { - "version": "5.1.40", - "resolved": "https://registry.npmjs.org/@restorecommerce/rc-grpc-clients/-/rc-grpc-clients-5.1.40.tgz", - "integrity": "sha512-Q8qXiPGtIqq/GuWwWq8aaZ2fnnKXIuPCUzqBJHLTnTDNbcIffGeqy47+kglo4a9qgZA1BD86YznmPzwU3HIIfw==", + "version": "5.1.41", + "resolved": "https://registry.npmjs.org/@restorecommerce/rc-grpc-clients/-/rc-grpc-clients-5.1.41.tgz", + "integrity": "sha512-ba0AcdRxN2Rc2UnZUsIweASAMg5w7oW1Uo2qDW92NE8UIUrKDJJdktCUdGlPofZ+subBrSZJUXUqgb8KkIyhGQ==", "license": "MIT", "dependencies": { "@grpc/grpc-js": "^1.12.2", @@ -2713,16 +2996,16 @@ } }, "node_modules/@restorecommerce/scs-jobs": { - "version": "0.1.45", - "resolved": "https://registry.npmjs.org/@restorecommerce/scs-jobs/-/scs-jobs-0.1.45.tgz", - "integrity": "sha512-aDvFs8u9ep44q4yArVmI5d+88bq5hweyCt2y6L/OJ5q9tCP5ya4Y3lNrK6pO3r2jF3r1SkHgOF6QLWbOh6pVaQ==", + "version": "0.1.46", + "resolved": "https://registry.npmjs.org/@restorecommerce/scs-jobs/-/scs-jobs-0.1.46.tgz", + "integrity": "sha512-lcNoCN2rVSuEA4eP8yZvP0xtk7xlQWe3yrbx+5BR45yRn0LW7GhFhdh/pCQslZ/oyvAdS3ds/kYbOXuB5/04+A==", "license": "MIT", "dependencies": { "@restorecommerce/dev": "^0.0.13", "@restorecommerce/grpc-client": "^2.2.5", - "@restorecommerce/kafka-client": "^1.2.18", + "@restorecommerce/kafka-client": "^1.2.19", "@restorecommerce/logger": "^1.3.2", - "@restorecommerce/rc-grpc-clients": "^5.1.40", + "@restorecommerce/rc-grpc-clients": "^5.1.41", "bullmq": "^5.21.2", "eslint": "9.13.0", "eslint-plugin-prefer-arrow-functions": "^3.2.4", @@ -5223,9 +5506,9 @@ } }, "node_modules/bullmq": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.25.3.tgz", - "integrity": "sha512-nUFTszxV/V3qJMZQxSMNOBF1HiGKh895WyJmE5keUonkutpTsxdYIr0dzVUTPbhXvBvW9LWlY7BetWY3afy/MQ==", + "version": "5.25.6", + "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.25.6.tgz", + "integrity": "sha512-jxpa/DB02V20CqBAgyqpQazT630CJm0r4fky8EchH3mcJAomRtKXLS6tRA0J8tb29BDGlr/LXhlUuZwdBJBSdA==", "license": "MIT", "dependencies": { "cron-parser": "^4.6.0", @@ -5324,12 +5607,12 @@ } }, "node_modules/cache-manager": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-6.1.2.tgz", - "integrity": "sha512-hBFCGc7g1sVMto7+Dwr1BWrOXOMuLvC77SbTYaI44tZPFK9myaySBmgvmBYgc7iqbG/qNyUc6oyuDOcHn6oTvw==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-6.1.3.tgz", + "integrity": "sha512-IcBseSv1GquLxlTb1nH5KhOQQwwOjMC5hkBras+8zTYD/bRSCgT9bIah1DZ+4eKc3vcqqYtfUCI5pYvOHmDXtw==", "license": "MIT", "dependencies": { - "keyv": "^5.1.2" + "keyv": "^5.2.1" } }, "node_modules/cache-manager-redis": { @@ -10038,21 +10321,19 @@ } }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", + "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" } }, "node_modules/jake": { @@ -10360,9 +10641,9 @@ } }, "node_modules/keyv": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.1.3.tgz", - "integrity": "sha512-qWefZgq3GByWFTQgn+C9U7iaHe+mwAVb1utqbna15ggTO5RiLSL91NY+5liTgzchAhGhI6MOn5NVVn/eR1FkPA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.2.1.tgz", + "integrity": "sha512-tpIgCaY02VCW2Pz0zAn4guyct+IeH6Mb5wZdOvpe4oqXeQOJO0C3Wo8fTnf7P3ZD83Vr9kghbkNmzG3lTOhy/A==", "license": "MIT", "dependencies": { "@keyv/serialize": "*" @@ -11484,9 +11765,9 @@ } }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.0.0.tgz", + "integrity": "sha512-9VQaK0N4YQ2F89Vy4wTIEyTm/Ggcv1PejfVeI82wOw0vBO6BjFyBGHCiNbl+wyHmgWDyFmHb2Yw1QlLaWzaEoA==", "dev": true, "license": "MIT", "dependencies": { @@ -11516,7 +11797,7 @@ "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/mocha/node_modules/anymatch": { @@ -16659,18 +16940,20 @@ } }, "node_modules/rimraf": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.7.tgz", - "integrity": "sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", "dev": true, + "license": "ISC", "dependencies": { - "glob": "^10.3.7" + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" }, "bin": { "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": ">=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -16681,42 +16964,73 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/rimraf/node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/node_modules/lru-cache": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", + "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/rimraf/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -22693,14 +23007,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.11.0.tgz", - "integrity": "sha512-cBRGnW3FSlxaYwU8KfAewxFK5uzeOAp0l2KebIlPDOT5olVi65KDG/yjBooPBG0kGW/HLkoz1c/iuBFehcS3IA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.14.0.tgz", + "integrity": "sha512-K8fBJHxVL3kxMmwByvz8hNdBJ8a0YqKzKDX6jRlrjMuNXyd5T2V02HIq37+OiWXvUUOXgOOGiSSOh26Mh8pC3w==", + "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.11.0", - "@typescript-eslint/parser": "8.11.0", - "@typescript-eslint/utils": "8.11.0" + "@typescript-eslint/eslint-plugin": "8.14.0", + "@typescript-eslint/parser": "8.14.0", + "@typescript-eslint/utils": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -22716,16 +23031,17 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz", - "integrity": "sha512-KhGn2LjW1PJT2A/GfDpiyOfS4a8xHQv2myUagTM5+zsormOmBlYsnQ6pobJ8XxJmh6hnHwa2Mbe3fPrDJoDhbA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.14.0.tgz", + "integrity": "sha512-tqp8H7UWFaZj0yNO6bycd5YjMwxa6wIHOLZvWPkidwbgLCsBMetQoGj7DPuAlWa2yGO3H48xmPwjhsSPPCGU5w==", + "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.11.0", - "@typescript-eslint/type-utils": "8.11.0", - "@typescript-eslint/utils": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/type-utils": "8.14.0", + "@typescript-eslint/utils": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -22749,15 +23065,16 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", - "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.14.0.tgz", + "integrity": "sha512-2p82Yn9juUJq0XynBXtFCyrBDb6/dJombnz6vbo6mgQEtWHfvHbQuEa9kAOVIt1c9YFwi7H6WxtPj1kg+80+RA==", + "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.11.0", - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/typescript-estree": "8.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/typescript-estree": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "debug": "^4.3.4" }, "engines": { @@ -22777,13 +23094,14 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", - "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", + "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.11.0", - "@typescript-eslint/visitor-keys": "8.11.0" + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -22794,13 +23112,14 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.11.0.tgz", - "integrity": "sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.14.0.tgz", + "integrity": "sha512-Xcz9qOtZuGusVOH5Uk07NGs39wrKkf3AxlkK79RBK6aJC1l03CobXjJbwBPSidetAOV+5rEVuiT1VSBUOAsanQ==", + "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.11.0", - "@typescript-eslint/utils": "8.11.0", + "@typescript-eslint/typescript-estree": "8.14.0", + "@typescript-eslint/utils": "8.14.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -22818,9 +23137,10 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", - "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", + "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": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -22831,13 +23151,14 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", - "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", + "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.11.0", - "@typescript-eslint/visitor-keys": "8.11.0", + "@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", @@ -22859,15 +23180,16 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.11.0.tgz", - "integrity": "sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==", + "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.11.0", - "@typescript-eslint/types": "8.11.0", - "@typescript-eslint/typescript-estree": "8.11.0" + "@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" @@ -22881,12 +23203,13 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", - "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", + "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.11.0", + "@typescript-eslint/types": "8.14.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -22901,6 +23224,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -22910,6 +23234,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -22922,6 +23247,7 @@ "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -22937,6 +23263,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -23143,9 +23470,9 @@ } }, "node_modules/uuid": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.2.tgz", - "integrity": "sha512-14FfcOJmqdjbBPdDjFQyk/SdT4NySW4eM0zcG+HqbHP5jzuH56xO3J1DGhgs/cEMCfwYi3HQI1gnTO62iaG+tQ==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.3.tgz", + "integrity": "sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" diff --git a/package.json b/package.json index 41b2841..7bf7805 100644 --- a/package.json +++ b/package.json @@ -18,24 +18,24 @@ ], "type": "module", "dependencies": { - "@bull-board/api": "6.3.3", - "@bull-board/express": "6.3.3", - "@bull-board/koa": "6.3.3", - "@restorecommerce/acs-client": "3.0.5", - "@restorecommerce/chassis-srv": "^1.6.2", - "@restorecommerce/kafka-client": "1.2.18", + "@bull-board/api": "6.4.0", + "@bull-board/express": "6.4.0", + "@bull-board/koa": "6.4.0", + "@restorecommerce/acs-client": "3.0.6", + "@restorecommerce/chassis-srv": "1.6.4", + "@restorecommerce/kafka-client": "1.2.19", "@restorecommerce/logger": "1.3.2", - "@restorecommerce/rc-grpc-clients": "5.1.40", - "@restorecommerce/scs-jobs": "0.1.45", + "@restorecommerce/rc-grpc-clients": "5.1.41", + "@restorecommerce/scs-jobs": "0.1.46", "@restorecommerce/service-config": "1.0.16", - "bullmq": "5.25.3", - "cache-manager": "6.1.2", + "bullmq": "5.25.6", + "cache-manager": "6.1.3", "cache-manager-redis": "^0.6.0", "cron-parser": "^4.9.0", "crypto": "^1.0.1", "express": "5.0.1", "lodash-es": "^4.17.21", - "uuid": "11.0.2" + "uuid": "11.0.3" }, "devDependencies": { "@alenon/grpc-mock-server": "3.1.15", @@ -56,17 +56,15 @@ "cz-conventional-changelog": "^3.3.0", "esbuild": "0.24.0", "eslint": "9.14.0", + "typescript-eslint": "8.14.0", "husky": "9.1.6", - "mocha": "10.8.2", + "mocha": "11.0.0", "nodemon": "3.1.7", "npm-run-all": "^4.1.5", "rimraf": "6.0.1", "should": "^13.2.3", "ts-node": "^10.9.2", - "typescript": "5.6.3" - }, - "overrides": { - "@grpc/grpc-js": "^1.10.6" + "typescript": "^5.6.3" }, "scripts": { "start": "node lib/start.cjs", diff --git a/src/schedulingService.ts b/src/schedulingService.ts index cd6f118..c969e32 100644 --- a/src/schedulingService.ts +++ b/src/schedulingService.ts @@ -81,7 +81,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation throw new Error('Queue configuration not found!'); } let defaultTrueExists = false; - for (let queueCfg of queuesCfg) { + for (const queueCfg of queuesCfg) { // Find configuration which has default=true if (queueCfg.default == true) { defaultTrueExists = true; @@ -95,13 +95,12 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } // Create Queues - for (let queueCfg of queuesCfg) { - let queueOptions: QueueOptions; + for (const queueCfg of queuesCfg) { const prefix = queueCfg.name; const rateLimiting = queueCfg.rateLimiting; const advancedSettings = queueCfg.advancedSettings; - queueOptions = { + const queueOptions: QueueOptions = { connection: { ...redisConfig, } @@ -124,7 +123,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation delete queueOptions.connection.keyPrefix; } - let queue = new Queue(prefix, { + const queue = new Queue(prefix, { ...queueOptions, connection: { ...queueOptions.connection as any, @@ -135,7 +134,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation this.queuesList.push(queue); // Add Queue Configurations - let queueCfgObj = { + const queueCfgObj = { name: queueCfg.name, concurrency: queueCfg.concurrency, default: queueCfg.default, @@ -151,16 +150,15 @@ export class SchedulingService implements SchedulingServiceServiceImplementation */ async start(): Promise { const logger = this.logger; - const that = this; const events = [JOB_DONE_EVENT, JOB_FAILED_EVENT]; - for (let eventName of events) { + for (const eventName of events) { // A Scheduling Service Event Listener await this.jobEvents.on(eventName, async (msg: any, ctx: any, config: any, eventName: string): Promise => { - let job = msg; + const job = msg; // Match Job Type to Queue Name, else use Default Queue let queue = _.find(this.queuesList, { name: job.type }); - let defaultQueue = _.find(this.queuesList, { name: this.defaultQueueName }); + const defaultQueue = _.find(this.queuesList, { name: this.defaultQueueName }); if (_.isEmpty(queue)) { queue = defaultQueue; } @@ -175,7 +173,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation logger.info('Received Job event', { event: eventName }); logger.info('Job details', job); const jobData: any = await queue.getJob(job.id).catch(error => { - that.logger.error('Error retrieving job ${job.id} from queue', error); + logger.error('Error retrieving job ${job.id} from queue', error); }); if (job?.delete_scheduled) { @@ -185,7 +183,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } // Initialize Event Listeners for each Queue - for (let queue of this.queuesList) { + for (const queue of this.queuesList) { queue.on('error', (error) => { logger.error('queue error', error); }); @@ -214,25 +212,25 @@ export class SchedulingService implements SchedulingServiceServiceImplementation this.disableAC(); const createDispatch = []; let result: Job[] = []; - let thiz = this; + const logger = this.logger; // Get the jobs - for (let queueCfg of this.queuesConfigList) { + for (const queueCfg of this.queuesConfigList) { // If enabled in the config, or the config is missing,b // Reschedule the missed jobs, else skip. - let queue = _.find(this.queuesList, { name: queueCfg.name }); - let runMissedScheduled = queueCfg.runMissedScheduled; + const queue = _.find(this.queuesList, { name: queueCfg.name }); + const runMissedScheduled = queueCfg.runMissedScheduled; if (_.isNil(runMissedScheduled) || (!_.isNil(runMissedScheduled) && runMissedScheduled == true)) { await queue.getJobs(this.bullOptions['activeAndFutureJobTypes']).then(jobs => { result = result.concat(jobs); }).catch(error => { - thiz.logger.error('Error reading jobs to reschedule the missed recurring jobs', error); + logger.error('Error reading jobs to reschedule the missed recurring jobs', error); }); } } let lastRunTime; - for (let job of result) { + for (const job of result) { // get the last run time for the job, we store the last run time only // for recurring jobs if (job?.name) { @@ -257,7 +255,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } if ((job?.opts?.repeat as any)?.pattern && lastRunTime?.time) { - let options = { + const options = { currentDate: new Date(lastRunTime.time), endDate: new Date(), iterator: true @@ -270,7 +268,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation this.logger.error('Error parsing cron expression running missed schedules', { code: error.code, message: error.message, stack: error.stack }); } while (intervalTime?.hasNext()) { - let nextInterval: any = intervalTime.next(); + const nextInterval: any = intervalTime.next(); const nextIntervalTime = nextInterval.value.toString(); // schedule it as one time job for now or immediately const data = { @@ -425,8 +423,8 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * @param {any} ctx RPC context */ async create(request: JobList, ctx: any): Promise> { - let jobListResponse: JobListResponse = { items: [], operation_status: { code: 0, message: '' }, total_count: 0 }; - let subject = request.subject; + const jobListResponse: JobListResponse = { items: [], operation_status: { code: 0, message: '' }, total_count: 0 }; + const subject = request.subject; if (_.isNil(request) || _.isNil(request.items)) { return { items: [], @@ -463,8 +461,8 @@ export class SchedulingService implements SchedulingServiceServiceImplementation return { items: [], total_count: 0, operation_status: acsResponse.operation_status }; } - let jobs: NewJob[] = []; - for (let job of request?.items || []) { + const jobs: NewJob[] = []; + for (const job of request?.items || []) { try { jobs.push(this._validateJob(job as any)); } catch (err) { @@ -479,10 +477,10 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } } - let result: Job[] = []; + const result: Job[] = []; // Scheduling jobs for (let i = 0; i < jobs.length; i += 1) { - let job = jobs[i]; + const job = jobs[i]; // if not jobID is specified generate a UUID if (!job.id) { job.id = this.idGen(); @@ -581,16 +579,16 @@ export class SchedulingService implements SchedulingServiceServiceImplementation result.push(submittedJob); } - for (let job of result) { - let jobId = job.id as string; + for (const job of result) { + const jobId = job.id as string; if (jobId.startsWith('repeat:')) { const repeatKey = jobId.split(':')[1]; job.id = await this.getRedisValue(repeatKey); } } - for (let job of result) { - let when = job?.opts?.delay ? new Date(job?.opts?.delay).toString() : ''; + for (const job of result) { + const when = job?.opts?.delay ? new Date(job?.opts?.delay).toString() : ''; jobListResponse.items.push({ payload: { id: job.id as string, @@ -628,7 +626,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation private filterByOwnerShip(customArgsObj, result) { // applying filter based on custom arguments (filterByOwnerShip) let filteredResult: Job[] = []; - let customArgs = (customArgsObj)?.custom_arguments; + const customArgs = (customArgsObj)?.custom_arguments; if (customArgs?.value) { let customArgsFilter; try { @@ -645,16 +643,16 @@ export class SchedulingService implements SchedulingServiceServiceImplementation if(!Array.isArray(customArgsFilter)) { customArgsFilter = [customArgsFilter]; } - for (let customArgObj of customArgsFilter) { + for (const customArgObj of customArgsFilter) { const ownerIndicatorEntity = customArgObj?.entity; const ownerValues = customArgObj?.instance; const ownerIndictaorEntURN = this.cfg.get('authorization:urns:ownerIndicatoryEntity'); const ownerInstanceURN = this.cfg.get('authorization:urns:ownerInstance'); const filteredResp = result.filter(job => { if (job?.data?.meta?.owners?.length > 0) { - for (let owner of job.data.meta.owners) { + for (const owner of job.data.meta.owners) { if (owner?.id === ownerIndictaorEntURN && owner?.value === ownerIndicatorEntity && owner?.attributes?.length > 0) { - for (let ownerInstObj of owner.attributes) { + for (const ownerInstObj of owner.attributes) { if (ownerInstObj?.id === ownerInstanceURN && ownerInstObj?.value && ownerValues.includes(ownerInstObj.value)) { return job; } @@ -708,8 +706,8 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * @param {any} ctx RPC context */ async read(request: JobReadRequest, ctx: any): Promise> { - let jobListResponse: JobListResponse = { items: [], operation_status: { code: 0, message: '' }, total_count: 0 }; - let subject = request.subject; + const jobListResponse: JobListResponse = { items: [], operation_status: { code: 0, message: '' }, total_count: 0 }; + const subject = request.subject; let acsResponse: PolicySetRQResponse; try { if (!ctx) { ctx = {}; }; @@ -743,7 +741,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } result = this.filterByOwnerShip({ custom_arguments }, result); } else { - const that = this; + const logger = this.logger; let jobIDs = request.filter.job_ids || []; if (!_.isArray(jobIDs)) { jobIDs = [jobIDs]; @@ -758,7 +756,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation if (jobIDs.length > 0) { // jobIDsCopy should contain the jobIDs duplicate values // after the for loop ends - let jobIDsCopy: string[] = []; + const jobIDsCopy: string[] = []; for (let jobID of jobIDs) { const jobIdData = await this.getRedisValue(jobID as string); // future jobs scheduled with `when` will have same repeatId as external SCS jobID @@ -779,7 +777,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation // map the repeatKey with nextmilis for bull repeatable jobID jobID = `repeat:${repeatId}:${nextMillis}`; } - for (let queue of this.queuesList) { + for (const queue of this.queuesList) { await new Promise((resolve, reject) => { // getJob returns job or null queue.getJob(jobID).then(job => { @@ -797,7 +795,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } } }).catch(err => { - that.logger.error(`Error reading job ${jobID}`, err); + logger.error(`Error reading job ${jobID}`, err); if (err?.code && typeof err.code === 'string') { err.code = 500; } @@ -814,7 +812,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } if (!_.isEqual(jobIDs.sort(), jobIDsCopy.sort())) { const jobIDsDiff = _.difference(jobIDs, jobIDsCopy); - for (let jobId of jobIDsDiff) { + for (const jobId of jobIDsDiff) { jobListResponse.items.push({ status: { id: jobId.toString(), @@ -827,7 +825,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } else { try { let jobsList: any[] = []; - for (let queue of this.queuesList) { + for (const queue of this.queuesList) { const getJobsResult = await queue.getJobs(this.bullOptions['activeAndFutureJobTypes']); getJobsResult.forEach((job) => { if (job?.opts?.repeat?.pattern) { @@ -839,7 +837,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } result = jobsList; } catch (err) { - that.logger.error('Error reading jobs', err); + logger.error('Error reading jobs', err); if (typeof err.code === 'string') { err.code = 500; } @@ -880,8 +878,8 @@ export class SchedulingService implements SchedulingServiceServiceImplementation result = _.orderBy(result, ['id'], [sort]); } - for (let job of result) { - let jobId = job.id as string; + for (const job of result) { + const jobId = job.id as string; if (jobId.startsWith('repeat:')) { const repeatKey = jobId.split(':')[1]; // it could be possible the redis repeat key is deleted on index 8 and old completed @@ -893,8 +891,8 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } } - for (let job of result) { - let when = job?.opts?.delay ? new Date(job?.opts?.delay).toString() : ''; + for (const job of result) { + const when = job?.opts?.delay ? new Date(job?.opts?.delay).toString() : ''; jobListResponse.items.push({ payload: { id: job.id as string, @@ -921,7 +919,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation async _getJobList(): Promise { let jobsList: any[] = []; - for (let queue of this.queuesList) { + for (const queue of this.queuesList) { const getJobsResult = await queue.getJobs(this.bullOptions['activeAndFutureJobTypes']); getJobsResult.forEach((job) => { if (job?.opts?.repeat?.pattern) { @@ -943,7 +941,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * Delete Job from queue. */ async delete(request: DeleteRequest, ctx: any): Promise> { - let deleteResponse: DeleteResponse = { status: [], operation_status: { code: 0, message: '' } }; + const deleteResponse: DeleteResponse = { status: [], operation_status: { code: 0, message: '' } }; if (_.isEmpty(request)) { return { operation_status: { @@ -959,7 +957,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation if (jobIDs) { action = AuthZAction.DELETE; if (_.isArray(jobIDs)) { - for (let id of jobIDs) { + for (const id of jobIDs) { resources.push({ id }); } } else { @@ -996,7 +994,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation this.logger.verbose('Deleting all jobs'); await this._getJobList().then(async (jobs) => { - for (let job of jobs) { + for (const job of jobs) { await job.remove(); if (this.resourceEventsEnabled) { dispatch.push(this.jobEvents.emit('jobsDeleted', { id: job.id })); @@ -1018,14 +1016,14 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } else if ('ids' in request) { this.logger.verbose('Deleting jobs by their IDs', { id: request.ids }); - for (let queue of this.queuesList) { - for (let jobDataKey of request.ids) { + for (const queue of this.queuesList) { + for (const jobDataKey of request.ids) { let callback: Promise; const jobIdData = await this.getRedisValue(jobDataKey as string); // future jobs scheduled with `when` will have same repeatId as external SCS jobID if (jobIdData && jobIdData.repeatId && (jobIdData.repeatId != jobDataKey)) { const jobs = await queue.getRepeatableJobs(); - for (let job of jobs) { + for (const job of jobs) { if (job.id === jobDataKey) { this.logger.debug('Removing Repeatable job by key for jobId', { id: job.id }); callback = queue.removeRepeatableByKey(job.key); @@ -1107,7 +1105,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * @param {any} job clean up job */ async cleanupJobs(ttlAfterFinished: number, maxJobsToCleanLimit: number) { - for (let queue of this.queuesList) { + for (const queue of this.queuesList) { try { await queue.clean(ttlAfterFinished, maxJobsToCleanLimit, COMPLETED_JOB_STATE); await queue.clean(ttlAfterFinished, maxJobsToCleanLimit, FAILED_JOB_STATE); @@ -1116,7 +1114,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } } this.logger.info('Jobs cleaned up successfully'); - let lastExecutedInterval = { lastExecutedInterval: (new Date()).toString() }; + const lastExecutedInterval = { lastExecutedInterval: (new Date()).toString() }; await this.repeatJobIdRedisClient.set(QUEUE_CLEANUP, JSON.stringify(lastExecutedInterval)); } @@ -1151,7 +1149,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * Reschedules a job - deletes it and recreates it with a new generated ID. */ async update(request: JobList, ctx: any): Promise> { - let subject = request.subject; + const subject = request.subject; // update meta data for owners information await this.createMetadata(request.items, AuthZAction.MODIFY, subject); let acsResponse: DecisionResponse; @@ -1206,7 +1204,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation jobData?.items?.forEach(async (job) => { const mappedJob = mappedJobs[job?.payload?.id]; - let endJob = { + const endJob = { id: mappedJob.id, type: mappedJob.type, queue_name: job?.payload?.queue_name, @@ -1236,7 +1234,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * existing one if it already exists. */ async upsert(request: JobList, ctx: any): Promise> { - let subject = request.subject; + const subject = request.subject; await this.createMetadata(request.items, AuthZAction.MODIFY, subject); let acsResponse: DecisionResponse; try { @@ -1265,10 +1263,10 @@ export class SchedulingService implements SchedulingServiceServiceImplementation let result = []; - for (let eachJob of request.items) { + for (const eachJob of request.items) { let jobExists = false; - let origJobId = _.cloneDeep(eachJob.id); - for (let queue of this.queuesList) { + const origJobId = _.cloneDeep(eachJob.id); + for (const queue of this.queuesList) { const jobIdData = await this.getRedisValue(eachJob.id as string); // future jobs scheduled with `when` will have same repeatId as external SCS jobID if (jobIdData?.repeatId && (jobIdData.repeatId != origJobId)) { @@ -1326,7 +1324,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation */ async clear(): Promise { let allJobs: any[] = []; - for (let queue of this.queuesList) { + for (const queue of this.queuesList) { allJobs = allJobs.concat(await queue.getJobs(this.bullOptions['allJobTypes'])); } return Promise.all(allJobs.map(async (job) => job.remove())).catch(err => { @@ -1394,7 +1392,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation * @param subject subject name */ async createMetadata(resources: any, action: string, subject): Promise { - let orgOwnerAttributes: Attribute[] = []; + const orgOwnerAttributes: Attribute[] = []; if (resources && !_.isArray(resources)) { resources = [resources]; } @@ -1414,7 +1412,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } if (resources?.length > 0) { - for (let resource of resources) { + for (const resource of resources) { if (!resource.data) { resource.data = { meta: {} }; } else if (!resource.data.meta) { @@ -1439,14 +1437,14 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } // update owners info if (result?.items?.length === 1 && result?.items[0]?.payload) { - let item = result.items[0].payload; + const item = result.items[0].payload; resource.data.meta.owners = item.data.meta.owners; // adding meta to resource root (needed by access-contorl-srv for owners information check) // meta is inside data of resource since the data is persisted in redis using bull resource.meta = { owners: item.data.meta.owners }; } else if ((!result || !result.items || !result.items[0] || !result.items[0].payload) && action === AuthZAction.MODIFY) { // job does not exist - create new job (ex: Upsert with action modify) - let ownerAttributes = _.cloneDeep(orgOwnerAttributes); + const ownerAttributes = _.cloneDeep(orgOwnerAttributes); // add user as default owners ownerAttributes.push( { @@ -1462,7 +1460,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation resource.meta = { owners: ownerAttributes }; } } else if ((action === AuthZAction.CREATE || !resource.id) && !resource.data.meta.owners) { - let ownerAttributes = _.cloneDeep(orgOwnerAttributes); + const ownerAttributes = _.cloneDeep(orgOwnerAttributes); if (!resource.id) { resource.id = uuid.v4().replace(/-/g, ''); } diff --git a/src/utilts.ts b/src/utilts.ts index be8fc97..4a8832e 100644 --- a/src/utilts.ts +++ b/src/utilts.ts @@ -102,10 +102,9 @@ export async function checkAccessRequest(ctx: GQLClientContext, resource: Resour * @param action The action to perform * @param operation Operation either isAllowed or whatIsAllowed */ -/* eslint-disable prefer-arrow-functions/prefer-arrow-functions */ export async function checkAccessRequest(ctx: GQLClientContext, resource: Resource[], action: AuthZAction, operation: Operation): Promise { - let subject = ctx.subject; + const subject = ctx.subject; // resolve subject id using findByToken api and update subject with id let dbSubject; if (subject?.token) { @@ -188,7 +187,7 @@ export function _filterKafkaJob(job: T, logger: Logger): Pi } export function _filterJobOptions(data: JobsOptions): Pick { - let picked = _.pick(data, [ + const picked = _.pick(data, [ 'priority', 'attempts', 'backoff', 'repeat', 'jobId', 'removeOnComplete' ]); diff --git a/src/worker.ts b/src/worker.ts index cfba202..0b3349f 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -83,8 +83,12 @@ class JobsCommandInterface extends chassis.CommandInterface { }; } - const that = this; - for (let topicName in restoreSetup) { + const logger = this.logger; + const schedulingService = this.schedulingService; + const commandTopic = this.commandTopic; + const encodeMsg = this.encodeMsg; + const service = this.service; + for (const topicName in restoreSetup) { const topicSetup = restoreSetup[topicName]; const topic = topicSetup.topic; @@ -97,39 +101,39 @@ class JobsCommandInterface extends chassis.CommandInterface { const ignoreOffsets: number[] = payload[resource].ignore_offset || []; const eventNames = _.keys(eventsSetup); - for (let eventName of eventNames) { + for (const eventName of eventNames) { const listener = eventsSetup[eventName]; const listenUntil = async (message: any, ctx: any, config: any, eventNameRet: string): Promise => { - that.logger.debug(`received message ${ctx.offset}/${targetOffset}`, ctx); + logger.debug(`received message ${ctx.offset}/${targetOffset}`, ctx); if (_.includes(ignoreOffsets, ctx.offset)) { return; } try { await listener(message, ctx, config, eventNameRet); } catch (e: any) { - that.logger.debug('Exception caught :', e.message); + logger.debug('Exception caught :', e.message); } if (ctx.offset >= targetOffset) { const message = { topic, offset: ctx.offset, }; - await that.commandTopic.emit('restoreResponse', { - services: _.keys(that.service), - payload: that.encodeMsg(message) + await commandTopic.emit('restoreResponse', { + services: _.keys(service), + payload: encodeMsg(message) }); - for (let name of eventNames) { - that.logger.debug('Number of listeners before removing :', + for (const name of eventNames) { + logger.debug('Number of listeners before removing :', topic.listenerCount(name)); await topic.removeAllListeners(name); - that.logger.debug('Number of listeners after removing :', + logger.debug('Number of listeners after removing :', topic.listenerCount(name)); } - that.logger.info('restore process done'); + logger.info('restore process done'); - that.schedulingService.enableEvents(); + schedulingService.enableEvents(); } }; @@ -146,7 +150,8 @@ class JobsCommandInterface extends chassis.CommandInterface { } makeJobsRestoreSetup(): any { - const that = this; + const logger = this.logger; + const schedulingService = this.schedulingService; return { jobsCreated: async function onJobsCreated(message: any, context: any): Promise { if (message?.when) { @@ -154,17 +159,17 @@ class JobsCommandInterface extends chassis.CommandInterface { const jobScheduleTime = new Date(message.when).getTime(); const currentTime = new Date().getTime(); if (jobScheduleTime < currentTime) { - that.logger.info('Skipping the elapsed time job'); + logger.info('Skipping the elapsed time job'); return {}; } } if (message?.now) { - that.logger.info('Skipping immediate job'); + logger.info('Skipping immediate job'); return {}; } - await that.schedulingService.create(JobList.fromPartial({ + await schedulingService.create(JobList.fromPartial({ items: [message] }), {}); @@ -172,7 +177,7 @@ class JobsCommandInterface extends chassis.CommandInterface { }, jobsDeleted: async function restoreDeleted(message: any, context: any, config: any, eventName: string): Promise { - await that.schedulingService.delete(DeleteRequest.fromPartial({ + await schedulingService.delete(DeleteRequest.fromPartial({ ids: [message.id] }), {}); return {}; @@ -295,14 +300,14 @@ export class Worker { }; const topicTypes = _.keys(kafkaCfg.topics); - for (let topicType of topicTypes) { + for (const topicType of topicTypes) { const topicName = kafkaCfg.topics[topicType].topic; const topic = await events.topic(topicName); const offsetValue = await this.offsetStore.getOffset(topicName); logger.info('subscribing to topic with offset value', topicName, offsetValue); if (kafkaCfg.topics[topicType].events) { const eventNames = kafkaCfg.topics[topicType].events; - for (let eventName of eventNames) { + for (const eventName of eventNames) { await topic.on(eventName, schedulingServiceEventsListener, { startingOffset: offsetValue }); } @@ -369,7 +374,7 @@ export class Worker { this.server = server; const serverAdapter = new ExpressAdapter(); - let queues: BullMQAdapter[] = this.schedulingService.queuesList.map(q => new BullMQAdapter(q)); + const queues: BullMQAdapter[] = this.schedulingService.queuesList.map(q => new BullMQAdapter(q)); createBullBoard({ queues, serverAdapter,