From a0de7967f98068790cd09c909bbbb7e7d6deefe8 Mon Sep 17 00:00:00 2001 From: leibale Date: Mon, 20 Dec 2021 14:47:51 -0500 Subject: [PATCH] buffers, buffers everywhere... --- README.md | 10 + package-lock.json | 1849 +++++++++-------- package.json | 12 +- packages/client/lib/client/commands-queue.ts | 25 +- packages/client/lib/client/index.spec.ts | 16 +- packages/client/lib/client/index.ts | 52 +- packages/client/lib/cluster/commands.ts | 48 - packages/client/lib/cluster/index.ts | 14 +- packages/client/lib/commands/ACL_CAT.ts | 8 +- packages/client/lib/commands/ACL_DELUSER.ts | 8 +- packages/client/lib/commands/ACL_GENPASS.ts | 6 +- packages/client/lib/commands/ACL_GETUSER.ts | 34 +- packages/client/lib/commands/ACL_LIST.ts | 6 +- packages/client/lib/commands/ACL_LOAD.ts | 6 +- packages/client/lib/commands/ACL_LOG.ts | 40 +- packages/client/lib/commands/ACL_LOG_RESET.ts | 6 +- packages/client/lib/commands/ACL_SAVE.ts | 6 +- packages/client/lib/commands/ACL_SETUSER.ts | 9 +- packages/client/lib/commands/ACL_USERS.ts | 6 +- packages/client/lib/commands/ACL_WHOAMI.ts | 6 +- packages/client/lib/commands/ASKING.ts | 6 +- packages/client/lib/commands/AUTH.ts | 10 +- packages/client/lib/commands/BGREWRITEAOF.ts | 6 +- packages/client/lib/commands/BGSAVE.ts | 6 +- packages/client/lib/commands/BITCOUNT.ts | 7 +- packages/client/lib/commands/BITOP.ts | 8 +- packages/client/lib/commands/BITPOS.ts | 8 +- packages/client/lib/commands/BLMOVE.ts | 2 +- packages/client/lib/commands/BLMOVE_BUFFER.ts | 5 - packages/client/lib/commands/BLPOP.ts | 8 +- packages/client/lib/commands/BLPOP_BUFFER.ts | 17 - packages/client/lib/commands/BRPOP.ts | 7 +- packages/client/lib/commands/BRPOPLPUSH.ts | 2 +- .../client/lib/commands/BRPOPLPUSH_BUFFER.ts | 5 - packages/client/lib/commands/BRPOP_BUFFER.ts | 3 - packages/client/lib/commands/BZPOPMAX.ts | 12 +- packages/client/lib/commands/BZPOPMIN.ts | 25 +- .../client/lib/commands/CLIENT_CACHING.ts | 2 +- .../client/lib/commands/CLIENT_SETNAME.ts | 6 +- .../client/lib/commands/COMMAND_GETKEYS.ts | 6 +- packages/client/lib/commands/CONFIG_GET.ts | 2 +- packages/client/lib/commands/COPY.ts | 10 +- packages/client/lib/commands/DECR.ts | 4 +- packages/client/lib/commands/DECRBY.ts | 7 +- packages/client/lib/commands/DEL.ts | 6 +- packages/client/lib/commands/DISCARD.ts | 4 +- packages/client/lib/commands/DUMP.ts | 6 +- packages/client/lib/commands/ECHO.ts | 6 +- packages/client/lib/commands/EXISTS.ts | 8 +- packages/client/lib/commands/EXPIRE.ts | 11 +- packages/client/lib/commands/EXPIREAT.ts | 10 +- packages/client/lib/commands/GEOADD.ts | 8 +- packages/client/lib/commands/GEODIST.ts | 11 +- packages/client/lib/commands/GEOHASH.ts | 9 +- packages/client/lib/commands/GEOPOS.ts | 15 +- packages/client/lib/commands/GEOSEARCH.ts | 7 +- .../client/lib/commands/GEOSEARCHSTORE.ts | 7 +- .../client/lib/commands/GEOSEARCH_WITH.ts | 4 +- packages/client/lib/commands/GET.spec.ts | 7 + packages/client/lib/commands/GET.ts | 2 +- packages/client/lib/commands/GETBIT.ts | 6 +- packages/client/lib/commands/GETDEL.ts | 6 +- packages/client/lib/commands/GETEX.ts | 9 +- packages/client/lib/commands/GETRANGE.ts | 10 +- packages/client/lib/commands/GETSET.ts | 9 +- .../client/lib/commands/GET_BUFFER.spec.ts | 22 - packages/client/lib/commands/GET_BUFFER.ts | 5 - packages/client/lib/commands/HDEL.ts | 7 +- packages/client/lib/commands/HELLO.ts | 25 +- packages/client/lib/commands/HEXISTS.ts | 9 +- packages/client/lib/commands/HGET.ts | 2 +- packages/client/lib/commands/HGETALL.ts | 6 +- .../client/lib/commands/HGETALL_BUFFER.ts | 5 - packages/client/lib/commands/HGET_BUFFER.ts | 5 - packages/client/lib/commands/HINCRBY.ts | 8 +- packages/client/lib/commands/HINCRBYFLOAT.ts | 8 +- packages/client/lib/commands/HKEYS.ts | 6 +- packages/client/lib/commands/HLEN.ts | 4 +- packages/client/lib/commands/HMGET.ts | 9 +- packages/client/lib/commands/HRANDFIELD.ts | 6 +- .../client/lib/commands/HRANDFIELD_COUNT.ts | 8 +- .../commands/HRANDFIELD_COUNT_WITHVALUES.ts | 8 +- .../HRANDFIELD_COUNT_WITHVALUES_BUFFER.ts | 5 - packages/client/lib/commands/HSCAN.ts | 15 +- packages/client/lib/commands/HSET.ts | 2 +- packages/client/lib/commands/HSETNX.ts | 10 +- packages/client/lib/commands/HSTRLEN.ts | 7 +- packages/client/lib/commands/HVALS.ts | 6 +- packages/client/lib/commands/INCR.ts | 4 +- packages/client/lib/commands/INCRBY.ts | 7 +- packages/client/lib/commands/INCRBYFLOAT.ts | 9 +- packages/client/lib/commands/KEYS.ts | 8 +- packages/client/lib/commands/LINDEX.ts | 8 +- packages/client/lib/commands/LINSERT.ts | 10 +- packages/client/lib/commands/LLEN.ts | 4 +- packages/client/lib/commands/LMOVE.ts | 10 +- packages/client/lib/commands/LOLWUT.ts | 4 +- packages/client/lib/commands/LPOP.ts | 6 +- packages/client/lib/commands/LPOP_COUNT.ts | 9 +- packages/client/lib/commands/LPOS.ts | 8 +- packages/client/lib/commands/LPOS_COUNT.ts | 8 +- packages/client/lib/commands/LPUSH.ts | 7 +- packages/client/lib/commands/LPUSHX.ts | 7 +- packages/client/lib/commands/LRANGE.ts | 10 +- packages/client/lib/commands/LREM.ts | 8 +- packages/client/lib/commands/LSET.ts | 10 +- packages/client/lib/commands/LTRIM.ts | 10 +- packages/client/lib/commands/MGET.ts | 8 +- packages/client/lib/commands/MIGRATE.ts | 17 +- packages/client/lib/commands/MOVE.ts | 2 +- packages/client/lib/commands/MSET.ts | 13 +- packages/client/lib/commands/MSETNX.ts | 9 +- packages/client/lib/commands/PERSIST.ts | 6 +- packages/client/lib/commands/PEXPIRE.ts | 9 +- packages/client/lib/commands/PEXPIREAT.ts | 8 +- packages/client/lib/commands/PFADD.ts | 9 +- packages/client/lib/commands/PFCOUNT.ts | 6 +- packages/client/lib/commands/PING.spec.ts | 22 +- packages/client/lib/commands/PING.ts | 4 +- packages/client/lib/commands/PSETEX.spec.ts | 1 + packages/client/lib/commands/PSETEX.ts | 10 +- packages/client/lib/commands/PTTL.ts | 4 +- packages/client/lib/commands/RANDOMKEY.ts | 8 +- packages/client/lib/commands/RENAME.ts | 9 +- packages/client/lib/commands/RENAMENX.ts | 9 +- packages/client/lib/commands/RPOP.ts | 6 +- packages/client/lib/commands/RPOPLPUSH.ts | 7 +- packages/client/lib/commands/RPOP_COUNT.ts | 9 +- packages/client/lib/commands/RPUSH.ts | 7 +- packages/client/lib/commands/RPUSHX.ts | 7 +- packages/client/lib/commands/SADD.ts | 7 +- packages/client/lib/commands/SAVE.ts | 4 +- packages/client/lib/commands/SCAN.ts | 14 +- packages/client/lib/commands/SCRIPT_EXISTS.ts | 2 +- packages/client/lib/commands/SDIFF.ts | 10 +- packages/client/lib/commands/SDIFFSTORE.ts | 7 +- packages/client/lib/commands/SET.ts | 4 +- packages/client/lib/commands/SETBIT.ts | 8 +- packages/client/lib/commands/SETEX.ts | 4 +- packages/client/lib/commands/SETNX.ts | 9 +- packages/client/lib/commands/SETRANGE.ts | 8 +- packages/client/lib/commands/SINTER.ts | 10 +- packages/client/lib/commands/SINTERSTORE.ts | 9 +- packages/client/lib/commands/SISMEMBER.ts | 9 +- packages/client/lib/commands/SMEMBERS.ts | 6 +- packages/client/lib/commands/SMISMEMBER.ts | 9 +- packages/client/lib/commands/SMOVE.ts | 10 +- packages/client/lib/commands/SPOP.ts | 9 +- packages/client/lib/commands/SRANDMEMBER.ts | 6 +- .../client/lib/commands/SRANDMEMBER_COUNT.ts | 8 +- packages/client/lib/commands/SREM.ts | 7 +- packages/client/lib/commands/SSCAN.ts | 13 +- packages/client/lib/commands/STRLEN.ts | 4 +- packages/client/lib/commands/SUNION.ts | 8 +- packages/client/lib/commands/SUNIONSTORE.ts | 7 +- packages/client/lib/commands/TOUCH.ts | 6 +- packages/client/lib/commands/TTL.ts | 4 +- packages/client/lib/commands/TYPE.ts | 6 +- packages/client/lib/commands/UNLINK.ts | 6 +- packages/client/lib/commands/XAUTOCLAIM.ts | 12 +- .../client/lib/commands/XAUTOCLAIM_BUFFER.ts | 17 - .../client/lib/commands/XAUTOCLAIM_JUSTID.ts | 10 +- .../lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts | 13 - packages/client/lib/commands/XCLAIM.ts | 2 +- packages/client/lib/commands/XCLAIM_BUFFER.ts | 5 - packages/client/lib/commands/XCLAIM_JUSTID.ts | 4 +- .../lib/commands/XCLAIM_JUSTID_BUFFER.ts | 5 - packages/client/lib/commands/XGROUP_CREATE.ts | 2 +- .../lib/commands/XGROUP_CREATECONSUMER.ts | 2 +- .../client/lib/commands/XGROUP_DESTROY.ts | 2 +- packages/client/lib/commands/XGROUP_SETID.ts | 2 +- .../client/lib/commands/XINFO_CONSUMERS.ts | 2 +- packages/client/lib/commands/XINFO_GROUPS.ts | 4 +- packages/client/lib/commands/XINFO_STREAM.ts | 12 +- packages/client/lib/commands/XPENDING.ts | 12 +- .../client/lib/commands/XPENDING_RANGE.ts | 6 +- packages/client/lib/commands/XRANGE.ts | 2 +- packages/client/lib/commands/XRANGE_BUFFER.ts | 5 - packages/client/lib/commands/XREAD.ts | 2 +- packages/client/lib/commands/XREADGROUP.ts | 2 +- .../client/lib/commands/XREADGROUP_BUFFER.ts | 6 - packages/client/lib/commands/XREAD_BUFFER.ts | 5 - packages/client/lib/commands/XREVRANGE.ts | 17 +- .../client/lib/commands/XREVRANGE_BUFFER.ts | 5 - packages/client/lib/commands/ZADD.ts | 6 +- packages/client/lib/commands/ZCARD.ts | 4 +- packages/client/lib/commands/ZCOUNT.ts | 13 +- packages/client/lib/commands/ZDIFF.ts | 8 +- packages/client/lib/commands/ZDIFFSTORE.ts | 7 +- .../client/lib/commands/ZDIFF_WITHSCORES.ts | 2 +- packages/client/lib/commands/ZINCRBY.ts | 13 +- packages/client/lib/commands/ZINTER.ts | 9 +- packages/client/lib/commands/ZINTERSTORE.ts | 8 +- .../client/lib/commands/ZINTER_WITHSCORES.ts | 2 +- packages/client/lib/commands/ZLEXCOUNT.ts | 8 +- packages/client/lib/commands/ZMSCORE.ts | 9 +- packages/client/lib/commands/ZPOPMAX.ts | 13 +- packages/client/lib/commands/ZPOPMAX_COUNT.ts | 8 +- packages/client/lib/commands/ZPOPMIN.ts | 13 +- packages/client/lib/commands/ZPOPMIN_COUNT.ts | 8 +- packages/client/lib/commands/ZRANDMEMBER.ts | 6 +- .../client/lib/commands/ZRANDMEMBER_COUNT.ts | 8 +- .../commands/ZRANDMEMBER_COUNT_WITHSCORES.ts | 5 +- packages/client/lib/commands/ZRANGE.ts | 16 +- packages/client/lib/commands/ZRANGEBYLEX.ts | 16 +- packages/client/lib/commands/ZRANGEBYSCORE.ts | 16 +- .../lib/commands/ZRANGEBYSCORE_WITHSCORES.ts | 10 +- packages/client/lib/commands/ZRANGESTORE.ts | 17 +- .../client/lib/commands/ZRANGE_WITHSCORES.ts | 5 +- packages/client/lib/commands/ZRANK.ts | 7 +- packages/client/lib/commands/ZREM.ts | 7 +- .../client/lib/commands/ZREMRANGEBYLEX.ts | 16 +- .../client/lib/commands/ZREMRANGEBYRANK.ts | 8 +- .../client/lib/commands/ZREMRANGEBYSCORE.ts | 16 +- packages/client/lib/commands/ZREVRANK.ts | 7 +- packages/client/lib/commands/ZSCAN.ts | 19 +- packages/client/lib/commands/ZSCORE.ts | 9 +- packages/client/lib/commands/ZUNION.ts | 9 +- packages/client/lib/commands/ZUNIONSTORE.ts | 8 +- .../client/lib/commands/ZUNION_WITHSCORES.ts | 2 +- .../lib/commands/generic-transformers.spec.ts | 260 +-- .../lib/commands/generic-transformers.ts | 181 +- packages/client/lib/commands/index.ts | 9 +- packages/client/lib/lua-script.ts | 2 +- packages/client/package.json | 13 +- packages/json/lib/commands/RESP.ts | 2 +- packages/json/lib/commands/index.ts | 11 +- packages/json/package.json | 7 +- packages/search/lib/commands/AGGREGATE.ts | 17 +- packages/search/lib/commands/SEARCH.ts | 4 +- packages/search/lib/commands/SUGDEL.ts | 2 +- packages/search/lib/commands/index.ts | 8 +- packages/search/package.json | 7 +- packages/test-utils/package.json | 4 +- .../time-series/lib/commands/CREATERULE.ts | 2 +- .../time-series/lib/commands/DELETERULE.ts | 2 +- packages/time-series/package.json | 7 +- 237 files changed, 2322 insertions(+), 1951 deletions(-) delete mode 100644 packages/client/lib/commands/BLMOVE_BUFFER.ts delete mode 100644 packages/client/lib/commands/BLPOP_BUFFER.ts delete mode 100644 packages/client/lib/commands/BRPOPLPUSH_BUFFER.ts delete mode 100644 packages/client/lib/commands/BRPOP_BUFFER.ts delete mode 100644 packages/client/lib/commands/GET_BUFFER.spec.ts delete mode 100644 packages/client/lib/commands/GET_BUFFER.ts delete mode 100644 packages/client/lib/commands/HGETALL_BUFFER.ts delete mode 100644 packages/client/lib/commands/HGET_BUFFER.ts delete mode 100644 packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES_BUFFER.ts delete mode 100644 packages/client/lib/commands/XAUTOCLAIM_BUFFER.ts delete mode 100644 packages/client/lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts delete mode 100644 packages/client/lib/commands/XCLAIM_BUFFER.ts delete mode 100644 packages/client/lib/commands/XCLAIM_JUSTID_BUFFER.ts delete mode 100644 packages/client/lib/commands/XRANGE_BUFFER.ts delete mode 100644 packages/client/lib/commands/XREADGROUP_BUFFER.ts delete mode 100644 packages/client/lib/commands/XREAD_BUFFER.ts delete mode 100644 packages/client/lib/commands/XREVRANGE_BUFFER.ts diff --git a/README.md b/README.md index 40ee294e4a..b38aadf036 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,16 @@ await client.hGetAll('key'); // { field1: 'value1', field2: 'value2' } await client.hVals('key'); // ['value1', 'value2'] ``` +`Buffer`s are supported as well: + +```typescript +await client.hSet('key', 'field', Buffer.from('value')); // 'OK' +await client.hGetAll( + commandOptions({ returnBuffers: true }), + 'key' +); // { field: } +``` + ### Unsupported Redis Commands If you want to run commands and/or use arguments that Node Redis doesn't know about (yet!) use `.sendCommand()`: diff --git a/package-lock.json b/package-lock.json index 2b0acfb562..036227ba09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,11 +21,11 @@ "@tsconfig/node12": "^1.0.9", "gh-pages": "^3.2.3", "release-it": "^14.11.8", - "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "engines": { - "npm": ">=7" + "npm": ">=7", + "typescript": ">=4" } }, "node_modules/@babel/code-frame": { @@ -79,6 +79,15 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.16.5", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", @@ -111,6 +120,15 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "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", @@ -303,6 +321,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -443,18 +470,6 @@ "node": ">= 4" } }, - "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.9.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", @@ -506,13 +521,17 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { @@ -528,6 +547,45 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -871,9 +929,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.11.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.13.tgz", - "integrity": "sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.1.tgz", + "integrity": "sha512-NXKvBVUzIbs6ylBwmOwHFkZS2EXCcjnqr8ZCRNaXBkHAf+3mn/rPcJxwrzuc6movh8fxQAsUUfYklJ/EG+hZqQ==", "dev": true }, "node_modules/@types/parse-json": { @@ -938,13 +996,13 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz", - "integrity": "sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.0.tgz", + "integrity": "sha512-spu1UW7QuBn0nJ6+psnfCc3iVoQAifjKORgBngKOmC8U/1tbe2YJMzYQqDGYB4JCss7L8+RM2kKLb1B1Aw9BNA==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "5.7.0", - "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/experimental-utils": "5.8.0", + "@typescript-eslint/scope-manager": "5.8.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -969,31 +1027,16 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.7.0.tgz", - "integrity": "sha512-u57eZ5FbEpzN5kSjmVrSesovWslH2ZyNPnaXQMXWgH57d5+EVHEt76W75vVuI9qKZ5BMDKNfRN+pxcPEjQjb2A==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.0.tgz", + "integrity": "sha512-KN5FvNH71bhZ8fKtL+lhW7bjm7cxs1nt+hrDZWIqb6ViCffQcWyLunGrgvISgkRojIDcXIsH+xlFfI4RCDA0xA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.7.0", - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/typescript-estree": "5.7.0", + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -1005,18 +1048,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.7.0.tgz", - "integrity": "sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.0.tgz", + "integrity": "sha512-Gleacp/ZhRtJRYs5/T8KQR3pAQjQI89Dn/k+OzyCKOsLiZH2/Vh60cFBTnFsHNI6WAD+lNUo/xGZ4NeA5u0Ipw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.7.0", - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/typescript-estree": "5.7.0", + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", "debug": "^4.3.2" }, "engines": { @@ -1036,13 +1079,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz", - "integrity": "sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz", + "integrity": "sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/visitor-keys": "5.7.0" + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1053,9 +1096,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.7.0.tgz", - "integrity": "sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.0.tgz", + "integrity": "sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1066,13 +1109,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz", - "integrity": "sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz", + "integrity": "sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/visitor-keys": "5.7.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -1092,57 +1135,13 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz", - "integrity": "sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz", + "integrity": "sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/types": "5.8.0", "eslint-visitor-keys": "^3.0.0" }, "engines": { @@ -1251,6 +1250,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1319,15 +1330,12 @@ "dev": true }, "node_modules/array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "dependencies": { - "array-uniq": "^1.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/array-uniq": { @@ -1437,10 +1445,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/boxen/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/boxen/node_modules/camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", "dev": true, "engines": { "node": ">=10" @@ -1610,21 +1618,18 @@ } }, "node_modules/camelcase": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", - "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001286", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz", - "integrity": "sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ==", + "version": "1.0.30001291", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001291.tgz", + "integrity": "sha512-roMV5V0HNGgJ88s42eE70sstqGW/gwFndosYrikHthw98N5tLnOTxFqMLQjZVRxTWFlJ4rn+MsgXrR7MDPY4jA==", "dev": true, "funding": { "type": "opencollective", @@ -1674,6 +1679,18 @@ "fsevents": "~2.3.2" } }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/ci-info": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", @@ -1845,12 +1862,6 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/convert-source-map/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "node_modules/cosmiconfig": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", @@ -1897,9 +1908,9 @@ } }, "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -2083,9 +2094,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "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==", + "version": "1.4.24", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.24.tgz", + "integrity": "sha512-erwx5r69B/WFfFuF2jcNN0817BfDBdC4765kQ6WltOMuwsimlQo3JTEq0Cle+wpHralwdeX3OfAtw/mHxPK0Wg==", "dev": true }, "node_modules/email-addresses": { @@ -2155,18 +2166,21 @@ } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", + "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.0.5", @@ -2267,18 +2281,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/eslint-scope": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", @@ -2301,18 +2303,6 @@ "node": ">=4.0" } }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/eslint/node_modules/ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -2322,33 +2312,6 @@ "node": ">= 4" } }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/espree": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", @@ -2495,6 +2458,18 @@ "node": ">=8" } }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2531,6 +2506,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2608,16 +2592,19 @@ } }, "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat": { @@ -2824,6 +2811,34 @@ "node": ">=10" } }, + "node_modules/gh-pages/node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages/node_modules/globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/git-up": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.5.tgz", @@ -2844,9 +2859,9 @@ } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -2864,15 +2879,15 @@ } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/global-dirs": { @@ -2905,11 +2920,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globals/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, "engines": { "node": ">=10" }, @@ -2917,22 +2940,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "dependencies": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/got": { "version": "11.8.3", "resolved": "https://registry.npmjs.org/got/-/got-11.8.3.tgz", @@ -3116,9 +3123,9 @@ ] }, "node_modules/ignore": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", - "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, "engines": { "node": ">= 4" @@ -3542,6 +3549,15 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/istanbul-lib-processinfo": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", @@ -3560,16 +3576,6 @@ "node": ">=8" } }, - "node_modules/istanbul-lib-processinfo/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", @@ -3751,15 +3757,18 @@ "dev": true }, "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -3856,6 +3865,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -4002,68 +4020,28 @@ "url": "https://opencollective.com/mochajs" } }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/mocha/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">=10" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/mocha/node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/mocha/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", @@ -4071,48 +4049,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/mocha/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -4146,15 +4082,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4323,15 +4250,6 @@ "node": ">=8.9" } }, - "node_modules/nyc/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/nyc/node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -4343,6 +4261,58 @@ "wrap-ansi": "^6.2.0" } }, + "node_modules/nyc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nyc/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -4417,9 +4387,9 @@ } }, "node_modules/object-inspect": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.1.tgz", - "integrity": "sha512-If7BjFlpkzzBeV1cqgT3OSWT3azyoxDGajR+iGnFBfVV2EWyDyWaZZW2ERDjUaY2QM8i5jI3Sj7mhsM4DDAqWA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4540,30 +4510,33 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { @@ -4783,6 +4756,15 @@ "node": ">=0.10.0" } }, + "node_modules/package-json/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4948,6 +4930,58 @@ "node": ">=8" } }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -5119,6 +5153,15 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -5255,46 +5298,37 @@ "node": ">=10" } }, - "node_modules/release-it/node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/release-it/node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "node_modules/release-it/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">=10" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/release-it/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/release-it/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { - "semver": "bin/semver.js" - }, + "uuid": "dist/bin/uuid" + } + }, + "node_modules/release-it/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, "engines": { "node": ">=10" } @@ -5452,24 +5486,10 @@ } }, "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -5478,12 +5498,18 @@ "dev": true }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/semver-diff": { @@ -5498,6 +5524,15 @@ "node": ">=8" } }, + "node_modules/semver-diff/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -5696,6 +5731,26 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -5741,12 +5796,15 @@ } }, "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-outer": { @@ -5761,6 +5819,15 @@ "node": ">=0.10.0" } }, + "node_modules/strip-outer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5859,6 +5926,15 @@ "node": ">=0.10.0" } }, + "node_modules/trim-repeated/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/ts-node": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", @@ -5958,9 +6034,9 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "engines": { "node": ">=10" @@ -6000,6 +6076,26 @@ "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" } }, + "node_modules/typedoc/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", @@ -6086,21 +6182,6 @@ "is-ci": "bin.js" } }, - "node_modules/update-notifier/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6135,12 +6216,13 @@ "dev": true }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, "bin": { - "uuid": "dist/bin/uuid" + "uuid": "bin/uuid" } }, "node_modules/v8-compile-cache": { @@ -6382,9 +6464,9 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, "engines": { "node": ">=10" @@ -6405,6 +6487,18 @@ "node": ">=10" } }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/yargs-unparser/node_modules/decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", @@ -6460,20 +6554,20 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "@types/redis-parser": "^3.0.0", "@types/sinon": "^10.0.6", "@types/yallist": "^4.0.1", - "@typescript-eslint/eslint-plugin": "^5.7.0", - "@typescript-eslint/parser": "^5.7.0", - "eslint": "^8.4.1", + "@typescript-eslint/eslint-plugin": "^5.8.0", + "@typescript-eslint/parser": "^5.8.0", + "eslint": "^8.5.0", "nyc": "^15.1.0", "release-it": "^14.11.8", "sinon": "^12.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "engines": { "node": ">=12" @@ -6486,13 +6580,13 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "peerDependencies": { "@node-redis/client": "^1.0.0" @@ -6505,13 +6599,13 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "peerDependencies": { "@node-redis/client": "^1.0.0" @@ -6522,14 +6616,14 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^9.0.0", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "@types/yargs": "^17.0.7", "mocha": "^9.1.3", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", - "typescript": "^4.5.3", + "typescript": "^4.5.4", "yargs": "^17.3.0" }, "peerDependencies": { @@ -6543,13 +6637,13 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "peerDependencies": { "@node-redis/client": "^1.0.0" @@ -6593,6 +6687,14 @@ "json5": "^2.1.2", "semver": "^6.3.0", "source-map": "^0.5.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "@babel/generator": { @@ -6616,6 +6718,14 @@ "@babel/helper-validator-option": "^7.14.5", "browserslist": "^4.17.5", "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "@babel/helper-environment-visitor": { @@ -6768,6 +6878,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -6875,12 +6991,6 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true } } }, @@ -6929,11 +7039,15 @@ "sprintf-js": "~1.0.2" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } }, "js-yaml": { "version": "3.14.1", @@ -6945,6 +7059,33 @@ "esprima": "^4.0.0" } }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -6973,14 +7114,14 @@ "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "@types/redis-parser": "^3.0.0", "@types/sinon": "^10.0.6", "@types/yallist": "^4.0.1", - "@typescript-eslint/eslint-plugin": "^5.7.0", - "@typescript-eslint/parser": "^5.7.0", + "@typescript-eslint/eslint-plugin": "^5.8.0", + "@typescript-eslint/parser": "^5.8.0", "cluster-key-slot": "1.1.0", - "eslint": "^8.4.1", + "eslint": "^8.5.0", "generic-pool": "3.8.2", "nyc": "^15.1.0", "redis-parser": "3.0.0", @@ -6989,7 +7130,7 @@ "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3", + "typescript": "^4.5.4", "yallist": "4.0.0" } }, @@ -6998,13 +7139,13 @@ "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" } }, "@node-redis/search": { @@ -7012,13 +7153,13 @@ "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" } }, "@node-redis/test-utils": { @@ -7026,14 +7167,14 @@ "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^9.0.0", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "@types/yargs": "^17.0.7", "mocha": "^9.1.3", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", - "typescript": "^4.5.3", + "typescript": "^4.5.4", "yargs": "^17.3.0" } }, @@ -7042,13 +7183,13 @@ "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" } }, "@nodelib/fs.scandir": { @@ -7315,9 +7456,9 @@ "dev": true }, "@types/node": { - "version": "16.11.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.13.tgz", - "integrity": "sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.1.tgz", + "integrity": "sha512-NXKvBVUzIbs6ylBwmOwHFkZS2EXCcjnqr8ZCRNaXBkHAf+3mn/rPcJxwrzuc6movh8fxQAsUUfYklJ/EG+hZqQ==", "dev": true }, "@types/parse-json": { @@ -7382,127 +7523,85 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz", - "integrity": "sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.0.tgz", + "integrity": "sha512-spu1UW7QuBn0nJ6+psnfCc3iVoQAifjKORgBngKOmC8U/1tbe2YJMzYQqDGYB4JCss7L8+RM2kKLb1B1Aw9BNA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.7.0", - "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/experimental-utils": "5.8.0", + "@typescript-eslint/scope-manager": "5.8.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", "regexpp": "^3.2.0", "semver": "^7.3.5", "tsutils": "^3.21.0" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/experimental-utils": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.7.0.tgz", - "integrity": "sha512-u57eZ5FbEpzN5kSjmVrSesovWslH2ZyNPnaXQMXWgH57d5+EVHEt76W75vVuI9qKZ5BMDKNfRN+pxcPEjQjb2A==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.0.tgz", + "integrity": "sha512-KN5FvNH71bhZ8fKtL+lhW7bjm7cxs1nt+hrDZWIqb6ViCffQcWyLunGrgvISgkRojIDcXIsH+xlFfI4RCDA0xA==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.7.0", - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/typescript-estree": "5.7.0", + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.7.0.tgz", - "integrity": "sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.0.tgz", + "integrity": "sha512-Gleacp/ZhRtJRYs5/T8KQR3pAQjQI89Dn/k+OzyCKOsLiZH2/Vh60cFBTnFsHNI6WAD+lNUo/xGZ4NeA5u0Ipw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.7.0", - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/typescript-estree": "5.7.0", + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz", - "integrity": "sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz", + "integrity": "sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/visitor-keys": "5.7.0" + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0" } }, "@typescript-eslint/types": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.7.0.tgz", - "integrity": "sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.0.tgz", + "integrity": "sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz", - "integrity": "sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz", + "integrity": "sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.7.0", - "@typescript-eslint/visitor-keys": "5.7.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", "semver": "^7.3.5", "tsutils": "^3.21.0" - }, - "dependencies": { - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/visitor-keys": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz", - "integrity": "sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz", + "integrity": "sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug==", "dev": true, "requires": { - "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/types": "5.8.0", "eslint-visitor-keys": "^3.0.0" } }, @@ -7575,6 +7674,14 @@ "dev": true, "requires": { "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } } }, "ansi-regex": { @@ -7630,13 +7737,10 @@ "dev": true }, "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "array-uniq": { "version": "1.0.3", @@ -7719,10 +7823,10 @@ "wrap-ansi": "^7.0.0" }, "dependencies": { - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", "dev": true } } @@ -7842,15 +7946,15 @@ "dev": true }, "camelcase": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", - "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "caniuse-lite": { - "version": "1.0.30001286", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz", - "integrity": "sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ==", + "version": "1.0.30001291", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001291.tgz", + "integrity": "sha512-roMV5V0HNGgJ88s42eE70sstqGW/gwFndosYrikHthw98N5tLnOTxFqMLQjZVRxTWFlJ4rn+MsgXrR7MDPY4jA==", "dev": true }, "chalk": { @@ -7883,6 +7987,17 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "ci-info": { @@ -8018,14 +8133,6 @@ "dev": true, "requires": { "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } } }, "cosmiconfig": { @@ -8065,9 +8172,9 @@ "dev": true }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -8200,9 +8307,9 @@ "dev": true }, "electron-to-chromium": { - "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==", + "version": "1.4.24", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.24.tgz", + "integrity": "sha512-erwx5r69B/WFfFuF2jcNN0817BfDBdC4765kQ6WltOMuwsimlQo3JTEq0Cle+wpHralwdeX3OfAtw/mHxPK0Wg==", "dev": true }, "email-addresses": { @@ -8263,15 +8370,15 @@ "dev": true }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", + "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", "dev": true, "requires": { "@eslint/eslintrc": "^1.0.5", @@ -8314,12 +8421,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, "eslint-scope": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", @@ -8336,35 +8437,11 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true } } }, @@ -8509,6 +8586,17 @@ "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "fast-json-stable-stringify": { @@ -8539,6 +8627,14 @@ "dev": true, "requires": { "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } } }, "file-entry-cache": { @@ -8594,12 +8690,12 @@ } }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, @@ -8741,6 +8837,30 @@ "find-cache-dir": "^3.3.1", "fs-extra": "^8.1.0", "globby": "^6.1.0" + }, + "dependencies": { + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } } }, "git-up": { @@ -8763,9 +8883,9 @@ } }, "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -8777,12 +8897,12 @@ } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "global-dirs": { @@ -8801,27 +8921,20 @@ "dev": true, "requires": { "type-fest": "^0.20.2" - }, - "dependencies": { - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - } } }, "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" } }, "got": { @@ -8950,9 +9063,9 @@ "dev": true }, "ignore": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", - "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-cwd": { @@ -9256,6 +9369,14 @@ "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "istanbul-lib-processinfo": { @@ -9271,14 +9392,6 @@ "p-map": "^3.0.0", "rimraf": "^3.0.0", "uuid": "^3.3.3" - }, - "dependencies": { - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - } } }, "istanbul-lib-report": { @@ -9431,12 +9544,12 @@ "dev": true }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" } }, "lodash": { @@ -9507,6 +9620,14 @@ "dev": true, "requires": { "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "make-error": { @@ -9617,43 +9738,21 @@ "yargs-unparser": "2.0.0" }, "dependencies": { - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "ms": { @@ -9662,30 +9761,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -9709,12 +9784,6 @@ "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true } } }, @@ -9852,12 +9921,6 @@ "yargs": "^15.0.2" }, "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -9869,6 +9932,43 @@ "wrap-ansi": "^6.2.0" } }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -9930,9 +10030,9 @@ "dev": true }, "object-inspect": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.1.tgz", - "integrity": "sha512-If7BjFlpkzzBeV1cqgT3OSWT3azyoxDGajR+iGnFBfVV2EWyDyWaZZW2ERDjUaY2QM8i5jI3Sj7mhsM4DDAqWA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true }, "once": { @@ -10017,21 +10117,21 @@ "dev": true }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } }, "p-map": { @@ -10208,6 +10308,12 @@ "dev": true } } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, @@ -10335,6 +10441,45 @@ "dev": true, "requires": { "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } } }, "prelude-ls": { @@ -10454,6 +10599,12 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true } } }, @@ -10560,34 +10711,26 @@ "yargs-parser": "20.2.9" }, "dependencies": { - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true }, - "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true } } }, @@ -10699,9 +10842,9 @@ } }, "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safer-buffer": { @@ -10711,10 +10854,13 @@ "dev": true }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } }, "semver-diff": { "version": "3.1.1", @@ -10723,6 +10869,14 @@ "dev": true, "requires": { "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "serialize-javascript": { @@ -10888,6 +11042,14 @@ "dev": true, "requires": { "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } } }, "string-width": { @@ -10923,9 +11085,9 @@ "dev": true }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "strip-outer": { @@ -10935,6 +11097,14 @@ "dev": true, "requires": { "escape-string-regexp": "^1.0.2" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } } }, "supports-color": { @@ -11012,6 +11182,14 @@ "dev": true, "requires": { "escape-string-regexp": "^1.0.2" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } } }, "ts-node": { @@ -11081,9 +11259,9 @@ "dev": true }, "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, "typedarray-to-buffer": { @@ -11106,6 +11284,22 @@ "marked": "^3.0.8", "minimatch": "^3.0.4", "shiki": "^0.9.12" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "typescript": { @@ -11171,15 +11365,6 @@ "requires": { "ci-info": "^2.0.0" } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } } } }, @@ -11214,9 +11399,9 @@ "dev": true }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "v8-compile-cache": { @@ -11417,9 +11602,9 @@ } }, "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true }, "yargs-unparser": { @@ -11434,6 +11619,12 @@ "is-plain-obj": "^2.1.0" }, "dependencies": { + "camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "dev": true + }, "decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", diff --git a/package.json b/package.json index 52057bda0e..8e675bc86c 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], "workspaces": [ "./packages/*" ], @@ -29,8 +32,7 @@ "@tsconfig/node12": "^1.0.9", "gh-pages": "^3.2.3", "release-it": "^14.11.8", - "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "repository": { "type": "git", @@ -40,10 +42,8 @@ "url": "https://github.com/redis/node-redis/issues" }, "homepage": "https://github.com/redis/node-redis", - "files": [ - "dist/" - ], "engines": { - "npm": ">=7" + "npm": ">=7", + "typescript": ">=4" } } diff --git a/packages/client/lib/client/commands-queue.ts b/packages/client/lib/client/commands-queue.ts index 4c58837259..e716dcd3a2 100644 --- a/packages/client/lib/client/commands-queue.ts +++ b/packages/client/lib/client/commands-queue.ts @@ -11,6 +11,7 @@ export interface QueueCommandOptions { asap?: boolean; chainId?: symbol; signal?: AbortSignal; + returnBuffers?: boolean; ignorePubSubMode?: boolean; } @@ -27,7 +28,7 @@ interface CommandWaitingForReply { resolve(reply?: unknown): void; reject(err: Error): void; channelsCounter?: number; - bufferMode?: boolean; + returnBuffers?: boolean; } export enum PubSubSubscribeCommands { @@ -41,8 +42,8 @@ export enum PubSubUnsubscribeCommands { } export type PubSubListener< - BUFFER_MODE extends boolean = false, - T = BUFFER_MODE extends true ? Buffer : string + RETURN_BUFFERS extends boolean = false, + T = RETURN_BUFFERS extends true ? Buffer : string > = (message: T, channel: T) => unknown; interface PubSubListeners { @@ -142,7 +143,7 @@ export default class RedisCommandsQueue { this.#maxLength = maxLength; } - addCommand(args: RedisCommandArguments, options?: QueueCommandOptions, bufferMode?: boolean): Promise { + addCommand(args: RedisCommandArguments, options?: QueueCommandOptions): Promise { if (this.#pubSubState && !options?.ignorePubSubMode) { return Promise.reject(new Error('Cannot send commands in PubSub mode')); } else if (this.#maxLength && this.#waitingToBeSent.length + this.#waitingForReply.length >= this.#maxLength) { @@ -154,7 +155,7 @@ export default class RedisCommandsQueue { const node = new LinkedList.Node({ args, chainId: options?.chainId, - bufferMode, + returnBuffers: options?.returnBuffers, resolve, reject }); @@ -197,7 +198,7 @@ export default class RedisCommandsQueue { command: PubSubSubscribeCommands, channels: RedisCommandArgument | Array, listener: PubSubListener, - bufferMode?: T + returnBuffers?: T ): Promise { const pubSubState = this.#initiatePubSubState(), channelsToSubscribe: Array = [], @@ -215,7 +216,7 @@ export default class RedisCommandsQueue { } // https://github.com/microsoft/TypeScript/issues/23132 - (bufferMode ? listeners.buffers : listeners.strings).add(listener as any); + (returnBuffers ? listeners.buffers : listeners.strings).add(listener as any); } if (!channelsToSubscribe.length) { @@ -228,7 +229,7 @@ export default class RedisCommandsQueue { command: PubSubUnsubscribeCommands, channels?: string | Array, listener?: PubSubListener, - bufferMode?: T + returnBuffers?: T ): Promise { if (!this.#pubSubState) { return Promise.resolve(); @@ -252,7 +253,7 @@ export default class RedisCommandsQueue { let shouldUnsubscribe; if (listener) { // https://github.com/microsoft/TypeScript/issues/23132 - (bufferMode ? sets.buffers : sets.strings).delete(listener as any); + (returnBuffers ? sets.buffers : sets.strings).delete(listener as any); shouldUnsubscribe = !sets.buffers.size && !sets.strings.size; } else { shouldUnsubscribe = true; @@ -289,7 +290,7 @@ export default class RedisCommandsQueue { this.#waitingToBeSent.push({ args: commandArgs, channelsCounter, - bufferMode: true, + returnBuffers: true, resolve: () => { pubSubState[inProgressKey] -= channelsCounter; if (isSubscribe) { @@ -350,7 +351,7 @@ export default class RedisCommandsQueue { resolve: toSend.resolve, reject: toSend.reject, channelsCounter: toSend.channelsCounter, - bufferMode: toSend.bufferMode + returnBuffers: toSend.returnBuffers }); } this.#chainInExecution = toSend?.chainId; @@ -359,7 +360,7 @@ export default class RedisCommandsQueue { parseResponse(data: Buffer): void { this.#parser.setReturnBuffers( - !!this.#waitingForReply.head?.value.bufferMode || + !!this.#waitingForReply.head?.value.returnBuffers || !!this.#pubSubState?.subscribed ); this.#parser.execute(data); diff --git a/packages/client/lib/client/index.spec.ts b/packages/client/lib/client/index.spec.ts index c5e05b7858..05c0deb897 100644 --- a/packages/client/lib/client/index.spec.ts +++ b/packages/client/lib/client/index.spec.ts @@ -319,9 +319,11 @@ describe('Client', () => { assert.equal(await client.sendCommand(['PING']), 'PONG'); }, GLOBAL.SERVERS.OPEN); - testUtils.testWithClient('bufferMode', async client => { + testUtils.testWithClient('returnBuffers', async client => { assert.deepEqual( - await client.sendCommand(['PING'], undefined, true), + await client.sendCommand(['PING'], RedisClient.commandOptions({ + returnBuffers: true + }),), Buffer.from('PONG') ); }, GLOBAL.SERVERS.OPEN); @@ -435,10 +437,10 @@ describe('Client', () => { }); testUtils.testWithClient('modules', async client => { - assert.equal( - await client.module.echo('message'), - 'message' - ); + // assert.equal( + // await client.module.echo('message'), + // 'message' + // ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { @@ -551,7 +553,7 @@ describe('Client', () => { await client.zAdd('key', members); - const map = new Map(); + const map = new Map(); for await (const member of client.zScanIterator('key')) { map.set(member.value, member.score); } diff --git a/packages/client/lib/client/index.ts b/packages/client/lib/client/index.ts index bd2557ce92..9e1b2d37cc 100644 --- a/packages/client/lib/client/index.ts +++ b/packages/client/lib/client/index.ts @@ -1,5 +1,5 @@ import COMMANDS from './commands'; -import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisModules, RedisPlugins, RedisScript, RedisScripts } from '../commands'; +import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisModules, RedisPlugins, RedisScript, RedisScripts } from '../commands'; import RedisSocket, { RedisSocketOptions, RedisTlsSocketOptions } from './socket'; import RedisCommandsQueue, { PubSubListener, PubSubSubscribeCommands, PubSubUnsubscribeCommands, QueueCommandOptions } from './commands-queue'; import RedisClientMultiCommand, { RedisClientMultiCommandType } from './multi-command'; @@ -28,8 +28,30 @@ export interface RedisClientOptions = - (...args: Parameters | [options: CommandOptions, ...rest: Parameters]) => Promise>; +type ConvertArgumentType = + Type extends RedisCommandArgument ? ( + Type extends (string & ToType) ? Type : ToType + ) : ( + Type extends Set ? Set> : ( + Type extends Map ? Map> : ( + Type extends Record ? { + [Property in keyof Type]: ConvertArgumentType + } : Type + ) + ) + ); + +export type RedisClientCommandSignature< + Command extends RedisCommand, + Params extends Array = Parameters +> = >( + ...args: Params | [options: Options, ...rest: Params] +) => Promise< + ConvertArgumentType< + RedisCommandReply, + Options['returnBuffers'] extends true ? Buffer : string + > +>; type WithCommands = { [P in keyof typeof COMMANDS]: RedisClientCommandSignature<(typeof COMMANDS)[P]>; @@ -59,7 +81,7 @@ type ClientLegacyCallback = (err: Error | null, reply?: RedisCommandRawReply) => export type ClientLegacyCommandArguments = LegacyCommandArguments | [...LegacyCommandArguments, ClientLegacyCallback]; export default class RedisClient extends EventEmitter { - static commandOptions(options: ClientCommandOptions): CommandOptions { + static commandOptions(options: T): CommandOptions { return commandOptions(options); } @@ -325,17 +347,17 @@ export default class RedisClient return transformCommandReply( command, - await this.#sendCommand(redisArgs, options, command.BUFFER_MODE), + await this.#sendCommand(redisArgs, options), redisArgs.preserve ); } - sendCommand(args: RedisCommandArguments, options?: ClientCommandOptions, bufferMode?: boolean): Promise { - return this.#sendCommand(args, options, bufferMode); + sendCommand(args: RedisCommandArguments, options?: ClientCommandOptions): Promise { + return this.#sendCommand(args, options); } // using `#sendCommand` cause `sendCommand` is overwritten in legacy mode - #sendCommand(args: RedisCommandArguments, options?: ClientCommandOptions, bufferMode?: boolean): Promise { + #sendCommand(args: RedisCommandArguments, options?: ClientCommandOptions): Promise { if (!this.#socket.isOpen) { return Promise.reject(new ClientClosedError()); } @@ -349,7 +371,7 @@ export default class RedisClient ); } - const promise = this.#queue.addCommand(args, options, bufferMode); + const promise = this.#queue.addCommand(args, options); this.#tick(); return promise; } @@ -359,19 +381,19 @@ export default class RedisClient return transformCommandReply( script, - await this.executeScript(script, redisArgs, options, script.BUFFER_MODE), + await this.executeScript(script, redisArgs, options), redisArgs.preserve ); } - async executeScript(script: RedisScript, args: RedisCommandArguments, options?: ClientCommandOptions, bufferMode?: boolean): Promise> { + async executeScript(script: RedisScript, args: RedisCommandArguments, options?: ClientCommandOptions): Promise> { try { return await this.#sendCommand([ 'EVALSHA', script.SHA1, script.NUMBER_OF_KEYS.toString(), ...args - ], options, bufferMode); + ], options); } catch (err: any) { if (!err?.message?.startsWith?.('NOSCRIPT')) { throw err; @@ -382,7 +404,7 @@ export default class RedisClient script.SCRIPT, script.NUMBER_OF_KEYS.toString(), ...args - ], options, bufferMode); + ], options); } } @@ -553,7 +575,7 @@ export default class RedisClient } while (cursor !== 0); } - async* hScanIterator(key: string, options?: ScanOptions): AsyncIterable { + async* hScanIterator(key: string, options?: ScanOptions): AsyncIterable> { let cursor = 0; do { const reply = await (this as any).hScan(key, cursor, options); @@ -575,7 +597,7 @@ export default class RedisClient } while (cursor !== 0); } - async* zScanIterator(key: string, options?: ScanOptions): AsyncIterable> { + async* zScanIterator(key: string, options?: ScanOptions): AsyncIterable> { let cursor = 0; do { const reply = await (this as any).zScan(key, cursor, options); diff --git a/packages/client/lib/cluster/commands.ts b/packages/client/lib/cluster/commands.ts index 5a8dca4ea4..4b2aba6a7a 100644 --- a/packages/client/lib/cluster/commands.ts +++ b/packages/client/lib/cluster/commands.ts @@ -4,13 +4,9 @@ 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'; @@ -31,7 +27,6 @@ import * as GEOPOS from '../commands/GEOPOS'; import * as GEOSEARCH_WITH from '../commands/GEOSEARCH_WITH'; import * as GEOSEARCH from '../commands/GEOSEARCH'; import * as GEOSEARCHSTORE from '../commands/GEOSEARCHSTORE'; -import * as GET_BUFFER from '../commands/GET_BUFFER'; import * as GET from '../commands/GET'; import * as GETBIT from '../commands/GETBIT'; import * as GETDEL from '../commands/GETDEL'; @@ -40,16 +35,13 @@ 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'; @@ -126,12 +118,8 @@ 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_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'; @@ -146,13 +134,9 @@ 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'; @@ -203,20 +187,12 @@ 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, @@ -257,8 +233,6 @@ export default { geoSearch: GEOSEARCH, GEOSEARCHSTORE, geoSearchStore: GEOSEARCHSTORE, - GET_BUFFER, - getBuffer: GET_BUFFER, GET, get: GET, GETBIT, @@ -275,12 +249,8 @@ export default { hDel: HDEL, HEXISTS, hExists: HEXISTS, - HGET_BUFFER, - hGetBuffer: HGET_BUFFER, HGET, hGet: HGET, - HGETALL_BUFFER, - hGetAllBuffer: HGETALL_BUFFER, HGETALL, hGetAll: HGETALL, HINCRBY, @@ -293,8 +263,6 @@ 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, @@ -447,20 +415,12 @@ 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, @@ -487,20 +447,12 @@ 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, diff --git a/packages/client/lib/cluster/index.ts b/packages/client/lib/cluster/index.ts index a944360056..0a9ead636a 100644 --- a/packages/client/lib/cluster/index.ts +++ b/packages/client/lib/cluster/index.ts @@ -76,8 +76,7 @@ export default class RedisCluster RedisCluster.extractFirstKey(command, args, redisArgs), command.IS_READ_ONLY, redisArgs, - options, - command.BUFFER_MODE + options ), redisArgs.preserve ); @@ -88,19 +87,18 @@ export default class RedisCluster isReadonly: boolean | undefined, args: RedisCommandArguments, options?: ClientCommandOptions, - bufferMode?: boolean, redirections = 0 ): Promise> { const client = this.#slots.getClient(firstKey, isReadonly); try { - return await client.sendCommand(args, options, bufferMode); + return await client.sendCommand(args, options); } catch (err: any) { const shouldRetry = await this.#handleCommandError(err, client, redirections); if (shouldRetry === true) { - return this.sendCommand(firstKey, isReadonly, args, options, bufferMode, redirections + 1); + return this.sendCommand(firstKey, isReadonly, args, options, redirections + 1); } else if (shouldRetry) { - return shouldRetry.sendCommand(args, options, bufferMode); + return shouldRetry.sendCommand(args, options); } throw err; @@ -135,13 +133,13 @@ export default class RedisCluster ); try { - return await client.executeScript(script, redisArgs, options, script.BUFFER_MODE); + return await client.executeScript(script, redisArgs, options); } catch (err: any) { const shouldRetry = await this.#handleCommandError(err, client, redirections); if (shouldRetry === true) { return this.executeScript(script, originalArgs, redisArgs, options, redirections + 1); } else if (shouldRetry) { - return shouldRetry.executeScript(script, redisArgs, options, script.BUFFER_MODE); + return shouldRetry.executeScript(script, redisArgs, options); } throw err; diff --git a/packages/client/lib/commands/ACL_CAT.ts b/packages/client/lib/commands/ACL_CAT.ts index f11be87396..161546cfbe 100644 --- a/packages/client/lib/commands/ACL_CAT.ts +++ b/packages/client/lib/commands/ACL_CAT.ts @@ -1,5 +1,7 @@ -export function transformArguments(categoryName?: string): Array { - const args = ['ACL', 'CAT']; +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(categoryName?: RedisCommandArgument): RedisCommandArguments { + const args: RedisCommandArguments = ['ACL', 'CAT']; if (categoryName) { args.push(categoryName); @@ -8,4 +10,4 @@ export function transformArguments(categoryName?: string): Array { return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ACL_DELUSER.ts b/packages/client/lib/commands/ACL_DELUSER.ts index 97f50d4894..25ed1a1030 100644 --- a/packages/client/lib/commands/ACL_DELUSER.ts +++ b/packages/client/lib/commands/ACL_DELUSER.ts @@ -1,8 +1,10 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; -export function transformArguments(username: string | Array): RedisCommandArguments { +export function transformArguments( + username: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['ACL', 'DELUSER'], username); } -export declare const transformReply: (reply: number) => number; +export declare function transformReply(): number; diff --git a/packages/client/lib/commands/ACL_GENPASS.ts b/packages/client/lib/commands/ACL_GENPASS.ts index 6a36c39661..91a71e220e 100644 --- a/packages/client/lib/commands/ACL_GENPASS.ts +++ b/packages/client/lib/commands/ACL_GENPASS.ts @@ -1,4 +1,6 @@ -export function transformArguments(bits?: number): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(bits?: number): RedisCommandArguments { const args = ['ACL', 'GENPASS']; if (bits) { @@ -8,4 +10,4 @@ export function transformArguments(bits?: number): Array { return args; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ACL_GETUSER.ts b/packages/client/lib/commands/ACL_GETUSER.ts index 876a723c39..cdb9f3aa78 100644 --- a/packages/client/lib/commands/ACL_GETUSER.ts +++ b/packages/client/lib/commands/ACL_GETUSER.ts @@ -1,26 +1,28 @@ -export function transformArguments(username: string): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(username: RedisCommandArgument): RedisCommandArguments { return ['ACL', 'GETUSER', username]; } type AclGetUserRawReply = [ - _: string, - flags: Array, - _: string, - passwords: Array, - _: string, - commands: string, - _: string, - keys: Array, - _: string, - channels: Array + _: RedisCommandArgument, + flags: Array, + _: RedisCommandArgument, + passwords: Array, + _: RedisCommandArgument, + commands: RedisCommandArgument, + _: RedisCommandArgument, + keys: Array, + _: RedisCommandArgument, + channels: Array ]; interface AclUser { - flags: Array; - passwords: Array; - commands: string; - keys: Array; - channels: Array + flags: Array; + passwords: Array; + commands: RedisCommandArgument; + keys: Array; + channels: Array } export function transformReply(reply: AclGetUserRawReply): AclUser { diff --git a/packages/client/lib/commands/ACL_LIST.ts b/packages/client/lib/commands/ACL_LIST.ts index a2caae82c4..ae523fe9ce 100644 --- a/packages/client/lib/commands/ACL_LIST.ts +++ b/packages/client/lib/commands/ACL_LIST.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ACL', 'LIST']; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ACL_LOAD.ts b/packages/client/lib/commands/ACL_LOAD.ts index 0a5ea85101..88309102b9 100644 --- a/packages/client/lib/commands/ACL_LOAD.ts +++ b/packages/client/lib/commands/ACL_LOAD.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ACL', 'LOAD']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ACL_LOG.ts b/packages/client/lib/commands/ACL_LOG.ts index ed0590b578..0fd9aa6f19 100644 --- a/packages/client/lib/commands/ACL_LOG.ts +++ b/packages/client/lib/commands/ACL_LOG.ts @@ -1,4 +1,6 @@ -export function transformArguments(count?: number): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(count?: number): RedisCommandArguments { const args = ['ACL', 'LOG']; if (count) { @@ -9,30 +11,30 @@ export function transformArguments(count?: number): Array { } type AclLogRawReply = [ - _: string, + _: RedisCommandArgument, count: number, - _: string, - reason: string, - _: string, - context: string, - _: string, - object: string, - _: string, - username: string, - _: string, - ageSeconds: string, - _: string, - clientInfo: string + _: RedisCommandArgument, + reason: RedisCommandArgument, + _: RedisCommandArgument, + context: RedisCommandArgument, + _: RedisCommandArgument, + object: RedisCommandArgument, + _: RedisCommandArgument, + username: RedisCommandArgument, + _: RedisCommandArgument, + ageSeconds: RedisCommandArgument, + _: RedisCommandArgument, + clientInfo: RedisCommandArgument ]; interface AclLog { count: number; - reason: string; - context: string; - object: string; - username: string; + reason: RedisCommandArgument; + context: RedisCommandArgument; + object: RedisCommandArgument; + username: RedisCommandArgument; ageSeconds: number; - clientInfo: string; + clientInfo: RedisCommandArgument; } export function transformReply(reply: Array): Array { diff --git a/packages/client/lib/commands/ACL_LOG_RESET.ts b/packages/client/lib/commands/ACL_LOG_RESET.ts index 5bfd7ae939..8ff0be4f8b 100644 --- a/packages/client/lib/commands/ACL_LOG_RESET.ts +++ b/packages/client/lib/commands/ACL_LOG_RESET.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ACL', 'LOG', 'RESET']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ACL_SAVE.ts b/packages/client/lib/commands/ACL_SAVE.ts index af9abeb1d5..e57cd69729 100644 --- a/packages/client/lib/commands/ACL_SAVE.ts +++ b/packages/client/lib/commands/ACL_SAVE.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ACL', 'SAVE']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ACL_SETUSER.ts b/packages/client/lib/commands/ACL_SETUSER.ts index d8734f0a1c..a12cc8ed24 100644 --- a/packages/client/lib/commands/ACL_SETUSER.ts +++ b/packages/client/lib/commands/ACL_SETUSER.ts @@ -1,8 +1,11 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; -export function transformArguments(username: string, rule: string | Array): RedisCommandArguments { +export function transformArguments( + username: RedisCommandArgument, + rule: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['ACL', 'SETUSER', username], rule); } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ACL_USERS.ts b/packages/client/lib/commands/ACL_USERS.ts index 91f391a5b7..7970a262e2 100644 --- a/packages/client/lib/commands/ACL_USERS.ts +++ b/packages/client/lib/commands/ACL_USERS.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ACL', 'USERS']; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ACL_WHOAMI.ts b/packages/client/lib/commands/ACL_WHOAMI.ts index c855eeb1aa..3c41171638 100644 --- a/packages/client/lib/commands/ACL_WHOAMI.ts +++ b/packages/client/lib/commands/ACL_WHOAMI.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ACL', 'WHOAMI']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ASKING.ts b/packages/client/lib/commands/ASKING.ts index 8071ec2018..8a87806fe6 100644 --- a/packages/client/lib/commands/ASKING.ts +++ b/packages/client/lib/commands/ASKING.ts @@ -1,5 +1,7 @@ -export function transformArguments(): Array { +import { RedisCommandArguments, RedisCommandArgument } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['ASKING']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/AUTH.ts b/packages/client/lib/commands/AUTH.ts index eb2449208a..49b0df6d31 100644 --- a/packages/client/lib/commands/AUTH.ts +++ b/packages/client/lib/commands/AUTH.ts @@ -1,9 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export interface AuthOptions { - username?: string; - password: string; + username?: RedisCommandArgument; + password: RedisCommandArgument; } -export function transformArguments({username, password}: AuthOptions): Array { +export function transformArguments({ username, password }: AuthOptions): RedisCommandArguments { if (!username) { return ['AUTH', password]; } @@ -11,4 +13,4 @@ export function transformArguments({username, password}: AuthOptions): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(): RedisCommandArguments { return ['BGREWRITEAOF']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/BGSAVE.ts b/packages/client/lib/commands/BGSAVE.ts index fba9e37ed7..9c90f3485b 100644 --- a/packages/client/lib/commands/BGSAVE.ts +++ b/packages/client/lib/commands/BGSAVE.ts @@ -1,8 +1,10 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + interface BgSaveOptions { SCHEDULE?: true; } -export function transformArguments(options?: BgSaveOptions): Array { +export function transformArguments(options?: BgSaveOptions): RedisCommandArguments { const args = ['BGSAVE']; if (options?.SCHEDULE) { @@ -12,4 +14,4 @@ export function transformArguments(options?: BgSaveOptions): Array { return args; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/BITCOUNT.ts b/packages/client/lib/commands/BITCOUNT.ts index 320d8f3acb..efbc6f2220 100644 --- a/packages/client/lib/commands/BITCOUNT.ts +++ b/packages/client/lib/commands/BITCOUNT.ts @@ -1,3 +1,5 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; @@ -7,7 +9,10 @@ interface BitCountRange { end: number; } -export function transformArguments(key: string, range?: BitCountRange): Array { +export function transformArguments( + key: RedisCommandArgument, + range?: BitCountRange +): RedisCommandArguments { const args = ['BITCOUNT', key]; if (range) { diff --git a/packages/client/lib/commands/BITOP.ts b/packages/client/lib/commands/BITOP.ts index af31f42f1d..e2953303d4 100644 --- a/packages/client/lib/commands/BITOP.ts +++ b/packages/client/lib/commands/BITOP.ts @@ -1,11 +1,15 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; type BitOperations = 'AND' | 'OR' | 'XOR' | 'NOT'; -export function transformArguments(operation: BitOperations, destKey: string, key: string | Array): RedisCommandArguments { +export function transformArguments( + operation: BitOperations, + destKey: RedisCommandArgument, + key: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['BITOP', operation, destKey], key); } diff --git a/packages/client/lib/commands/BITPOS.ts b/packages/client/lib/commands/BITPOS.ts index 86f539f2dd..2e54b11bc9 100644 --- a/packages/client/lib/commands/BITPOS.ts +++ b/packages/client/lib/commands/BITPOS.ts @@ -1,10 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { BitValue } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, bit: BitValue, start?: number, end?: number): Array { +export function transformArguments( + key: RedisCommandArgument, + bit: BitValue, + start?: number, + end?: number +): RedisCommandArguments { const args = ['BITPOS', key, bit.toString()]; if (typeof start === 'number') { diff --git a/packages/client/lib/commands/BLMOVE.ts b/packages/client/lib/commands/BLMOVE.ts index 1aa7145892..329192f634 100644 --- a/packages/client/lib/commands/BLMOVE.ts +++ b/packages/client/lib/commands/BLMOVE.ts @@ -20,4 +20,4 @@ export function transformArguments( ]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/BLMOVE_BUFFER.ts b/packages/client/lib/commands/BLMOVE_BUFFER.ts deleted file mode 100644 index 2e676281e2..0000000000 --- a/packages/client/lib/commands/BLMOVE_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, transformArguments } from './BLMOVE'; - -export const BUFFER_MODE = true; - -export declare function transformReply(): Buffer | null; diff --git a/packages/client/lib/commands/BLPOP.ts b/packages/client/lib/commands/BLPOP.ts index 53eaa0b78e..46ef41ad6f 100644 --- a/packages/client/lib/commands/BLPOP.ts +++ b/packages/client/lib/commands/BLPOP.ts @@ -14,12 +14,14 @@ export function transformArguments( return args; } +type BLPopRawReply = null | [RedisCommandArgument, RedisCommandArgument]; + type BLPopReply = null | { - key: string; - element: string; + key: RedisCommandArgument; + element: RedisCommandArgument; }; -export function transformReply(reply: null | [string, string]): BLPopReply { +export function transformReply(reply: BLPopRawReply): BLPopReply { if (reply === null) return null; return { diff --git a/packages/client/lib/commands/BLPOP_BUFFER.ts b/packages/client/lib/commands/BLPOP_BUFFER.ts deleted file mode 100644 index 0f574db846..0000000000 --- a/packages/client/lib/commands/BLPOP_BUFFER.ts +++ /dev/null @@ -1,17 +0,0 @@ -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] - }; -} diff --git a/packages/client/lib/commands/BRPOP.ts b/packages/client/lib/commands/BRPOP.ts index e0a0c82c9e..b30e7e2cc2 100644 --- a/packages/client/lib/commands/BRPOP.ts +++ b/packages/client/lib/commands/BRPOP.ts @@ -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 | Array, timeout: number): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument | Array, + timeout: number +): RedisCommandArguments { const args = pushVerdictArguments(['BRPOP'], key); args.push(timeout.toString()); diff --git a/packages/client/lib/commands/BRPOPLPUSH.ts b/packages/client/lib/commands/BRPOPLPUSH.ts index 7c671fd85a..72c3e4aa5b 100644 --- a/packages/client/lib/commands/BRPOPLPUSH.ts +++ b/packages/client/lib/commands/BRPOPLPUSH.ts @@ -10,4 +10,4 @@ export function transformArguments( return ['BRPOPLPUSH', source, destination, timeout.toString()]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/BRPOPLPUSH_BUFFER.ts b/packages/client/lib/commands/BRPOPLPUSH_BUFFER.ts deleted file mode 100644 index 255f88bab8..0000000000 --- a/packages/client/lib/commands/BRPOPLPUSH_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, transformArguments } from './BRPOPLPUSH'; - -export const BUFFER_MODE = true; - -export declare function transformReply(): Buffer | null; diff --git a/packages/client/lib/commands/BRPOP_BUFFER.ts b/packages/client/lib/commands/BRPOP_BUFFER.ts deleted file mode 100644 index a30a661da0..0000000000 --- a/packages/client/lib/commands/BRPOP_BUFFER.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { FIRST_KEY_INDEX, transformArguments } from './BRPOP'; - -export { BUFFER_MODE, transformReply } from './BLPOP_BUFFER'; diff --git a/packages/client/lib/commands/BZPOPMAX.ts b/packages/client/lib/commands/BZPOPMAX.ts index 90f9835f27..94a30fb8dc 100644 --- a/packages/client/lib/commands/BZPOPMAX.ts +++ b/packages/client/lib/commands/BZPOPMAX.ts @@ -1,5 +1,5 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; -import { pushVerdictArguments, transformReplyNumberInfinity, ZMember } from './generic-transformers'; +import { pushVerdictArguments, transformNumberInfinityReply, ZMember } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -14,18 +14,16 @@ export function transformArguments( return args; } -interface ZMemberWithKey extends ZMember { - key: string; -} +type ZMemberRawReply = [key: RedisCommandArgument, value: RedisCommandArgument, score: RedisCommandArgument] | null; -type BZPopMaxReply = ZMemberWithKey | null; +type BZPopMaxReply = (ZMember & { key: RedisCommandArgument }) | null; -export function transformReply(reply: [key: string, value: string, score: string] | null): BZPopMaxReply | null { +export function transformReply(reply: ZMemberRawReply): BZPopMaxReply | null { if (!reply) return null; return { key: reply[0], value: reply[1], - score: transformReplyNumberInfinity(reply[2]) + score: transformNumberInfinityReply(reply[2]) }; } diff --git a/packages/client/lib/commands/BZPOPMIN.ts b/packages/client/lib/commands/BZPOPMIN.ts index 098d939404..40cb3d5dc7 100644 --- a/packages/client/lib/commands/BZPOPMIN.ts +++ b/packages/client/lib/commands/BZPOPMIN.ts @@ -1,9 +1,12 @@ -import { RedisCommandArguments } from '.'; -import { pushVerdictArguments, transformReplyNumberInfinity, ZMember } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string | Array, timeout: number): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument | Array, + timeout: number +): RedisCommandArguments { const args = pushVerdictArguments(['BZPOPMIN'], key); args.push(timeout.toString()); @@ -11,18 +14,4 @@ export function transformArguments(key: string | Array, timeout: number) return args; } -interface ZMemberWithKey extends ZMember { - key: string; -} - -type BZPopMinReply = ZMemberWithKey | null; - -export function transformReply(reply: [key: string, value: string, score: string] | null): BZPopMinReply | null { - if (!reply) return null; - - return { - key: reply[0], - value: reply[1], - score: transformReplyNumberInfinity(reply[2]) - }; -} +export { transformReply } from './BZPOPMAX'; diff --git a/packages/client/lib/commands/CLIENT_CACHING.ts b/packages/client/lib/commands/CLIENT_CACHING.ts index 62a46bad6c..bc2fbe41e9 100644 --- a/packages/client/lib/commands/CLIENT_CACHING.ts +++ b/packages/client/lib/commands/CLIENT_CACHING.ts @@ -8,4 +8,4 @@ export function transformArguments(value: boolean): RedisCommandArguments { ]; } -export declare function transformReply(): 'OK'; +export declare function transformReply(): 'OK' | Buffer; diff --git a/packages/client/lib/commands/CLIENT_SETNAME.ts b/packages/client/lib/commands/CLIENT_SETNAME.ts index 562fa9f2e9..f5cf1c786f 100644 --- a/packages/client/lib/commands/CLIENT_SETNAME.ts +++ b/packages/client/lib/commands/CLIENT_SETNAME.ts @@ -1,7 +1,7 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; -export function transformArguments(name: string): RedisCommandArguments { +export function transformArguments(name: RedisCommandArgument): RedisCommandArguments { return ['CLIENT', 'SETNAME', name]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/COMMAND_GETKEYS.ts b/packages/client/lib/commands/COMMAND_GETKEYS.ts index 1c38515aef..6762fe4b58 100644 --- a/packages/client/lib/commands/COMMAND_GETKEYS.ts +++ b/packages/client/lib/commands/COMMAND_GETKEYS.ts @@ -1,9 +1,9 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; -export function transformArguments(args: Array): RedisCommandArguments { +export function transformArguments(args: Array): RedisCommandArguments { return ['COMMAND', 'GETKEYS', ...args]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/CONFIG_GET.ts b/packages/client/lib/commands/CONFIG_GET.ts index 3a4f0105d3..3afc0eddfd 100644 --- a/packages/client/lib/commands/CONFIG_GET.ts +++ b/packages/client/lib/commands/CONFIG_GET.ts @@ -2,4 +2,4 @@ export function transformArguments(parameter: string): Array { return ['CONFIG', 'GET', parameter]; } -export { transformReplyStringTuples as transformReply } from './generic-transformers'; +export { transformTuplesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/COPY.ts b/packages/client/lib/commands/COPY.ts index c7a44e45c3..b1e212a995 100644 --- a/packages/client/lib/commands/COPY.ts +++ b/packages/client/lib/commands/COPY.ts @@ -1,3 +1,5 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + interface CopyCommandOptions { destinationDb?: number; replace?: boolean; @@ -5,7 +7,11 @@ interface CopyCommandOptions { export const FIRST_KEY_INDEX = 1; -export function transformArguments(source: string, destination: string, options?: CopyCommandOptions): Array { +export function transformArguments( + source: RedisCommandArgument, + destination: RedisCommandArgument, + options?: CopyCommandOptions +): RedisCommandArguments { const args = ['COPY', source, destination]; if (options?.destinationDb) { @@ -19,4 +25,4 @@ export function transformArguments(source: string, destination: string, options? return args; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/DECR.ts b/packages/client/lib/commands/DECR.ts index e30d2aaf29..2b5f2c4bb5 100644 --- a/packages/client/lib/commands/DECR.ts +++ b/packages/client/lib/commands/DECR.ts @@ -1,6 +1,8 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['DECR', key]; } diff --git a/packages/client/lib/commands/DECRBY.ts b/packages/client/lib/commands/DECRBY.ts index 561eb9491c..afe4d79f0a 100644 --- a/packages/client/lib/commands/DECRBY.ts +++ b/packages/client/lib/commands/DECRBY.ts @@ -1,6 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, decrement: number): Array { +export function transformArguments( + key: RedisCommandArgument, + decrement: number +): RedisCommandArguments { return ['DECRBY', key, decrement.toString()]; } diff --git a/packages/client/lib/commands/DEL.ts b/packages/client/lib/commands/DEL.ts index 02ef553f64..7597cf09cb 100644 --- a/packages/client/lib/commands/DEL.ts +++ b/packages/client/lib/commands/DEL.ts @@ -1,7 +1,9 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; -export function transformArguments(keys: string | Array): RedisCommandArguments { +export function transformArguments( + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['DEL'], keys); } diff --git a/packages/client/lib/commands/DISCARD.ts b/packages/client/lib/commands/DISCARD.ts index 444f800db8..acad8a722e 100644 --- a/packages/client/lib/commands/DISCARD.ts +++ b/packages/client/lib/commands/DISCARD.ts @@ -1,5 +1,7 @@ +import { RedisCommandArgument } from '.'; + export function transformArguments(): Array { return ['DISCARD']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/DUMP.ts b/packages/client/lib/commands/DUMP.ts index de85b889bb..79805795ed 100644 --- a/packages/client/lib/commands/DUMP.ts +++ b/packages/client/lib/commands/DUMP.ts @@ -1,5 +1,7 @@ -export function transformArguments(key: string): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['DUMP', key]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/ECHO.ts b/packages/client/lib/commands/ECHO.ts index 75a91d4ac9..7a837307e2 100644 --- a/packages/client/lib/commands/ECHO.ts +++ b/packages/client/lib/commands/ECHO.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const IS_READ_ONLY = true; -export function transformArguments(message: string): Array { +export function transformArguments(message: RedisCommandArgument): RedisCommandArguments { return ['ECHO', message]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/EXISTS.ts b/packages/client/lib/commands/EXISTS.ts index 5a9c0e3be6..3b4665fc7f 100644 --- a/packages/client/lib/commands/EXISTS.ts +++ b/packages/client/lib/commands/EXISTS.ts @@ -1,12 +1,14 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(keys: string | Array): RedisCommandArguments { +export function transformArguments( + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['EXISTS'], keys); } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/EXPIRE.ts b/packages/client/lib/commands/EXPIRE.ts index 36bcf8b882..291b544c6a 100644 --- a/packages/client/lib/commands/EXPIRE.ts +++ b/packages/client/lib/commands/EXPIRE.ts @@ -1,5 +1,12 @@ -export function transformArguments(key: string, seconds: number): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export const FIRST_KEY_INDEX = 1; + +export function transformArguments( + key: RedisCommandArgument, + seconds: number +): RedisCommandArguments { return ['EXPIRE', key, seconds.toString()]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/EXPIREAT.ts b/packages/client/lib/commands/EXPIREAT.ts index 72142e4cb7..3ddb75fe18 100644 --- a/packages/client/lib/commands/EXPIREAT.ts +++ b/packages/client/lib/commands/EXPIREAT.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformEXAT } from './generic-transformers'; -export function transformArguments(key: string, timestamp: number | Date): Array { +export const FIRST_KEY_INDEX = 1; + +export function transformArguments( + key: RedisCommandArgument, + timestamp: number | Date +): RedisCommandArguments { return [ 'EXPIREAT', key, @@ -8,4 +14,4 @@ export function transformArguments(key: string, timestamp: number | Date): Array ]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/GEOADD.ts b/packages/client/lib/commands/GEOADD.ts index 7f5ac5533e..74adeda514 100644 --- a/packages/client/lib/commands/GEOADD.ts +++ b/packages/client/lib/commands/GEOADD.ts @@ -1,7 +1,8 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoCoordinates } from './generic-transformers'; interface GeoMember extends GeoCoordinates { - member: string; + member: RedisCommandArgument; } interface NX { @@ -22,7 +23,10 @@ type GeoAddOptions = SetGuards & GeoAddCommonOptions; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, toAdd: GeoMember | Array, options?: GeoAddOptions): Array { +export function transformArguments( + key: RedisCommandArgument, toAdd: GeoMember | Array, + options?: GeoAddOptions +): RedisCommandArguments { const args = ['GEOADD', key]; if ((options as NX)?.NX) { diff --git a/packages/client/lib/commands/GEODIST.ts b/packages/client/lib/commands/GEODIST.ts index 6fe6fbb47a..5dbf8ece9c 100644 --- a/packages/client/lib/commands/GEODIST.ts +++ b/packages/client/lib/commands/GEODIST.ts @@ -1,3 +1,4 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoUnits } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -5,11 +6,11 @@ export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( - key: string, - member1: string, - member2: string, + key: RedisCommandArgument, + member1: RedisCommandArgument, + member2: RedisCommandArgument, unit?: GeoUnits -): Array { +): RedisCommandArguments { const args = ['GEODIST', key, member1, member2]; if (unit) { @@ -19,6 +20,6 @@ export function transformArguments( return args; } -export function transformReply(reply: string | null): number | null { +export function transformReply(reply: RedisCommandArgument | null): number | null { return reply === null ? null : Number(reply); } diff --git a/packages/client/lib/commands/GEOHASH.ts b/packages/client/lib/commands/GEOHASH.ts index 8613f37fa4..55e22c497e 100644 --- a/packages/client/lib/commands/GEOHASH.ts +++ b/packages/client/lib/commands/GEOHASH.ts @@ -1,12 +1,15 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, member: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['GEOHASH', key], member); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/GEOPOS.ts b/packages/client/lib/commands/GEOPOS.ts index 95f33d9e3a..0a5f079dee 100644 --- a/packages/client/lib/commands/GEOPOS.ts +++ b/packages/client/lib/commands/GEOPOS.ts @@ -1,20 +1,25 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, member: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['GEOPOS', key], member); } +type GeoCoordinatesRawReply = Array<[RedisCommandArgument, RedisCommandArgument] | null>; + interface GeoCoordinates { - longitude: string; - latitude: string; + longitude: RedisCommandArgument; + latitude: RedisCommandArgument; } -export function transformReply(reply: Array<[string, string] | null>): Array { +export function transformReply(reply: GeoCoordinatesRawReply): Array { return reply.map(coordinates => coordinates === null ? null : { longitude: coordinates[0], latitude: coordinates[1] diff --git a/packages/client/lib/commands/GEOSEARCH.ts b/packages/client/lib/commands/GEOSEARCH.ts index 5453a2ae1b..a02a21391f 100644 --- a/packages/client/lib/commands/GEOSEARCH.ts +++ b/packages/client/lib/commands/GEOSEARCH.ts @@ -1,3 +1,4 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -5,12 +6,12 @@ export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( - key: string, + key: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchOptions -): Array { +): RedisCommandArguments { return pushGeoSearchArguments(['GEOSEARCH'], key, from, by, options); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/GEOSEARCHSTORE.ts b/packages/client/lib/commands/GEOSEARCHSTORE.ts index e10622052b..bc06659ef0 100644 --- a/packages/client/lib/commands/GEOSEARCHSTORE.ts +++ b/packages/client/lib/commands/GEOSEARCHSTORE.ts @@ -1,3 +1,4 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -9,12 +10,12 @@ interface GeoSearchStoreOptions extends GeoSearchOptions { } export function transformArguments( - destination: string, - source: string, + destination: RedisCommandArgument, + source: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchStoreOptions -): Array { +): RedisCommandArguments { const args = pushGeoSearchArguments( ['GEOSEARCHSTORE', destination], source, diff --git a/packages/client/lib/commands/GEOSEARCH_WITH.ts b/packages/client/lib/commands/GEOSEARCH_WITH.ts index 64c6d88e33..d7a5f456a9 100644 --- a/packages/client/lib/commands/GEOSEARCH_WITH.ts +++ b/packages/client/lib/commands/GEOSEARCH_WITH.ts @@ -1,11 +1,11 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchFrom, GeoSearchBy, GeoReplyWith, GeoSearchOptions } from './generic-transformers'; import { transformArguments as geoSearchTransformArguments } from './GEOSEARCH'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEOSEARCH'; export function transformArguments( - key: string, + key: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, replyWith: Array, diff --git a/packages/client/lib/commands/GET.spec.ts b/packages/client/lib/commands/GET.spec.ts index 4c197f99a4..2946ea19b6 100644 --- a/packages/client/lib/commands/GET.spec.ts +++ b/packages/client/lib/commands/GET.spec.ts @@ -1,4 +1,5 @@ import { strict as assert } from 'assert'; +import RedisClient from '../client'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GET'; @@ -11,6 +12,12 @@ describe('GET', () => { }); testUtils.testWithClient('client.get', async client => { + const a = await client.get( + 'key' + ); + + + assert.equal( await client.get('key'), null diff --git a/packages/client/lib/commands/GET.ts b/packages/client/lib/commands/GET.ts index 0bcecc98b8..127b0a5634 100644 --- a/packages/client/lib/commands/GET.ts +++ b/packages/client/lib/commands/GET.ts @@ -8,4 +8,4 @@ export function transformArguments(key: RedisCommandArgument): RedisCommandArgum return ['GET', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/GETBIT.ts b/packages/client/lib/commands/GETBIT.ts index 1e5fd88425..67f67f39b1 100644 --- a/packages/client/lib/commands/GETBIT.ts +++ b/packages/client/lib/commands/GETBIT.ts @@ -1,10 +1,14 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { BitValue } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, offset: number): Array { +export function transformArguments( + key: RedisCommandArgument, + offset: number +): RedisCommandArguments { return ['GETBIT', key, offset.toString()]; } diff --git a/packages/client/lib/commands/GETDEL.ts b/packages/client/lib/commands/GETDEL.ts index de99cc6357..2d91e6cc02 100644 --- a/packages/client/lib/commands/GETDEL.ts +++ b/packages/client/lib/commands/GETDEL.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['GETDEL', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/GETEX.ts b/packages/client/lib/commands/GETEX.ts index cd4f283eee..5b3cec6d88 100644 --- a/packages/client/lib/commands/GETEX.ts +++ b/packages/client/lib/commands/GETEX.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformEXAT, transformPXAT } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -15,7 +15,10 @@ type GetExModes = { PERSIST: true; }; -export function transformArguments(key: string, mode: GetExModes): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + mode: GetExModes +): RedisCommandArguments { const args = ['GETEX', key]; if ('EX' in mode) { @@ -33,4 +36,4 @@ export function transformArguments(key: string, mode: GetExModes): RedisCommandA return args; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/GETRANGE.ts b/packages/client/lib/commands/GETRANGE.ts index babb0a6a7c..2d12d937cc 100644 --- a/packages/client/lib/commands/GETRANGE.ts +++ b/packages/client/lib/commands/GETRANGE.ts @@ -1,9 +1,15 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, start: number, end: number): Array { +export function transformArguments( + key: RedisCommandArgument, + start: number, + end: number +): RedisCommandArguments { return ['GETRANGE', key, start.toString(), end.toString()]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/GETSET.ts b/packages/client/lib/commands/GETSET.ts index 4d3516866f..87d111792c 100644 --- a/packages/client/lib/commands/GETSET.ts +++ b/packages/client/lib/commands/GETSET.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, value: string): Array { +export function transformArguments( + key: RedisCommandArgument, + value: RedisCommandArgument +): RedisCommandArguments { return ['GETSET', key, value]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/GET_BUFFER.spec.ts b/packages/client/lib/commands/GET_BUFFER.spec.ts deleted file mode 100644 index 1f1a86799f..0000000000 --- a/packages/client/lib/commands/GET_BUFFER.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { strict as assert } from 'assert'; -import testUtils, { GLOBAL } from '../test-utils'; - -describe('GET_BUFFER', () => { - testUtils.testWithClient('client.getBuffer', async client => { - const buffer = Buffer.from('string'); - await client.set('key', buffer); - assert.deepEqual( - buffer, - await client.getBuffer('key') - ); - }, GLOBAL.SERVERS.OPEN); - - testUtils.testWithCluster('cluster.getBuffer', async cluster => { - const buffer = Buffer.from('string'); - await cluster.set('key', buffer); - assert.deepEqual( - buffer, - await cluster.getBuffer('key') - ); - }, GLOBAL.CLUSTERS.OPEN); -}); diff --git a/packages/client/lib/commands/GET_BUFFER.ts b/packages/client/lib/commands/GET_BUFFER.ts deleted file mode 100644 index 2f08ecb708..0000000000 --- a/packages/client/lib/commands/GET_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './GET'; - -export const BUFFER_MODE = true; - -export declare function transformReply(): Buffer | null; diff --git a/packages/client/lib/commands/HDEL.ts b/packages/client/lib/commands/HDEL.ts index 58d057ebf1..1a994e109d 100644 --- a/packages/client/lib/commands/HDEL.ts +++ b/packages/client/lib/commands/HDEL.ts @@ -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, field: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + field: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['HDEL', key], field); } diff --git a/packages/client/lib/commands/HELLO.ts b/packages/client/lib/commands/HELLO.ts index 86dae2a1d7..d943f2e4c3 100644 --- a/packages/client/lib/commands/HELLO.ts +++ b/packages/client/lib/commands/HELLO.ts @@ -1,3 +1,4 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { AuthOptions } from './AUTH'; interface HelloOptions { @@ -6,8 +7,8 @@ interface HelloOptions { clientName?: string; } -export function transformArguments(options?: HelloOptions): Array { - const args = ['HELLO']; +export function transformArguments(options?: HelloOptions): RedisCommandArguments { + const args: RedisCommandArguments = ['HELLO']; if (options) { args.push(options.protover.toString()); @@ -26,29 +27,29 @@ export function transformArguments(options?: HelloOptions): Array { type HelloRawReply = [ _: never, - server: string, + server: RedisCommandArgument, _: never, - version: string, + version: RedisCommandArgument, _: never, proto: number, _: never, id: number, _: never, - mode: string, + mode: RedisCommandArgument, _: never, - role: string, + role: RedisCommandArgument, _: never, - modules: Array + modules: Array ]; interface HelloTransformedReply { - server: string; - version: string; + server: RedisCommandArgument; + version: RedisCommandArgument; proto: number; id: number; - mode: string; - role: string; - modules: Array; + mode: RedisCommandArgument; + role: RedisCommandArgument; + modules: Array; } export function transformReply(reply: HelloRawReply): HelloTransformedReply { diff --git a/packages/client/lib/commands/HEXISTS.ts b/packages/client/lib/commands/HEXISTS.ts index 0eae5e03e5..289be20aa8 100644 --- a/packages/client/lib/commands/HEXISTS.ts +++ b/packages/client/lib/commands/HEXISTS.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, field: string): Array { +export function transformArguments( + key: RedisCommandArgument, + field: RedisCommandArgument +): RedisCommandArguments { return ['HEXISTS', key, field]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/HGET.ts b/packages/client/lib/commands/HGET.ts index 8da4890174..fcfd31e617 100644 --- a/packages/client/lib/commands/HGET.ts +++ b/packages/client/lib/commands/HGET.ts @@ -11,4 +11,4 @@ export function transformArguments( return ['HGET', key, field]; } -export declare function transformReply(): string | undefined; +export declare function transformReply(): RedisCommandArgument | undefined; diff --git a/packages/client/lib/commands/HGETALL.ts b/packages/client/lib/commands/HGETALL.ts index 56bd76f4ae..1ea702080b 100644 --- a/packages/client/lib/commands/HGETALL.ts +++ b/packages/client/lib/commands/HGETALL.ts @@ -1,9 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HGETALL', key]; } -export { transformReplyStringTuples as transformReply } from './generic-transformers'; +export { transformTuplesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/HGETALL_BUFFER.ts b/packages/client/lib/commands/HGETALL_BUFFER.ts deleted file mode 100644 index 61ab171e07..0000000000 --- a/packages/client/lib/commands/HGETALL_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './HGETALL'; - -export const BUFFER_MODE = true; - -export { transformReplyBufferTuples as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/HGET_BUFFER.ts b/packages/client/lib/commands/HGET_BUFFER.ts deleted file mode 100644 index 07d41f0dc3..0000000000 --- a/packages/client/lib/commands/HGET_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './HGET'; - -export const BUFFER_MODE = true; - -export declare function transformReply(): Buffer | undefined; diff --git a/packages/client/lib/commands/HINCRBY.ts b/packages/client/lib/commands/HINCRBY.ts index 8f0e99d41f..b2cf6eefe8 100644 --- a/packages/client/lib/commands/HINCRBY.ts +++ b/packages/client/lib/commands/HINCRBY.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, field: string, increment: number): Array { +export function transformArguments( + key: RedisCommandArgument, + field: RedisCommandArgument, + increment: number +): RedisCommandArguments { return ['HINCRBY', key, field, increment.toString()]; } diff --git a/packages/client/lib/commands/HINCRBYFLOAT.ts b/packages/client/lib/commands/HINCRBYFLOAT.ts index 262a7d5d6b..0e2de6e9b2 100644 --- a/packages/client/lib/commands/HINCRBYFLOAT.ts +++ b/packages/client/lib/commands/HINCRBYFLOAT.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, field: string, increment: number): Array { +export function transformArguments( + key: RedisCommandArgument, + field: RedisCommandArgument, + increment: number +): RedisCommandArguments { return ['HINCRBYFLOAT', key, field, increment.toString()]; } diff --git a/packages/client/lib/commands/HKEYS.ts b/packages/client/lib/commands/HKEYS.ts index 358f08fc76..3d629733d0 100644 --- a/packages/client/lib/commands/HKEYS.ts +++ b/packages/client/lib/commands/HKEYS.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HKEYS', key]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/HLEN.ts b/packages/client/lib/commands/HLEN.ts index 5c717ad7c5..15a93d408d 100644 --- a/packages/client/lib/commands/HLEN.ts +++ b/packages/client/lib/commands/HLEN.ts @@ -1,6 +1,8 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HLEN', key]; } diff --git a/packages/client/lib/commands/HMGET.ts b/packages/client/lib/commands/HMGET.ts index 7ca3a55b69..64b4014abe 100644 --- a/packages/client/lib/commands/HMGET.ts +++ b/packages/client/lib/commands/HMGET.ts @@ -1,12 +1,15 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, fields: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + fields: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['HMGET', key], fields); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/HRANDFIELD.ts b/packages/client/lib/commands/HRANDFIELD.ts index 63f092bf09..a2c70aabd5 100644 --- a/packages/client/lib/commands/HRANDFIELD.ts +++ b/packages/client/lib/commands/HRANDFIELD.ts @@ -1,9 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HRANDFIELD', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/HRANDFIELD_COUNT.ts b/packages/client/lib/commands/HRANDFIELD_COUNT.ts index b97e38ea16..01b8df6327 100644 --- a/packages/client/lib/commands/HRANDFIELD_COUNT.ts +++ b/packages/client/lib/commands/HRANDFIELD_COUNT.ts @@ -1,12 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformHRandFieldArguments } from './HRANDFIELD'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './HRANDFIELD'; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return [ ...transformHRandFieldArguments(key), count.toString() ]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES.ts b/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES.ts index 807e3cc1cf..3e09dbb9a1 100644 --- a/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES.ts +++ b/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES.ts @@ -1,12 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformHRandFieldCountArguments } from './HRANDFIELD_COUNT'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './HRANDFIELD_COUNT'; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return [ ...transformHRandFieldCountArguments(key, count), 'WITHVALUES' ]; } -export { transformReplyStringTuples as transformReply } from './generic-transformers'; +export { transformTuplesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES_BUFFER.ts b/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES_BUFFER.ts deleted file mode 100644 index 6937f7400b..0000000000 --- a/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './HRANDFIELD_COUNT'; - -export const BUFFER_MODE = true; - -export { transformReplyBufferTuples as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/HSCAN.ts b/packages/client/lib/commands/HSCAN.ts index 18b1355b59..ba18fb986b 100644 --- a/packages/client/lib/commands/HSCAN.ts +++ b/packages/client/lib/commands/HSCAN.ts @@ -1,19 +1,26 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ScanOptions, pushScanArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, cursor: number, options?: ScanOptions): Array { +export function transformArguments( + key: RedisCommandArgument, + cursor: number, + options?: ScanOptions +): RedisCommandArguments { return pushScanArguments([ 'HSCAN', key ], cursor, options); } +type HScanRawReply = [RedisCommandArgument, Array]; + export interface HScanTuple { - field: string; - value: string; + field: RedisCommandArgument; + value: RedisCommandArgument; } interface HScanReply { @@ -21,7 +28,7 @@ interface HScanReply { tuples: Array; } -export function transformReply([cursor, rawTuples]: [string, Array]): HScanReply { +export function transformReply([cursor, rawTuples]: HScanRawReply): HScanReply { const parsedTuples = []; for (let i = 0; i < rawTuples.length; i += 2) { parsedTuples.push({ diff --git a/packages/client/lib/commands/HSET.ts b/packages/client/lib/commands/HSET.ts index edb4c76e10..81bde83d22 100644 --- a/packages/client/lib/commands/HSET.ts +++ b/packages/client/lib/commands/HSET.ts @@ -1,6 +1,6 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; -type Types = string | number | Buffer; +type Types = RedisCommandArgument | number; type HSETObject = Record; diff --git a/packages/client/lib/commands/HSETNX.ts b/packages/client/lib/commands/HSETNX.ts index 83112f8945..9ac6ef0edd 100644 --- a/packages/client/lib/commands/HSETNX.ts +++ b/packages/client/lib/commands/HSETNX.ts @@ -1,7 +1,13 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, field: string, value: string): Array { +export function transformArguments( + key: RedisCommandArgument, + field: RedisCommandArgument, + value: RedisCommandArgument +): RedisCommandArguments { return ['HSETNX', key, field, value]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/HSTRLEN.ts b/packages/client/lib/commands/HSTRLEN.ts index d0138eb3ec..a820e6c564 100644 --- a/packages/client/lib/commands/HSTRLEN.ts +++ b/packages/client/lib/commands/HSTRLEN.ts @@ -1,6 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, field: string): Array { +export function transformArguments( + key: RedisCommandArgument, + field: RedisCommandArgument +): RedisCommandArguments { return ['HSTRLEN', key, field]; } diff --git a/packages/client/lib/commands/HVALS.ts b/packages/client/lib/commands/HVALS.ts index cb17fdb29b..ef63fdc7f8 100644 --- a/packages/client/lib/commands/HVALS.ts +++ b/packages/client/lib/commands/HVALS.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HVALS', key]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/INCR.ts b/packages/client/lib/commands/INCR.ts index f7b8101325..2f9a9adfe2 100644 --- a/packages/client/lib/commands/INCR.ts +++ b/packages/client/lib/commands/INCR.ts @@ -1,6 +1,8 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['INCR', key]; } diff --git a/packages/client/lib/commands/INCRBY.ts b/packages/client/lib/commands/INCRBY.ts index 8f2a4406bf..75c61156d6 100644 --- a/packages/client/lib/commands/INCRBY.ts +++ b/packages/client/lib/commands/INCRBY.ts @@ -1,6 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, increment: number): Array { +export function transformArguments( + key: RedisCommandArgument, + increment: number +): RedisCommandArguments { return ['INCRBY', key, increment.toString()]; } diff --git a/packages/client/lib/commands/INCRBYFLOAT.ts b/packages/client/lib/commands/INCRBYFLOAT.ts index a5f99820cb..ace3702339 100644 --- a/packages/client/lib/commands/INCRBYFLOAT.ts +++ b/packages/client/lib/commands/INCRBYFLOAT.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, increment: number): Array { +export function transformArguments( + key: RedisCommandArgument, + increment: number +): RedisCommandArguments { return ['INCRBYFLOAT', key, increment.toString()]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/KEYS.ts b/packages/client/lib/commands/KEYS.ts index 99c99c1152..c96ee00143 100644 --- a/packages/client/lib/commands/KEYS.ts +++ b/packages/client/lib/commands/KEYS.ts @@ -1,7 +1,7 @@ -export function transformArguments(pattern: string): Array { +import { RedisCommandArgument, RedisCommandArguments } from '.'; + +export function transformArguments(pattern: RedisCommandArgument): RedisCommandArguments { return ['KEYS', pattern]; } -export function transformReply(keys: Array): Array { - return keys; -} \ No newline at end of file +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/LINDEX.ts b/packages/client/lib/commands/LINDEX.ts index d13bc0c2d0..bb657de3cb 100644 --- a/packages/client/lib/commands/LINDEX.ts +++ b/packages/client/lib/commands/LINDEX.ts @@ -1,8 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; -export function transformArguments(key: string, index: number): Array { +export function transformArguments( + key: RedisCommandArgument, + index: number +): RedisCommandArguments { return ['LINDEX', key, index.toString()]; } -export declare function transformReply(): string | null; \ No newline at end of file +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/LINSERT.ts b/packages/client/lib/commands/LINSERT.ts index b1d377f92a..0a8e1f32ba 100644 --- a/packages/client/lib/commands/LINSERT.ts +++ b/packages/client/lib/commands/LINSERT.ts @@ -1,13 +1,15 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; type LInsertPosition = 'BEFORE' | 'AFTER'; export function transformArguments( - key: string, + key: RedisCommandArgument, position: LInsertPosition, - pivot: string, - element: string -): Array { + pivot: RedisCommandArgument, + element: RedisCommandArgument +): RedisCommandArguments { return [ 'LINSERT', key, diff --git a/packages/client/lib/commands/LLEN.ts b/packages/client/lib/commands/LLEN.ts index 49ac1d1916..3410e57d42 100644 --- a/packages/client/lib/commands/LLEN.ts +++ b/packages/client/lib/commands/LLEN.ts @@ -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 { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['LLEN', key]; } diff --git a/packages/client/lib/commands/LMOVE.ts b/packages/client/lib/commands/LMOVE.ts index 111e758a0a..96946722ef 100644 --- a/packages/client/lib/commands/LMOVE.ts +++ b/packages/client/lib/commands/LMOVE.ts @@ -1,13 +1,15 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export type LMoveSide = 'LEFT' | 'RIGHT'; export const FIRST_KEY_INDEX = 1; export function transformArguments( - source: string, - destination: string, + source: RedisCommandArgument, + destination: RedisCommandArgument, sourceSide: LMoveSide, destinationSide: LMoveSide -): Array { +): RedisCommandArguments { return [ 'LMOVE', source, @@ -17,4 +19,4 @@ export function transformArguments( ]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/LOLWUT.ts b/packages/client/lib/commands/LOLWUT.ts index cfe01adbcf..5d5fc72606 100644 --- a/packages/client/lib/commands/LOLWUT.ts +++ b/packages/client/lib/commands/LOLWUT.ts @@ -1,3 +1,5 @@ +import { RedisCommandArgument } from '.'; + export const IS_READ_ONLY = true; export function transformArguments(version?: number, ...optionalArguments: Array): Array { @@ -14,4 +16,4 @@ export function transformArguments(version?: number, ...optionalArguments: Array return args; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/LPOP.ts b/packages/client/lib/commands/LPOP.ts index 9bf340e07c..5dd1bea519 100644 --- a/packages/client/lib/commands/LPOP.ts +++ b/packages/client/lib/commands/LPOP.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['LPOP', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/LPOP_COUNT.ts b/packages/client/lib/commands/LPOP_COUNT.ts index 828b0251ff..021517b018 100644 --- a/packages/client/lib/commands/LPOP_COUNT.ts +++ b/packages/client/lib/commands/LPOP_COUNT.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return ['LPOP', key, count.toString()]; } -export declare function transformReply(): Array | null; +export declare function transformReply(): Array | null; diff --git a/packages/client/lib/commands/LPOS.ts b/packages/client/lib/commands/LPOS.ts index 3371f01d67..1f2e34ab88 100644 --- a/packages/client/lib/commands/LPOS.ts +++ b/packages/client/lib/commands/LPOS.ts @@ -1,3 +1,5 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; @@ -7,7 +9,11 @@ export interface LPosOptions { MAXLEN?: number; } -export function transformArguments(key: string, element: string, options?: LPosOptions): Array { +export function transformArguments( + key: RedisCommandArgument, + element: RedisCommandArgument, + options?: LPosOptions +): RedisCommandArguments { const args = ['LPOS', key, element]; if (typeof options?.RANK === 'number') { diff --git a/packages/client/lib/commands/LPOS_COUNT.ts b/packages/client/lib/commands/LPOS_COUNT.ts index b5a60317ea..0549df82db 100644 --- a/packages/client/lib/commands/LPOS_COUNT.ts +++ b/packages/client/lib/commands/LPOS_COUNT.ts @@ -1,8 +1,14 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { LPosOptions } from './LPOS'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './LPOS'; -export function transformArguments(key: string, element: string, count: number, options?: LPosOptions): Array { +export function transformArguments( + key: RedisCommandArgument, + element: RedisCommandArgument, + count: number, + options?: LPosOptions +): RedisCommandArguments { const args = ['LPOS', key, element]; if (typeof options?.RANK === 'number') { diff --git a/packages/client/lib/commands/LPUSH.ts b/packages/client/lib/commands/LPUSH.ts index b964434477..7144b146e2 100644 --- a/packages/client/lib/commands/LPUSH.ts +++ b/packages/client/lib/commands/LPUSH.ts @@ -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, elements: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + elements: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['LPUSH', key], elements);} export declare function transformReply(): number; diff --git a/packages/client/lib/commands/LPUSHX.ts b/packages/client/lib/commands/LPUSHX.ts index 5f92d84d3b..0b518add6d 100644 --- a/packages/client/lib/commands/LPUSHX.ts +++ b/packages/client/lib/commands/LPUSHX.ts @@ -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, element: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + element: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['LPUSHX', key], element); } diff --git a/packages/client/lib/commands/LRANGE.ts b/packages/client/lib/commands/LRANGE.ts index 7ea97ec4f4..df12c57d80 100644 --- a/packages/client/lib/commands/LRANGE.ts +++ b/packages/client/lib/commands/LRANGE.ts @@ -1,8 +1,14 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, start: number, stop: number): Array { +export function transformArguments( + key: RedisCommandArgument, + start: number, + stop: number +): RedisCommandArguments { return [ 'LRANGE', key, @@ -11,4 +17,4 @@ export function transformArguments(key: string, start: number, stop: number): Ar ]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/LREM.ts b/packages/client/lib/commands/LREM.ts index b43f8a2842..b495133488 100644 --- a/packages/client/lib/commands/LREM.ts +++ b/packages/client/lib/commands/LREM.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, count: number, element: string): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number, + element: RedisCommandArgument +): RedisCommandArguments { return [ 'LREM', key, diff --git a/packages/client/lib/commands/LSET.ts b/packages/client/lib/commands/LSET.ts index 1511fb9751..33c7b4cc06 100644 --- a/packages/client/lib/commands/LSET.ts +++ b/packages/client/lib/commands/LSET.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, index: number, element: string): Array { +export function transformArguments( + key: RedisCommandArgument, + index: number, + element: RedisCommandArgument +): RedisCommandArguments { return [ 'LSET', key, @@ -9,4 +15,4 @@ export function transformArguments(key: string, index: number, element: string): ]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/LTRIM.ts b/packages/client/lib/commands/LTRIM.ts index ab78e5305a..668497cdde 100644 --- a/packages/client/lib/commands/LTRIM.ts +++ b/packages/client/lib/commands/LTRIM.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, start: number, stop: number): Array { +export function transformArguments( + key: RedisCommandArgument, + start: number, + stop: number +): RedisCommandArguments { return [ 'LTRIM', key, @@ -9,4 +15,4 @@ export function transformArguments(key: string, start: number, stop: number): Ar ]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/MGET.ts b/packages/client/lib/commands/MGET.ts index 6d5b9073d4..6635a2ca20 100644 --- a/packages/client/lib/commands/MGET.ts +++ b/packages/client/lib/commands/MGET.ts @@ -1,9 +1,13 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(keys: Array): Array { +export function transformArguments( + keys: Array +): RedisCommandArguments { return ['MGET', ...keys]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/MIGRATE.ts b/packages/client/lib/commands/MIGRATE.ts index 4d2795123a..d5e5977df8 100644 --- a/packages/client/lib/commands/MIGRATE.ts +++ b/packages/client/lib/commands/MIGRATE.ts @@ -1,3 +1,4 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { AuthOptions } from './AUTH'; interface MigrateOptions { @@ -7,20 +8,20 @@ interface MigrateOptions { } export function transformArguments( - host: string, + host: RedisCommandArgument, port: number, - key: string | Array, + key: RedisCommandArgument | Array, destinationDb: number, timeout: number, options?: MigrateOptions -): Array { +): RedisCommandArguments { const args = ['MIGRATE', host, port.toString()], - isKeyString = typeof key === 'string'; + isKeyArray = Array.isArray(key); - if (isKeyString) { - args.push(key); - } else { + if (isKeyArray) { args.push('""'); + } else { + args.push(key); } args.push( @@ -51,7 +52,7 @@ export function transformArguments( } } - if (!isKeyString) { + if (isKeyArray) { args.push( 'KEYS', ...key diff --git a/packages/client/lib/commands/MOVE.ts b/packages/client/lib/commands/MOVE.ts index 93896a6305..f446fd18dc 100644 --- a/packages/client/lib/commands/MOVE.ts +++ b/packages/client/lib/commands/MOVE.ts @@ -2,4 +2,4 @@ export function transformArguments(key: string, db: number): Array { return ['MOVE', key, db.toString()]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/MSET.ts b/packages/client/lib/commands/MSET.ts index d3e290df70..bd7111659d 100644 --- a/packages/client/lib/commands/MSET.ts +++ b/packages/client/lib/commands/MSET.ts @@ -1,7 +1,14 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(toSet: Array<[string, string]> | Array | Record): Array { - const args = ['MSET']; +export type MSetArguments = + Array<[RedisCommandArgument, RedisCommandArgument]> | + Array | + Record; + +export function transformArguments(toSet: MSetArguments): RedisCommandArguments { + const args: RedisCommandArguments = ['MSET']; if (Array.isArray(toSet)) { args.push(...toSet.flat()); @@ -14,4 +21,4 @@ export function transformArguments(toSet: Array<[string, string]> | Array | Array | Record): Array { - const args = ['MSETNX']; +export function transformArguments(toSet: MSetArguments): RedisCommandArguments { + const args: RedisCommandArguments = ['MSETNX']; if (Array.isArray(toSet)) { args.push(...toSet.flat()); @@ -14,4 +17,4 @@ export function transformArguments(toSet: Array<[string, string]> | Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['PERSIST', key]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/PEXPIRE.ts b/packages/client/lib/commands/PEXPIRE.ts index f3b70279aa..428bfd9d26 100644 --- a/packages/client/lib/commands/PEXPIRE.ts +++ b/packages/client/lib/commands/PEXPIRE.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, milliseconds: number): Array { +export function transformArguments( + key: RedisCommandArgument, + milliseconds: number +): RedisCommandArguments { return ['PEXPIRE', key, milliseconds.toString()]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/PEXPIREAT.ts b/packages/client/lib/commands/PEXPIREAT.ts index 5dded48d27..49872877f6 100644 --- a/packages/client/lib/commands/PEXPIREAT.ts +++ b/packages/client/lib/commands/PEXPIREAT.ts @@ -1,8 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformPXAT } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, millisecondsTimestamp: number | Date): Array { +export function transformArguments( + key: RedisCommandArgument, + millisecondsTimestamp: number | Date +): RedisCommandArguments { return [ 'PEXPIREAT', key, @@ -10,4 +14,4 @@ export function transformArguments(key: string, millisecondsTimestamp: number | ]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/PFADD.ts b/packages/client/lib/commands/PFADD.ts index e45e83c3ae..8c8985de89 100644 --- a/packages/client/lib/commands/PFADD.ts +++ b/packages/client/lib/commands/PFADD.ts @@ -1,10 +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, element: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + element: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['PFADD', key], element); } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/PFCOUNT.ts b/packages/client/lib/commands/PFCOUNT.ts index ec6c090604..a4cf2dbcb2 100644 --- a/packages/client/lib/commands/PFCOUNT.ts +++ b/packages/client/lib/commands/PFCOUNT.ts @@ -1,9 +1,11 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['PFCOUNT'], key); } diff --git a/packages/client/lib/commands/PING.spec.ts b/packages/client/lib/commands/PING.spec.ts index 85b48fec6b..fae349176d 100644 --- a/packages/client/lib/commands/PING.spec.ts +++ b/packages/client/lib/commands/PING.spec.ts @@ -1,11 +1,21 @@ import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; +import RedisClient from '../client'; describe('PING', () => { - testUtils.testWithClient('client.ping', async client => { - assert.equal( - await client.ping(), - 'PONG' - ); - }, GLOBAL.SERVERS.OPEN); + describe('client.ping', () => { + testUtils.testWithClient('string', async client => { + assert.equal( + await client.ping(), + 'PONG' + ); + }, GLOBAL.SERVERS.OPEN); + + testUtils.testWithClient('buffer', async client => { + assert.deepEqual( + await client.ping(RedisClient.commandOptions({ returnBuffers: true })), + Buffer.from('PONG') + ); + }, GLOBAL.SERVERS.OPEN); + }); }); diff --git a/packages/client/lib/commands/PING.ts b/packages/client/lib/commands/PING.ts index 1e9aa957bf..10ab01f7bd 100644 --- a/packages/client/lib/commands/PING.ts +++ b/packages/client/lib/commands/PING.ts @@ -1,5 +1,7 @@ +import { RedisCommandArgument } from '.'; + export function transformArguments(): Array { return ['PING']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/PSETEX.spec.ts b/packages/client/lib/commands/PSETEX.spec.ts index 61a6e682b0..f6262ed870 100644 --- a/packages/client/lib/commands/PSETEX.spec.ts +++ b/packages/client/lib/commands/PSETEX.spec.ts @@ -11,6 +11,7 @@ describe('PSETEX', () => { }); testUtils.testWithClient('client.pSetEx', async client => { + const a = await client.pSetEx('key', 1, 'value'); assert.equal( await client.pSetEx('key', 1, 'value'), 'OK' diff --git a/packages/client/lib/commands/PSETEX.ts b/packages/client/lib/commands/PSETEX.ts index a0bd4f5c22..f2739b6e27 100644 --- a/packages/client/lib/commands/PSETEX.ts +++ b/packages/client/lib/commands/PSETEX.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, milliseconds: number, value: string): Array { +export function transformArguments( + key: RedisCommandArgument, + milliseconds: number, + value: RedisCommandArgument +): RedisCommandArguments { return [ 'PSETEX', key, @@ -9,4 +15,4 @@ export function transformArguments(key: string, milliseconds: number, value: str ]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/PTTL.ts b/packages/client/lib/commands/PTTL.ts index c1bc18323d..a2975623f7 100644 --- a/packages/client/lib/commands/PTTL.ts +++ b/packages/client/lib/commands/PTTL.ts @@ -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 { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['PTTL', key]; } diff --git a/packages/client/lib/commands/RANDOMKEY.ts b/packages/client/lib/commands/RANDOMKEY.ts index fad0b073c7..f2d511d4de 100644 --- a/packages/client/lib/commands/RANDOMKEY.ts +++ b/packages/client/lib/commands/RANDOMKEY.ts @@ -1,9 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const IS_READ_ONLY = true; -export function transformArguments(): Array { +export function transformArguments(): RedisCommandArguments { return ['RANDOMKEY']; } -export function transformReply(reply: string | null): string | null { - return reply; -} +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/RENAME.ts b/packages/client/lib/commands/RENAME.ts index f2affada60..2d1134084f 100644 --- a/packages/client/lib/commands/RENAME.ts +++ b/packages/client/lib/commands/RENAME.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, newKey: string): Array { +export function transformArguments( + key: RedisCommandArgument, + newKey: RedisCommandArgument +): RedisCommandArguments { return ['RENAME', key, newKey]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/RENAMENX.ts b/packages/client/lib/commands/RENAMENX.ts index 2cfec00774..322ff0a88c 100644 --- a/packages/client/lib/commands/RENAMENX.ts +++ b/packages/client/lib/commands/RENAMENX.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, newKey: string): Array { +export function transformArguments( + key: RedisCommandArgument, + newKey: RedisCommandArgument +): RedisCommandArguments { return ['RENAMENX', key, newKey]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/RPOP.ts b/packages/client/lib/commands/RPOP.ts index 96735dea8b..ed696b6d52 100644 --- a/packages/client/lib/commands/RPOP.ts +++ b/packages/client/lib/commands/RPOP.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['RPOP', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/RPOPLPUSH.ts b/packages/client/lib/commands/RPOPLPUSH.ts index 23f1ff0876..d388b55ac0 100644 --- a/packages/client/lib/commands/RPOPLPUSH.ts +++ b/packages/client/lib/commands/RPOPLPUSH.ts @@ -1,6 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(source: string, destination: string): Array { +export function transformArguments( + source: RedisCommandArgument, + destination: RedisCommandArgument +): RedisCommandArguments { return ['RPOPLPUSH', source, destination]; } diff --git a/packages/client/lib/commands/RPOP_COUNT.ts b/packages/client/lib/commands/RPOP_COUNT.ts index f7f3463a3e..b3bc778ee5 100644 --- a/packages/client/lib/commands/RPOP_COUNT.ts +++ b/packages/client/lib/commands/RPOP_COUNT.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return ['RPOP', key, count.toString()]; } -export declare function transformReply(): Array | null; +export declare function transformReply(): Array | null; diff --git a/packages/client/lib/commands/RPUSH.ts b/packages/client/lib/commands/RPUSH.ts index 575177755c..15e282f089 100644 --- a/packages/client/lib/commands/RPUSH.ts +++ b/packages/client/lib/commands/RPUSH.ts @@ -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, element: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + element: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['RPUSH', key], element); } diff --git a/packages/client/lib/commands/RPUSHX.ts b/packages/client/lib/commands/RPUSHX.ts index bacc60d404..29253cd6ed 100644 --- a/packages/client/lib/commands/RPUSHX.ts +++ b/packages/client/lib/commands/RPUSHX.ts @@ -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, element: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + element: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['RPUSHX', key], element); } diff --git a/packages/client/lib/commands/SADD.ts b/packages/client/lib/commands/SADD.ts index 05e5a6858f..7d7121e539 100644 --- a/packages/client/lib/commands/SADD.ts +++ b/packages/client/lib/commands/SADD.ts @@ -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, members: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + members: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SADD', key], members); } diff --git a/packages/client/lib/commands/SAVE.ts b/packages/client/lib/commands/SAVE.ts index e88575f0a5..3d75c29df9 100644 --- a/packages/client/lib/commands/SAVE.ts +++ b/packages/client/lib/commands/SAVE.ts @@ -1,5 +1,7 @@ +import { RedisCommandArgument } from '.'; + export function transformArguments(): Array { return ['SAVE']; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/SCAN.ts b/packages/client/lib/commands/SCAN.ts index e3541ea9a7..ee5908eb9b 100644 --- a/packages/client/lib/commands/SCAN.ts +++ b/packages/client/lib/commands/SCAN.ts @@ -1,11 +1,15 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ScanOptions, pushScanArguments } from './generic-transformers'; export const IS_READ_ONLY = true; export interface ScanCommandOptions extends ScanOptions { - TYPE?: string; + TYPE?: RedisCommandArgument; } -export function transformArguments(cursor: number, options?: ScanCommandOptions): Array { +export function transformArguments( + cursor: number, + options?: ScanCommandOptions +): RedisCommandArguments { const args = pushScanArguments(['SCAN'], cursor, options); if (options?.TYPE) { @@ -15,12 +19,14 @@ export function transformArguments(cursor: number, options?: ScanCommandOptions) return args; } +type ScanRawReply = [string, Array]; + export interface ScanReply { cursor: number; - keys: Array; + keys: Array; } -export function transformReply([cursor, keys]: [string, Array]): ScanReply { +export function transformReply([cursor, keys]: ScanRawReply): ScanReply { return { cursor: Number(cursor), keys diff --git a/packages/client/lib/commands/SCRIPT_EXISTS.ts b/packages/client/lib/commands/SCRIPT_EXISTS.ts index d4f65cfd72..cee889215d 100644 --- a/packages/client/lib/commands/SCRIPT_EXISTS.ts +++ b/packages/client/lib/commands/SCRIPT_EXISTS.ts @@ -5,4 +5,4 @@ export function transformArguments(sha1: string | Array): RedisCommandAr return pushVerdictArguments(['SCRIPT', 'EXISTS'], sha1); } -export { transformReplyBooleanArray as transformReply } from './generic-transformers'; +export { transformBooleanArrayReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/SDIFF.ts b/packages/client/lib/commands/SDIFF.ts index 7c1e4fc34a..9c4f3b4820 100644 --- a/packages/client/lib/commands/SDIFF.ts +++ b/packages/client/lib/commands/SDIFF.ts @@ -1,10 +1,14 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(keys: string | Array): RedisCommandArguments { +export const IS_READ_ONLY = true; + +export function transformArguments( + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SDIFF'], keys); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SDIFFSTORE.ts b/packages/client/lib/commands/SDIFFSTORE.ts index 9cca24beb6..a927e12ef0 100644 --- a/packages/client/lib/commands/SDIFFSTORE.ts +++ b/packages/client/lib/commands/SDIFFSTORE.ts @@ -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(destination: string, keys: string | Array): RedisCommandArguments { +export function transformArguments( + destination: RedisCommandArgument, + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SDIFFSTORE', destination], keys); } diff --git a/packages/client/lib/commands/SET.ts b/packages/client/lib/commands/SET.ts index e94abc47ac..3f9f568f23 100644 --- a/packages/client/lib/commands/SET.ts +++ b/packages/client/lib/commands/SET.ts @@ -60,6 +60,4 @@ export function transformArguments( return args; } -export function transformReply(reply?: string): string | null { - return reply ?? null; -} +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/SETBIT.ts b/packages/client/lib/commands/SETBIT.ts index 7b0812a55b..94f463330a 100644 --- a/packages/client/lib/commands/SETBIT.ts +++ b/packages/client/lib/commands/SETBIT.ts @@ -1,9 +1,13 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { BitValue } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, offset: number, value: BitValue): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + offset: number, + value: BitValue +): RedisCommandArguments { return ['SETBIT', key, offset.toString(), value.toString()]; } diff --git a/packages/client/lib/commands/SETEX.ts b/packages/client/lib/commands/SETEX.ts index 871c286b24..bb3068501f 100644 --- a/packages/client/lib/commands/SETEX.ts +++ b/packages/client/lib/commands/SETEX.ts @@ -5,7 +5,7 @@ export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, seconds: number, - value: string + value: RedisCommandArgument ): RedisCommandArguments { return [ 'SETEX', @@ -15,4 +15,4 @@ export function transformArguments( ]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/SETNX.ts b/packages/client/lib/commands/SETNX.ts index b45e93b0f7..b01d45dc32 100644 --- a/packages/client/lib/commands/SETNX.ts +++ b/packages/client/lib/commands/SETNX.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, value: string): Array { +export function transformArguments( + key: RedisCommandArgument, + value: RedisCommandArgument +): RedisCommandArguments { return ['SETNX', key, value]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/SETRANGE.ts b/packages/client/lib/commands/SETRANGE.ts index fa15c41db9..038a8a5dd7 100644 --- a/packages/client/lib/commands/SETRANGE.ts +++ b/packages/client/lib/commands/SETRANGE.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, offset: number, value: string): Array { +export function transformArguments( + key: RedisCommandArgument, + offset: number, + value: RedisCommandArgument +): RedisCommandArguments { return ['SETRANGE', key, offset.toString(), value]; } diff --git a/packages/client/lib/commands/SINTER.ts b/packages/client/lib/commands/SINTER.ts index 5d74e761f0..fe1feee7ad 100644 --- a/packages/client/lib/commands/SINTER.ts +++ b/packages/client/lib/commands/SINTER.ts @@ -1,10 +1,14 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(keys: string | Array): RedisCommandArguments { +export const IS_READ_ONLY = true; + +export function transformArguments( + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SINTER'], keys); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SINTERSTORE.ts b/packages/client/lib/commands/SINTERSTORE.ts index 40f31a8b7a..02bf9d061a 100644 --- a/packages/client/lib/commands/SINTERSTORE.ts +++ b/packages/client/lib/commands/SINTERSTORE.ts @@ -1,10 +1,13 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(destination: string, keys: string | Array): RedisCommandArguments { +export function transformArguments( + destination: RedisCommandArgument, + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SINTERSTORE', destination], keys); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SISMEMBER.ts b/packages/client/lib/commands/SISMEMBER.ts index d8c47a76a6..4d40c63250 100644 --- a/packages/client/lib/commands/SISMEMBER.ts +++ b/packages/client/lib/commands/SISMEMBER.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, member: string): Array { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument +): RedisCommandArguments { return ['SISMEMBER', key, member]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/SMEMBERS.ts b/packages/client/lib/commands/SMEMBERS.ts index 71b479f9d8..7950a4c073 100644 --- a/packages/client/lib/commands/SMEMBERS.ts +++ b/packages/client/lib/commands/SMEMBERS.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['SMEMBERS', key]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SMISMEMBER.ts b/packages/client/lib/commands/SMISMEMBER.ts index 85b954bc3d..175120bdfb 100644 --- a/packages/client/lib/commands/SMISMEMBER.ts +++ b/packages/client/lib/commands/SMISMEMBER.ts @@ -1,7 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, members: Array): Array { +export function transformArguments( + key: RedisCommandArgument, + members: Array +): RedisCommandArguments { return ['SMISMEMBER', key, ...members]; } -export { transformReplyBooleanArray as transformReply } from './generic-transformers'; +export { transformBooleanArrayReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/SMOVE.ts b/packages/client/lib/commands/SMOVE.ts index 7850b8f9dd..83c4027dbd 100644 --- a/packages/client/lib/commands/SMOVE.ts +++ b/packages/client/lib/commands/SMOVE.ts @@ -1,7 +1,13 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(source: string, destination: string, member: string): Array { +export function transformArguments( + source: RedisCommandArgument, + destination: RedisCommandArgument, + member: RedisCommandArgument +): RedisCommandArguments { return ['SMOVE', source, destination, member]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/SPOP.ts b/packages/client/lib/commands/SPOP.ts index 84845230d4..38ce8573f3 100644 --- a/packages/client/lib/commands/SPOP.ts +++ b/packages/client/lib/commands/SPOP.ts @@ -1,6 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, count?: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count?: number +): RedisCommandArguments { const args = ['SPOP', key]; if (typeof count === 'number') { @@ -10,4 +15,4 @@ export function transformArguments(key: string, count?: number): Array { return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SRANDMEMBER.ts b/packages/client/lib/commands/SRANDMEMBER.ts index c477a5691d..d84e61993e 100644 --- a/packages/client/lib/commands/SRANDMEMBER.ts +++ b/packages/client/lib/commands/SRANDMEMBER.ts @@ -1,7 +1,9 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['SRANDMEMBER', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/SRANDMEMBER_COUNT.ts b/packages/client/lib/commands/SRANDMEMBER_COUNT.ts index 89d9b8c4ae..d265d89e9a 100644 --- a/packages/client/lib/commands/SRANDMEMBER_COUNT.ts +++ b/packages/client/lib/commands/SRANDMEMBER_COUNT.ts @@ -1,12 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformSRandMemberArguments } from './SRANDMEMBER'; export { FIRST_KEY_INDEX } from './SRANDMEMBER'; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return [ ...transformSRandMemberArguments(key), count.toString() ]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SREM.ts b/packages/client/lib/commands/SREM.ts index 9a37ac9bf9..34aebdf02e 100644 --- a/packages/client/lib/commands/SREM.ts +++ b/packages/client/lib/commands/SREM.ts @@ -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, members: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + members: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SREM', key], members); } diff --git a/packages/client/lib/commands/SSCAN.ts b/packages/client/lib/commands/SSCAN.ts index 9b881f5d88..9b3938f159 100644 --- a/packages/client/lib/commands/SSCAN.ts +++ b/packages/client/lib/commands/SSCAN.ts @@ -1,22 +1,29 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ScanOptions, pushScanArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, cursor: number, options?: ScanOptions): Array { +export function transformArguments( + key: RedisCommandArgument, + cursor: number, + options?: ScanOptions +): RedisCommandArguments { return pushScanArguments([ 'SSCAN', key, ], cursor, options); } +type SScanRawReply = [string, Array]; + interface SScanReply { cursor: number; - members: Array; + members: Array; } -export function transformReply([cursor, members]: [string, Array]): SScanReply { +export function transformReply([cursor, members]: SScanRawReply): SScanReply { return { cursor: Number(cursor), members diff --git a/packages/client/lib/commands/STRLEN.ts b/packages/client/lib/commands/STRLEN.ts index 208d9d73fb..de88340d8b 100644 --- a/packages/client/lib/commands/STRLEN.ts +++ b/packages/client/lib/commands/STRLEN.ts @@ -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 { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['STRLEN', key]; } diff --git a/packages/client/lib/commands/SUNION.ts b/packages/client/lib/commands/SUNION.ts index ae8b02b481..52c112e661 100644 --- a/packages/client/lib/commands/SUNION.ts +++ b/packages/client/lib/commands/SUNION.ts @@ -1,12 +1,14 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(keys: string | Array): RedisCommandArguments { +export function transformArguments( + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SUNION'], keys); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/SUNIONSTORE.ts b/packages/client/lib/commands/SUNIONSTORE.ts index f259769f49..94df6771a0 100644 --- a/packages/client/lib/commands/SUNIONSTORE.ts +++ b/packages/client/lib/commands/SUNIONSTORE.ts @@ -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(destination: string, keys: string | Array): RedisCommandArguments { +export function transformArguments( + destination: RedisCommandArgument, + keys: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['SUNIONSTORE', destination], keys); } diff --git a/packages/client/lib/commands/TOUCH.ts b/packages/client/lib/commands/TOUCH.ts index a3dc31e856..e67dff8e93 100644 --- a/packages/client/lib/commands/TOUCH.ts +++ b/packages/client/lib/commands/TOUCH.ts @@ -1,9 +1,11 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['TOUCH'], key); } diff --git a/packages/client/lib/commands/TTL.ts b/packages/client/lib/commands/TTL.ts index 4ae31245aa..29586f31fa 100644 --- a/packages/client/lib/commands/TTL.ts +++ b/packages/client/lib/commands/TTL.ts @@ -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 { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['TTL', key]; } diff --git a/packages/client/lib/commands/TYPE.ts b/packages/client/lib/commands/TYPE.ts index 283701b6e9..10cd3f99b0 100644 --- a/packages/client/lib/commands/TYPE.ts +++ b/packages/client/lib/commands/TYPE.ts @@ -1,9 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['TYPE', key]; } -export declare function transformReply(): string; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/UNLINK.ts b/packages/client/lib/commands/UNLINK.ts index 467b4172e0..53b0360e2d 100644 --- a/packages/client/lib/commands/UNLINK.ts +++ b/packages/client/lib/commands/UNLINK.ts @@ -1,9 +1,11 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['UNLINK'], key); } diff --git a/packages/client/lib/commands/XAUTOCLAIM.ts b/packages/client/lib/commands/XAUTOCLAIM.ts index 9eeb04623d..4bf46057ba 100644 --- a/packages/client/lib/commands/XAUTOCLAIM.ts +++ b/packages/client/lib/commands/XAUTOCLAIM.ts @@ -1,5 +1,5 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; -import { StreamStringsMessagesReply, transformReplyStreamStringMessages } from './generic-transformers'; +import { StreamMessagesReply, transformStreamMessagesReply } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -24,14 +24,16 @@ export function transformArguments( return args; } +type XAutoClaimRawReply = [RedisCommandArgument, Array]; + interface XAutoClaimReply { - nextId: string; - messages: StreamStringsMessagesReply; + nextId: RedisCommandArgument; + messages: StreamMessagesReply; } -export function transformReply(reply: [string, Array]): XAutoClaimReply { +export function transformReply(reply: XAutoClaimRawReply): XAutoClaimReply { return { nextId: reply[0], - messages: transformReplyStreamStringMessages(reply[1]) + messages: transformStreamMessagesReply(reply[1]) }; } diff --git a/packages/client/lib/commands/XAUTOCLAIM_BUFFER.ts b/packages/client/lib/commands/XAUTOCLAIM_BUFFER.ts deleted file mode 100644 index dab264be87..0000000000 --- a/packages/client/lib/commands/XAUTOCLAIM_BUFFER.ts +++ /dev/null @@ -1,17 +0,0 @@ -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]): XAutoClaimReply { - return { - nextId: reply[0], - messages: transformReplyStreamBufferMessages(reply[1]) - }; -} diff --git a/packages/client/lib/commands/XAUTOCLAIM_JUSTID.ts b/packages/client/lib/commands/XAUTOCLAIM_JUSTID.ts index b18f49b6b7..a30ac1579e 100644 --- a/packages/client/lib/commands/XAUTOCLAIM_JUSTID.ts +++ b/packages/client/lib/commands/XAUTOCLAIM_JUSTID.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformXAutoClaimArguments } from './XAUTOCLAIM'; export { FIRST_KEY_INDEX } from './XAUTOCLAIM'; @@ -10,12 +10,14 @@ export function transformArguments(...args: Parameters]; + interface XAutoClaimJustIdReply { - nextId: string; - messages: Array; + nextId: RedisCommandArgument; + messages: Array; } -export function transformReply(reply: [string, Array]): XAutoClaimJustIdReply { +export function transformReply(reply: XAutoClaimJustIdRawReply): XAutoClaimJustIdReply { return { nextId: reply[0], messages: reply[1] diff --git a/packages/client/lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts b/packages/client/lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts deleted file mode 100644 index eeb9c801e1..0000000000 --- a/packages/client/lib/commands/XAUTOCLAIM_JUSTID_BUFFER.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { FIRST_KEY_INDEX, transformArguments } from './XAUTOCLAIM_JUSTID'; - -interface XAutoClaimJustIdBufferReply { - nextId: Buffer; - messages: Array; -} - -export function transformReply(reply: [Buffer, Array]): XAutoClaimJustIdBufferReply { - return { - nextId: reply[0], - messages: reply[1] - }; -} diff --git a/packages/client/lib/commands/XCLAIM.ts b/packages/client/lib/commands/XCLAIM.ts index 84362f917a..c87d254754 100644 --- a/packages/client/lib/commands/XCLAIM.ts +++ b/packages/client/lib/commands/XCLAIM.ts @@ -44,4 +44,4 @@ export function transformArguments( return args; } -export { transformReplyStreamStringMessages as transformReply } from './generic-transformers'; +export { transformStreamMessagesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XCLAIM_BUFFER.ts b/packages/client/lib/commands/XCLAIM_BUFFER.ts deleted file mode 100644 index 45e960ff86..0000000000 --- a/packages/client/lib/commands/XCLAIM_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, transformArguments } from './XCLAIM'; - -export const BUFFER_MODE = true; - -export { transformReplyStreamBufferMessages as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XCLAIM_JUSTID.ts b/packages/client/lib/commands/XCLAIM_JUSTID.ts index da2dce2d3d..50d0d5a036 100644 --- a/packages/client/lib/commands/XCLAIM_JUSTID.ts +++ b/packages/client/lib/commands/XCLAIM_JUSTID.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformXClaimArguments } from './XCLAIM'; export { FIRST_KEY_INDEX } from './XCLAIM'; @@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/XCLAIM_JUSTID_BUFFER.ts b/packages/client/lib/commands/XCLAIM_JUSTID_BUFFER.ts deleted file mode 100644 index 9933e4a6a8..0000000000 --- a/packages/client/lib/commands/XCLAIM_JUSTID_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, transformArguments } from './XCLAIM_JUSTID'; - -export const BUFFER_MODE = true; - -export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/XGROUP_CREATE.ts b/packages/client/lib/commands/XGROUP_CREATE.ts index 85847029cf..8cfd4e262e 100644 --- a/packages/client/lib/commands/XGROUP_CREATE.ts +++ b/packages/client/lib/commands/XGROUP_CREATE.ts @@ -21,4 +21,4 @@ export function transformArguments( return args; } -export declare function transformReply(): 'OK'; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/XGROUP_CREATECONSUMER.ts b/packages/client/lib/commands/XGROUP_CREATECONSUMER.ts index 6f1458e337..2b816a6b48 100644 --- a/packages/client/lib/commands/XGROUP_CREATECONSUMER.ts +++ b/packages/client/lib/commands/XGROUP_CREATECONSUMER.ts @@ -10,4 +10,4 @@ export function transformArguments( return ['XGROUP', 'CREATECONSUMER', key, group, consumer]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XGROUP_DESTROY.ts b/packages/client/lib/commands/XGROUP_DESTROY.ts index 3bd61b3056..85910c0247 100644 --- a/packages/client/lib/commands/XGROUP_DESTROY.ts +++ b/packages/client/lib/commands/XGROUP_DESTROY.ts @@ -9,4 +9,4 @@ export function transformArguments( return ['XGROUP', 'DESTROY', key, group]; } -export { transformReplyBoolean as transformReply } from './generic-transformers'; +export { transformBooleanReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XGROUP_SETID.ts b/packages/client/lib/commands/XGROUP_SETID.ts index fd580d7aac..e732fc8d7b 100644 --- a/packages/client/lib/commands/XGROUP_SETID.ts +++ b/packages/client/lib/commands/XGROUP_SETID.ts @@ -10,4 +10,4 @@ export function transformArguments( return ['XGROUP', 'SETID', key, group, id]; } -export declare function transformReply(): 'OK'; +export declare function transformReply(): RedisCommandArgument; diff --git a/packages/client/lib/commands/XINFO_CONSUMERS.ts b/packages/client/lib/commands/XINFO_CONSUMERS.ts index 8cdcb9d143..05e3a26b17 100644 --- a/packages/client/lib/commands/XINFO_CONSUMERS.ts +++ b/packages/client/lib/commands/XINFO_CONSUMERS.ts @@ -12,7 +12,7 @@ export function transformArguments( } type XInfoConsumersReply = Array<{ - name: string; + name: RedisCommandArgument; pending: number; idle: number; }>; diff --git a/packages/client/lib/commands/XINFO_GROUPS.ts b/packages/client/lib/commands/XINFO_GROUPS.ts index 2799cd7244..dcf504c8ce 100644 --- a/packages/client/lib/commands/XINFO_GROUPS.ts +++ b/packages/client/lib/commands/XINFO_GROUPS.ts @@ -9,10 +9,10 @@ export function transformArguments(key: RedisCommandArgument): RedisCommandArgum } type XInfoGroupsReply = Array<{ - name: string; + name: RedisCommandArgument; consumers: number; pending: number; - lastDeliveredId: string; + lastDeliveredId: RedisCommandArgument; }>; export function transformReply(rawReply: Array): XInfoGroupsReply { diff --git a/packages/client/lib/commands/XINFO_STREAM.ts b/packages/client/lib/commands/XINFO_STREAM.ts index c62ad1eee8..e9de25be8c 100644 --- a/packages/client/lib/commands/XINFO_STREAM.ts +++ b/packages/client/lib/commands/XINFO_STREAM.ts @@ -1,5 +1,5 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; -import { StreamStringsMessageReply, transformReplyStringTuples } from './generic-transformers'; +import { StreamMessageReply, transformTuplesReply } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; @@ -14,9 +14,9 @@ interface XInfoStreamReply { radixTreeKeys: number; radixTreeNodes: number; groups: number; - lastGeneratedId: string; - firstEntry: StreamStringsMessageReply | null; - lastEntry: StreamStringsMessageReply | null; + lastGeneratedId: RedisCommandArgument; + firstEntry: StreamMessageReply | null; + lastEntry: StreamMessageReply | null; } export function transformReply(rawReply: Array): XInfoStreamReply { @@ -47,14 +47,14 @@ export function transformReply(rawReply: Array): XInfoStreamReply { case 'first-entry': parsedReply.firstEntry = rawReply[i + 1] ? { id: rawReply[i + 1][0], - message: transformReplyStringTuples(rawReply[i + 1][1]) + message: transformTuplesReply(rawReply[i + 1][1]) } : null; break; case 'last-entry': parsedReply.lastEntry = rawReply[i + 1] ? { id: rawReply[i + 1][0], - message: transformReplyStringTuples(rawReply[i + 1][1]) + message: transformTuplesReply(rawReply[i + 1][1]) } : null; break; } diff --git a/packages/client/lib/commands/XPENDING.ts b/packages/client/lib/commands/XPENDING.ts index aedd8c6885..a6052adb0f 100644 --- a/packages/client/lib/commands/XPENDING.ts +++ b/packages/client/lib/commands/XPENDING.ts @@ -13,20 +13,20 @@ export function transformArguments( type XPendingRawReply = [ pending: number, - firstId: string | null, - lastId: string | null, + firstId: RedisCommandArgument | null, + lastId: RedisCommandArgument | null, consumers: Array<[ - name: string, + name: RedisCommandArgument, deliveriesCounter: number ]> | null ] interface XPendingReply { pending: number; - firstId: string | null; - lastId: string | null + firstId: RedisCommandArgument | null; + lastId: RedisCommandArgument | null consumers: Array<{ - name: string, + name: RedisCommandArgument, deliveriesCounter: number }> | null; } diff --git a/packages/client/lib/commands/XPENDING_RANGE.ts b/packages/client/lib/commands/XPENDING_RANGE.ts index 1299f8d603..fd9a09113b 100644 --- a/packages/client/lib/commands/XPENDING_RANGE.ts +++ b/packages/client/lib/commands/XPENDING_RANGE.ts @@ -6,7 +6,7 @@ export const IS_READ_ONLY = true; interface XPendingRangeOptions { IDLE?: number; - consumer?: string; + consumer?: RedisCommandArgument; } export function transformArguments( @@ -34,14 +34,14 @@ export function transformArguments( type XPendingRangeRawReply = Array<[ id: number, - consumer: string, + consumer: RedisCommandArgument, millisecondsSinceLastDelivery: number, deliveriesCounter: number ]>; type XPendingRangeReply = Array<{ id: number; - owner: string; + owner: RedisCommandArgument; millisecondsSinceLastDelivery: number; deliveriesCounter: number; }>; diff --git a/packages/client/lib/commands/XRANGE.ts b/packages/client/lib/commands/XRANGE.ts index 283e3423d2..ae56639f76 100644 --- a/packages/client/lib/commands/XRANGE.ts +++ b/packages/client/lib/commands/XRANGE.ts @@ -23,4 +23,4 @@ export function transformArguments( return args; } -export { transformReplyStreamStringMessages as transformReply } from './generic-transformers'; +export { transformStreamMessagesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XRANGE_BUFFER.ts b/packages/client/lib/commands/XRANGE_BUFFER.ts deleted file mode 100644 index f69c824c14..0000000000 --- a/packages/client/lib/commands/XRANGE_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XRANGE'; - -export const BUFFER_MODE = true; - -export { transformReplyStreamBufferMessages as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XREAD.ts b/packages/client/lib/commands/XREAD.ts index a81ffbae59..e5f85dbe7f 100644 --- a/packages/client/lib/commands/XREAD.ts +++ b/packages/client/lib/commands/XREAD.ts @@ -43,4 +43,4 @@ export function transformArguments( return args; } -export { transformReplyStreamsStringMessages as transformReply } from './generic-transformers'; +export { transformStreamsMessagesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XREADGROUP.ts b/packages/client/lib/commands/XREADGROUP.ts index 5814de94ef..e90e698a2a 100644 --- a/packages/client/lib/commands/XREADGROUP.ts +++ b/packages/client/lib/commands/XREADGROUP.ts @@ -54,4 +54,4 @@ export function transformArguments( return args; } -export { transformReplyStreamsStringMessages as transformReply } from './generic-transformers'; +export { transformStreamsMessagesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XREADGROUP_BUFFER.ts b/packages/client/lib/commands/XREADGROUP_BUFFER.ts deleted file mode 100644 index f02c8fee27..0000000000 --- a/packages/client/lib/commands/XREADGROUP_BUFFER.ts +++ /dev/null @@ -1,6 +0,0 @@ - -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XREADGROUP'; - -export const BUFFER_MODE = true; - -export { transformReplyStreamsBufferMessages as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XREAD_BUFFER.ts b/packages/client/lib/commands/XREAD_BUFFER.ts deleted file mode 100644 index c699aae8ad..0000000000 --- a/packages/client/lib/commands/XREAD_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XREAD'; - -export const BUFFER_MODE = true; - -export { transformReplyStreamsBufferMessages as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XREVRANGE.ts b/packages/client/lib/commands/XREVRANGE.ts index c61fcb7a52..96bbeba83c 100644 --- a/packages/client/lib/commands/XREVRANGE.ts +++ b/packages/client/lib/commands/XREVRANGE.ts @@ -1,12 +1,19 @@ -interface XRangeRevOptions { - COUNT?: number; -} +import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, start: string, end: string, options?: XRangeRevOptions): Array { +interface XRangeRevOptions { + COUNT?: number; +} + +export function transformArguments( + key: RedisCommandArgument, + start: RedisCommandArgument, + end: RedisCommandArgument, + options?: XRangeRevOptions +): RedisCommandArguments { const args = ['XREVRANGE', key, start, end]; if (options?.COUNT) { @@ -16,4 +23,4 @@ export function transformArguments(key: string, start: string, end: string, opti return args; } -export { transformReplyStreamStringMessages as transformReply } from './generic-transformers'; +export { transformStreamMessagesReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/XREVRANGE_BUFFER.ts b/packages/client/lib/commands/XREVRANGE_BUFFER.ts deleted file mode 100644 index eb45ee486e..0000000000 --- a/packages/client/lib/commands/XREVRANGE_BUFFER.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FIRST_KEY_INDEX, IS_READ_ONLY, transformArguments } from './XREVRANGE'; - -export const BUFFER_MODE = true; - -export { transformReplyStreamBufferMessages as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZADD.ts b/packages/client/lib/commands/ZADD.ts index c8b7c4002c..9ac67d59cc 100644 --- a/packages/client/lib/commands/ZADD.ts +++ b/packages/client/lib/commands/ZADD.ts @@ -1,5 +1,5 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; -import { transformArgumentNumberInfinity, ZMember } from './generic-transformers'; +import { transformNumberInfinityArgument, ZMember } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -60,7 +60,7 @@ export function transformArguments( for (const { score, value } of (Array.isArray(members) ? members : [members])) { args.push( - transformArgumentNumberInfinity(score), + transformNumberInfinityArgument(score), value ); } @@ -68,4 +68,4 @@ export function transformArguments( return args; } -export { transformReplyNumberInfinity as transformReply } from './generic-transformers'; +export { transformNumberInfinityReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZCARD.ts b/packages/client/lib/commands/ZCARD.ts index 9c76c485bf..f208c18136 100644 --- a/packages/client/lib/commands/ZCARD.ts +++ b/packages/client/lib/commands/ZCARD.ts @@ -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 { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['ZCARD', key]; } diff --git a/packages/client/lib/commands/ZCOUNT.ts b/packages/client/lib/commands/ZCOUNT.ts index 83a0710fa1..f9700cc909 100644 --- a/packages/client/lib/commands/ZCOUNT.ts +++ b/packages/client/lib/commands/ZCOUNT.ts @@ -1,15 +1,20 @@ -import { transformArgumentStringNumberInfinity } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, min: string | number, max: string | number): Array { +export function transformArguments( + key: RedisCommandArgument, + min: RedisCommandArgument | number, + max: RedisCommandArgument | number +): RedisCommandArguments { return [ 'ZCOUNT', key, - transformArgumentStringNumberInfinity(min), - transformArgumentStringNumberInfinity(max) + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) ]; } diff --git a/packages/client/lib/commands/ZDIFF.ts b/packages/client/lib/commands/ZDIFF.ts index a45bf01a52..f3818a139f 100644 --- a/packages/client/lib/commands/ZDIFF.ts +++ b/packages/client/lib/commands/ZDIFF.ts @@ -1,12 +1,14 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; -export function transformArguments(keys: Array | string): RedisCommandArguments { +export function transformArguments( + keys: Array | RedisCommandArgument +): RedisCommandArguments { return pushVerdictArgument(['ZDIFF'], keys); } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZDIFFSTORE.ts b/packages/client/lib/commands/ZDIFFSTORE.ts index 9c782b8a5a..3b9af9511c 100644 --- a/packages/client/lib/commands/ZDIFFSTORE.ts +++ b/packages/client/lib/commands/ZDIFFSTORE.ts @@ -1,9 +1,12 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(destination: string, keys: Array | string): RedisCommandArguments { +export function transformArguments( + destination: RedisCommandArgument, + keys: Array | RedisCommandArgument +): RedisCommandArguments { return pushVerdictArgument(['ZDIFFSTORE', destination], keys); } diff --git a/packages/client/lib/commands/ZDIFF_WITHSCORES.ts b/packages/client/lib/commands/ZDIFF_WITHSCORES.ts index 961e1a73e1..9caa13c9f8 100644 --- a/packages/client/lib/commands/ZDIFF_WITHSCORES.ts +++ b/packages/client/lib/commands/ZDIFF_WITHSCORES.ts @@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters { +export function transformArguments( + key: RedisCommandArgument, + increment: number, + member: RedisCommandArgument +): RedisCommandArguments { return [ 'ZINCRBY', key, - transformArgumentNumberInfinity(increment), + transformNumberInfinityArgument(increment), member ]; } -export { transformReplyNumberInfinity as transformReply } from './generic-transformers'; +export { transformNumberInfinityReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZINTER.ts b/packages/client/lib/commands/ZINTER.ts index 629515b57f..88d7f80188 100644 --- a/packages/client/lib/commands/ZINTER.ts +++ b/packages/client/lib/commands/ZINTER.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; @@ -10,7 +10,10 @@ interface ZInterOptions { AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } -export function transformArguments(keys: Array | string, options?: ZInterOptions): RedisCommandArguments { +export function transformArguments( + keys: Array | RedisCommandArgument, + options?: ZInterOptions +): RedisCommandArguments { const args = pushVerdictArgument(['ZINTER'], keys); if (options?.WEIGHTS) { @@ -27,4 +30,4 @@ export function transformArguments(keys: Array | string, options?: ZInte return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZINTERSTORE.ts b/packages/client/lib/commands/ZINTERSTORE.ts index e0916e5b14..540f10ae2d 100644 --- a/packages/client/lib/commands/ZINTERSTORE.ts +++ b/packages/client/lib/commands/ZINTERSTORE.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -8,7 +8,11 @@ interface ZInterStoreOptions { AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } -export function transformArguments(destination: string, keys: Array | string, options?: ZInterStoreOptions): RedisCommandArguments { +export function transformArguments( + destination: RedisCommandArgument, + keys: Array | RedisCommandArgument, + options?: ZInterStoreOptions +): RedisCommandArguments { const args = pushVerdictArgument(['ZINTERSTORE', destination], keys); if (options?.WEIGHTS) { diff --git a/packages/client/lib/commands/ZINTER_WITHSCORES.ts b/packages/client/lib/commands/ZINTER_WITHSCORES.ts index cb951284bc..c9416e9222 100644 --- a/packages/client/lib/commands/ZINTER_WITHSCORES.ts +++ b/packages/client/lib/commands/ZINTER_WITHSCORES.ts @@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters { +export function transformArguments( + key: RedisCommandArgument, + min: RedisCommandArgument, + max: RedisCommandArgument +): RedisCommandArguments { return [ 'ZLEXCOUNT', key, diff --git a/packages/client/lib/commands/ZMSCORE.ts b/packages/client/lib/commands/ZMSCORE.ts index a6dd8e45e4..6c8c9dace3 100644 --- a/packages/client/lib/commands/ZMSCORE.ts +++ b/packages/client/lib/commands/ZMSCORE.ts @@ -1,12 +1,15 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, member: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['ZMSCORE', key], member); } -export { transformReplyNumberInfinityNullArray as transformReply } from './generic-transformers'; +export { transformNumberInfinityNullArrayReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZPOPMAX.ts b/packages/client/lib/commands/ZPOPMAX.ts index 3691f63f0c..811166a690 100644 --- a/packages/client/lib/commands/ZPOPMAX.ts +++ b/packages/client/lib/commands/ZPOPMAX.ts @@ -1,19 +1,12 @@ -import { transformReplyNumberInfinity, ZMember } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'ZPOPMAX', key ]; } -export function transformReply(reply: [string, string] | []): ZMember | null { - if (!reply.length) return null; - - return { - value: reply[0], - score: transformReplyNumberInfinity(reply[1]) - }; -} +export { transformSortedSetMemberNullReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZPOPMAX_COUNT.ts b/packages/client/lib/commands/ZPOPMAX_COUNT.ts index cf43cf3fe1..875bcfb914 100644 --- a/packages/client/lib/commands/ZPOPMAX_COUNT.ts +++ b/packages/client/lib/commands/ZPOPMAX_COUNT.ts @@ -1,12 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformZPopMaxArguments } from './ZPOPMAX'; export { FIRST_KEY_INDEX } from './ZPOPMAX'; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return [ ...transformZPopMaxArguments(key), count.toString() ]; } -export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers'; +export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZPOPMIN.ts b/packages/client/lib/commands/ZPOPMIN.ts index 891e56593b..053ffd2d2c 100644 --- a/packages/client/lib/commands/ZPOPMIN.ts +++ b/packages/client/lib/commands/ZPOPMIN.ts @@ -1,19 +1,12 @@ -import { transformReplyNumberInfinity, ZMember } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'ZPOPMIN', key ]; } -export function transformReply(reply: [string, string] | []): ZMember | null { - if (!reply.length) return null; - - return { - value: reply[0], - score: transformReplyNumberInfinity(reply[1]) - }; -} +export { transformSortedSetMemberNullReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZPOPMIN_COUNT.ts b/packages/client/lib/commands/ZPOPMIN_COUNT.ts index e3b7adcce9..54125ade0a 100644 --- a/packages/client/lib/commands/ZPOPMIN_COUNT.ts +++ b/packages/client/lib/commands/ZPOPMIN_COUNT.ts @@ -1,12 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformZPopMinArguments } from './ZPOPMIN'; export { FIRST_KEY_INDEX } from './ZPOPMIN'; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return [ ...transformZPopMinArguments(key), count.toString() ]; } -export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers'; +export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZRANDMEMBER.ts b/packages/client/lib/commands/ZRANDMEMBER.ts index 13bb05598b..00420872c0 100644 --- a/packages/client/lib/commands/ZRANDMEMBER.ts +++ b/packages/client/lib/commands/ZRANDMEMBER.ts @@ -1,9 +1,11 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string): Array { +export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['ZRANDMEMBER', key]; } -export declare function transformReply(): string | null; +export declare function transformReply(): RedisCommandArgument | null; diff --git a/packages/client/lib/commands/ZRANDMEMBER_COUNT.ts b/packages/client/lib/commands/ZRANDMEMBER_COUNT.ts index 1b7b8fea99..3aa91902c6 100644 --- a/packages/client/lib/commands/ZRANDMEMBER_COUNT.ts +++ b/packages/client/lib/commands/ZRANDMEMBER_COUNT.ts @@ -1,12 +1,16 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformZRandMemberArguments } from './ZRANDMEMBER'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANDMEMBER'; -export function transformArguments(key: string, count: number): Array { +export function transformArguments( + key: RedisCommandArgument, + count: number +): RedisCommandArguments { return [ ...transformZRandMemberArguments(key), count.toString() ]; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZRANDMEMBER_COUNT_WITHSCORES.ts b/packages/client/lib/commands/ZRANDMEMBER_COUNT_WITHSCORES.ts index 83ce83ec6c..cc9d2bc26e 100644 --- a/packages/client/lib/commands/ZRANDMEMBER_COUNT_WITHSCORES.ts +++ b/packages/client/lib/commands/ZRANDMEMBER_COUNT_WITHSCORES.ts @@ -1,12 +1,13 @@ +import { RedisCommandArguments } from '.'; import { transformArguments as transformZRandMemberCountArguments } from './ZRANDMEMBER_COUNT'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANDMEMBER_COUNT'; -export function transformArguments(...args: Parameters): Array { +export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZRandMemberCountArguments(...args), 'WITHSCORES' ]; } -export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers'; +export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZRANGE.ts b/packages/client/lib/commands/ZRANGE.ts index 3d30e0f8dd..83f09aaa1b 100644 --- a/packages/client/lib/commands/ZRANGE.ts +++ b/packages/client/lib/commands/ZRANGE.ts @@ -1,4 +1,5 @@ -import { transformArgumentStringNumberInfinity } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -13,12 +14,17 @@ interface ZRangeOptions { }; } -export function transformArguments(key: string, min: string | number, max: string | number, options?: ZRangeOptions): Array { +export function transformArguments( + key: RedisCommandArgument, + min: RedisCommandArgument | number, + max: RedisCommandArgument | number, + options?: ZRangeOptions +): RedisCommandArguments { const args = [ 'ZRANGE', key, - transformArgumentStringNumberInfinity(min), - transformArgumentStringNumberInfinity(max) + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) ]; switch (options?.BY) { @@ -42,4 +48,4 @@ export function transformArguments(key: string, min: string | number, max: strin return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZRANGEBYLEX.ts b/packages/client/lib/commands/ZRANGEBYLEX.ts index 214d796da0..d6e621a562 100644 --- a/packages/client/lib/commands/ZRANGEBYLEX.ts +++ b/packages/client/lib/commands/ZRANGEBYLEX.ts @@ -1,5 +1,5 @@ -import { RedisCommandArguments } from '.'; -import { transformArgumentStringNumberInfinity } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -13,16 +13,16 @@ export interface ZRangeByLexOptions { } export function transformArguments( - key: string, - min: number | string, - max: number | string, + key: RedisCommandArgument, + min: RedisCommandArgument, + max: RedisCommandArgument, options?: ZRangeByLexOptions ): RedisCommandArguments { const args = [ 'ZRANGEBYLEX', key, - transformArgumentStringNumberInfinity(min), - transformArgumentStringNumberInfinity(max) + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) ]; if (options?.LIMIT) { @@ -32,4 +32,4 @@ export function transformArguments( return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZRANGEBYSCORE.ts b/packages/client/lib/commands/ZRANGEBYSCORE.ts index f6097fad58..5ab7d7ac72 100644 --- a/packages/client/lib/commands/ZRANGEBYSCORE.ts +++ b/packages/client/lib/commands/ZRANGEBYSCORE.ts @@ -1,5 +1,5 @@ -import { RedisCommandArguments } from '.'; -import { transformArgumentStringNumberInfinity } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -13,16 +13,16 @@ export interface ZRangeByScoreOptions { } export function transformArguments( - key: string, - min: number | string, - max: number | string, + key: RedisCommandArgument, + min: string | number, + max: string | number, options?: ZRangeByScoreOptions ): RedisCommandArguments { const args = [ 'ZRANGEBYSCORE', key, - transformArgumentStringNumberInfinity(min), - transformArgumentStringNumberInfinity(max) + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) ]; if (options?.LIMIT) { @@ -32,4 +32,4 @@ export function transformArguments( return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZRANGEBYSCORE_WITHSCORES.ts b/packages/client/lib/commands/ZRANGEBYSCORE_WITHSCORES.ts index f11ef26115..c7266f1c06 100644 --- a/packages/client/lib/commands/ZRANGEBYSCORE_WITHSCORES.ts +++ b/packages/client/lib/commands/ZRANGEBYSCORE_WITHSCORES.ts @@ -1,12 +1,12 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ZRangeByScoreOptions, transformArguments as transformZRangeByScoreArguments } from './ZRANGEBYSCORE'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANGEBYSCORE'; export function transformArguments( - key: string, - min: number | string, - max: number | string, + key: RedisCommandArgument, + min: string | number, + max: string | number, options?: ZRangeByScoreOptions ): RedisCommandArguments { return [ @@ -15,4 +15,4 @@ export function transformArguments( ]; } -export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers'; +export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZRANGESTORE.ts b/packages/client/lib/commands/ZRANGESTORE.ts index c76afe6102..28067ceabe 100644 --- a/packages/client/lib/commands/ZRANGESTORE.ts +++ b/packages/client/lib/commands/ZRANGESTORE.ts @@ -1,4 +1,5 @@ -import { transformArgumentStringNumberInfinity } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -13,18 +14,18 @@ interface ZRangeStoreOptions { } export function transformArguments( - dst: string, - src: string, - min: string | number, - max: string | number, + dst: RedisCommandArgument, + src: RedisCommandArgument, + min: RedisCommandArgument | number, + max: RedisCommandArgument | number, options?: ZRangeStoreOptions -): Array { +): RedisCommandArguments { const args = [ 'ZRANGESTORE', dst, src, - transformArgumentStringNumberInfinity(min), - transformArgumentStringNumberInfinity(max) + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) ]; switch (options?.BY) { diff --git a/packages/client/lib/commands/ZRANGE_WITHSCORES.ts b/packages/client/lib/commands/ZRANGE_WITHSCORES.ts index fbecdfdacb..23ea4d6337 100644 --- a/packages/client/lib/commands/ZRANGE_WITHSCORES.ts +++ b/packages/client/lib/commands/ZRANGE_WITHSCORES.ts @@ -1,12 +1,13 @@ +import { RedisCommandArguments } from '.'; import { transformArguments as transformZRangeArguments } from './ZRANGE'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANGE'; -export function transformArguments(...args: Parameters): Array { +export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZRangeArguments(...args), 'WITHSCORES' ]; } -export { transformReplySortedStringsSetWithScores as transformReply } from './generic-transformers'; +export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZRANK.ts b/packages/client/lib/commands/ZRANK.ts index e060ccf6f8..33439ea4b5 100644 --- a/packages/client/lib/commands/ZRANK.ts +++ b/packages/client/lib/commands/ZRANK.ts @@ -1,8 +1,13 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, member: string): Array { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument +): RedisCommandArguments { return ['ZRANK', key, member]; } diff --git a/packages/client/lib/commands/ZREM.ts b/packages/client/lib/commands/ZREM.ts index 332289b3fd..7ab92c4a78 100644 --- a/packages/client/lib/commands/ZREM.ts +++ b/packages/client/lib/commands/ZREM.ts @@ -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, member: string | Array): RedisCommandArguments { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument | Array +): RedisCommandArguments { return pushVerdictArguments(['ZREM', key], member); } diff --git a/packages/client/lib/commands/ZREMRANGEBYLEX.ts b/packages/client/lib/commands/ZREMRANGEBYLEX.ts index 1f17d6b986..f1f3908f53 100644 --- a/packages/client/lib/commands/ZREMRANGEBYLEX.ts +++ b/packages/client/lib/commands/ZREMRANGEBYLEX.ts @@ -1,7 +1,19 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, min: string, max: string): Array { - return ['ZREMRANGEBYLEX', key, min, max]; +export function transformArguments( + key: RedisCommandArgument, + min: RedisCommandArgument | number, + max: RedisCommandArgument | number +): RedisCommandArguments { + return [ + 'ZREMRANGEBYLEX', + key, + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) + ]; } export declare function transformReply(): number; diff --git a/packages/client/lib/commands/ZREMRANGEBYRANK.ts b/packages/client/lib/commands/ZREMRANGEBYRANK.ts index 550a56e8a8..c50d06e3bf 100644 --- a/packages/client/lib/commands/ZREMRANGEBYRANK.ts +++ b/packages/client/lib/commands/ZREMRANGEBYRANK.ts @@ -1,6 +1,12 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, start: number, stop: number): Array { +export function transformArguments( + key: RedisCommandArgument, + start: number, + stop: number +): RedisCommandArguments { return ['ZREMRANGEBYRANK', key, start.toString(), stop.toString()]; } diff --git a/packages/client/lib/commands/ZREMRANGEBYSCORE.ts b/packages/client/lib/commands/ZREMRANGEBYSCORE.ts index e0186fcb64..12d1eff811 100644 --- a/packages/client/lib/commands/ZREMRANGEBYSCORE.ts +++ b/packages/client/lib/commands/ZREMRANGEBYSCORE.ts @@ -1,7 +1,19 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { transformStringNumberInfinityArgument } from './generic-transformers'; + export const FIRST_KEY_INDEX = 1; -export function transformArguments(key: string, min: number, max: number): Array { - return ['ZREMRANGEBYSCORE', key, min.toString(), max.toString()]; +export function transformArguments( + key: RedisCommandArgument, + min: RedisCommandArgument | number, + max: RedisCommandArgument | number, +): RedisCommandArguments { + return [ + 'ZREMRANGEBYSCORE', + key, + transformStringNumberInfinityArgument(min), + transformStringNumberInfinityArgument(max) + ]; } export declare function transformReply(): number; diff --git a/packages/client/lib/commands/ZREVRANK.ts b/packages/client/lib/commands/ZREVRANK.ts index 808d9e45dc..b88936c0c9 100644 --- a/packages/client/lib/commands/ZREVRANK.ts +++ b/packages/client/lib/commands/ZREVRANK.ts @@ -1,8 +1,13 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, member: string): Array { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument +): RedisCommandArguments { return ['ZREVRANK', key, member]; } diff --git a/packages/client/lib/commands/ZSCAN.ts b/packages/client/lib/commands/ZSCAN.ts index 61774c1042..f6fa17c2d4 100644 --- a/packages/client/lib/commands/ZSCAN.ts +++ b/packages/client/lib/commands/ZSCAN.ts @@ -1,27 +1,34 @@ -import { ScanOptions, transformReplyNumberInfinity, pushScanArguments, ZMember } from './generic-transformers'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; +import { ScanOptions, transformNumberInfinityReply, pushScanArguments, ZMember } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, cursor: number, options?: ScanOptions): Array { +export function transformArguments( + key: RedisCommandArgument, + cursor: number, + options?: ScanOptions +): RedisCommandArguments { return pushScanArguments([ 'ZSCAN', key ], cursor, options); } +type ZScanRawReply = [RedisCommandArgument, Array]; + interface ZScanReply { cursor: number; - members: Array>; + members: Array; } -export function transformReply([cursor, rawMembers]: [string, Array]): ZScanReply { - const parsedMembers: Array> = []; +export function transformReply([cursor, rawMembers]: ZScanRawReply): ZScanReply { + const parsedMembers: Array = []; for (let i = 0; i < rawMembers.length; i += 2) { parsedMembers.push({ value: rawMembers[i], - score: transformReplyNumberInfinity(rawMembers[i + 1]) + score: transformNumberInfinityReply(rawMembers[i + 1]) }); } diff --git a/packages/client/lib/commands/ZSCORE.ts b/packages/client/lib/commands/ZSCORE.ts index 2bdecaf432..118abc1085 100644 --- a/packages/client/lib/commands/ZSCORE.ts +++ b/packages/client/lib/commands/ZSCORE.ts @@ -1,9 +1,14 @@ +import { RedisCommandArgument, RedisCommandArguments } from '.'; + export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; -export function transformArguments(key: string, member: string): Array { +export function transformArguments( + key: RedisCommandArgument, + member: RedisCommandArgument +): RedisCommandArguments { return ['ZSCORE', key, member]; } -export { transformReplyNumberInfinityNull as transformReply } from './generic-transformers'; +export { transformNumberInfinityNullReply as transformReply } from './generic-transformers'; diff --git a/packages/client/lib/commands/ZUNION.ts b/packages/client/lib/commands/ZUNION.ts index 2163978470..f329348cc8 100644 --- a/packages/client/lib/commands/ZUNION.ts +++ b/packages/client/lib/commands/ZUNION.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; @@ -10,7 +10,10 @@ interface ZUnionOptions { AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } -export function transformArguments(keys: Array | string, options?: ZUnionOptions): RedisCommandArguments { +export function transformArguments( + keys: Array | RedisCommandArgument, + options?: ZUnionOptions +): RedisCommandArguments { const args = pushVerdictArgument(['ZUNION'], keys); if (options?.WEIGHTS) { @@ -24,4 +27,4 @@ export function transformArguments(keys: Array | string, options?: ZUnio return args; } -export declare function transformReply(): Array; +export declare function transformReply(): Array; diff --git a/packages/client/lib/commands/ZUNIONSTORE.ts b/packages/client/lib/commands/ZUNIONSTORE.ts index 406f0430c5..2a42e21bc8 100644 --- a/packages/client/lib/commands/ZUNIONSTORE.ts +++ b/packages/client/lib/commands/ZUNIONSTORE.ts @@ -1,4 +1,4 @@ -import { RedisCommandArguments } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; @@ -8,7 +8,11 @@ interface ZUnionOptions { AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } -export function transformArguments(destination: string, keys: Array | string, options?: ZUnionOptions): RedisCommandArguments { +export function transformArguments( + destination: RedisCommandArgument, + keys: Array | RedisCommandArgument, + options?: ZUnionOptions +): RedisCommandArguments { const args = pushVerdictArgument(['ZUNIONSTORE', destination], keys); if (options?.WEIGHTS) { diff --git a/packages/client/lib/commands/ZUNION_WITHSCORES.ts b/packages/client/lib/commands/ZUNION_WITHSCORES.ts index 5896c89ea1..168cc929ac 100644 --- a/packages/client/lib/commands/ZUNION_WITHSCORES.ts +++ b/packages/client/lib/commands/ZUNION_WITHSCORES.ts @@ -10,4 +10,4 @@ export function transformArguments(...args: Parameters { - describe('transformReplyBoolean', () => { + describe('transformBooleanReply', () => { it('0', () => { assert.equal( - transformReplyBoolean(0), + transformBooleanReply(0), false ); }); it('1', () => { assert.equal( - transformReplyBoolean(1), + transformBooleanReply(1), true ); }); }); - describe('transformReplyBooleanArray', () => { + describe('transformBooleanArrayReply', () => { it('empty array', () => { assert.deepEqual( - transformReplyBooleanArray([]), + transformBooleanArrayReply([]), [] ); }); it('0, 1', () => { assert.deepEqual( - transformReplyBooleanArray([0, 1]), + transformBooleanArrayReply([0, 1]), [false, true] ); }); @@ -102,103 +96,87 @@ describe('Generic Transformers', () => { }); }); - describe('transformReplyNumberInfinity', () => { + describe('transformNumberInfinityReply', () => { it('0.5', () => { assert.equal( - transformReplyNumberInfinity('0.5'), + transformNumberInfinityReply('0.5'), 0.5 ); }); it('+inf', () => { assert.equal( - transformReplyNumberInfinity('+inf'), + transformNumberInfinityReply('+inf'), Infinity ); }); it('-inf', () => { assert.equal( - transformReplyNumberInfinity('-inf'), + transformNumberInfinityReply('-inf'), -Infinity ); }); }); - describe('transformReplyNumberInfinityArray', () => { - it('empty array', () => { - assert.deepEqual( - transformReplyNumberInfinityArray([]), - [] - ); - }); - - it('0.5, +inf, -inf', () => { - assert.deepEqual( - transformReplyNumberInfinityArray(['0.5', '+inf', '-inf']), - [0.5, Infinity, -Infinity] - ); - }); - }); - - describe('transformReplyNumberInfinityNull', () => { + describe('transformNumberInfinityNullReply', () => { it('null', () => { assert.equal( - transformReplyNumberInfinityNull(null), + transformNumberInfinityNullReply(null), null ); }); it('1', () => { assert.equal( - transformReplyNumberInfinityNull('1'), + transformNumberInfinityNullReply('1'), 1 ); }); }); - describe('transformArgumentNumberInfinity', () => { + describe('transformNumberInfinityArgument', () => { it('0.5', () => { assert.equal( - transformArgumentNumberInfinity(0.5), + transformNumberInfinityArgument(0.5), '0.5' ); }); it('Infinity', () => { assert.equal( - transformArgumentNumberInfinity(Infinity), + transformNumberInfinityArgument(Infinity), '+inf' ); }); it('-Infinity', () => { assert.equal( - transformArgumentNumberInfinity(-Infinity), + transformNumberInfinityArgument(-Infinity), '-inf' ); }); }); - describe('transformArgumentStringNumberInfinity', () => { + describe('transformStringNumberInfinityArgument', () => { it("'0.5'", () => { assert.equal( - transformArgumentStringNumberInfinity('0.5'), + transformStringNumberInfinityArgument('0.5'), '0.5' ); }); it('0.5', () => { assert.equal( - transformArgumentStringNumberInfinity(0.5), + transformStringNumberInfinityArgument(0.5), '0.5' ); }); }); - it('transformReplyStringTuples', () => { + it('transformTuplesReply', () => { assert.deepEqual( - transformReplyStringTuples(['key1', 'value1', 'key2', 'value2']), + transformTuplesReply(['key1', 'value1', 'key2', 'value2']), Object.create(null, { key1: { value: 'value1', @@ -214,27 +192,9 @@ describe('Generic Transformers', () => { ); }); - it('transformReplyBufferTuples', () => { + it('transformStreamMessagesReply', () => { assert.deepEqual( - 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']]]), + transformStreamMessagesReply([['0-0', ['0key', '0value']], ['1-0', ['1key', '1value']]]), [{ id: '0-0', message: Object.create(null, { @@ -257,45 +217,17 @@ describe('Generic Transformers', () => { ); }); - 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', () => { + describe('transformStreamsMessagesReply', () => { it('null', () => { assert.equal( - transformReplyStreamsStringMessages(null), + transformStreamsMessagesReply(null), null ); }); it('with messages', () => { assert.deepEqual( - transformReplyStreamsStringMessages([['stream1', [['0-1', ['11key', '11value']], ['1-1', ['12key', '12value']]]], ['stream2', [['0-2', ['2key1', '2value1', '2key2', '2value2']]]]]), + transformStreamsMessagesReply([['stream1', [['0-1', ['11key', '11value']], ['1-1', ['12key', '12value']]]], ['stream2', [['0-2', ['2key1', '2value1', '2key2', '2value2']]]]]), [{ name: 'stream1', messages: [{ @@ -339,77 +271,9 @@ describe('Generic Transformers', () => { }); }); - 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', () => { + it('transformSortedSetWithScoresReply', () => { assert.deepEqual( - transformReplySortedStringsSetWithScores(['member1', '0.5', 'member2', '+inf', 'member3', '-inf']), + transformSortedSetWithScoresReply(['member1', '0.5', 'member2', '+inf', 'member3', '-inf']), [{ value: 'member1', score: 0.5 @@ -423,29 +287,6 @@ 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( @@ -721,29 +562,6 @@ describe('Generic Transformers', () => { }); }); - describe('pushStringTuplesArguments', () => { - it("['key1', 'value1', 'key2', 'value2']", () => { - assert.deepEqual( - pushStringTuplesArguments([], ['key1', 'value1', 'key2', 'value2']), - ['key1', 'value1', 'key2', 'value2'] - ); - }); - - it("[['key1', 'value1'], ['key2', 'value2']]", () => { - assert.deepEqual( - pushStringTuplesArguments([], [['key1', 'value1'], ['key2', 'value2']]), - ['key1', 'value1', 'key2', 'value2'] - ); - }); - - it("{key1: 'value1'. key2: 'value2'}", () => { - assert.deepEqual( - pushStringTuplesArguments([], { key1: 'value1', key2: 'value2' }), - ['key1', 'value1', 'key2', 'value2'] - ); - }); - }); - describe('pushVerdictArguments', () => { it('string', () => { assert.deepEqual( diff --git a/packages/client/lib/commands/generic-transformers.ts b/packages/client/lib/commands/generic-transformers.ts index 10729132fa..0799476ae6 100644 --- a/packages/client/lib/commands/generic-transformers.ts +++ b/packages/client/lib/commands/generic-transformers.ts @@ -1,11 +1,11 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; -export function transformReplyBoolean(reply: number): boolean { +export function transformBooleanReply(reply: number): boolean { return reply === 1; } -export function transformReplyBooleanArray(reply: Array): Array { - return reply.map(transformReplyBoolean); +export function transformBooleanArrayReply(reply: Array): Array { + return reply.map(transformBooleanReply); } export type BitValue = 0 | 1; @@ -15,7 +15,11 @@ export interface ScanOptions { COUNT?: number; } -export function pushScanArguments(args: Array, cursor: number, options?: ScanOptions): Array { +export function pushScanArguments( + args: RedisCommandArguments, + cursor: number, + options?: ScanOptions +): RedisCommandArguments { args.push(cursor.toString()); if (options?.MATCH) { @@ -29,8 +33,8 @@ export function pushScanArguments(args: Array, cursor: number, options?: return args; } -export function transformReplyNumberInfinity(reply: string): number { - switch (reply) { +export function transformNumberInfinityReply(reply: RedisCommandArgument): number { + switch (reply.toString()) { case '+inf': return Infinity; @@ -42,21 +46,17 @@ export function transformReplyNumberInfinity(reply: string): number { } } -export function transformReplyNumberInfinityArray(reply: Array): Array { - return reply.map(transformReplyNumberInfinity); -} - -export function transformReplyNumberInfinityNull(reply: string | null): number | null { +export function transformNumberInfinityNullReply(reply: RedisCommandArgument | null): number | null { if (reply === null) return null; - return transformReplyNumberInfinity(reply); + return transformNumberInfinityReply(reply); } -export function transformReplyNumberInfinityNullArray(reply: Array): Array { - return reply.map(transformReplyNumberInfinityNull); +export function transformNumberInfinityNullArrayReply(reply: Array): Array { + return reply.map(transformNumberInfinityNullReply); } -export function transformArgumentNumberInfinity(num: number): string { +export function transformNumberInfinityArgument(num: number): string { switch (num) { case Infinity: return '+inf'; @@ -69,24 +69,15 @@ export function transformArgumentNumberInfinity(num: number): string { } } -export function transformArgumentStringNumberInfinity(num: string | number): string { - if (typeof num === 'string') return num; +export function transformStringNumberInfinityArgument(num: RedisCommandArgument | number): RedisCommandArgument { + if (typeof num !== 'number') return num; - return transformArgumentNumberInfinity(num); + return transformNumberInfinityArgument(num); } -export function transformReplyStringTuples(reply: Array): Record { - const message = Object.create(null); - - for (let i = 0; i < reply.length; i += 2) { - message[reply[i]] = reply[i + 1]; - } - - return message; -} - - -export function transformReplyBufferTuples(reply: Array): Record { +export function transformTuplesReply( + reply: Array +): Record { const message = Object.create(null); for (let i = 0; i < reply.length; i += 2) { @@ -96,99 +87,63 @@ export function transformReplyBufferTuples(reply: Array): Record; +export interface StreamMessageReply { + id: RedisCommandArgument; + message: Record; } -export type StreamStringsMessagesReply = Array; +export type StreamMessagesReply = Array; -export function transformReplyStreamStringMessages(reply: Array): StreamStringsMessagesReply { +export function transformStreamMessagesReply(reply: Array): StreamMessagesReply { const messages = []; for (const [id, message] of reply) { messages.push({ id, - message: transformReplyStringTuples(message) + message: transformTuplesReply(message) }); } return messages; } -interface StreamBufferMessageReply { - id: Buffer; - message: Record; -} - -export type StreamBufferMessagesReply = Array; - -export function transformReplyStreamBufferMessages(reply: Array): StreamBufferMessagesReply { - const messages = []; - - for (const [id, message] of reply) { - messages.push({ - id, - message: transformReplyBufferTuples(message) - }); - } - - return messages; -} - -export type StreamsStringMessagesReply = Array<{ - name: string; - messages: StreamStringsMessagesReply; +export type StreamsMessagesReply = Array<{ + name: RedisCommandArgument; + messages: StreamMessagesReply; }> | null; -export function transformReplyStreamsStringMessages(reply: Array | null): StreamsStringMessagesReply | null { +export function transformStreamsMessagesReply(reply: Array | null): StreamsMessagesReply | null { if (reply === null) return null; return reply.map(([name, rawMessages]) => ({ name, - messages: transformReplyStreamStringMessages(rawMessages) + messages: transformStreamMessagesReply(rawMessages) })); } -export type StreamsBufferMessagesReply = Array<{ - name: Buffer; - messages: StreamBufferMessagesReply; -}> | null; - -export function transformReplyStreamsBufferMessages(reply: Array | null): StreamsBufferMessagesReply | null { - if (reply === null) return null; - - return reply.map(([name, rawMessages]) => ({ - name, - messages: transformReplyStreamBufferMessages(rawMessages) - })); -} - -export interface ZMember { +export interface ZMember { score: number; - value: T; + value: RedisCommandArgument; } -export function transformReplySortedStringsSetWithScores(reply: Array): Array> { +export function transformSortedSetMemberNullReply( + reply: [RedisCommandArgument, RedisCommandArgument] | [] +): ZMember | null { + if (!reply.length) return null; + + return { + value: reply[0], + score: transformNumberInfinityReply(reply[1]) + }; +} + +export function transformSortedSetWithScoresReply(reply: Array): Array { const members = []; for (let i = 0; i < reply.length; i += 2) { members.push({ value: reply[i], - score: transformReplyNumberInfinity(reply[i + 1]) - }); - } - - return members; -} - -export function transformReplySortedBuffersSetWithScores(reply: Array): Array> { - const members = []; - - for (let i = 0; i < reply.length; i += 2) { - members.push({ - value: reply[i], - score: transformReplyNumberInfinity(reply[i + 1].toString()) + score: transformNumberInfinityReply(reply[i + 1]) }); } @@ -200,7 +155,10 @@ type GeoCountArgument = number | { ANY?: true }; -export function pushGeoCountArgument(args: Array, count: GeoCountArgument | undefined): Array { +export function pushGeoCountArgument( + args: RedisCommandArguments, + count: GeoCountArgument | undefined +): RedisCommandArguments { if (typeof count === 'number') { args.push('COUNT', count.toString()); } else if (count) { @@ -244,12 +202,12 @@ export interface GeoSearchOptions { } export function pushGeoSearchArguments( - args: Array, - key: string, + args: RedisCommandArguments, + key: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchOptions -): Array { +): RedisCommandArguments { args.push(key); if (typeof from === 'string') { @@ -354,20 +312,6 @@ export function pushEvalArguments(args: Array, options?: EvalOptions): A return args; } -export type StringTuplesArguments = Array<[string, string]> | Array | Record; - -export function pushStringTuplesArguments(args: Array, tuples: StringTuplesArguments): Array { - if (Array.isArray(tuples)) { - args.push(...tuples.flat()); - } else { - for (const key of Object.keys(tuples)) { - args.push(key, tuples[key]); - } - } - - return args; -} - export function pushVerdictArguments(args: RedisCommandArguments, value: RedisCommandArgument | Array): RedisCommandArguments { if (Array.isArray(value)) { args.push(...value); @@ -378,17 +322,24 @@ export function pushVerdictArguments(args: RedisCommandArguments, value: RedisCo return args; } -export function pushVerdictArgument(args: RedisCommandArguments, value: string | Array): RedisCommandArguments { - if (typeof value === 'string') { - args.push('1', value); - } else { +export function pushVerdictArgument( + args: RedisCommandArguments, + value: RedisCommandArgument | Array +): RedisCommandArguments { + if (Array.isArray(value)) { args.push(value.length.toString(), ...value); + } else { + args.push('1', value); } return args; } -export function pushOptionalVerdictArgument(args: RedisCommandArguments, name: string, value: undefined | string | Array): RedisCommandArguments { +export function pushOptionalVerdictArgument( + args: RedisCommandArguments, + name: RedisCommandArgument, + value: undefined | RedisCommandArgument | Array +): RedisCommandArguments { if (value === undefined) return args; args.push(name); diff --git a/packages/client/lib/commands/index.ts b/packages/client/lib/commands/index.ts index 03aaf93fb1..c589770a94 100644 --- a/packages/client/lib/commands/index.ts +++ b/packages/client/lib/commands/index.ts @@ -1,6 +1,10 @@ import { RedisScriptConfig, SHA1 } from '../lua-script'; -export type RedisCommandRawReply = string | number | Buffer | Array | null | undefined; + +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface RedisCommandRawReplyArray extends Array {} +export type RedisCommandRawReply = string | number | Buffer | null | undefined | RedisCommandRawReplyArray; export type RedisCommandArgument = string | Buffer; @@ -10,8 +14,7 @@ export interface RedisCommand { FIRST_KEY_INDEX?: number | ((...args: Array) => RedisCommandArgument); IS_READ_ONLY?: boolean; transformArguments(this: void, ...args: Array): RedisCommandArguments; - BUFFER_MODE?: boolean; - transformReply?(this: void, reply: RedisCommandRawReply, preserved?: unknown): any; + transformReply?(this: void, reply: any, preserved?: any): any; } export type RedisCommandReply = C['transformReply'] extends (...args: any) => infer T ? T : RedisCommandRawReply; diff --git a/packages/client/lib/lua-script.ts b/packages/client/lib/lua-script.ts index 57de985733..8a0481364c 100644 --- a/packages/client/lib/lua-script.ts +++ b/packages/client/lib/lua-script.ts @@ -10,7 +10,7 @@ export interface SHA1 { SHA1: string; } -export function defineScript(script: TScript): TScript & SHA1 { +export function defineScript(script: S): S & SHA1 { return { ...script, SHA1: scriptSha1(script.SCRIPT) diff --git a/packages/client/package.json b/packages/client/package.json index 8916ec1a57..25afddbaaa 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -4,6 +4,9 @@ "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], "scripts": { "test": "nyc -r text-summary -r lcov mocha -r source-map-support/register -r ts-node/register './lib/**/*.spec.ts'", "build": "tsc", @@ -19,20 +22,20 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "@types/redis-parser": "^3.0.0", "@types/sinon": "^10.0.6", "@types/yallist": "^4.0.1", - "@typescript-eslint/eslint-plugin": "^5.7.0", - "@typescript-eslint/parser": "^5.7.0", - "eslint": "^8.4.1", + "@typescript-eslint/eslint-plugin": "^5.8.0", + "@typescript-eslint/parser": "^5.8.0", + "eslint": "^8.5.0", "nyc": "^15.1.0", "release-it": "^14.11.8", "sinon": "^12.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" }, "engines": { "node": ">=12" diff --git a/packages/json/lib/commands/RESP.ts b/packages/json/lib/commands/RESP.ts index 2b56bf1f05..fcf54cd353 100644 --- a/packages/json/lib/commands/RESP.ts +++ b/packages/json/lib/commands/RESP.ts @@ -12,4 +12,4 @@ export function transformArguments(key: string, path?: string): Array { type RESPReply = Array; -export declare function transfromReply(): RESPReply; +export declare function transformReply(): RESPReply; diff --git a/packages/json/lib/commands/index.ts b/packages/json/lib/commands/index.ts index a3c561addc..f898fde584 100644 --- a/packages/json/lib/commands/index.ts +++ b/packages/json/lib/commands/index.ts @@ -62,9 +62,14 @@ export default { type: TYPE }; -// using two "objects" and not `Record` cause of: -// https://github.com/microsoft/TypeScript/issues/14174 -export type RedisJSON = null | boolean | number | string | Date | Array | { [key: string]: RedisJSON } | { [key: number]: RedisJSON }; +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface RedisJSONArray extends Array {} +interface RedisJSONObject { + [key: string]: RedisJSON; + [key: number]: RedisJSON; +} +export type RedisJSON = null | boolean | number | string | Date | RedisJSONArray | RedisJSONObject; export function transformRedisJsonArgument(json: RedisJSON): string { return JSON.stringify(json); diff --git a/packages/json/package.json b/packages/json/package.json index 57e5a2357c..445a95e9e3 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -4,6 +4,9 @@ "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], "scripts": { "test": "nyc -r text-summary -r lcov mocha -r source-map-support/register -r ts-node/register './lib/**/*.spec.ts'", "build": "tsc", @@ -15,12 +18,12 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" } } diff --git a/packages/search/lib/commands/AGGREGATE.ts b/packages/search/lib/commands/AGGREGATE.ts index f305fbc6cf..84a8f9a55a 100644 --- a/packages/search/lib/commands/AGGREGATE.ts +++ b/packages/search/lib/commands/AGGREGATE.ts @@ -1,6 +1,6 @@ -import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands'; -import { pushVerdictArgument, transformReplyStringTuples } from '@node-redis/client/dist/lib/commands/generic-transformers'; -import { AggregateReply, PropertyName, pushArgumentsWithLength, pushSortByArguments, SortByProperty } from '.'; +import { RedisCommandArgument, RedisCommandArguments } from '@node-redis/client/dist/lib/commands'; +import { pushVerdictArgument, transformTuplesReply } from '@node-redis/client/dist/lib/commands/generic-transformers'; +import { PropertyName, pushArgumentsWithLength, pushSortByArguments, SortByProperty } from '.'; export enum AggregateSteps { GROUPBY = 'GROUPBY', @@ -273,14 +273,19 @@ function pushGroupByReducer(args: RedisCommandArguments, reducer: GroupByReducer export type AggregateRawReply = [ total: number, - ...results: Array> + ...results: Array> ]; +export interface AggregateReply { + total: number; + results: Array>; +} + export function transformReply(rawReply: AggregateRawReply): AggregateReply { - const results: Array> = []; + const results: Array> = []; for (let i = 1; i < rawReply.length; i++) { results.push( - transformReplyStringTuples(rawReply[i] as Array) + transformTuplesReply(rawReply[i] as Array) ); } diff --git a/packages/search/lib/commands/SEARCH.ts b/packages/search/lib/commands/SEARCH.ts index 3a71ec26ba..efbe24e151 100644 --- a/packages/search/lib/commands/SEARCH.ts +++ b/packages/search/lib/commands/SEARCH.ts @@ -1,5 +1,5 @@ import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands'; -import { transformReplyStringTuples } from '@node-redis/client/dist/lib/commands/generic-transformers'; +import { transformTuplesReply } 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]) : - transformReplyStringTuples(tuples) + transformTuplesReply(tuples) }); } diff --git a/packages/search/lib/commands/SUGDEL.ts b/packages/search/lib/commands/SUGDEL.ts index 43f4744c00..c6b236f496 100644 --- a/packages/search/lib/commands/SUGDEL.ts +++ b/packages/search/lib/commands/SUGDEL.ts @@ -2,4 +2,4 @@ export function transformArguments(key: string, string: string): Array { return ['FT.SUGDEL', key, string]; } -export { transformReplyBoolean as transformReply } from '@node-redis/client/dist/lib/commands/generic-transformers'; +export { transformBooleanReply as transformReply } from '@node-redis/client/dist/lib/commands/generic-transformers'; diff --git a/packages/search/lib/commands/index.ts b/packages/search/lib/commands/index.ts index 9b717f64a4..305b0f81fc 100644 --- a/packages/search/lib/commands/index.ts +++ b/packages/search/lib/commands/index.ts @@ -396,10 +396,6 @@ export interface SearchReply { }>; } -export interface AggregateReply { - total: number; - results: Array>; -} export interface ProfileOptions { LIMITED?: true; @@ -420,8 +416,8 @@ export type ProfileRawReply = [ ]; export interface ProfileReply { - results: SearchReply | AggregateReply, - profile: ProfileData + results: SearchReply | AGGREGATE.AggregateReply; + profile: ProfileData; } interface ChildIterator { diff --git a/packages/search/package.json b/packages/search/package.json index bca7619b84..c15585746b 100644 --- a/packages/search/package.json +++ b/packages/search/package.json @@ -4,6 +4,9 @@ "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], "scripts": { "test": "nyc -r text-summary -r lcov mocha -r source-map-support/register -r ts-node/register './lib/**/*.spec.ts'", "build": "tsc", @@ -15,12 +18,12 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" } } diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 36caf2d10e..233d7f279a 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -12,14 +12,14 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^9.0.0", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "@types/yargs": "^17.0.7", "mocha": "^9.1.3", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", - "typescript": "^4.5.3", + "typescript": "^4.5.4", "yargs": "^17.3.0" } } diff --git a/packages/time-series/lib/commands/CREATERULE.ts b/packages/time-series/lib/commands/CREATERULE.ts index 8d39722c9e..9e3d25a4c8 100644 --- a/packages/time-series/lib/commands/CREATERULE.ts +++ b/packages/time-series/lib/commands/CREATERULE.ts @@ -18,4 +18,4 @@ export function transformArguments( ]; } -export declare function transfromReply(): 'OK'; +export declare function transformReply(): 'OK'; diff --git a/packages/time-series/lib/commands/DELETERULE.ts b/packages/time-series/lib/commands/DELETERULE.ts index fff00a906a..1714d51093 100644 --- a/packages/time-series/lib/commands/DELETERULE.ts +++ b/packages/time-series/lib/commands/DELETERULE.ts @@ -8,4 +8,4 @@ export function transformArguments(sourceKey: string, destinationKey: string): A ]; } -export declare function transfromReply(): 'OK'; +export declare function transformReply(): 'OK'; diff --git a/packages/time-series/package.json b/packages/time-series/package.json index fefb8891be..04e18b75f9 100644 --- a/packages/time-series/package.json +++ b/packages/time-series/package.json @@ -4,6 +4,9 @@ "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], "scripts": { "test": "nyc -r text-summary -r lcov mocha -r source-map-support/register -r ts-node/register './lib/**/*.spec.ts'", "build": "tsc", @@ -15,12 +18,12 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@node-redis/test-utils": "*", - "@types/node": "^16.11.12", + "@types/node": "^17.0.1", "nyc": "^15.1.0", "release-it": "^14.11.8", "source-map-support": "^0.5.21", "ts-node": "^10.4.0", "typedoc": "^0.22.10", - "typescript": "^4.5.3" + "typescript": "^4.5.4" } }