You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
add buffer support to a bunch of commands
This commit is contained in:
282
package-lock.json
generated
282
package-lock.json
generated
@@ -12,9 +12,10 @@
|
||||
"./packages/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-redis/client": "^1.0.0",
|
||||
"@node-redis/json": "^1.0.0",
|
||||
"@node-redis/search": "^1.0.0"
|
||||
"@node-redis/client": "^1.0.1",
|
||||
"@node-redis/json": "^1.0.1",
|
||||
"@node-redis/search": "^1.0.1",
|
||||
"@node-redis/time-series": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node12": "^1.0.9",
|
||||
@@ -49,19 +50,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/core": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.0.tgz",
|
||||
"integrity": "sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz",
|
||||
"integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/helper-compilation-targets": "^7.16.0",
|
||||
"@babel/helper-module-transforms": "^7.16.0",
|
||||
"@babel/helpers": "^7.16.0",
|
||||
"@babel/parser": "^7.16.0",
|
||||
"@babel/generator": "^7.16.5",
|
||||
"@babel/helper-compilation-targets": "^7.16.3",
|
||||
"@babel/helper-module-transforms": "^7.16.5",
|
||||
"@babel/helpers": "^7.16.5",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0",
|
||||
"convert-source-map": "^1.7.0",
|
||||
"debug": "^4.1.0",
|
||||
@@ -79,9 +80,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/generator": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.0.tgz",
|
||||
"integrity": "sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz",
|
||||
"integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0",
|
||||
@@ -110,6 +111,18 @@
|
||||
"@babel/core": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-environment-visitor": {
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz",
|
||||
"integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-function-name": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz",
|
||||
@@ -148,18 +161,6 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-member-expression-to-functions": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz",
|
||||
"integrity": "sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-module-imports": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz",
|
||||
@@ -173,45 +174,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-module-transforms": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz",
|
||||
"integrity": "sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz",
|
||||
"integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-environment-visitor": "^7.16.5",
|
||||
"@babel/helper-module-imports": "^7.16.0",
|
||||
"@babel/helper-replace-supers": "^7.16.0",
|
||||
"@babel/helper-simple-access": "^7.16.0",
|
||||
"@babel/helper-split-export-declaration": "^7.16.0",
|
||||
"@babel/helper-validator-identifier": "^7.15.7",
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-optimise-call-expression": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz",
|
||||
"integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-replace-supers": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz",
|
||||
"integrity": "sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.16.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -261,13 +235,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helpers": {
|
||||
"version": "7.16.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.3.tgz",
|
||||
"integrity": "sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz",
|
||||
"integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.3",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -351,9 +325,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.16.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.4.tgz",
|
||||
"integrity": "sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==",
|
||||
"version": "7.16.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz",
|
||||
"integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
@@ -377,17 +351,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse": {
|
||||
"version": "7.16.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.3.tgz",
|
||||
"integrity": "sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz",
|
||||
"integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/generator": "^7.16.5",
|
||||
"@babel/helper-environment-visitor": "^7.16.5",
|
||||
"@babel/helper-function-name": "^7.16.0",
|
||||
"@babel/helper-hoist-variables": "^7.16.0",
|
||||
"@babel/helper-split-export-declaration": "^7.16.0",
|
||||
"@babel/parser": "^7.16.3",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@babel/types": "^7.16.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0"
|
||||
@@ -896,9 +871,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.11.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz",
|
||||
"integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==",
|
||||
"version": "16.11.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.13.tgz",
|
||||
"integrity": "sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/parse-json": {
|
||||
@@ -1503,13 +1478,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.1.tgz",
|
||||
"integrity": "sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ==",
|
||||
"version": "4.19.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
|
||||
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001280",
|
||||
"electron-to-chromium": "^1.3.896",
|
||||
"caniuse-lite": "^1.0.30001286",
|
||||
"electron-to-chromium": "^1.4.17",
|
||||
"escalade": "^3.1.1",
|
||||
"node-releases": "^2.0.1",
|
||||
"picocolors": "^1.0.0"
|
||||
@@ -2108,9 +2083,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.17",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.17.tgz",
|
||||
"integrity": "sha512-zhk1MravPtq/KBhmGB7TLBILmXTgRG9TFSI3qS3DbgyfHzIl72iiTE37r/BHIbPCJJlWIo5rySyxiH4vWhu2ZA==",
|
||||
"version": "1.4.19",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.19.tgz",
|
||||
"integrity": "sha512-TeAjwsC/vhvxEtX/xN1JQUMkl+UrwKXlB4rwLyuLYVuBuRtqJJrU4Jy5pCVihMQg4m1ceZ3MEJ0yYuxHj8vC+w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/email-addresses": {
|
||||
@@ -6026,9 +6001,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.3.tgz",
|
||||
"integrity": "sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ==",
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz",
|
||||
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
@@ -6473,7 +6448,8 @@
|
||||
}
|
||||
},
|
||||
"packages/client": {
|
||||
"version": "1.0.0",
|
||||
"name": "@node-redis/client",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cluster-key-slot": "1.1.0",
|
||||
@@ -6504,7 +6480,8 @@
|
||||
}
|
||||
},
|
||||
"packages/json": {
|
||||
"version": "1.0.0-rc.0",
|
||||
"name": "@node-redis/json",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||
@@ -6522,7 +6499,8 @@
|
||||
}
|
||||
},
|
||||
"packages/search": {
|
||||
"version": "1.0.0",
|
||||
"name": "@node-redis/search",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||
@@ -6540,6 +6518,7 @@
|
||||
}
|
||||
},
|
||||
"packages/test-utils": {
|
||||
"name": "@node-redis/test-utils",
|
||||
"devDependencies": {
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||
"@types/mocha": "^9.0.0",
|
||||
@@ -6558,6 +6537,7 @@
|
||||
}
|
||||
},
|
||||
"packages/time-series": {
|
||||
"name": "@node-redis/time-series",
|
||||
"version": "1.0.0-rc.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@@ -6593,19 +6573,19 @@
|
||||
"dev": true
|
||||
},
|
||||
"@babel/core": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.0.tgz",
|
||||
"integrity": "sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz",
|
||||
"integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/helper-compilation-targets": "^7.16.0",
|
||||
"@babel/helper-module-transforms": "^7.16.0",
|
||||
"@babel/helpers": "^7.16.0",
|
||||
"@babel/parser": "^7.16.0",
|
||||
"@babel/generator": "^7.16.5",
|
||||
"@babel/helper-compilation-targets": "^7.16.3",
|
||||
"@babel/helper-module-transforms": "^7.16.5",
|
||||
"@babel/helpers": "^7.16.5",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0",
|
||||
"convert-source-map": "^1.7.0",
|
||||
"debug": "^4.1.0",
|
||||
@@ -6616,9 +6596,9 @@
|
||||
}
|
||||
},
|
||||
"@babel/generator": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.0.tgz",
|
||||
"integrity": "sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz",
|
||||
"integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.16.0",
|
||||
@@ -6638,6 +6618,15 @@
|
||||
"semver": "^6.3.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-environment-visitor": {
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz",
|
||||
"integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-function-name": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz",
|
||||
@@ -6667,15 +6656,6 @@
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-member-expression-to-functions": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz",
|
||||
"integrity": "sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-module-imports": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz",
|
||||
@@ -6686,39 +6666,18 @@
|
||||
}
|
||||
},
|
||||
"@babel/helper-module-transforms": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz",
|
||||
"integrity": "sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz",
|
||||
"integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/helper-environment-visitor": "^7.16.5",
|
||||
"@babel/helper-module-imports": "^7.16.0",
|
||||
"@babel/helper-replace-supers": "^7.16.0",
|
||||
"@babel/helper-simple-access": "^7.16.0",
|
||||
"@babel/helper-split-export-declaration": "^7.16.0",
|
||||
"@babel/helper-validator-identifier": "^7.15.7",
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-optimise-call-expression": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz",
|
||||
"integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-replace-supers": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz",
|
||||
"integrity": "sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.16.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
@@ -6753,13 +6712,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"@babel/helpers": {
|
||||
"version": "7.16.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.3.tgz",
|
||||
"integrity": "sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz",
|
||||
"integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.3",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0"
|
||||
}
|
||||
},
|
||||
@@ -6827,9 +6786,9 @@
|
||||
}
|
||||
},
|
||||
"@babel/parser": {
|
||||
"version": "7.16.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.4.tgz",
|
||||
"integrity": "sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==",
|
||||
"version": "7.16.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz",
|
||||
"integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/template": {
|
||||
@@ -6844,17 +6803,18 @@
|
||||
}
|
||||
},
|
||||
"@babel/traverse": {
|
||||
"version": "7.16.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.3.tgz",
|
||||
"integrity": "sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag==",
|
||||
"version": "7.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz",
|
||||
"integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/generator": "^7.16.5",
|
||||
"@babel/helper-environment-visitor": "^7.16.5",
|
||||
"@babel/helper-function-name": "^7.16.0",
|
||||
"@babel/helper-hoist-variables": "^7.16.0",
|
||||
"@babel/helper-split-export-declaration": "^7.16.0",
|
||||
"@babel/parser": "^7.16.3",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@babel/types": "^7.16.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0"
|
||||
@@ -7355,9 +7315,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.11.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz",
|
||||
"integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==",
|
||||
"version": "16.11.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.13.tgz",
|
||||
"integrity": "sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/parse-json": {
|
||||
@@ -7793,13 +7753,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"browserslist": {
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.1.tgz",
|
||||
"integrity": "sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ==",
|
||||
"version": "4.19.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
|
||||
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caniuse-lite": "^1.0.30001280",
|
||||
"electron-to-chromium": "^1.3.896",
|
||||
"caniuse-lite": "^1.0.30001286",
|
||||
"electron-to-chromium": "^1.4.17",
|
||||
"escalade": "^3.1.1",
|
||||
"node-releases": "^2.0.1",
|
||||
"picocolors": "^1.0.0"
|
||||
@@ -8240,9 +8200,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.4.17",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.17.tgz",
|
||||
"integrity": "sha512-zhk1MravPtq/KBhmGB7TLBILmXTgRG9TFSI3qS3DbgyfHzIl72iiTE37r/BHIbPCJJlWIo5rySyxiH4vWhu2ZA==",
|
||||
"version": "1.4.19",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.19.tgz",
|
||||
"integrity": "sha512-TeAjwsC/vhvxEtX/xN1JQUMkl+UrwKXlB4rwLyuLYVuBuRtqJJrU4Jy5pCVihMQg4m1ceZ3MEJ0yYuxHj8vC+w==",
|
||||
"dev": true
|
||||
},
|
||||
"email-addresses": {
|
||||
@@ -11149,9 +11109,9 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.3.tgz",
|
||||
"integrity": "sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ==",
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz",
|
||||
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==",
|
||||
"dev": true
|
||||
},
|
||||
"unique-string": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import * as LinkedList from 'yallist';
|
||||
import { AbortError } from '../errors';
|
||||
import { RedisCommandArguments, RedisCommandRawReply } from '../commands';
|
||||
import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from '../commands';
|
||||
|
||||
// We need to use 'require', because it's not possible with Typescript to import
|
||||
// classes that are exported as 'module.exports = class`, without esModuleInterop
|
||||
@@ -40,8 +40,6 @@ export enum PubSubUnsubscribeCommands {
|
||||
PUNSUBSCRIBE = 'PUNSUBSCRIBE'
|
||||
}
|
||||
|
||||
type PubSubArgumentTypes = Buffer | string;
|
||||
|
||||
export type PubSubListener<
|
||||
BUFFER_MODE extends boolean = false,
|
||||
T = BUFFER_MODE extends true ? Buffer : string
|
||||
@@ -197,12 +195,12 @@ export default class RedisCommandsQueue {
|
||||
|
||||
subscribe<T extends boolean>(
|
||||
command: PubSubSubscribeCommands,
|
||||
channels: PubSubArgumentTypes | Array<PubSubArgumentTypes>,
|
||||
channels: RedisCommandArgument | Array<RedisCommandArgument>,
|
||||
listener: PubSubListener<T>,
|
||||
bufferMode?: T
|
||||
): Promise<void> {
|
||||
const pubSubState = this.#initiatePubSubState(),
|
||||
channelsToSubscribe: Array<PubSubArgumentTypes> = [],
|
||||
channelsToSubscribe: Array<RedisCommandArgument> = [],
|
||||
listenersMap = command === PubSubSubscribeCommands.SUBSCRIBE ? pubSubState.listeners.channels : pubSubState.listeners.patterns;
|
||||
for (const channel of (Array.isArray(channels) ? channels : [channels])) {
|
||||
const channelString = typeof channel === 'string' ? channel : channel.toString();
|
||||
@@ -271,12 +269,12 @@ export default class RedisCommandsQueue {
|
||||
return this.#pushPubSubCommand(command, channelsToUnsubscribe);
|
||||
}
|
||||
|
||||
#pushPubSubCommand(command: PubSubSubscribeCommands | PubSubUnsubscribeCommands, channels: number | Array<PubSubArgumentTypes>): Promise<void> {
|
||||
#pushPubSubCommand(command: PubSubSubscribeCommands | PubSubUnsubscribeCommands, channels: number | Array<RedisCommandArgument>): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const pubSubState = this.#initiatePubSubState(),
|
||||
isSubscribe = command === PubSubSubscribeCommands.SUBSCRIBE || command === PubSubSubscribeCommands.PSUBSCRIBE,
|
||||
inProgressKey = isSubscribe ? 'subscribing' : 'unsubscribing',
|
||||
commandArgs: Array<PubSubArgumentTypes> = [command];
|
||||
commandArgs: Array<RedisCommandArgument> = [command];
|
||||
|
||||
let channelsCounter: number;
|
||||
if (typeof channels === 'number') { // unsubscribe only
|
||||
|
@@ -575,7 +575,7 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
|
||||
} while (cursor !== 0);
|
||||
}
|
||||
|
||||
async* zScanIterator(key: string, options?: ScanOptions): AsyncIterable<ZMember> {
|
||||
async* zScanIterator(key: string, options?: ScanOptions): AsyncIterable<ZMember<string>> {
|
||||
let cursor = 0;
|
||||
do {
|
||||
const reply = await (this as any).zScan(key, cursor, options);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import RedisClient, { InstantiableRedisClient, RedisClientType } from '../client';
|
||||
import { RedisClusterMasterNode, RedisClusterReplicaNode } from '../commands/CLUSTER_NODES';
|
||||
import { RedisClusterClientOptions, RedisClusterOptions } from '.';
|
||||
import { RedisModules, RedisScripts } from '../commands';
|
||||
import { RedisCommandArgument, RedisModules, RedisScripts } from '../commands';
|
||||
|
||||
// We need to use 'require', because it's not possible with Typescript to import
|
||||
// function that are exported as 'module.exports = function`, without esModuleInterop
|
||||
@@ -202,7 +202,7 @@ export default class RedisClusterSlots<M extends RedisModules, S extends RedisSc
|
||||
return value.client;
|
||||
}
|
||||
|
||||
getClient(firstKey?: string | Buffer, isReadonly?: boolean): RedisClientType<M, S> {
|
||||
getClient(firstKey?: RedisCommandArgument, isReadonly?: boolean): RedisClientType<M, S> {
|
||||
if (!firstKey) {
|
||||
return this.#getRandomClient();
|
||||
}
|
||||
|
@@ -4,9 +4,13 @@ import * as BITCOUNT from '../commands/BITCOUNT';
|
||||
import * as BITFIELD from '../commands/BITFIELD';
|
||||
import * as BITOP from '../commands/BITOP';
|
||||
import * as BITPOS from '../commands/BITPOS';
|
||||
import * as BLMOVE_BUFFER from '../commands/BLMOVE_BUFFER';
|
||||
import * as BLMOVE from '../commands/BLMOVE';
|
||||
import * as BLPOP_BUFFER from '../commands/BLPOP_BUFFER';
|
||||
import * as BLPOP from '../commands/BLPOP';
|
||||
import * as BRPOP_BUFFER from '../commands/BRPOP_BUFFER';
|
||||
import * as BRPOP from '../commands/BRPOP';
|
||||
import * as BRPOPLPUSH_BUFFER from '../commands/BRPOPLPUSH_BUFFER';
|
||||
import * as BRPOPLPUSH from '../commands/BRPOPLPUSH';
|
||||
import * as BZPOPMAX from '../commands/BZPOPMAX';
|
||||
import * as BZPOPMIN from '../commands/BZPOPMIN';
|
||||
@@ -36,13 +40,16 @@ import * as GETRANGE from '../commands/GETRANGE';
|
||||
import * as GETSET from '../commands/GETSET';
|
||||
import * as HDEL from '../commands/HDEL';
|
||||
import * as HEXISTS from '../commands/HEXISTS';
|
||||
import * as HGET_BUFFER from '../commands/HGET_BUFFER';
|
||||
import * as HGET from '../commands/HGET';
|
||||
import * as HGETALL_BUFFER from '../commands/HGETALL_BUFFER';
|
||||
import * as HGETALL from '../commands/HGETALL';
|
||||
import * as HINCRBY from '../commands/HINCRBY';
|
||||
import * as HINCRBYFLOAT from '../commands/HINCRBYFLOAT';
|
||||
import * as HKEYS from '../commands/HKEYS';
|
||||
import * as HLEN from '../commands/HLEN';
|
||||
import * as HMGET from '../commands/HMGET';
|
||||
import * as HRANDFIELD_COUNT_WITHVALUES_BUFFER from '../commands/HRANDFIELD_COUNT_WITHVALUES_BUFFER';
|
||||
import * as HRANDFIELD_COUNT_WITHVALUES from '../commands/HRANDFIELD_COUNT_WITHVALUES';
|
||||
import * as HRANDFIELD_COUNT from '../commands/HRANDFIELD_COUNT';
|
||||
import * as HRANDFIELD from '../commands/HRANDFIELD';
|
||||
@@ -119,10 +126,14 @@ import * as UNLINK from '../commands/UNLINK';
|
||||
import * as WATCH from '../commands/WATCH';
|
||||
import * as XACK from '../commands/XACK';
|
||||
import * as XADD from '../commands/XADD';
|
||||
import * as XAUTOCLAIM_JUSTID_BUFFER from '../commands/XAUTOCLAIM_JUSTID_BUFFER';
|
||||
import * as XAUTOCLAIM_BUFFER from '../commands/XAUTOCLAIM_BUFFER';
|
||||
import * as XAUTOCLAIM_JUSTID from '../commands/XAUTOCLAIM_JUSTID';
|
||||
import * as XAUTOCLAIM from '../commands/XAUTOCLAIM';
|
||||
import * as XCLAIM from '../commands/XCLAIM';
|
||||
import * as XCLAIM_JUSTID_BUFFER from '../commands/XCLAIM_JUSTID_BUFFER';
|
||||
import * as XCLAIM_BUFFER from '../commands/XCLAIM_BUFFER';
|
||||
import * as XCLAIM_JUSTID from '../commands/XCLAIM_JUSTID';
|
||||
import * as XCLAIM from '../commands/XCLAIM';
|
||||
import * as XDEL from '../commands/XDEL';
|
||||
import * as XGROUP_CREATE from '../commands/XGROUP_CREATE';
|
||||
import * as XGROUP_CREATECONSUMER from '../commands/XGROUP_CREATECONSUMER';
|
||||
@@ -135,9 +146,13 @@ import * as XINFO_STREAM from '../commands/XINFO_STREAM';
|
||||
import * as XLEN from '../commands/XLEN';
|
||||
import * as XPENDING_RANGE from '../commands/XPENDING_RANGE';
|
||||
import * as XPENDING from '../commands/XPENDING';
|
||||
import * as XRANGE_BUFFER from '../commands/XRANGE_BUFFER';
|
||||
import * as XRANGE from '../commands/XRANGE';
|
||||
import * as XREAD_BUFFER from '../commands/XREAD_BUFFER';
|
||||
import * as XREAD from '../commands/XREAD';
|
||||
import * as XREADGROUP_BUFFER from '../commands/XREADGROUP_BUFFER';
|
||||
import * as XREADGROUP from '../commands/XREADGROUP';
|
||||
import * as XREVRANGE_BUFFER from '../commands/XREVRANGE_BUFFER';
|
||||
import * as XREVRANGE from '../commands/XREVRANGE';
|
||||
import * as XTRIM from '../commands/XTRIM';
|
||||
import * as ZADD from '../commands/ZADD';
|
||||
@@ -188,12 +203,20 @@ export default {
|
||||
bitOp: BITOP,
|
||||
BITPOS,
|
||||
bitPos: BITPOS,
|
||||
BLMOVE_BUFFER,
|
||||
blMoveBuffer: BLMOVE_BUFFER,
|
||||
BLMOVE,
|
||||
blMove: BLMOVE,
|
||||
BLPOP_BUFFER,
|
||||
blPopBuffer: BLPOP_BUFFER,
|
||||
BLPOP,
|
||||
blPop: BLPOP,
|
||||
BRPOP_BUFFER,
|
||||
brPopBuffer: BRPOP_BUFFER,
|
||||
BRPOP,
|
||||
brPop: BRPOP,
|
||||
BRPOPLPUSH_BUFFER,
|
||||
brPopLPushBuffer: BRPOPLPUSH_BUFFER,
|
||||
BRPOPLPUSH,
|
||||
brPopLPush: BRPOPLPUSH,
|
||||
BZPOPMAX,
|
||||
@@ -252,8 +275,12 @@ export default {
|
||||
hDel: HDEL,
|
||||
HEXISTS,
|
||||
hExists: HEXISTS,
|
||||
HGET_BUFFER,
|
||||
hGetBuffer: HGET_BUFFER,
|
||||
HGET,
|
||||
hGet: HGET,
|
||||
HGETALL_BUFFER,
|
||||
hGetAllBuffer: HGETALL_BUFFER,
|
||||
HGETALL,
|
||||
hGetAll: HGETALL,
|
||||
HINCRBY,
|
||||
@@ -266,6 +293,8 @@ export default {
|
||||
hLen: HLEN,
|
||||
HMGET,
|
||||
hmGet: HMGET,
|
||||
HRANDFIELD_COUNT_WITHVALUES_BUFFER,
|
||||
hRandFieldCountWithValuesBuffer: HRANDFIELD_COUNT_WITHVALUES_BUFFER,
|
||||
HRANDFIELD_COUNT_WITHVALUES,
|
||||
hRandFieldCountWithValues: HRANDFIELD_COUNT_WITHVALUES,
|
||||
HRANDFIELD_COUNT,
|
||||
@@ -418,12 +447,20 @@ export default {
|
||||
xAck: XACK,
|
||||
XADD,
|
||||
xAdd: XADD,
|
||||
XAUTOCLAIM_JUSTID_BUFFER,
|
||||
xAutoClaimJustIdBuffer: XAUTOCLAIM_JUSTID_BUFFER,
|
||||
XAUTOCLAIM_BUFFER,
|
||||
xAutoClaimBuffer: XAUTOCLAIM_BUFFER,
|
||||
XAUTOCLAIM_JUSTID,
|
||||
xAutoClaimJustId: XAUTOCLAIM_JUSTID,
|
||||
XAUTOCLAIM,
|
||||
xAutoClaim: XAUTOCLAIM,
|
||||
XCLAIM,
|
||||
xClaim: XCLAIM,
|
||||
XCLAIM_JUSTID_BUFFER,
|
||||
xClaimJustIdBuffer: XCLAIM_JUSTID_BUFFER,
|
||||
XCLAIM_BUFFER,
|
||||
xClaimBuffer: XCLAIM_BUFFER,
|
||||
XCLAIM_JUSTID,
|
||||
xClaimJustId: XCLAIM_JUSTID,
|
||||
XDEL,
|
||||
@@ -450,12 +487,20 @@ export default {
|
||||
xPendingRange: XPENDING_RANGE,
|
||||
XPENDING,
|
||||
xPending: XPENDING,
|
||||
XRANGE_BUFFER,
|
||||
xRangeBuffer: XRANGE_BUFFER,
|
||||
XRANGE,
|
||||
xRange: XRANGE,
|
||||
XREAD_BUFFER,
|
||||
xReadBuffer: XREAD_BUFFER,
|
||||
XREAD,
|
||||
xRead: XREAD,
|
||||
XREADGROUP_BUFFER,
|
||||
xReadGroupBuffer: XREADGROUP_BUFFER,
|
||||
XREADGROUP,
|
||||
xReadGroup: XREADGROUP,
|
||||
XREVRANGE_BUFFER,
|
||||
xRevRangeBuffer: XREVRANGE_BUFFER,
|
||||
XREVRANGE,
|
||||
xRevRange: XREVRANGE,
|
||||
XTRIM,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import COMMANDS from './commands';
|
||||
import { RedisCommand, RedisCommandArguments, RedisCommandReply, RedisModules, RedisPlugins, RedisScript, RedisScripts } from '../commands';
|
||||
import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandReply, RedisModules, RedisPlugins, RedisScript, RedisScripts } from '../commands';
|
||||
import { ClientCommandOptions, RedisClientCommandSignature, RedisClientOptions, RedisClientType, WithModules, WithScripts } from '../client';
|
||||
import RedisClusterSlots, { ClusterNode } from './cluster-slots';
|
||||
import { extendWithModulesAndScripts, transformCommandArguments, transformCommandReply, extendWithCommands } from '../commander';
|
||||
@@ -24,7 +24,7 @@ export type RedisClusterType<M extends RedisModules = Record<string, never>, S e
|
||||
RedisCluster<M, S> & WithCommands & WithModules<M> & WithScripts<S>;
|
||||
|
||||
export default class RedisCluster<M extends RedisModules = Record<string, never>, S extends RedisScripts = Record<string, never>> extends EventEmitter {
|
||||
static extractFirstKey(command: RedisCommand, originalArgs: Array<unknown>, redisArgs: RedisCommandArguments): string | Buffer | undefined {
|
||||
static extractFirstKey(command: RedisCommand, originalArgs: Array<unknown>, redisArgs: RedisCommandArguments): RedisCommandArgument | undefined {
|
||||
if (command.FIRST_KEY_INDEX === undefined) {
|
||||
return undefined;
|
||||
} else if (typeof command.FIRST_KEY_INDEX === 'number') {
|
||||
@@ -84,7 +84,7 @@ export default class RedisCluster<M extends RedisModules = Record<string, never>
|
||||
}
|
||||
|
||||
async sendCommand<C extends RedisCommand>(
|
||||
firstKey: string | Buffer | undefined,
|
||||
firstKey: RedisCommandArgument | undefined,
|
||||
isReadonly: boolean | undefined,
|
||||
args: RedisCommandArguments,
|
||||
options?: ClientCommandOptions,
|
||||
@@ -175,9 +175,9 @@ export default class RedisCluster<M extends RedisModules = Record<string, never>
|
||||
throw err;
|
||||
}
|
||||
|
||||
multi(routing?: string | Buffer): RedisClusterMultiCommandType<M, S> {
|
||||
multi(routing?: RedisCommandArgument): RedisClusterMultiCommandType<M, S> {
|
||||
return new this.#Multi(
|
||||
async (commands: Array<RedisMultiQueuedCommand>, firstKey?: string | Buffer, chainId?: symbol) => {
|
||||
async (commands: Array<RedisMultiQueuedCommand>, firstKey?: RedisCommandArgument, chainId?: symbol) => {
|
||||
return this.#slots
|
||||
.getClient(firstKey)
|
||||
.multiExecutor(commands, chainId);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import COMMANDS from './commands';
|
||||
import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisModules, RedisPlugins, RedisScript, RedisScripts } from '../commands';
|
||||
import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply, RedisModules, RedisPlugins, RedisScript, RedisScripts } from '../commands';
|
||||
import RedisMultiCommand, { RedisMultiQueuedCommand } from '../multi-command';
|
||||
import { extendWithCommands, extendWithModulesAndScripts } from '../commander';
|
||||
import RedisCluster from '.';
|
||||
@@ -24,12 +24,12 @@ type WithScripts<M extends RedisModules, S extends RedisScripts> = {
|
||||
export type RedisClusterMultiCommandType<M extends RedisModules = Record<string, never>, S extends RedisScripts = Record<string, never>> =
|
||||
RedisClusterMultiCommand & WithCommands<M, S> & WithModules<M, S> & WithScripts<M, S>;
|
||||
|
||||
export type RedisClusterMultiExecutor = (queue: Array<RedisMultiQueuedCommand>, firstKey?: string | Buffer, chainId?: symbol) => Promise<Array<RedisCommandRawReply>>;
|
||||
export type RedisClusterMultiExecutor = (queue: Array<RedisMultiQueuedCommand>, firstKey?: RedisCommandArgument, chainId?: symbol) => Promise<Array<RedisCommandRawReply>>;
|
||||
|
||||
export default class RedisClusterMultiCommand {
|
||||
readonly #multi = new RedisMultiCommand();
|
||||
readonly #executor: RedisClusterMultiExecutor;
|
||||
#firstKey: string | Buffer | undefined;
|
||||
#firstKey: RedisCommandArgument | undefined;
|
||||
|
||||
static extend<M extends RedisModules, S extends RedisScripts>(
|
||||
plugins?: RedisPlugins<M, S>
|
||||
@@ -43,7 +43,7 @@ export default class RedisClusterMultiCommand {
|
||||
});
|
||||
}
|
||||
|
||||
constructor(executor: RedisClusterMultiExecutor, firstKey?: string | Buffer) {
|
||||
constructor(executor: RedisClusterMultiExecutor, firstKey?: RedisCommandArgument) {
|
||||
this.#executor = executor;
|
||||
this.#firstKey = firstKey;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export default class RedisClusterMultiCommand {
|
||||
}
|
||||
|
||||
addCommand(
|
||||
firstKey: string | Buffer | undefined,
|
||||
firstKey: RedisCommandArgument | undefined,
|
||||
args: RedisCommandArguments,
|
||||
transformReply?: RedisCommand['transformReply']
|
||||
): this {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
|
||||
import { CommandOptions, isCommandOptions } from './command-options';
|
||||
import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisCommands, RedisModules, RedisScript, RedisScripts } from './commands';
|
||||
import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisCommands, RedisModules, RedisScript, RedisScripts } from './commands';
|
||||
|
||||
type Instantiable<T = any> = new(...args: Array<any>) => T;
|
||||
|
||||
@@ -91,7 +91,7 @@ export function transformCommandArguments<T = unknown>(
|
||||
|
||||
const DELIMITER = '\r\n';
|
||||
|
||||
export function* encodeCommand(args: RedisCommandArguments): IterableIterator<string | Buffer> {
|
||||
export function* encodeCommand(args: RedisCommandArguments): IterableIterator<RedisCommandArgument> {
|
||||
let strings = `*${args.length}${DELIMITER}`,
|
||||
stringsLength = 0;
|
||||
for (const arg of args) {
|
||||
|
@@ -1,7 +1,12 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(key: string, value: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
value: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['APPEND', key, value];
|
||||
}
|
||||
|
||||
export declare function transformReply(): string;
|
||||
export declare function transformReply(): number;
|
||||
|
@@ -1,14 +1,15 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { LMoveSide } from './LMOVE';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(
|
||||
source: string,
|
||||
destination: string,
|
||||
source: RedisCommandArgument,
|
||||
destination: RedisCommandArgument,
|
||||
sourceDirection: LMoveSide,
|
||||
destinationDirection: LMoveSide,
|
||||
timeout: number
|
||||
): Array<string> {
|
||||
): RedisCommandArguments {
|
||||
return [
|
||||
'BLMOVE',
|
||||
source,
|
||||
|
5
packages/client/lib/commands/BLMOVE_BUFFER.ts
Normal file
5
packages/client/lib/commands/BLMOVE_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './BLMOVE';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export declare function transformReply(): Buffer | null;
|
@@ -1,9 +1,12 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { pushVerdictArguments } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(keys: string | Buffer | Array<string | Buffer>, timeout: number): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
keys: RedisCommandArgument | Array<RedisCommandArgument>,
|
||||
timeout: number
|
||||
): RedisCommandArguments {
|
||||
const args = pushVerdictArguments(['BLPOP'], keys);
|
||||
|
||||
args.push(timeout.toString());
|
||||
@@ -11,12 +14,12 @@ export function transformArguments(keys: string | Buffer | Array<string | Buffer
|
||||
return args;
|
||||
}
|
||||
|
||||
type BLPOPReply = null | {
|
||||
type BLPopReply = null | {
|
||||
key: string;
|
||||
element: string;
|
||||
};
|
||||
|
||||
export function transformReply(reply: null | [string, string]): BLPOPReply {
|
||||
export function transformReply(reply: null | [string, string]): BLPopReply {
|
||||
if (reply === null) return null;
|
||||
|
||||
return {
|
||||
|
17
packages/client/lib/commands/BLPOP_BUFFER.ts
Normal file
17
packages/client/lib/commands/BLPOP_BUFFER.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './BLPOP';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
type BLPopBufferReply = null | {
|
||||
key: Buffer;
|
||||
element: Buffer;
|
||||
};
|
||||
|
||||
export function transformReply(reply: null | [Buffer, Buffer]): BLPopBufferReply {
|
||||
if (reply === null) return null;
|
||||
|
||||
return {
|
||||
key: reply[0],
|
||||
element: reply[1]
|
||||
};
|
||||
}
|
@@ -11,16 +11,4 @@ export function transformArguments(key: string | Array<string>, timeout: number)
|
||||
return args;
|
||||
}
|
||||
|
||||
type BRPOPReply = null | {
|
||||
key: string;
|
||||
element: string;
|
||||
};
|
||||
|
||||
export function transformReply(reply: null | [string, string]): BRPOPReply {
|
||||
if (reply === null) return null;
|
||||
|
||||
return {
|
||||
key: reply[0],
|
||||
element: reply[1]
|
||||
};
|
||||
}
|
||||
export { transformReply } from './BLPOP';
|
||||
|
@@ -1,7 +1,13 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(source: string, destination: string, timeout: number): Array<string> {
|
||||
export function transformArguments(
|
||||
source: RedisCommandArgument,
|
||||
destination: RedisCommandArgument,
|
||||
timeout: number
|
||||
): RedisCommandArguments {
|
||||
return ['BRPOPLPUSH', source, destination, timeout.toString()];
|
||||
}
|
||||
|
||||
export declare function transformReply(): number | null;
|
||||
export declare function transformReply(): string | null;
|
||||
|
5
packages/client/lib/commands/BRPOPLPUSH_BUFFER.ts
Normal file
5
packages/client/lib/commands/BRPOPLPUSH_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './BRPOPLPUSH';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export declare function transformReply(): Buffer | null;
|
3
packages/client/lib/commands/BRPOP_BUFFER.ts
Normal file
3
packages/client/lib/commands/BRPOP_BUFFER.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './BRPOP';
|
||||
|
||||
export { BUFFER_MODE, transformReply } from './BLPOP_BUFFER';
|
@@ -1,9 +1,12 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { pushVerdictArguments, transformReplyNumberInfinity, ZMember } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(key: string | Array<string>, timeout: number): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument | Array<RedisCommandArgument>,
|
||||
timeout: number
|
||||
): RedisCommandArguments {
|
||||
const args = pushVerdictArguments(['BZPOPMAX'], key);
|
||||
|
||||
args.push(timeout.toString());
|
||||
@@ -11,7 +14,7 @@ export function transformArguments(key: string | Array<string>, timeout: number)
|
||||
return args;
|
||||
}
|
||||
|
||||
interface ZMemberWithKey extends ZMember {
|
||||
interface ZMemberWithKey extends ZMember<string> {
|
||||
key: string;
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,7 @@ export function transformArguments(key: string | Array<string>, timeout: number)
|
||||
return args;
|
||||
}
|
||||
|
||||
interface ZMemberWithKey extends ZMember {
|
||||
interface ZMemberWithKey extends ZMember<string> {
|
||||
key: string;
|
||||
}
|
||||
|
||||
|
@@ -2,4 +2,4 @@ export function transformArguments(parameter: string): Array<string> {
|
||||
return ['CONFIG', 'GET', parameter];
|
||||
}
|
||||
|
||||
export { transformReplyTuples as transformReply } from './generic-transformers';
|
||||
export { transformReplyStringTuples as transformReply } from './generic-transformers';
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string | Buffer): RedisCommandArguments {
|
||||
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
|
||||
return ['GET', key];
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,14 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(key: string, field: string): Array<string> {
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
field: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['HGET', key, field];
|
||||
}
|
||||
|
||||
export function transformReply(reply?: string): string | undefined {
|
||||
return reply;
|
||||
}
|
||||
export declare function transformReply(): string | undefined;
|
||||
|
@@ -1,7 +1,9 @@
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string): Array<string> {
|
||||
return ['HGETALL', key];
|
||||
}
|
||||
|
||||
export { transformReplyTuples as transformReply } from './generic-transformers';
|
||||
export { transformReplyStringTuples as transformReply } from './generic-transformers';
|
||||
|
5
packages/client/lib/commands/HGETALL_BUFFER.ts
Normal file
5
packages/client/lib/commands/HGETALL_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './HGETALL';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyBufferTuples as transformReply } from './generic-transformers';
|
5
packages/client/lib/commands/HGET_BUFFER.ts
Normal file
5
packages/client/lib/commands/HGET_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './HGET';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export declare function transformReply(): Buffer | undefined;
|
@@ -1,5 +1,7 @@
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string): Array<string> {
|
||||
return ['HRANDFIELD', key];
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { transformArguments as transformHRandFieldArguments } from './HRANDFIELD';
|
||||
|
||||
export { FIRST_KEY_INDEX } from './HRANDFIELD';
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './HRANDFIELD';
|
||||
|
||||
export function transformArguments(key: string, count: number): Array<string> {
|
||||
return [
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { transformArguments as transformHRandFieldCountArguments } from './HRANDFIELD_COUNT';
|
||||
|
||||
export { FIRST_KEY_INDEX } from './HRANDFIELD_COUNT';
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './HRANDFIELD_COUNT';
|
||||
|
||||
export function transformArguments(key: string, count: number): Array<string> {
|
||||
return [
|
||||
@@ -9,4 +9,4 @@ export function transformArguments(key: string, count: number): Array<string> {
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplyTuples as transformReply } from './generic-transformers';
|
||||
export { transformReplyStringTuples as transformReply } from './generic-transformers';
|
||||
|
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './HRANDFIELD_COUNT';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyBufferTuples as transformReply } from './generic-transformers';
|
@@ -1,4 +1,4 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
type Types = string | number | Buffer;
|
||||
|
||||
@@ -10,7 +10,7 @@ type HSETTuples = Array<[Types, Types]> | Array<Types>;
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
type GenericArguments = [key: string | Buffer];
|
||||
type GenericArguments = [key: RedisCommandArgument];
|
||||
|
||||
type SingleFieldArguments = [...generic: GenericArguments, field: Types, value: Types];
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export function transformArguments(channel: string | Buffer, message: string | Buffer): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
channel: RedisCommandArgument,
|
||||
message: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['PUBLISH', channel, message];
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
@@ -24,7 +24,11 @@ interface SetCommonOptions {
|
||||
|
||||
type SetOptions = SetTTL & SetGuards & SetCommonOptions;
|
||||
|
||||
export function transformArguments(key: string | Buffer, value: string | number | Buffer, options?: SetOptions): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
value: RedisCommandArgument | number,
|
||||
options?: SetOptions
|
||||
): RedisCommandArguments {
|
||||
const args = [
|
||||
'SET',
|
||||
key,
|
||||
|
@@ -1,8 +1,12 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(key: string | Buffer, seconds: number, value: string): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
seconds: number,
|
||||
value: string
|
||||
): RedisCommandArguments {
|
||||
return [
|
||||
'SETEX',
|
||||
key,
|
||||
|
@@ -1,9 +1,13 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { pushVerdictArguments } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(key: string, group: string, id: string | Array<string>): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
id: RedisCommandArgument | Array<RedisCommandArgument>
|
||||
): RedisCommandArguments {
|
||||
return pushVerdictArguments(['XACK', key, group], id);
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { TuplesObject } from './generic-transformers';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
@@ -9,10 +9,15 @@ interface XAddOptions {
|
||||
strategyModifier?: '=' | '~';
|
||||
threshold: number;
|
||||
limit?: number;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function transformArguments(key: string, id: string, message: TuplesObject, options?: XAddOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
id: RedisCommandArgument,
|
||||
message: Record<string, RedisCommandArgument>,
|
||||
options?: XAddOptions
|
||||
): RedisCommandArguments {
|
||||
const args = ['XADD', key];
|
||||
|
||||
if (options?.NOMKSTREAM) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { StreamMessagesReply, transformReplyStreamMessages } from './generic-transformers';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { StreamStringsMessagesReply, transformReplyStreamStringMessages } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
@@ -7,13 +8,13 @@ export interface XAutoClaimOptions {
|
||||
}
|
||||
|
||||
export function transformArguments(
|
||||
key: string,
|
||||
group: string,
|
||||
consumer: string,
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
consumer: RedisCommandArgument,
|
||||
minIdleTime: number,
|
||||
start: string,
|
||||
options?: XAutoClaimOptions
|
||||
): Array<string> {
|
||||
): RedisCommandArguments {
|
||||
const args = ['XAUTOCLAIM', key, group, consumer, minIdleTime.toString(), start];
|
||||
|
||||
if (options?.COUNT) {
|
||||
@@ -25,12 +26,12 @@ export function transformArguments(
|
||||
|
||||
interface XAutoClaimReply {
|
||||
nextId: string;
|
||||
messages: StreamMessagesReply;
|
||||
messages: StreamStringsMessagesReply;
|
||||
}
|
||||
|
||||
export function transformReply(reply: [string, Array<any>]): XAutoClaimReply {
|
||||
return {
|
||||
nextId: reply[0],
|
||||
messages: transformReplyStreamMessages(reply[1])
|
||||
messages: transformReplyStreamStringMessages(reply[1])
|
||||
};
|
||||
}
|
||||
|
17
packages/client/lib/commands/XAUTOCLAIM_BUFFER.ts
Normal file
17
packages/client/lib/commands/XAUTOCLAIM_BUFFER.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { StreamBufferMessagesReply, transformReplyStreamBufferMessages } from './generic-transformers';
|
||||
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './XAUTOCLAIM';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
interface XAutoClaimReply {
|
||||
nextId: Buffer;
|
||||
messages: StreamBufferMessagesReply;
|
||||
}
|
||||
|
||||
export function transformReply(reply: [Buffer, Array<any>]): XAutoClaimReply {
|
||||
return {
|
||||
nextId: reply[0],
|
||||
messages: transformReplyStreamBufferMessages(reply[1])
|
||||
};
|
||||
}
|
@@ -1,8 +1,9 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { transformArguments as transformXAutoClaimArguments } from './XAUTOCLAIM';
|
||||
|
||||
export { FIRST_KEY_INDEX } from './XAUTOCLAIM';
|
||||
|
||||
export function transformArguments(...args: Parameters<typeof transformXAutoClaimArguments>): Array<string> {
|
||||
export function transformArguments(...args: Parameters<typeof transformXAutoClaimArguments>): RedisCommandArguments {
|
||||
return [
|
||||
...transformXAutoClaimArguments(...args),
|
||||
'JUSTID'
|
||||
|
13
packages/client/lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts
Normal file
13
packages/client/lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './XAUTOCLAIM_JUSTID';
|
||||
|
||||
interface XAutoClaimJustIdBufferReply {
|
||||
nextId: Buffer;
|
||||
messages: Array<Buffer>;
|
||||
}
|
||||
|
||||
export function transformReply(reply: [Buffer, Array<Buffer>]): XAutoClaimJustIdBufferReply {
|
||||
return {
|
||||
nextId: reply[0],
|
||||
messages: reply[1]
|
||||
};
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { pushVerdictArguments } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
@@ -10,13 +11,13 @@ export interface XClaimOptions {
|
||||
}
|
||||
|
||||
export function transformArguments(
|
||||
key: string,
|
||||
group: string,
|
||||
consumer: string,
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
consumer: RedisCommandArgument,
|
||||
minIdleTime: number,
|
||||
id: string | Array<string>,
|
||||
id: RedisCommandArgument | Array<RedisCommandArgument>,
|
||||
options?: XClaimOptions
|
||||
): Array<string> {
|
||||
): RedisCommandArguments {
|
||||
const args = ['XCLAIM', key, group, consumer, minIdleTime.toString()];
|
||||
|
||||
pushVerdictArguments(args, id);
|
||||
@@ -43,4 +44,4 @@ export function transformArguments(
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReplyStreamMessages as transformReply } from './generic-transformers';
|
||||
export { transformReplyStreamStringMessages as transformReply } from './generic-transformers';
|
||||
|
5
packages/client/lib/commands/XCLAIM_BUFFER.ts
Normal file
5
packages/client/lib/commands/XCLAIM_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './XCLAIM';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyStreamBufferMessages as transformReply } from './generic-transformers';
|
@@ -1,10 +1,11 @@
|
||||
import { transformArguments as transformArgumentsXClaim } from './XCLAIM';
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { transformArguments as transformXClaimArguments } from './XCLAIM';
|
||||
|
||||
export { FIRST_KEY_INDEX } from './XCLAIM';
|
||||
|
||||
export function transformArguments(...args: Parameters<typeof transformArgumentsXClaim>): Array<string> {
|
||||
export function transformArguments(...args: Parameters<typeof transformXClaimArguments>): RedisCommandArguments {
|
||||
return [
|
||||
...transformArgumentsXClaim(...args),
|
||||
...transformXClaimArguments(...args),
|
||||
'JUSTID'
|
||||
];
|
||||
}
|
||||
|
5
packages/client/lib/commands/XCLAIM_JUSTID_BUFFER.ts
Normal file
5
packages/client/lib/commands/XCLAIM_JUSTID_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, transformArguments } from './XCLAIM_JUSTID';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export declare function transformReply(): Array<Buffer>;
|
@@ -1,9 +1,12 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { pushVerdictArguments } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export function transformArguments(key: string, id: string | Array<string>): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
id: RedisCommandArgument | Array<RedisCommandArgument>
|
||||
): RedisCommandArguments {
|
||||
return pushVerdictArguments(['XDEL', key], id);
|
||||
}
|
||||
|
||||
|
@@ -1,10 +1,17 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
interface XGroupCreateOptions {
|
||||
MKSTREAM?: true;
|
||||
}
|
||||
|
||||
export function transformArguments(key: string, group: string, id: string, options?: XGroupCreateOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
id: RedisCommandArgument,
|
||||
options?: XGroupCreateOptions
|
||||
): RedisCommandArguments {
|
||||
const args = ['XGROUP', 'CREATE', key, group, id];
|
||||
|
||||
if (options?.MKSTREAM) {
|
||||
@@ -14,4 +21,4 @@ export function transformArguments(key: string, group: string, id: string, optio
|
||||
return args;
|
||||
}
|
||||
|
||||
export declare function transformReply(): string;
|
||||
export declare function transformReply(): 'OK';
|
||||
|
@@ -1,6 +1,12 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export function transformArguments(key: string, group: string, consumer: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
consumer: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['XGROUP', 'CREATECONSUMER', key, group, consumer];
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,12 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export function transformArguments(key: string, group: string, consumer: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
consumer: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['XGROUP', 'DELCONSUMER', key, group, consumer];
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,11 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export function transformArguments(key: string, group: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['XGROUP', 'DESTROY', key, group];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export function transformArguments(key: string, group: string, id: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
id: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['XGROUP', 'SETID', key, group, id];
|
||||
}
|
||||
|
||||
export declare function transformReply(): string;
|
||||
export declare function transformReply(): 'OK';
|
||||
|
@@ -1,8 +1,13 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string, group: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['XINFO', 'CONSUMERS', key, group];
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string): Array<string> {
|
||||
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
|
||||
return ['XINFO', 'GROUPS', key];
|
||||
}
|
||||
|
||||
|
@@ -1,10 +1,11 @@
|
||||
import { StreamMessageReply, transformReplyTuples } from './generic-transformers';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { StreamStringsMessageReply, transformReplyStringTuples } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 2;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string): Array<string> {
|
||||
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
|
||||
return ['XINFO', 'STREAM', key];
|
||||
}
|
||||
|
||||
@@ -14,8 +15,8 @@ interface XInfoStreamReply {
|
||||
radixTreeNodes: number;
|
||||
groups: number;
|
||||
lastGeneratedId: string;
|
||||
firstEntry: StreamMessageReply | null;
|
||||
lastEntry: StreamMessageReply | null;
|
||||
firstEntry: StreamStringsMessageReply | null;
|
||||
lastEntry: StreamStringsMessageReply | null;
|
||||
}
|
||||
|
||||
export function transformReply(rawReply: Array<any>): XInfoStreamReply {
|
||||
@@ -46,14 +47,14 @@ export function transformReply(rawReply: Array<any>): XInfoStreamReply {
|
||||
case 'first-entry':
|
||||
parsedReply.firstEntry = rawReply[i + 1] ? {
|
||||
id: rawReply[i + 1][0],
|
||||
message: transformReplyTuples(rawReply[i + 1][1])
|
||||
message: transformReplyStringTuples(rawReply[i + 1][1])
|
||||
} : null;
|
||||
break;
|
||||
|
||||
case 'last-entry':
|
||||
parsedReply.lastEntry = rawReply[i + 1] ? {
|
||||
id: rawReply[i + 1][0],
|
||||
message: transformReplyTuples(rawReply[i + 1][1])
|
||||
message: transformReplyStringTuples(rawReply[i + 1][1])
|
||||
} : null;
|
||||
break;
|
||||
}
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string): Array<string> {
|
||||
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
|
||||
return ['XLEN', key];
|
||||
}
|
||||
|
||||
|
@@ -1,23 +1,44 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string, group: string): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument
|
||||
): RedisCommandArguments {
|
||||
return ['XPENDING', key, group];
|
||||
}
|
||||
|
||||
type XPendingRawReply = [
|
||||
pending: number,
|
||||
firstId: string | null,
|
||||
lastId: string | null,
|
||||
consumers: Array<[
|
||||
name: string,
|
||||
deliveriesCounter: number
|
||||
]> | null
|
||||
]
|
||||
|
||||
interface XPendingReply {
|
||||
pending: number;
|
||||
firstId: string | null;
|
||||
lastId: number | null
|
||||
consumers: Array<string> | null;
|
||||
lastId: string | null
|
||||
consumers: Array<{
|
||||
name: string,
|
||||
deliveriesCounter: number
|
||||
}> | null;
|
||||
}
|
||||
|
||||
export function transformReply(reply: [number, string | null, number | null, Array<string> | null]): XPendingReply {
|
||||
export function transformReply(reply: XPendingRawReply): XPendingReply {
|
||||
return {
|
||||
pending: reply[0],
|
||||
firstId: reply[1],
|
||||
lastId: reply[2],
|
||||
consumers: reply[3]
|
||||
consumers: reply[3] === null ? null : reply[3].map(([name, deliveriesCounter]) => ({
|
||||
name,
|
||||
deliveriesCounter
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
@@ -8,13 +10,13 @@ interface XPendingRangeOptions {
|
||||
}
|
||||
|
||||
export function transformArguments(
|
||||
key: string,
|
||||
group: string,
|
||||
key: RedisCommandArgument,
|
||||
group: RedisCommandArgument,
|
||||
start: string,
|
||||
end: string,
|
||||
count: number,
|
||||
options?: XPendingRangeOptions
|
||||
): Array<string> {
|
||||
): RedisCommandArguments {
|
||||
const args = ['XPENDING', key, group];
|
||||
|
||||
if (options?.IDLE) {
|
||||
@@ -30,4 +32,25 @@ export function transformArguments(
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReplyStreamMessages as transformReply } from './generic-transformers';
|
||||
type XPendingRangeRawReply = Array<[
|
||||
id: number,
|
||||
consumer: string,
|
||||
millisecondsSinceLastDelivery: number,
|
||||
deliveriesCounter: number
|
||||
]>;
|
||||
|
||||
type XPendingRangeReply = Array<{
|
||||
id: number;
|
||||
owner: string;
|
||||
millisecondsSinceLastDelivery: number;
|
||||
deliveriesCounter: number;
|
||||
}>;
|
||||
|
||||
export function transformReply(reply: XPendingRangeRawReply): XPendingRangeReply {
|
||||
return reply.map(([id, owner, millisecondsSinceLastDelivery, deliveriesCounter]) => ({
|
||||
id,
|
||||
owner,
|
||||
millisecondsSinceLastDelivery,
|
||||
deliveriesCounter
|
||||
}));
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
@@ -6,7 +8,12 @@ interface XRangeOptions {
|
||||
COUNT?: number;
|
||||
}
|
||||
|
||||
export function transformArguments(key: string, start: string, end: string, options?: XRangeOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
start: RedisCommandArgument,
|
||||
end: RedisCommandArgument,
|
||||
options?: XRangeOptions
|
||||
): RedisCommandArguments {
|
||||
const args = ['XRANGE', key, start, end];
|
||||
|
||||
if (options?.COUNT) {
|
||||
@@ -16,4 +23,4 @@ export function transformArguments(key: string, start: string, end: string, opti
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReplyStreamMessages as transformReply } from './generic-transformers';
|
||||
export { transformReplyStreamStringMessages as transformReply } from './generic-transformers';
|
||||
|
5
packages/client/lib/commands/XRANGE_BUFFER.ts
Normal file
5
packages/client/lib/commands/XRANGE_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XRANGE';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyStreamBufferMessages as transformReply } from './generic-transformers';
|
@@ -1,12 +1,14 @@
|
||||
export const FIRST_KEY_INDEX = (streams: Array<XReadStream> | XReadStream): string => {
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = (streams: Array<XReadStream> | XReadStream): RedisCommandArgument => {
|
||||
return Array.isArray(streams) ? streams[0].key : streams.key;
|
||||
};
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
interface XReadStream {
|
||||
key: string;
|
||||
id: string;
|
||||
key: RedisCommandArgument;
|
||||
id: RedisCommandArgument;
|
||||
}
|
||||
|
||||
interface XReadOptions {
|
||||
@@ -14,8 +16,11 @@ interface XReadOptions {
|
||||
BLOCK?: number;
|
||||
}
|
||||
|
||||
export function transformArguments(streams: Array<XReadStream> | XReadStream, options?: XReadOptions): Array<string> {
|
||||
const args = ['XREAD'];
|
||||
export function transformArguments(
|
||||
streams: Array<XReadStream> | XReadStream,
|
||||
options?: XReadOptions
|
||||
): RedisCommandArguments {
|
||||
const args: RedisCommandArguments = ['XREAD'];
|
||||
|
||||
if (options?.COUNT) {
|
||||
args.push('COUNT', options.COUNT.toString());
|
||||
@@ -38,4 +43,4 @@ export function transformArguments(streams: Array<XReadStream> | XReadStream, op
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReplyStreamsMessages as transformReply } from './generic-transformers';
|
||||
export { transformReplyStreamsStringMessages as transformReply } from './generic-transformers';
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export interface XReadGroupStream {
|
||||
key: string;
|
||||
id: string;
|
||||
key: RedisCommandArgument;
|
||||
id: RedisCommandArgument;
|
||||
}
|
||||
|
||||
export interface XReadGroupOptions {
|
||||
@@ -10,21 +12,21 @@ export interface XReadGroupOptions {
|
||||
}
|
||||
|
||||
export const FIRST_KEY_INDEX = (
|
||||
_group: string,
|
||||
_consumer: string,
|
||||
_group: RedisCommandArgument,
|
||||
_consumer: RedisCommandArgument,
|
||||
streams: Array<XReadGroupStream> | XReadGroupStream
|
||||
): string => {
|
||||
): RedisCommandArgument => {
|
||||
return Array.isArray(streams) ? streams[0].key : streams.key;
|
||||
};
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(
|
||||
group: string,
|
||||
consumer: string,
|
||||
group: RedisCommandArgument,
|
||||
consumer: RedisCommandArgument,
|
||||
streams: Array<XReadGroupStream> | XReadGroupStream,
|
||||
options?: XReadGroupOptions
|
||||
): Array<string> {
|
||||
): RedisCommandArguments {
|
||||
const args = ['XREADGROUP', 'GROUP', group, consumer];
|
||||
|
||||
if (options?.COUNT) {
|
||||
@@ -52,4 +54,4 @@ export function transformArguments(
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReplyStreamsMessages as transformReply } from './generic-transformers';
|
||||
export { transformReplyStreamsStringMessages as transformReply } from './generic-transformers';
|
||||
|
6
packages/client/lib/commands/XREADGROUP_BUFFER.ts
Normal file
6
packages/client/lib/commands/XREADGROUP_BUFFER.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XREADGROUP';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyStreamsBufferMessages as transformReply } from './generic-transformers';
|
5
packages/client/lib/commands/XREAD_BUFFER.ts
Normal file
5
packages/client/lib/commands/XREAD_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XREAD';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyStreamsBufferMessages as transformReply } from './generic-transformers';
|
@@ -2,6 +2,10 @@ interface XRangeRevOptions {
|
||||
COUNT?: number;
|
||||
}
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string, start: string, end: string, options?: XRangeRevOptions): Array<string> {
|
||||
const args = ['XREVRANGE', key, start, end];
|
||||
|
||||
@@ -12,4 +16,4 @@ export function transformArguments(key: string, start: string, end: string, opti
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReplyStreamMessages as transformReply } from './generic-transformers';
|
||||
export { transformReplyStreamStringMessages as transformReply } from './generic-transformers';
|
||||
|
5
packages/client/lib/commands/XREVRANGE_BUFFER.ts
Normal file
5
packages/client/lib/commands/XREVRANGE_BUFFER.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XREVRANGE';
|
||||
|
||||
export const BUFFER_MODE = true;
|
||||
|
||||
export { transformReplyStreamBufferMessages as transformReply } from './generic-transformers';
|
@@ -1,3 +1,5 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
interface XTrimOptions {
|
||||
@@ -5,7 +7,12 @@ interface XTrimOptions {
|
||||
LIMIT?: number;
|
||||
}
|
||||
|
||||
export function transformArguments(key: string, strategy: 'MAXLEN' | 'MINID', threshold: number, options?: XTrimOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
strategy: 'MAXLEN' | 'MINID',
|
||||
threshold: number,
|
||||
options?: XTrimOptions
|
||||
): RedisCommandArguments {
|
||||
const args = ['XTRIM', key, strategy];
|
||||
|
||||
if (options?.strategyModifier) {
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { transformArgumentNumberInfinity, ZMember } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
@@ -28,7 +29,11 @@ interface INCR {
|
||||
|
||||
type ZAddOptions = (NX | (XX & LT & GT)) & CH & INCR;
|
||||
|
||||
export function transformArguments(key: string, members: ZMember | Array<ZMember>, options?: ZAddOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
members: ZMember | Array<ZMember>,
|
||||
options?: ZAddOptions
|
||||
): RedisCommandArguments {
|
||||
const args = ['ZADD', key];
|
||||
|
||||
if ((<NX>options)?.NX) {
|
||||
|
@@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters<typeof transformZDiffArgu
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters<typeof transformZInterArg
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -9,9 +9,9 @@ export function transformArguments(key: string): Array<string> {
|
||||
];
|
||||
}
|
||||
|
||||
export function transformReply(reply: [string, string] | []): ZMember | null {
|
||||
export function transformReply(reply: [string, string] | []): ZMember<string> | null {
|
||||
if (!reply.length) return null;
|
||||
|
||||
|
||||
return {
|
||||
value: reply[0],
|
||||
score: transformReplyNumberInfinity(reply[1])
|
||||
|
@@ -9,4 +9,4 @@ export function transformArguments(key: string, count: number): Array<string> {
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -9,9 +9,9 @@ export function transformArguments(key: string): Array<string> {
|
||||
];
|
||||
}
|
||||
|
||||
export function transformReply(reply: [string, string] | []): ZMember | null {
|
||||
export function transformReply(reply: [string, string] | []): ZMember<string> | null {
|
||||
if (!reply.length) return null;
|
||||
|
||||
|
||||
return {
|
||||
value: reply[0],
|
||||
score: transformReplyNumberInfinity(reply[1])
|
||||
|
@@ -9,4 +9,4 @@ export function transformArguments(key: string, count: number): Array<string> {
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -9,4 +9,4 @@ export function transformArguments(...args: Parameters<typeof transformZRandMemb
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -15,4 +15,4 @@ export function transformArguments(
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -9,4 +9,4 @@ export function transformArguments(...args: Parameters<typeof transformZRangeArg
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -13,11 +13,11 @@ export function transformArguments(key: string, cursor: number, options?: ScanOp
|
||||
|
||||
interface ZScanReply {
|
||||
cursor: number;
|
||||
members: Array<ZMember>;
|
||||
members: Array<ZMember<string>>;
|
||||
}
|
||||
|
||||
export function transformReply([cursor, rawMembers]: [string, Array<string>]): ZScanReply {
|
||||
const parsedMembers: Array<ZMember> = [];
|
||||
const parsedMembers: Array<ZMember<string>> = [];
|
||||
for (let i = 0; i < rawMembers.length; i += 2) {
|
||||
parsedMembers.push({
|
||||
value: rawMembers[i],
|
||||
|
@@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters<typeof transformZUnionArg
|
||||
];
|
||||
}
|
||||
|
||||
export { transformReplySortedSetWithScores as transformReply } from './generic-transformers';
|
||||
export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers';
|
||||
|
@@ -8,10 +8,14 @@ import {
|
||||
transformReplyNumberInfinityNull,
|
||||
transformArgumentNumberInfinity,
|
||||
transformArgumentStringNumberInfinity,
|
||||
transformReplyTuples,
|
||||
transformReplyStreamMessages,
|
||||
transformReplyStreamsMessages,
|
||||
transformReplySortedSetWithScores,
|
||||
transformReplyStringTuples,
|
||||
transformReplyBufferTuples,
|
||||
transformReplyStreamStringMessages,
|
||||
transformReplyStreamBufferMessages,
|
||||
transformReplyStreamsStringMessages,
|
||||
transformReplyStreamsBufferMessages,
|
||||
transformReplySortedStringsSetWithScores,
|
||||
transformReplySortedBuffersSetWithScores,
|
||||
pushGeoCountArgument,
|
||||
pushGeoSearchArguments,
|
||||
GeoReplyWith,
|
||||
@@ -192,9 +196,9 @@ describe('Generic Transformers', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('transformReplyTuples', () => {
|
||||
it('transformReplyStringTuples', () => {
|
||||
assert.deepEqual(
|
||||
transformReplyTuples(['key1', 'value1', 'key2', 'value2']),
|
||||
transformReplyStringTuples(['key1', 'value1', 'key2', 'value2']),
|
||||
Object.create(null, {
|
||||
key1: {
|
||||
value: 'value1',
|
||||
@@ -210,9 +214,27 @@ describe('Generic Transformers', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('transformReplyStreamMessages', () => {
|
||||
it('transformReplyBufferTuples', () => {
|
||||
assert.deepEqual(
|
||||
transformReplyStreamMessages([['0-0', ['0key', '0value']], ['1-0', ['1key', '1value']]]),
|
||||
transformReplyBufferTuples([Buffer.from('key1'), Buffer.from('value1'), Buffer.from('key2'), Buffer.from('value2')]),
|
||||
Object.create(null, {
|
||||
key1: {
|
||||
value: Buffer.from('value1'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
},
|
||||
key2: {
|
||||
value: Buffer.from('value2'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('transformReplyStreamStringMessages', () => {
|
||||
assert.deepEqual(
|
||||
transformReplyStreamStringMessages([['0-0', ['0key', '0value']], ['1-0', ['1key', '1value']]]),
|
||||
[{
|
||||
id: '0-0',
|
||||
message: Object.create(null, {
|
||||
@@ -235,17 +257,45 @@ describe('Generic Transformers', () => {
|
||||
);
|
||||
});
|
||||
|
||||
describe('transformReplyStreamsMessages', () => {
|
||||
it('transformReplyStreamBufferMessages', () => {
|
||||
assert.deepEqual(
|
||||
transformReplyStreamBufferMessages([
|
||||
[Buffer.from('0-0'), [Buffer.from('0key'), Buffer.from('0value')]],
|
||||
[Buffer.from('1-0'), [Buffer.from('1key'), Buffer.from('1value')]]
|
||||
]),
|
||||
[{
|
||||
id: Buffer.from('0-0'),
|
||||
message: Object.create(null, {
|
||||
'0key': {
|
||||
value: Buffer.from('0value'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
})
|
||||
}, {
|
||||
id: Buffer.from('1-0'),
|
||||
message: Object.create(null, {
|
||||
'1key': {
|
||||
value: Buffer.from('1value'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
})
|
||||
}]
|
||||
);
|
||||
});
|
||||
|
||||
describe('transformReplyStreamsStringMessages', () => {
|
||||
it('null', () => {
|
||||
assert.equal(
|
||||
transformReplyStreamsMessages(null),
|
||||
transformReplyStreamsStringMessages(null),
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
it('with messages', () => {
|
||||
assert.deepEqual(
|
||||
transformReplyStreamsMessages([['stream1', [['0-1', ['11key', '11value']], ['1-1', ['12key', '12value']]]], ['stream2', [['0-2', ['2key1', '2value1', '2key2', '2value2']]]]]),
|
||||
transformReplyStreamsStringMessages([['stream1', [['0-1', ['11key', '11value']], ['1-1', ['12key', '12value']]]], ['stream2', [['0-2', ['2key1', '2value1', '2key2', '2value2']]]]]),
|
||||
[{
|
||||
name: 'stream1',
|
||||
messages: [{
|
||||
@@ -289,9 +339,77 @@ describe('Generic Transformers', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('transformReplySortedSetWithScores', () => {
|
||||
describe('transformReplyStreamsBufferMessages', () => {
|
||||
it('null', () => {
|
||||
assert.equal(
|
||||
transformReplyStreamsBufferMessages(null),
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
it('with messages', () => {
|
||||
assert.deepEqual(
|
||||
transformReplyStreamsBufferMessages([
|
||||
[
|
||||
Buffer.from('stream1'),
|
||||
[
|
||||
[Buffer.from('0-1'), [Buffer.from('11key'), Buffer.from('11value')]],
|
||||
[Buffer.from('1-1'), [Buffer.from('12key'), Buffer.from('12value')]]
|
||||
]
|
||||
],
|
||||
[
|
||||
Buffer.from('stream2'),
|
||||
[
|
||||
[Buffer.from('0-2'), [Buffer.from('2key1'), Buffer.from('2value1'), Buffer.from('2key2'), Buffer.from('2value2')]]
|
||||
]
|
||||
]
|
||||
]),
|
||||
[{
|
||||
name: Buffer.from('stream1'),
|
||||
messages: [{
|
||||
id: Buffer.from('0-1'),
|
||||
message: Object.create(null, {
|
||||
'11key': {
|
||||
value: Buffer.from('11value'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
})
|
||||
}, {
|
||||
id: Buffer.from('1-1'),
|
||||
message: Object.create(null, {
|
||||
'12key': {
|
||||
value: Buffer.from('12value'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
})
|
||||
}]
|
||||
}, {
|
||||
name: Buffer.from('stream2'),
|
||||
messages: [{
|
||||
id: Buffer.from('0-2'),
|
||||
message: Object.create(null, {
|
||||
'2key1': {
|
||||
value: Buffer.from('2value1'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
},
|
||||
'2key2': {
|
||||
value: Buffer.from('2value2'),
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
}
|
||||
})
|
||||
}]
|
||||
}]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('transformReplySortedStringsSetWithScores', () => {
|
||||
assert.deepEqual(
|
||||
transformReplySortedSetWithScores(['member1', '0.5', 'member2', '+inf', 'member3', '-inf']),
|
||||
transformReplySortedStringsSetWithScores(['member1', '0.5', 'member2', '+inf', 'member3', '-inf']),
|
||||
[{
|
||||
value: 'member1',
|
||||
score: 0.5
|
||||
@@ -305,6 +423,29 @@ describe('Generic Transformers', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('transformReplySortedBuffersSetWithScores', () => {
|
||||
assert.deepEqual(
|
||||
transformReplySortedBuffersSetWithScores([
|
||||
Buffer.from('member1'),
|
||||
Buffer.from('0.5'),
|
||||
Buffer.from('member2'),
|
||||
Buffer.from('+inf'),
|
||||
Buffer.from('member3'),
|
||||
Buffer.from('-inf')
|
||||
]),
|
||||
[{
|
||||
value: Buffer.from('member1'),
|
||||
score: 0.5
|
||||
}, {
|
||||
value: Buffer.from('member2'),
|
||||
score: Infinity
|
||||
}, {
|
||||
value: Buffer.from('member3'),
|
||||
score: -Infinity
|
||||
}]
|
||||
);
|
||||
});
|
||||
|
||||
describe('pushGeoCountArgument', () => {
|
||||
it('undefined', () => {
|
||||
assert.deepEqual(
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export function transformReplyBoolean(reply: number): boolean {
|
||||
return reply === 1;
|
||||
@@ -75,11 +75,7 @@ export function transformArgumentStringNumberInfinity(num: string | number): str
|
||||
return transformArgumentNumberInfinity(num);
|
||||
}
|
||||
|
||||
export interface TuplesObject {
|
||||
[field: string]: string;
|
||||
}
|
||||
|
||||
export function transformReplyTuples(reply: Array<string>): TuplesObject {
|
||||
export function transformReplyStringTuples(reply: Array<string>): Record<string, string> {
|
||||
const message = Object.create(null);
|
||||
|
||||
for (let i = 0; i < reply.length; i += 2) {
|
||||
@@ -89,46 +85,91 @@ export function transformReplyTuples(reply: Array<string>): TuplesObject {
|
||||
return message;
|
||||
}
|
||||
|
||||
export interface StreamMessageReply {
|
||||
id: string;
|
||||
message: TuplesObject;
|
||||
|
||||
export function transformReplyBufferTuples(reply: Array<Buffer>): Record<string, Buffer> {
|
||||
const message = Object.create(null);
|
||||
|
||||
for (let i = 0; i < reply.length; i += 2) {
|
||||
message[reply[i].toString()] = reply[i + 1];
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
export type StreamMessagesReply = Array<StreamMessageReply>;
|
||||
export interface StreamStringsMessageReply {
|
||||
id: string;
|
||||
message: Record<string, string>;
|
||||
}
|
||||
|
||||
export function transformReplyStreamMessages(reply: Array<any>): StreamMessagesReply {
|
||||
export type StreamStringsMessagesReply = Array<StreamStringsMessageReply>;
|
||||
|
||||
export function transformReplyStreamStringMessages(reply: Array<any>): StreamStringsMessagesReply {
|
||||
const messages = [];
|
||||
|
||||
for (const [id, message] of reply) {
|
||||
messages.push({
|
||||
id,
|
||||
message: transformReplyTuples(message)
|
||||
message: transformReplyStringTuples(message)
|
||||
});
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
export type StreamsMessagesReply = Array<{
|
||||
interface StreamBufferMessageReply {
|
||||
id: Buffer;
|
||||
message: Record<string, Buffer>;
|
||||
}
|
||||
|
||||
export type StreamBufferMessagesReply = Array<StreamBufferMessageReply>;
|
||||
|
||||
export function transformReplyStreamBufferMessages(reply: Array<any>): StreamBufferMessagesReply {
|
||||
const messages = [];
|
||||
|
||||
for (const [id, message] of reply) {
|
||||
messages.push({
|
||||
id,
|
||||
message: transformReplyBufferTuples(message)
|
||||
});
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
export type StreamsStringMessagesReply = Array<{
|
||||
name: string;
|
||||
messages: StreamMessagesReply;
|
||||
messages: StreamStringsMessagesReply;
|
||||
}> | null;
|
||||
|
||||
export function transformReplyStreamsMessages(reply: Array<any> | null): StreamsMessagesReply | null {
|
||||
export function transformReplyStreamsStringMessages(reply: Array<any> | null): StreamsStringMessagesReply | null {
|
||||
if (reply === null) return null;
|
||||
|
||||
return reply.map(([name, rawMessages]) => ({
|
||||
name,
|
||||
messages: transformReplyStreamMessages(rawMessages)
|
||||
messages: transformReplyStreamStringMessages(rawMessages)
|
||||
}));
|
||||
}
|
||||
|
||||
export interface ZMember {
|
||||
score: number;
|
||||
value: string;
|
||||
export type StreamsBufferMessagesReply = Array<{
|
||||
name: Buffer;
|
||||
messages: StreamBufferMessagesReply;
|
||||
}> | null;
|
||||
|
||||
export function transformReplyStreamsBufferMessages(reply: Array<any> | null): StreamsBufferMessagesReply | null {
|
||||
if (reply === null) return null;
|
||||
|
||||
return reply.map(([name, rawMessages]) => ({
|
||||
name,
|
||||
messages: transformReplyStreamBufferMessages(rawMessages)
|
||||
}));
|
||||
}
|
||||
|
||||
export function transformReplySortedSetWithScores(reply: Array<string>): Array<ZMember> {
|
||||
export interface ZMember<T = RedisCommandArgument> {
|
||||
score: number;
|
||||
value: T;
|
||||
}
|
||||
|
||||
export function transformReplySortedStringsSetWithScores(reply: Array<string>): Array<ZMember<string>> {
|
||||
const members = [];
|
||||
|
||||
for (let i = 0; i < reply.length; i += 2) {
|
||||
@@ -141,6 +182,19 @@ export function transformReplySortedSetWithScores(reply: Array<string>): Array<Z
|
||||
return members;
|
||||
}
|
||||
|
||||
export function transformReplySortedBuffersSetWithScores(reply: Array<Buffer>): Array<ZMember<Buffer>> {
|
||||
const members = [];
|
||||
|
||||
for (let i = 0; i < reply.length; i += 2) {
|
||||
members.push({
|
||||
value: reply[i],
|
||||
score: transformReplyNumberInfinity(reply[i + 1].toString())
|
||||
});
|
||||
}
|
||||
|
||||
return members;
|
||||
}
|
||||
|
||||
type GeoCountArgument = number | {
|
||||
value: number;
|
||||
ANY?: true
|
||||
@@ -314,7 +368,7 @@ export function pushStringTuplesArguments(args: Array<string>, tuples: StringTup
|
||||
return args;
|
||||
}
|
||||
|
||||
export function pushVerdictArguments(args: RedisCommandArguments, value: string | Buffer | Array<string | Buffer>): RedisCommandArguments {
|
||||
export function pushVerdictArguments(args: RedisCommandArguments, value: RedisCommandArgument | Array<RedisCommandArgument>): RedisCommandArguments {
|
||||
if (Array.isArray(value)) {
|
||||
args.push(...value);
|
||||
} else {
|
||||
|
@@ -2,10 +2,12 @@ import { RedisScriptConfig, SHA1 } from '../lua-script';
|
||||
|
||||
export type RedisCommandRawReply = string | number | Buffer | Array<RedisCommandRawReply> | null | undefined;
|
||||
|
||||
export type RedisCommandArguments = Array<string | Buffer> & { preserve?: unknown };
|
||||
export type RedisCommandArgument = string | Buffer;
|
||||
|
||||
export type RedisCommandArguments = Array<RedisCommandArgument> & { preserve?: unknown };
|
||||
|
||||
export interface RedisCommand {
|
||||
FIRST_KEY_INDEX?: number | ((...args: Array<any>) => string);
|
||||
FIRST_KEY_INDEX?: number | ((...args: Array<any>) => RedisCommandArgument);
|
||||
IS_READ_ONLY?: boolean;
|
||||
transformArguments(this: void, ...args: Array<any>): RedisCommandArguments;
|
||||
BUFFER_MODE?: boolean;
|
||||
|
@@ -1,3 +0,0 @@
|
||||
declare module 'cluster-key-slot' {
|
||||
export default function calculateSlot(key: string | Buffer): number;
|
||||
}
|
@@ -17,10 +17,6 @@
|
||||
"./lib"
|
||||
],
|
||||
"entryPointStrategy": "expand",
|
||||
"exclude": [
|
||||
"./lib/ts-declarations",
|
||||
"./lib/test-utils.ts"
|
||||
],
|
||||
"out": "../../documentation/client"
|
||||
}
|
||||
}
|
||||
|
@@ -15,10 +15,6 @@
|
||||
"./lib"
|
||||
],
|
||||
"entryPointStrategy": "expand",
|
||||
"exclude": [
|
||||
"./lib/test-utils.ts",
|
||||
"./lib/**/*.spec.ts"
|
||||
],
|
||||
"out": "../../documentation/json"
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
|
||||
import { pushVerdictArgument, transformReplyTuples, TuplesObject } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { pushVerdictArgument, transformReplyStringTuples } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { AggregateReply, PropertyName, pushArgumentsWithLength, pushSortByArguments, SortByProperty } from '.';
|
||||
|
||||
export enum AggregateSteps {
|
||||
@@ -125,8 +125,8 @@ export interface AggregateOptions {
|
||||
}
|
||||
|
||||
export function transformArguments(
|
||||
index: string,
|
||||
query: string,
|
||||
index: string,
|
||||
query: string,
|
||||
options?: AggregateOptions
|
||||
): RedisCommandArguments {
|
||||
|
||||
@@ -277,10 +277,10 @@ export type AggregateRawReply = [
|
||||
];
|
||||
|
||||
export function transformReply(rawReply: AggregateRawReply): AggregateReply {
|
||||
const results: Array<TuplesObject> = [];
|
||||
const results: Array<Record<string, string>> = [];
|
||||
for (let i = 1; i < rawReply.length; i++) {
|
||||
results.push(
|
||||
transformReplyTuples(rawReply[i] as Array<string>)
|
||||
transformReplyStringTuples(rawReply[i] as Array<string>)
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
|
||||
import { transformReplyTuples } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { transformReplyStringTuples } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { pushSearchOptions, RedisSearchLanguages, PropertyName, SortByProperty, SearchReply } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
@@ -76,7 +76,7 @@ export function transformReply(reply: SearchRawReply): SearchReply {
|
||||
id: reply[i],
|
||||
value: tuples.length === 2 && tuples[0] === '$' ?
|
||||
JSON.parse(tuples[1]) :
|
||||
transformReplyTuples(tuples)
|
||||
transformReplyStringTuples(tuples)
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ import * as SYNDUMP from './SYNDUMP';
|
||||
import * as SYNUPDATE from './SYNUPDATE';
|
||||
import * as TAGVALS from './TAGVALS';
|
||||
import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
|
||||
import { pushOptionalVerdictArgument, pushVerdictArgument, TuplesObject } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { pushOptionalVerdictArgument, pushVerdictArgument } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { SearchOptions } from './SEARCH';
|
||||
|
||||
export default {
|
||||
@@ -398,7 +398,7 @@ export interface SearchReply {
|
||||
|
||||
export interface AggregateReply {
|
||||
total: number;
|
||||
results: Array<TuplesObject>;
|
||||
results: Array<Record<string, string>>;
|
||||
}
|
||||
|
||||
export interface ProfileOptions {
|
||||
|
@@ -15,10 +15,6 @@
|
||||
"./lib"
|
||||
],
|
||||
"entryPointStrategy": "expand",
|
||||
"exclude": [
|
||||
"./lib/test-utils.ts",
|
||||
"./lib/**/*.spec.ts"
|
||||
],
|
||||
"out": "../../documentation/search"
|
||||
}
|
||||
}
|
||||
|
@@ -15,10 +15,6 @@
|
||||
"./lib"
|
||||
],
|
||||
"entryPointStrategy": "expand",
|
||||
"exclude": [
|
||||
"./lib/test-utils.ts",
|
||||
"./lib/**/*.spec.ts"
|
||||
],
|
||||
"out": "../../documentation/time-series"
|
||||
}
|
||||
}
|
||||
|
@@ -6,9 +6,6 @@
|
||||
"useDefineForClassFields": true,
|
||||
"esModuleInterop": false
|
||||
},
|
||||
"files": [
|
||||
"./packages/client/lib/ts-declarations/cluster-key-slot.d.ts"
|
||||
],
|
||||
"ts-node": {
|
||||
"files": true
|
||||
}
|
||||
|
Reference in New Issue
Block a user