1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

replace empty "transformReply" functions with typescript "declare"

This commit is contained in:
leibale
2021-09-29 17:58:16 -04:00
parent 9a1beedda7
commit c19d200b91
174 changed files with 472 additions and 1051 deletions

View File

@@ -4,9 +4,9 @@
"requires": true,
"packages": {
"": {
"name": "benchmark",
"license": "ISC",
"dependencies": {
"@probe.gl/bench": "^3.4.0",
"benny": "^3.6.15",
"v3": "npm:redis@3.1.2",
"v4": "file:../"
@@ -14,30 +14,31 @@
},
"..": {
"name": "redis",
"version": "4.0.0-next.5",
"version": "4.0.0-rc.2",
"license": "MIT",
"dependencies": {
"cluster-key-slot": "1.1.0",
"generic-pool": "3.8.2",
"redis-parser": "3.0.0",
"yallist": "4.0.0"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.5",
"@types/sinon": "^10.0.2",
"@types/node": "^16.9.6",
"@types/sinon": "^10.0.3",
"@types/which": "^2.0.1",
"@types/yallist": "^4.0.1",
"mocha": "^9.0.3",
"mocha": "^9.1.1",
"nyc": "^15.1.0",
"release-it": "^14.10.1",
"release-it": "^14.11.6",
"sinon": "^11.1.2",
"source-map-support": "^0.5.19",
"ts-node": "^10.1.0",
"typedoc": "^0.21.4",
"source-map-support": "^0.5.20",
"ts-node": "^10.2.1",
"typedoc": "0.21.9",
"typedoc-github-wiki-theme": "^0.5.1",
"typedoc-plugin-markdown": "^3.10.4",
"typescript": "^4.3.5",
"typedoc-plugin-markdown": "3.10.4",
"typescript": "^4.4.3",
"which": "^2.0.2"
},
"engines": {
@@ -81,34 +82,6 @@
"fast-deep-equal": "^3.1.1"
}
},
"node_modules/@babel/runtime": {
"version": "7.14.8",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz",
"integrity": "sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==",
"dependencies": {
"regenerator-runtime": "^0.13.4"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@probe.gl/bench": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@probe.gl/bench/-/bench-3.4.0.tgz",
"integrity": "sha512-S7iNPz5G3zEfEP0S4SAMvtj+dwP7EWfVBaA8Cy5CVIgM1lnpUbXvqoAJxlVEedNC32Icxwq65XQheufy1Zzmug==",
"dependencies": {
"@babel/runtime": "^7.0.0",
"probe.gl": "3.4.0"
}
},
"node_modules/@probe.gl/stats": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.4.0.tgz",
"integrity": "sha512-Gl37r9qGuiKadIvTZdSZvzCNOttJYw6RcY1oT0oDuB8r2uhuZAdSMQRQTy9FTinp6MY6O9wngGnV6EpQ8wSBAw==",
"dependencies": {
"@babel/runtime": "^7.0.0"
}
},
"node_modules/ansi-escapes": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
@@ -124,9 +97,9 @@
}
},
"node_modules/ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
@@ -223,9 +196,9 @@
}
},
"node_modules/denque": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz",
"integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==",
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz",
"integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==",
"engines": {
"node": ">=0.10"
}
@@ -255,9 +228,9 @@
}
},
"node_modules/graceful-fs": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ=="
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
@@ -366,9 +339,9 @@
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
"node_modules/prettier": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
"integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==",
"bin": {
"prettier": "bin-prettier.js"
},
@@ -376,15 +349,6 @@
"node": ">=10.13.0"
}
},
"node_modules/probe.gl": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/probe.gl/-/probe.gl-3.4.0.tgz",
"integrity": "sha512-9CLByZATuhuG/Viq3ckfWU+dAhb7dMmjzsyCy4s7ds9ueTejcVRENxL197/XacOK/AN61YrEERB0QnouB0Qc0Q==",
"dependencies": {
"@babel/runtime": "^7.0.0",
"@probe.gl/stats": "3.4.0"
}
},
"node_modules/redis-commands": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz",
@@ -409,11 +373,6 @@
"node": ">=4"
}
},
"node_modules/regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
},
"node_modules/restore-cursor": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
@@ -427,9 +386,9 @@
}
},
"node_modules/signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
"integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ=="
},
"node_modules/slice-ansi": {
"version": "4.0.0",
@@ -453,24 +412,24 @@
"integrity": "sha512-IYsheLg6dasD3zT/w9+8Iq9tcIQqqu91ZIpJOnIEM25C3X/g4Tl8mhXwW2ZQpbrsJISr9+wizEYgsibN5/b32Q=="
},
"node_modules/string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.0"
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
@@ -570,31 +529,6 @@
"fast-deep-equal": "^3.1.1"
}
},
"@babel/runtime": {
"version": "7.14.8",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz",
"integrity": "sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"@probe.gl/bench": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@probe.gl/bench/-/bench-3.4.0.tgz",
"integrity": "sha512-S7iNPz5G3zEfEP0S4SAMvtj+dwP7EWfVBaA8Cy5CVIgM1lnpUbXvqoAJxlVEedNC32Icxwq65XQheufy1Zzmug==",
"requires": {
"@babel/runtime": "^7.0.0",
"probe.gl": "3.4.0"
}
},
"@probe.gl/stats": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.4.0.tgz",
"integrity": "sha512-Gl37r9qGuiKadIvTZdSZvzCNOttJYw6RcY1oT0oDuB8r2uhuZAdSMQRQTy9FTinp6MY6O9wngGnV6EpQ8wSBAw==",
"requires": {
"@babel/runtime": "^7.0.0"
}
},
"ansi-escapes": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
@@ -604,9 +538,9 @@
}
},
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
},
"ansi-styles": {
"version": "4.3.0",
@@ -679,9 +613,9 @@
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA=="
},
"denque": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz",
"integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ=="
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz",
"integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw=="
},
"emoji-regex": {
"version": "8.0.0",
@@ -705,9 +639,9 @@
}
},
"graceful-fs": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ=="
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
@@ -783,18 +717,9 @@
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
"prettier": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ=="
},
"probe.gl": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/probe.gl/-/probe.gl-3.4.0.tgz",
"integrity": "sha512-9CLByZATuhuG/Viq3ckfWU+dAhb7dMmjzsyCy4s7ds9ueTejcVRENxL197/XacOK/AN61YrEERB0QnouB0Qc0Q==",
"requires": {
"@babel/runtime": "^7.0.0",
"@probe.gl/stats": "3.4.0"
}
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
"integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA=="
},
"redis-commands": {
"version": "1.7.0",
@@ -814,11 +739,6 @@
"redis-errors": "^1.0.0"
}
},
"regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
},
"restore-cursor": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
@@ -829,9 +749,9 @@
}
},
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
"integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ=="
},
"slice-ansi": {
"version": "4.0.0",
@@ -849,21 +769,21 @@
"integrity": "sha512-IYsheLg6dasD3zT/w9+8Iq9tcIQqqu91ZIpJOnIEM25C3X/g4Tl8mhXwW2ZQpbrsJISr9+wizEYgsibN5/b32Q=="
},
"string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
"strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"requires": {
"ansi-regex": "^5.0.0"
"ansi-regex": "^5.0.1"
}
},
"type-fest": {
@@ -892,22 +812,23 @@
"requires": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.5",
"@types/sinon": "^10.0.2",
"@types/node": "^16.9.6",
"@types/sinon": "^10.0.3",
"@types/which": "^2.0.1",
"@types/yallist": "^4.0.1",
"cluster-key-slot": "1.1.0",
"mocha": "^9.0.3",
"generic-pool": "3.8.2",
"mocha": "^9.1.1",
"nyc": "^15.1.0",
"redis-parser": "3.0.0",
"release-it": "^14.10.1",
"release-it": "^14.11.6",
"sinon": "^11.1.2",
"source-map-support": "^0.5.19",
"ts-node": "^10.1.0",
"typedoc": "^0.21.4",
"source-map-support": "^0.5.20",
"ts-node": "^10.2.1",
"typedoc": "0.21.9",
"typedoc-github-wiki-theme": "^0.5.1",
"typedoc-plugin-markdown": "^3.10.4",
"typescript": "^4.3.5",
"typedoc-plugin-markdown": "3.10.4",
"typescript": "^4.4.3",
"which": "^2.0.2",
"yallist": "4.0.0"
}

View File

@@ -1,6 +1,6 @@
import RedisSocket, { RedisSocketOptions, RedisNetSocketOptions, RedisTlsSocketOptions } from './socket';
import RedisCommandsQueue, { PubSubListener, PubSubSubscribeCommands, PubSubUnsubscribeCommands, QueueCommandOptions } from './commands-queue';
import COMMANDS, { TransformArgumentsReply } from './commands';
import COMMANDS, { RedisCommandReply, TransformArgumentsReply } from './commands';
import { RedisCommand, RedisModules, RedisReply } from './commands';
import RedisMultiCommand, { MultiQueuedCommand, RedisMultiCommandType } from './multi-command';
import EventEmitter from 'events';
@@ -9,7 +9,7 @@ import { RedisLuaScript, RedisLuaScripts } from './lua-script';
import { ScanOptions, ZMember } from './commands/generic-transformers';
import { ScanCommandOptions } from './commands/SCAN';
import { HScanTuple } from './commands/HSCAN';
import { encodeCommand, extendWithDefaultCommands, extendWithModulesAndScripts, transformCommandArguments } from './commander';
import { encodeCommand, extendWithDefaultCommands, extendWithModulesAndScripts, transformCommandArguments, transformCommandReply } from './commander';
import { Pool, Options as PoolOptions, createPool } from 'generic-pool';
import { ClientClosedError } from './errors';
import { URL } from 'url';
@@ -29,7 +29,7 @@ export interface RedisClientOptions<M, S> {
}
export type RedisCommandSignature<C extends RedisCommand> =
(...args: Parameters<C['transformArguments']> | [options: CommandOptions<ClientCommandOptions>, ...rest: Parameters<C['transformArguments']>]) => Promise<ReturnType<C['transformReply']>>;
(...args: Parameters<C['transformArguments']> | [options: CommandOptions<ClientCommandOptions>, ...rest: Parameters<C['transformArguments']>]) => Promise<RedisCommandReply<C>>;
type WithCommands = {
[P in keyof typeof COMMANDS]: RedisCommandSignature<(typeof COMMANDS)[P]>;
@@ -275,12 +275,13 @@ export default class RedisClient<M extends RedisModules, S extends RedisLuaScrip
await this.#socket.connect();
}
async commandsExecutor(command: RedisCommand, args: Array<unknown>): Promise<ReturnType<typeof command['transformReply']>> {
async commandsExecutor(command: RedisCommand, args: Array<unknown>): Promise<RedisCommandReply<typeof command>> {
const { args: redisArgs, options } = transformCommandArguments<ClientCommandOptions>(command, args);
return command.transformReply(
return transformCommandReply(
command,
await this.#sendCommand(redisArgs, options, command.BUFFER_MODE),
redisArgs.preserve,
redisArgs.preserve
);
}
@@ -308,16 +309,17 @@ export default class RedisClient<M extends RedisModules, S extends RedisLuaScrip
return await promise;
}
async scriptsExecutor(script: RedisLuaScript, args: Array<unknown>): Promise<ReturnType<typeof script['transformReply']>> {
async scriptsExecutor(script: RedisLuaScript, args: Array<unknown>): Promise<RedisCommandReply<typeof script>> {
const { args: redisArgs, options } = transformCommandArguments<ClientCommandOptions>(script, args);
return script.transformReply(
return transformCommandReply(
script,
await this.executeScript(script, redisArgs, options, script.BUFFER_MODE),
redisArgs.preserve
);
}
async executeScript(script: RedisLuaScript, args: TransformArgumentsReply, options?: ClientCommandOptions, bufferMode?: boolean): Promise<ReturnType<typeof script['transformReply']>> {
async executeScript(script: RedisLuaScript, args: TransformArgumentsReply, options?: ClientCommandOptions, bufferMode?: boolean): Promise<RedisCommandReply<typeof script>> {
try {
return await this.#sendCommand([
'EVALSHA',

View File

@@ -1,9 +1,9 @@
import { RedisCommand, RedisModules, TransformArgumentsReply } from './commands';
import { RedisCommand, RedisCommandReply, RedisModules, TransformArgumentsReply } from './commands';
import RedisClient, { ClientCommandOptions, RedisClientType, WithPlugins } from './client';
import { RedisSocketOptions } from './socket';
import RedisClusterSlots, { ClusterNode } from './cluster-slots';
import { RedisLuaScript, RedisLuaScripts } from './lua-script';
import { extendWithModulesAndScripts, extendWithDefaultCommands, transformCommandArguments } from './commander';
import { extendWithModulesAndScripts, extendWithDefaultCommands, transformCommandArguments, transformCommandReply } from './commander';
import RedisMultiCommand, { MultiQueuedCommand, RedisMultiCommandType } from './multi-command';
import { EventEmitter } from 'events';
@@ -59,10 +59,11 @@ export default class RedisCluster<M extends RedisModules = {}, S extends RedisLu
return this.#slots.connect();
}
async commandsExecutor(command: RedisCommand, args: Array<unknown>): Promise<ReturnType<typeof command['transformReply']>> {
async commandsExecutor(command: RedisCommand, args: Array<unknown>): Promise<RedisCommandReply<typeof command>> {
const { args: redisArgs, options } = transformCommandArguments<ClientCommandOptions>(command, args);
const reply = command.transformReply(
return transformCommandReply(
command,
await this.sendCommand(
RedisCluster.#extractFirstKey(command, args, redisArgs),
command.IS_READ_ONLY,
@@ -72,8 +73,6 @@ export default class RedisCluster<M extends RedisModules = {}, S extends RedisLu
),
redisArgs.preserve
);
return reply;
}
async sendCommand<C extends RedisCommand>(
@@ -83,7 +82,7 @@ export default class RedisCluster<M extends RedisModules = {}, S extends RedisLu
options?: ClientCommandOptions,
bufferMode?: boolean,
redirections = 0
): Promise<ReturnType<C['transformReply']>> {
): Promise<RedisCommandReply<C>> {
const client = this.#slots.getClient(firstKey, isReadonly);
try {
@@ -100,10 +99,11 @@ export default class RedisCluster<M extends RedisModules = {}, S extends RedisLu
}
}
async scriptsExecutor(script: RedisLuaScript, args: Array<unknown>): Promise<ReturnType<typeof script['transformReply']>> {
async scriptsExecutor(script: RedisLuaScript, args: Array<unknown>): Promise<RedisCommandReply<typeof script>> {
const { args: redisArgs, options } = transformCommandArguments<ClientCommandOptions>(script, args);
const reply = script.transformReply(
return transformCommandReply(
script,
await this.executeScript(
script,
args,
@@ -112,8 +112,6 @@ export default class RedisCluster<M extends RedisModules = {}, S extends RedisLu
),
redisArgs.preserve
);
return reply;
}
async executeScript(
@@ -122,7 +120,7 @@ export default class RedisCluster<M extends RedisModules = {}, S extends RedisLu
redisArgs: TransformArgumentsReply,
options?: ClientCommandOptions,
redirections = 0
): Promise<ReturnType<typeof script['transformReply']>> {
): Promise<RedisCommandReply<typeof script>> {
const client = this.#slots.getClient(
RedisCluster.#extractFirstKey(script, originalArgs, redisArgs),
script.IS_READ_ONLY

View File

@@ -1,5 +1,5 @@
import COMMANDS, { RedisCommand, RedisModules, TransformArgumentsReply } from './commands';
import COMMANDS, { RedisCommand, RedisCommandReply, RedisModules, RedisReply, TransformArgumentsReply } from './commands';
import { RedisLuaScript, RedisLuaScripts } from './lua-script';
import { CommandOptions, isCommandOptions } from './command-options';
@@ -106,3 +106,11 @@ export function* encodeCommand(args: TransformArgumentsReply): IterableIterator<
yield DELIMITER;
}
}
export function transformCommandReply(command: RedisCommand, rawReply: RedisReply, preserved: unknown): RedisCommandReply<typeof command> {
if (!command.transformReply) {
return rawReply;
}
return command.transformReply(rawReply, preserved);
}

View File

@@ -1,5 +1,3 @@
import { transformReplyStringArray } from './generic-transformers';
export function transformArguments(categoryName?: string): Array<string> {
const args = ['ACL', 'CAT'];
@@ -10,4 +8,4 @@ export function transformArguments(categoryName?: string): Array<string> {
return args;
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,8 +1,8 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export function transformArguments(username: string | Array<string>): TransformArgumentsReply {
return pushVerdictArguments(['ACL', 'DELUSER'], username);
}
export const transformReply = transformReplyNumber;
export declare const transformReply: (reply: number) => number;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(bits?: number): Array<string> {
const args = ['ACL', 'GENPASS'];
@@ -10,4 +8,4 @@ export function transformArguments(bits?: number): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyStringArray } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ACL', 'LIST'];
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ACL', 'LOAD'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ACL', 'LOG', 'RESET'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ACL', 'SAVE'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,8 +1,8 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyString } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export function transformArguments(username: string, rule: string | Array<string>): TransformArgumentsReply {
return pushVerdictArguments(['ACL', 'SETUSER', username], rule);
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyStringArray } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ACL', 'USERS'];
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ACL', 'WHOAMI'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,9 +1,7 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, value: string): Array<string> {
return ['APPEND', key, value];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['ASKING'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export interface AuthOptions {
username?: string;
password: string;
@@ -13,4 +11,4 @@ export function transformArguments({username, password}: AuthOptions): Array<str
return ['AUTH', username, password];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['BGREWRITEAOF'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
interface BgSaveOptions {
SCHEDULE?: true;
}
@@ -14,4 +12,4 @@ export function transformArguments(options?: BgSaveOptions): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -22,4 +20,4 @@ export function transformArguments(key: string, range?: BitCountRange): Array<st
return args;
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumberNullArray } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -81,4 +79,4 @@ export function transformArguments(key: string, operations: BitFieldOperations):
return args;
}
export const transformReply = transformReplyNumberNullArray;
export declare function transformReply(): Array<number | null>;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 2;
@@ -9,4 +9,4 @@ export function transformArguments(operation: BitOperations, destKey: string, ke
return pushVerdictArguments(['BITOP', operation, destKey], key);
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,4 +1,4 @@
import { BitValue, transformReplyNumber } from './generic-transformers';
import { BitValue } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -18,4 +18,4 @@ export function transformArguments(key: string, bit: BitValue, start?: number, e
return args;
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,4 +1,3 @@
import { transformReplyStringNull } from './generic-transformers';
import { LMoveSide } from './LMOVE';
export const FIRST_KEY_INDEX = 1;
@@ -20,4 +19,4 @@ export function transformArguments(
];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumberNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(source: string, destination: string, timeout: number): Array<string> {
return ['BRPOPLPUSH', source, destination, timeout.toString()];
}
export const transformReply = transformReplyNumberNull;
export declare function transformReply(): number | null;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const IS_READ_ONLY = true;
export function transformArguments(): Array<string> {
return ['CLIENT', 'ID'];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(slots: number | Array<number>): Array<string> {
const args = ['CLUSTER', 'ADDSLOTS'];
@@ -12,4 +10,4 @@ export function transformArguments(slots: number | Array<number>): Array<string>
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['CLUSTER', 'FLUSHSLOTS'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(slot: number, count: number): Array<string> {
return ['CLUSTER', 'GETKEYSINSLOT', slot.toString(), count.toString()];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(ip: string, port: number): Array<string> {
return ['CLUSTER', 'MEET', ip, port.toString()];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export type ClusterResetModes = 'HARD' | 'SOFT';
export function transformArguments(mode?: ClusterResetModes): Array<string> {
@@ -12,4 +10,4 @@ export function transformArguments(mode?: ClusterResetModes): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export enum ClusterSlotStates {
IMPORTING = 'IMPORTING',
MIGRATING = 'MIGRATING',
@@ -17,4 +15,4 @@ export function transformArguments(slot: number, state: ClusterSlotStates, nodeI
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['CONFIG', 'RESETSTAT'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['CONFIG', 'REWRITE'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(parameter: string, value: string): Array<string> {
return ['CONFIG', 'SET', parameter, value];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const IS_READ_ONLY = true;
export function transformArguments(): Array<string> {
return ['DBSIZE'];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['DECR', key];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, decrement: number): Array<string> {
return ['DECRBY', key, decrement.toString()];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,8 +1,8 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export function transformArguments(keys: string | Array<string>): TransformArgumentsReply {
return pushVerdictArguments(['DEL'], keys);
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['DISCARD'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(key: string): Array<string> {
return ['DUMP', key];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,9 +1,7 @@
import { transformReplyString } from './generic-transformers';
export const IS_READ_ONLY = true;
export function transformArguments(message: string): Array<string> {
return ['ECHO', message];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
interface FailoverOptions {
TO?: {
host: string;
@@ -32,4 +30,4 @@ export function transformArguments(options?: FailoverOptions): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export enum RedisFlushModes {
ASYNC = 'ASYNC',
SYNC = 'SYNC'
@@ -15,4 +13,4 @@ export function transformArguments(mode?: RedisFlushModes): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,4 @@
import { RedisFlushModes } from './FLUSHALL';
import { transformReplyString } from './generic-transformers';
export function transformArguments(mode?: RedisFlushModes): Array<string> {
const args = ['FLUSHDB'];
@@ -11,4 +10,4 @@ export function transformArguments(mode?: RedisFlushModes): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,4 +1,4 @@
import { GeoCoordinates, transformReplyNumber } from './generic-transformers';
import { GeoCoordinates } from './generic-transformers';
interface GeoMember extends GeoCoordinates {
member: string;
@@ -46,4 +46,4 @@ export function transformArguments(key: string, toAdd: GeoMember | Array<GeoMemb
return args;
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyStringArray } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -9,4 +9,4 @@ export function transformArguments(key: string, member: string | Array<string>):
return pushVerdictArguments(['GEOHASH', key], member);
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,4 +1,4 @@
import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments, transformReplyStringArray } from './generic-transformers';
import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -13,4 +13,4 @@ export function transformArguments(
return pushGeoSearchArguments(['GEOSEARCH'], key, from, by, options);
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,5 +1,4 @@
import { TransformArgumentsReply } from '.';
import { transformReplyStringNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -9,4 +8,4 @@ export function transformArguments(key: string | Buffer): TransformArgumentsRepl
return ['GET', key];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,4 +1,4 @@
import { transformReplyBit } from './generic-transformers';
import { BitValue } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -8,4 +8,4 @@ export function transformArguments(key: string, offset: number): Array<string> {
return ['GETBIT', key, offset.toString()];
}
export const transformReply = transformReplyBit;
export declare function transformReply(): BitValue;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['GETDEL', key];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { transformEXAT, transformPXAT, transformReplyStringNull } from './generic-transformers';
import { transformEXAT, transformPXAT } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -33,4 +33,4 @@ export function transformArguments(key: string, mode: GetExModes): TransformArgu
return args;
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -8,4 +6,4 @@ export function transformArguments(key: string, start: number, end: number): Arr
return ['GETRANGE', key, start.toString(), end.toString()];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, value: string): Array<string> {
return ['GETSET', key, value];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,7 +1,5 @@
import { transformReplyBufferNull } from './generic-transformers';
export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './GET';
export const BUFFER_MODE = true;
export const transformReply = transformReplyBufferNull;
export declare function transformReply(): Buffer | null;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -7,4 +7,4 @@ export function transformArguments(key: string, field: string | Array<string>):
return pushVerdictArguments(['HDEL', key], field);
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, field: string, increment: number): Array<string> {
return ['HINCRBY', key, field, increment.toString()];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, field: string, increment: number): Array<string> {
return ['HINCRBYFLOAT', key, field, increment.toString()];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringArray } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['HKEYS', key];
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['HLEN', key];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyStringArray } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -9,4 +9,4 @@ export function transformArguments(key: string, fields: string | Array<string>):
return pushVerdictArguments(['HMGET', key], fields);
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['HRANDFIELD', key];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,4 +1,3 @@
import { transformReplyStringArray } from './generic-transformers';
import { transformArguments as transformHRandFieldArguments } from './HRANDFIELD';
export { FIRST_KEY_INDEX } from './HRANDFIELD';
@@ -10,4 +9,4 @@ export function transformArguments(key: string, count: number): Array<string> {
];
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,5 +1,4 @@
import { TransformArgumentsReply } from '.';
import { transformReplyString } from './generic-transformers';
type HSETObject = Record<string | number, string | number>;
@@ -47,4 +46,4 @@ function pushObject(args: Array<string>, object: HSETObject): void {
}
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, field: string): Array<string> {
return ['HSTRLEN', key, field];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringArray } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['HVALS', key];
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['INCR', key];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, increment: number): Array<string> {
return ['INCRBY', key, increment.toString()];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,9 +1,7 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, increment: number): Array<string> {
return ['INCRBYFLOAT', key, increment.toString()];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const IS_READ_ONLY = true;
export function transformArguments(section?: string): Array<string> {
@@ -12,4 +10,4 @@ export function transformArguments(section?: string): Array<string> {
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumberNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -8,4 +6,4 @@ export function transformArguments(key: string, element: string): Array<string>
return ['LINDEX', key, element];
}
export const transformReply = transformReplyNumberNull;
export declare function transformReply(): number | null;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
type LInsertPosition = 'BEFORE' | 'AFTER';
@@ -19,4 +17,4 @@ export function transformArguments(
];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -8,4 +6,4 @@ export function transformArguments(key: string): Array<string> {
return ['LLEN', key];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,3 @@
import { transformReplyStringNull } from './generic-transformers';
export type LMoveSide = 'LEFT' | 'RIGHT';
export const FIRST_KEY_INDEX = 1;
@@ -19,4 +17,4 @@ export function transformArguments(
];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const IS_READ_ONLY = true;
export function transformArguments(version?: number, ...optionalArguments: Array<number>): Array<string> {
@@ -16,4 +14,4 @@ export function transformArguments(version?: number, ...optionalArguments: Array
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string): Array<string> {
return ['LPOP', key];
}
export const transformReply = transformReplyStringNull;
export declare function transformReply(): string | null;

View File

@@ -1,9 +1,7 @@
import { transformReplyStringArrayNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, count: number): Array<string> {
return ['LPOP', key, count.toString()];
}
export const transformReply = transformReplyStringArrayNull;
export declare function transformReply(): Array<string> | null;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumberNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -23,4 +21,4 @@ export function transformArguments(key: string, element: string, options?: LPosO
return args;
}
export const transformReply = transformReplyNumberNull;
export declare function transformReply(): number | null;

View File

@@ -1,4 +1,3 @@
import { transformReplyNumberArray } from './generic-transformers';
import { LPosOptions } from './LPOS';
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './LPOS';
@@ -19,4 +18,4 @@ export function transformArguments(key: string, element: string, count: number,
return args;
}
export const transformReply = transformReplyNumberArray;
export declare function transformReply(): Array<number>;

View File

@@ -1,9 +1,9 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, elements: string | Array<string>): TransformArgumentsReply {
return pushVerdictArguments(['LPUSH', key], elements);}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -7,4 +7,4 @@ export function transformArguments(key: string, element: string | Array<string>)
return pushVerdictArguments(['LPUSHX', key], element);
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,3 @@
import { transformReplyStringArray } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -13,4 +11,4 @@ export function transformArguments(key: string, start: number, stop: number): Ar
];
}
export const transformReply = transformReplyStringArray;
export declare function transformReply(): Array<string>;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, count: number, element: string): Array<string> {
@@ -11,4 +9,4 @@ export function transformArguments(key: string, count: number, element: string):
];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, index: number, element: string): Array<string> {
@@ -11,4 +9,4 @@ export function transformArguments(key: string, index: number, element: string):
];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, start: number, stop: number): Array<string> {
@@ -11,4 +9,4 @@ export function transformArguments(key: string, start: number, stop: number): Ar
]
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['MEMORY', 'DOCTOR'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['MEMORY', 'MALLOC-STATS'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['MEMORY', 'PURGE'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumberNull } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -18,4 +16,4 @@ export function transformArguments(key: string, options?: MemoryUsageOptions): A
return args;
}
export const transformReply = transformReplyNumberNull;
export declare function transformReply(): number | null;

View File

@@ -1,5 +1,3 @@
import { transformReplyStringNullArray } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -8,4 +6,4 @@ export function transformArguments(keys: Array<string>): Array<string> {
return ['MGET', ...keys];
}
export const transformReply = transformReplyStringNullArray;
export declare function transformReply(): Array<string | null>;

View File

@@ -1,5 +1,4 @@
import { AuthOptions } from './AUTH';
import { transformReplyString } from './generic-transformers';
interface MigrateOptions {
COPY?: true;
@@ -62,4 +61,4 @@ export function transformArguments(
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['MODULE', 'LIST'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(path: string, moduleArgs?: Array<string>): Array<string> {
const args = ['MODULE', 'LOAD', path];
@@ -10,4 +8,4 @@ export function transformArguments(path: string, moduleArgs?: Array<string>): Ar
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(name: string): Array<string> {
return ['MODULE', 'UNLOAD', name];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(toSet: Array<[string, string]> | Array<string> | Record<string, string>): Array<string> {
@@ -16,4 +14,4 @@ export function transformArguments(toSet: Array<[string, string]> | Array<string
return args;
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyNumber } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -7,4 +7,4 @@ export function transformArguments(key: string | Array<string>): TransformArgume
return pushVerdictArguments(['PFCOUNT'], key);
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

View File

@@ -1,5 +1,5 @@
import { TransformArgumentsReply } from '.';
import { pushVerdictArguments, transformReplyString } from './generic-transformers';
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
@@ -7,4 +7,4 @@ export function transformArguments(destination: string, source: string | Array<s
return pushVerdictArguments(['PFMERGE', destination], source);
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,7 +1,5 @@
import { transformReplyString } from './generic-transformers';
export function transformArguments(): Array<string> {
return ['PING'];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyString } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, milliseconds: number, value: string): Array<string> {
@@ -11,4 +9,4 @@ export function transformArguments(key: string, milliseconds: number, value: str
];
}
export const transformReply = transformReplyString;
export declare function transformReply(): string;

View File

@@ -1,5 +1,3 @@
import { transformReplyNumber } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
@@ -8,4 +6,4 @@ export function transformArguments(key: string): Array<string> {
return ['PTTL', key];
}
export const transformReply = transformReplyNumber;
export declare function transformReply(): number;

Some files were not shown because too many files have changed in this diff Show More