pax_global_header00006660000000000000000000000064143377411440014522gustar00rootroot0000000000000052 comment=55a3a5165decdd2b9b048a3138fef2b3ecc42969 node-redis-redis-4.5.1/000077500000000000000000000000001433774114400146665ustar00rootroot00000000000000node-redis-redis-4.5.1/.deepsource.toml000066400000000000000000000002061433774114400177750ustar00rootroot00000000000000version = 1 [[analyzers]] name = "javascript" enabled = true [analyzers.meta] environment = ["nodejs"] dialect = "typescript" node-redis-redis-4.5.1/.github/000077500000000000000000000000001433774114400162265ustar00rootroot00000000000000node-redis-redis-4.5.1/.github/ISSUE_TEMPLATE/000077500000000000000000000000001433774114400204115ustar00rootroot00000000000000node-redis-redis-4.5.1/.github/ISSUE_TEMPLATE/bug-report.md000066400000000000000000000006261433774114400230250ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve title: '' labels: Bug assignees: '' --- **Environment:** - **Node.js Version**: - **Redis Server Version**: - **Node Redis Version**: - **Platform**: node-redis-redis-4.5.1/.github/ISSUE_TEMPLATE/feature-request.md000066400000000000000000000001521433774114400240520ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for this project title: '' labels: Bug assignees: '' --- node-redis-redis-4.5.1/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000012261433774114400220300ustar00rootroot00000000000000### Description > Describe your pull request here --- ### Checklist - [ ] Does `npm test` pass with this change (including linting)? - [ ] Is the new or changed code fully tested? - [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)? node-redis-redis-4.5.1/.github/release-drafter-config.yml000066400000000000000000000014741433774114400232670ustar00rootroot00000000000000name-template: 'Version $NEXT_PATCH_VERSION' tag-template: 'v$NEXT_PATCH_VERSION' autolabeler: - label: 'chore' files: - '*.md' - '.github/*' - label: 'bug' branch: - '/bug-.+' - label: 'chore' branch: - '/chore-.+' - label: 'feature' branch: - '/feature-.+' categories: - title: 'Breaking Changes' labels: - 'breakingchange' - title: '🚀 New Features' labels: - 'feature' - 'enhancement' - title: '🐛 Bug Fixes' labels: - 'fix' - 'bugfix' - 'bug' - title: '🧰 Maintenance' label: 'chore' change-template: '- $TITLE (#$NUMBER)' exclude-labels: - 'skip-changelog' template: | ## Changes $CHANGES ## Contributors We'd like to thank all the contributors who worked on this release! $CONTRIBUTORS node-redis-redis-4.5.1/.github/workflows/000077500000000000000000000000001433774114400202635ustar00rootroot00000000000000node-redis-redis-4.5.1/.github/workflows/documentation.yml000066400000000000000000000012771433774114400236660ustar00rootroot00000000000000name: Documentation on: push: branches: - master - v4.0 jobs: documentation: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 with: fetch-depth: 1 - name: Use Node.js uses: actions/setup-node@v2.3.0 - name: Install Packages run: npm ci - name: Build tests tools run: npm run build:tests-tools - name: Generate Documentation run: npm run documentation - name: Upload run: | git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git npm run gh-pages env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} node-redis-redis-4.5.1/.github/workflows/release-drafter.yml000066400000000000000000000010621433774114400240520ustar00rootroot00000000000000name: Release Drafter on: push: # branches to consider in the event; optional, defaults to all branches: - master jobs: update_release_draft: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v5 with: # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml config-name: release-drafter-config.yml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} node-redis-redis-4.5.1/.github/workflows/tests.yml000066400000000000000000000026411433774114400221530ustar00rootroot00000000000000name: Tests on: push: branches: - master - v4.0 pull_request: branches: - master - v4.0 jobs: tests: runs-on: ubuntu-latest strategy: fail-fast: false matrix: node-version: ['14', '16', '18', '19'] redis-version: ['5', '6.0', '6.2', '7.0'] steps: - uses: actions/checkout@v2.3.4 with: fetch-depth: 1 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2.3.0 with: node-version: ${{ matrix.node-version }} - name: Update npm run: npm i -g npm if: ${{ matrix.node-version <= 14 }} - name: Install Packages run: npm ci - name: Build tests tools run: npm run build:tests-tools - name: Run Tests run: npm run test -- -- --forbid-only --redis-version=${{ matrix.redis-version }} - name: Upload to Codecov run: | curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig gpgv codecov.SHA256SUM.sig codecov.SHA256SUM shasum -a 256 -c codecov.SHA256SUM chmod +x codecov ./codecov node-redis-redis-4.5.1/.gitignore000066400000000000000000000001351433774114400166550ustar00rootroot00000000000000.idea/ .nyc_output/ .vscode/ coverage/ dist/ node_modules/ .DS_Store dump.rdb documentation/ node-redis-redis-4.5.1/.npmignore000066400000000000000000000002241433774114400166630ustar00rootroot00000000000000.github/ .vscode/ docs/ examples/ packages/ .deepsource.toml .release-it.json CONTRIBUTING.md SECURITY.md index.ts tsconfig.base.json tsconfig.json node-redis-redis-4.5.1/.release-it.json000066400000000000000000000002131433774114400176650ustar00rootroot00000000000000{ "git": { "tagName": "redis@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" } } node-redis-redis-4.5.1/CHANGELOG.md000066400000000000000000001236451433774114400165120ustar00rootroot00000000000000# Changelog ## v4.0.2 - 13 Jan, 2022 ### Fixes - Fix v4 commands in legacy mode (#1820) - Fix `EXISTS` command reply (#1819) - Fix handler for "__redis__:invalidate" messages (#1798) - Fix "SEPARATOR" typo in RediSearch (#1823) ### Enhancements - First release of `@node-redis/bloom` - Add support for `Buffer`s - Enhance `ASK` and `MOVED` errors handler ## v4.0.1 - 13 Dec, 2021 ### Fixes - Fix `NOAUTH` error when using authentication & database (#1681) - Allow to `.quit()` in PubSub mode (#1766) - Add an option to configurate `name` on a client (#1758) - Lowercase commands (`client.hset`) in `legacyMode` - Fix PubSub resubscribe (#1764) - Fix `RedisSocketOptions` type (#1741) ### Enhancements - Add support for `number`s and `Buffer`s in `HSET` (#1738 #1739) - Export `RedisClientType`, `RedisClusterType` and some more types (#1673) - First release of `@node-redis/time-series` ## v4.0.0 - 24 Nov, 2021 This version is a major change and refactor, adding modern JavaScript capabilities and multiple breaking changes. See the [migration guide](./docs/v3-to-v4.md) for tips on how to upgrade. ### Breaking Changes - All functions return Promises by default - Dropped support for Node.js 10.x, the minimum supported Node.js version is now 12.x - `createClient` takes new and different arguments - The `prefix`, `rename_commands` configuration options to `createClient` have been removed - The `enable_offline_queue` configuration option is removed, executing commands on a closed client (without calling `.connect()` or after calling `.disconnect()`) will reject immediately - Login credentials are no longer saved when using `.auth()` directly ### Features - Added support for Promises - Added built-in TypeScript declaration files enabling code completion - Added support for [clustering](./README.md#cluster) - Added idiomatic arguments and responses to [Redis commands](./README.md#redis-commands) - Added full support for [Lua Scripts](./README.md#lua-scripts) - Added support for [SCAN iterators](./README.md#scan-iterator) - Added the ability to extend Node Redis with Redis Module commands ## v3.1.2 ### Fixes - Exclude unnecessary files from tarball ## v3.1.1 ### Enhancements - Upgrade node and dependencies ### Fixes - Fix a potential exponential regex in monitor mode ## v3.1.0 - 31 Mar, 2021 ### Enhancements - Upgrade node and dependencies and redis-commands to support Redis 6 - Add support for Redis 6 `auth pass [user]` ## v3.0.0 - 09 Feb, 2020 This version is mainly a release to distribute all the unreleased changes on master since 2017 and additionally removes a lot of old deprecated features and old internals in preparation for an upcoming modernization refactor (v4). ### Breaking Changes - Dropped support for Node.js < 6 - Dropped support for `hiredis` (no longer required) - Removed previously deprecated `drain` event - Removed previously deprecated `idle` event - Removed previously deprecated `parser` option - Removed previously deprecated `max_delay` option - Removed previously deprecated `max_attempts` option - Removed previously deprecated `socket_no_delay` option ### Bug Fixes - Removed development files from published package (#1370) - Duplicate function now allows db param to be passed (#1311) ### Features - Upgraded to latest `redis-commands` package - Upgraded to latest `redis-parser` package, v3.0.0, which brings performance improvements - Replaced `double-ended-queue` with `denque`, which brings performance improvements - Add timestamps to debug traces - Add `socket_initial_delay` option for `socket.setKeepAlive` (#1396) - Add support for `rediss` protocol in url (#1282) ## v2.8.0 - 31 Jul, 2017 Features - Accept UPPER_CASE commands in send_command - Add arbitrary commands to the prototype by using `Redis.addCommand(name)` Bugfixes - Fixed not always copying subscribe unsubscribe arguments - Fixed emitting internal errors while reconnecting with auth - Fixed crashing with invalid url option ## v2.7.1 - 14 Mar, 2017 Bugfixes - Fixed monitor mode not working in combination with IPv6 (2.6.0 regression) ## v2.7.0 - 11 Mar, 2017 Features - All returned errors are from now a subclass of `RedisError`. Bugfixes - Fixed rename_commands not accepting `null` as value - Fixed `AbortError`s and `AggregateError`s not showing the error message in the stack trace ## v2.6.5 - 15 Jan, 2017 Bugfixes - Fixed parser not being reset in case the redis connection closed ASAP for overcoming of output buffer limits - Fixed parser reset if (p)message_buffer listener is attached ## v2.6.4 - 12 Jan, 2017 Bugfixes - Fixed monitor mode not working in combination with IPv6, sockets or lua scripts (2.6.0 regression) ## v2.6.3 - 31 Oct, 2016 Bugfixes - Do not change the tls setting to camel_case - Fix domain handling in combination with the offline queue (2.5.3 regression) ## v2.6.2 - 16 Jun, 2016 Bugfixes - Fixed individual callbacks of a transaction not being called (2.6.0 regression) ## v2.6.1 - 02 Jun, 2016 Bugfixes - Fixed invalid function name being exported ## v2.6.0 - 01 Jun, 2016 In addition to the pre-releases the following changes exist in v.2.6.0: Features - Updated [redis-parser](https://github.com/NodeRedis/node-redis-parser) dependency ([changelog](https://github.com/NodeRedis/node-redis-parser/releases/tag/v.2.0.0)) - The JS parser is from now on the new default as it is a lot faster than the hiredis parser - This is no BC as there is no changed behavior for the user at all but just a performance improvement. Explicitly requireing the Hiredis parser is still possible. - Added name property to all Redis functions (Node.js >= 4.0) - Improved stack traces in development and debug mode Bugfixes - Reverted support for `__proto__` (v.2.6.0-2) to prevent and breaking change Deprecations - The `parser` option is deprecated and should be removed. The built-in Javascript parser is a lot faster than the hiredis parser and has more features ## v2.6.0-2 - 29 Apr, 2016 Features - Added support for the new [CLIENT REPLY ON|OFF|SKIP](http://redis.io/commands/client-reply) command (Redis v.3.2) - Added support for camelCase - The Node.js landscape default is to use camelCase. node_redis is a bit out of the box here but from now on it is possible to use both, just as you prefer! - If there's any documented variable missing as camelCased, please open a issue for it - Improve error handling significantly - Only emit an error if the error has not already been handled in a callback - Improved unspecific error messages e.g. "Connection gone from end / close event" - Added `args` to command errors to improve identification of the error - Added origin to errors if there's e.g. a connection error - Added ReplyError class. All Redis errors are from now on going to be of that class - Added AbortError class. A subclass of AbortError. All unresolved and by node_redis rejected commands are from now on of that class - Added AggregateError class. If a unresolved and by node_redis rejected command has no callback and this applies to more than a single command, the errors for the commands without callback are aggregated to a single error that is emitted in debug_mode in that case. - Added `message_buffer` / `pmessage_buffer` events. That event is always going to emit a buffer - Listening to the `message` event at the same time is always going to return the same message as string - Added callback option to the duplicate function - Added support for `__proto__` and other reserved keywords as hgetall field - Updated [redis-commands](https://github.com/NodeRedis/redis-commands) dependency ([changelog](https://github.com/NodeRedis/redis-commands/releases/tag/v.1.2.0)) Bugfixes - Fixed v.2.5.0 auth command regression (under special circumstances a reconnect would not authenticate properly) - Fixed v.2.6.0-0 pub sub mode and quit command regressions: - Entering pub sub mode not working if a earlier called and still running command returned an error - Unsubscribe callback not called if unsubscribing from all channels and resubscribing right away - Quit command resulting in an error in some cases - Fixed special handled functions in batch and multi context not working the same as without (e.g. select and info) - Be aware that not all commands work in combination with transactions but they all work with batch - Fixed address always set to 127.0.0.1:6379 in case host / port is set in the `tls` options instead of the general options ## v2.6.0-1 - 01 Apr, 2016 A second pre-release with further fixes. This is likely going to be released as 2.6.0 stable without further changes. Features - Added type validations for client.send_command arguments Bugfixes - Fixed client.send_command not working properly with every command and every option - Fixed pub sub mode unsubscribing from all channels in combination with the new `string_numbers` option crashing - Fixed pub sub mode unsubscribing from all channels not respected while reconnecting - Fixed pub sub mode events in combination with the `string_numbers` option emitting the number of channels not as number ## v2.6.0-0 - 27 Mar, 2016 This is mainly a very important bug fix release with some smaller features. Features - Monitor and pub sub mode now work together with the offline queue - All commands that were send after a connection loss are now going to be send after reconnecting - Activating monitor mode does now work together with arbitrary commands including pub sub mode - Pub sub mode is completely rewritten and all known issues fixed - Added `string_numbers` option to get back strings instead of numbers - Quit command is from now on always going to end the connection properly Bugfixes - Fixed calling monitor command while other commands are still running - Fixed monitor and pub sub mode not working together - Fixed monitor mode not working in combination with the offline queue - Fixed pub sub mode not working in combination with the offline queue - Fixed pub sub mode resubscribing not working with non utf8 buffer channels - Fixed pub sub mode crashing if calling unsubscribe / subscribe in various combinations - Fixed pub sub mode emitting unsubscribe even if no channels were unsubscribed - Fixed pub sub mode emitting a message without a message published - Fixed quit command not ending the connection and resulting in further reconnection if called while reconnecting The quit command did not end connections earlier if the connection was down at that time and this could have lead to strange situations, therefor this was fixed to end the connection right away in those cases. ## v2.5.3 - 21 Mar, 2016 Bugfixes - Revert throwing on invalid data types and print a warning instead ## v2.5.2 - 16 Mar, 2016 Bugfixes - Fixed breaking changes against Redis 2.4 introduced in 2.5.0 / 2.5.1 ## v2.5.1 - 15 Mar, 2016 Bugfixes - Fixed info command not working anymore with optional section argument ## v2.5.0 - 15 Mar, 2016 Same changelog as the pre-release ## v2.5.0-1 - 07 Mar, 2016 This is a big release with some substantial underlining changes. Therefor this is released as a pre-release and I encourage anyone who's able to, to test this out. It took way to long to release this one and the next release cycles will be shorter again. This release is also going to deprecate a couple things to prepare for a future v.3 (it'll still take a while to v.3). Features - The parsers moved into the [redis-parser](https://github.com/NodeRedis/node-redis-parser) module and will be maintained in there from now on - Improve js parser speed significantly for big SUNION/SINTER/LRANGE/ZRANGE - Improve redis-url parsing to also accept the database-number and options as query parameters as suggested in [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis) - Added a `retry_unfulfilled_commands` option - Setting this to 'true' results in retrying all commands that were not fulfilled on a connection loss after the reconnect. Use with caution - Added a `db` option to select the database while connecting (this is [not recommended](https://groups.google.com/forum/#!topic/redis-db/vS5wX8X4Cjg)) - Added a `password` option as alias for auth_pass - The client.server_info is from now on updated while using the info command - Gracefuly handle redis protocol errors from now on - Added a `warning` emitter that receives node_redis warnings like auth not required and deprecation messages - Added a `retry_strategy` option that replaces all reconnect options - The reconnecting event from now on also receives: - The error message why the reconnect happened (params.error) - The amount of times the client was connected (params.times_connected) - The total reconnecting time since the last time connected (params.total_retry_time) - Always respect the command execution order no matter if the reply could be returned sync or not (former exceptions: [#937](https://github.com/NodeRedis/node_redis/issues/937#issuecomment-167525939)) - redis.createClient is now checking input values stricter and detects more faulty input - Started refactoring internals into individual modules - Pipelining speed improvements Bugfixes - Fixed explicit undefined as a command callback in a multi context - Fixed hmset failing to detect the first key as buffer or date if the key is of that type - Fixed do not run toString on an array argument and throw a "invalid data" error instead - This is not considered as breaking change, as this is likely a error in your code and if you want to have such a behavior you should handle this beforehand - The same applies to Map / Set and individual Object types - Fixed redis url not accepting the protocol being omitted or protocols other than the redis protocol for convenience - Fixed parsing the db keyspace even if the first database does not begin with a zero - Fixed handling of errors occurring while receiving pub sub messages - Fixed huge string pipelines crashing NodeJS (Pipeline size above 256mb) - Fixed rename_commands and prefix option not working together - Fixed ready being emitted to early in case a slave is still syncing / master down Deprecations - Using any command with a argument being set to null or undefined is deprecated - From v.3.0.0 on using a command with such an argument will return an error instead - If you want to keep the old behavior please use a precheck in your code that converts the arguments to a string. - Using SET or SETEX with a undefined or null value will from now on also result in converting the value to "null" / "undefined" to have a consistent behavior. This is not considered as breaking change, as it returned an error earlier. - Using .end(flush) without the flush parameter is deprecated and the flush parameter should explicitly be used - From v.3.0.0 on using .end without flush will result in an error - Using .end without flush means that any command that did not yet return is going to silently fail. Therefor this is considered harmful and you should explicitly silence such errors if you are sure you want this - Depending on the return value of a command to detect the backpressure is deprecated - From version 3.0.0 on node_redis might not return true / false as a return value anymore. Please rely on client.should_buffer instead - The `socket_nodelay` option is deprecated and will be removed in v.3.0.0 - If you want to buffer commands you should use [.batch or .multi](./README.md) instead. This is necessary to reduce the amount of different options and this is very likely reducing your throughput if set to false. - If you are sure you want to activate the NAGLE algorithm you can still activate it by using client.stream.setNoDelay(false) - The `max_attempts` option is deprecated and will be removed in v.3.0.0. Please use the `retry_strategy` instead - The `retry_max_delay` option is deprecated and will be removed in v.3.0.0. Please use the `retry_strategy` instead - The drain event is deprecated and will be removed in v.3.0.0. Please listen to the stream drain event instead - The idle event is deprecated and will likely be removed in v.3.0.0. If you rely on this feature please open a new ticket in node_redis with your use case - Redis < v. 2.6 is not officially supported anymore and might not work in all cases. Please update to a newer redis version as it is not possible to test for these old versions - Removed non documented command syntax (adding the callback to an arguments array instead of passing it as individual argument) ## v2.4.2 - 27 Nov, 2015 Bugfixes - Fixed not emitting ready after reconnect with disable_resubscribing ([@maxgalbu](https://github.com/maxgalbu)) ## v2.4.1 - 25 Nov, 2015 Bugfixes - Fixed a js parser regression introduced in 2.4.0 ([@BridgeAR](https://github.com/BridgeAR)) ## v2.4.0 - 25 Nov, 2015 Features - Added `tls` option to initiate a connection to a redis server behind a TLS proxy. Thanks ([@paddybyers](https://github.com/paddybyers)) - Added `prefix` option to auto key prefix any command with the provided prefix ([@luin](https://github.com/luin) & [@BridgeAR](https://github.com/BridgeAR)) - Added `url` option to pass the connection url with the options object ([@BridgeAR](https://github.com/BridgeAR)) - Added `client.duplicate([options])` to duplicate the current client and return a new one with the same options ([@BridgeAR](https://github.com/BridgeAR)) - Improve performance by up to 20% on almost all use cases ([@BridgeAR](https://github.com/BridgeAR)) Bugfixes - Fixed js parser handling big values slow ([@BridgeAR](https://github.com/BridgeAR)) - The speed is now on par with the hiredis parser. ## v2.3.1 - 18 Nov, 2015 Bugfixes - Fixed saving buffers with charsets other than utf-8 while using multi ([@BridgeAR](https://github.com/BridgeAR)) - Fixed js parser handling big values very slow ([@BridgeAR](https://github.com/BridgeAR)) - The speed is up to ~500% faster than before but still up to ~50% slower than the hiredis parser. ## v2.3.0 - 30 Oct, 2015 Features - Improve speed further for: ([@BridgeAR](https://github.com/BridgeAR)) - saving big strings (up to +300%) - using .multi / .batch (up to +50% / on Node.js 0.10.x +300%) - saving small buffers - Increased coverage to 99% ([@BridgeAR](https://github.com/BridgeAR)) - Refactored manual backpressure control ([@BridgeAR](https://github.com/BridgeAR)) - Removed the high water mark and low water mark. Such a mechanism should be implemented by a user instead - The `drain` event is from now on only emitted if the stream really had to buffer - Reduced the default connect_timeout to be one hour instead of 24h ([@BridgeAR](https://github.com/BridgeAR)) - Added .path to redis.createClient(options); ([@BridgeAR](https://github.com/BridgeAR)) - Ignore info command, if not available on server ([@ivanB1975](https://github.com/ivanB1975)) Bugfixes - Fixed a js parser error that could result in a timeout ([@BridgeAR](https://github.com/BridgeAR)) - Fixed .multi / .batch used with Node.js 0.10.x not working properly after a reconnect ([@BridgeAR](https://github.com/BridgeAR)) - Fixed fired but not yet returned commands not being rejected after a connection loss ([@BridgeAR](https://github.com/BridgeAR)) - Fixed connect_timeout not respected if no connection has ever been established ([@gagle](https://github.com/gagle) & [@benjie](https://github.com/benjie)) - Fixed return_buffers in pub sub mode ([@komachi](https://github.com/komachi)) ## v2.2.5 - 18 Oct, 2015 Bugfixes - Fixed undefined options passed to a new instance not accepted (possible with individual .createClient functions) ([@BridgeAR](https://github.com/BridgeAR)) ## v2.2.4 - 17 Oct, 2015 Bugfixes - Fixed unspecific error message for unresolvable commands ([@BridgeAR](https://github.com/BridgeAR)) - Fixed not allowed command error in pubsub mode not being returned in a provided callback ([@BridgeAR](https://github.com/BridgeAR)) - Fixed to many commands forbidden in pub sub mode ([@BridgeAR](https://github.com/BridgeAR)) - Fixed mutation of the arguments array passed to .multi / .batch constructor ([@BridgeAR](https://github.com/BridgeAR)) - Fixed mutation of the options object passed to createClient ([@BridgeAR](https://github.com/BridgeAR)) - Fixed error callback in .multi not called if connection in broken mode ([@BridgeAR](https://github.com/BridgeAR)) ## v2.2.3 - 14 Oct, 2015 Bugfixes - Fixed multi not being executed on Node 0.10.x if node_redis not yet ready ([@BridgeAR](https://github.com/BridgeAR)) ## v2.2.2 - 14 Oct, 2015 Bugfixes - Fixed regular commands not being executed after a .multi until .exec was called ([@BridgeAR](https://github.com/BridgeAR)) ## v2.2.1 - 12 Oct, 2015 No code change ## v2.2.0 - 12 Oct, 2015 - The peregrino falcon The peregrino falcon is the fasted bird on earth and this is what this release is all about: Increased performance for heavy usage by up to **400%** [sic!] and increased overall performance for any command as well. Please check the benchmarks in the [README.md](./README.md) for further details. Features - Added rename_commands options to handle renamed commands from the redis config ([@digmxl](https://github.com/digmxl) & [@BridgeAR](https://github.com/BridgeAR)) - Added disable_resubscribing option to prevent a client from resubscribing after reconnecting ([@BridgeAR](https://github.com/BridgeAR)) - Increased performance ([@BridgeAR](https://github.com/BridgeAR)) - exchanging built in queue with [@petkaantonov](https://github.com/petkaantonov)'s [double-ended queue](https://github.com/petkaantonov/deque) - prevent polymorphism - optimize statements - Added _.batch_ command, similar to .multi but without transaction ([@BridgeAR](https://github.com/BridgeAR)) - Improved pipelining to minimize the [RTT](http://redis.io/topics/pipelining) further ([@BridgeAR](https://github.com/BridgeAR)) Bugfixes - Fixed a javascript parser regression introduced in 2.0 that could result in timeouts on high load. ([@BridgeAR](https://github.com/BridgeAR)) - I was not able to write a regression test for this, since the error seems to only occur under heavy load with special conditions. So please have a look for timeouts with the js parser, if you use it and report all issues and switch to the hiredis parser in the meanwhile. If you're able to come up with a reproducable test case, this would be even better :) - Fixed should_buffer boolean for .exec, .select and .auth commands not being returned and fix a couple special conditions ([@BridgeAR](https://github.com/BridgeAR)) If you do not rely on transactions but want to reduce the RTT you can use .batch from now on. It'll behave just the same as .multi but it does not have any transaction and therefor won't roll back any failed commands.
Both .multi and .batch are from now on going to cache the commands and release them while calling .exec. Please consider using .batch instead of looping through a lot of commands one by one. This will significantly improve your performance. Here are some stats compared to ioredis 1.9.1 (Lenovo T450s i7-5600U): simple set 82,496 op/s » ioredis 112,617 op/s » node_redis simple get 82,015 op/s » ioredis 105,701 op/s » node_redis simple get with pipeline 10,233 op/s » ioredis 26,541 op/s » node_redis (using .batch) lrange 100 7,321 op/s » ioredis 26,155 op/s » node_redis publish 90,524 op/s » ioredis 112,823 op/s » node_redis subscribe 43,783 op/s » ioredis 61,889 op/s » node_redis To conclude: we can proudly say that node_redis is very likely outperforming any other node redis client. Known issues - The pub sub system has some flaws and those will be addressed in the next minor release ## v2.1.0 - Oct 02, 2015 Features: - Addded optional flush parameter to `.end`. If set to true, commands fired after using .end are going to be rejected instead of being ignored. (@crispy1989) - Addded: host and port can now be provided in a single options object. E.g. redis.createClient({ host: 'localhost', port: 1337, max_attempts: 5 }); (@BridgeAR) - Speedup common cases (@BridgeAR) Bugfixes: - Fix argument mutation while using the array notation with the multi constructor (@BridgeAR) - Fix multi.hmset key not being type converted if used with an object and key not being a string (@BridgeAR) - Fix parser errors not being catched properly (@BridgeAR) - Fix a crash that could occur if a redis server does not return the info command as usual #541 (@BridgeAR) - Explicitly passing undefined as a callback statement will work again. E.g. client.publish('channel', 'message', undefined); (@BridgeAR) ## v2.0.1 - Sep 24, 2015 Bugfixes: - Fix argument mutation while using the array notation in combination with keys / callbacks ([#866](.)). (@BridgeAR) ## v2.0.0 - Sep 21, 2015 This is the biggest release that node_redis had since it was released in 2010. A long list of outstanding bugs has been fixed, so we are very happy to present you redis 2.0 and we highly recommend updating as soon as possible. # What's new in 2.0 - Implemented a "connection is broken" mode if no connection could be established - node_redis no longer throws under any circumstances, preventing it from terminating applications. - Multi error handling is now working properly - Consistent command behavior including multi - Windows support - Improved performance - A lot of code cleanup - Many bug fixes - Better user support! ## Features: - Added a "redis connection is broken" mode after reaching max connection attempts / exceeding connection timeout. (@BridgeAR) - Added NODE_DEBUG=redis env to activate the debug_mode (@BridgeAR) - Added a default connection timeout of 24h instead of never timing out as a default (@BridgeAR) - Added: Network errors and other stream errors will from now on include the error code as `err.code` property (@BridgeAR) - Added: Errors thrown by redis will now include the redis error code as `err.code` property. (@skeggse & @BridgeAR) - Added: Errors thrown by node_redis will now include a `err.command` property for the command used (@BridgeAR) - Added new commands and drop support for deprecated _substr_ (@BridgeAR) - Added new possibilities how to provide the command arguments (@BridgeAR) - The entries in the keyspace of the server_info is now an object instead of a string. (@SinisterLight & @BridgeAR) - Small speedup here and there (e.g. by not using .toLowerCase() anymore) (@BridgeAR) - Full windows support (@bcoe) - Increased coverage by 10% and add a lot of tests to make sure everything works as it should. We now reached 97% :-) (@BridgeAR) - Remove dead code, clean up and refactor very old chunks (@BridgeAR) - Don't flush the offline queue if reconnecting (@BridgeAR) - Emit all errors insteaf of throwing sometimes and sometimes emitting them (@BridgeAR) - _auth_pass_ passwords are now checked to be a valid password (@jcppman & @BridgeAR) ## Bug fixes: - Don't kill the app anymore by randomly throwing errors sync instead of emitting them (@BridgeAR) - Don't catch user errors anymore occuring in callbacks (no try callback anymore & more fixes for the parser) (@BridgeAR) - Early garbage collection of queued items (@dohse) - Fix js parser returning errors as strings (@BridgeAR) - Do not wrap errors into other errors (@BridgeAR) - Authentication failures are now returned in the callback instead of being emitted (@BridgeAR) - Fix a memory leak on reconnect (@rahar) - Using `send_command` directly may now also be called without the args as stated in the [README.md](./README.md) (@BridgeAR) - Fix the multi.exec error handling (@BridgeAR) - Fix commands being inconsistent and behaving wrong (@BridgeAR) - Channel names with spaces are now properly resubscribed after a reconnection (@pbihler) - Do not try to reconnect after the connection timeout has been exceeded (@BridgeAR) - Ensure the execution order is observed if using .eval (@BridgeAR) - Fix commands not being rejected after calling .quit (@BridgeAR) - Fix .auth calling the callback twice if already connected (@BridgeAR) - Fix detect_buffers not working in pub sub mode and while monitoring (@BridgeAR) - Fix channel names always being strings instead of buffers while return_buffers is true (@BridgeAR) - Don't print any debug statements if not asked for (@BridgeAR) - Fix a couple small other bugs ## Breaking changes: 1. redis.send_command commands have to be lower case from now on. This does only apply if you use `.send_command` directly instead of the convenient methods like `redis.command`. 2. Error messages have changed quite a bit. If you depend on a specific wording please check your application carfully. 3. Errors are from now on always either returned if a callback is present or emitted. They won't be thrown (neither sync, nor async). 4. The Multi error handling has changed a lot! - All errors are from now on errors instead of strings (this only applied to the js parser). - If an error occurs while queueing the commands an EXECABORT error will be returned including the failed commands as `.errors` property instead of an array with errors. - If an error occurs while executing the commands and that command has a callback it'll return the error as first parameter (`err, undefined` instead of `null, undefined`). - All the errors occuring while executing the commands will stay in the result value as error instance (if you used the js parser before they would have been strings). Be aware that the transaction won't be aborted if those error occurr! - If `multi.exec` does not have a callback and an EXECABORT error occurrs, it'll emit that error instead. 5. If redis can't connect to your redis server it'll give up after a certain point of failures (either max connection attempts or connection timeout exceeded). If that is the case it'll emit an CONNECTION_BROKEN error. You'll have to initiate a new client to try again afterwards. 6. The offline queue is not flushed anymore on a reconnect. It'll stay until node_redis gives up trying to reach the server or until you close the connection. 7. Before this release node_redis catched user errors and threw them async back. This is not the case anymore! No user behavior of what so ever will be tracked or catched. 8. The keyspace of `redis.server_info` (db0...) is from now on an object instead of an string. NodeRedis also thanks @qdb, @tobek, @cvibhagool, @frewsxcv, @davidbanham, @serv, @vitaliylag, @chrishamant, @GamingCoder and all other contributors that I may have missed for their contributions! From now on we'll push new releases more frequently out and fix further long outstanding things and implement new features.
## v1.0.0 - Aug 30, 2015 - Huge issue and pull-request cleanup. Thanks Blain! (@blainsmith) - [#658](https://github.com/NodeRedis/node_redis/pull/658) Client now parses URL-format connection strings (e.g., redis://foo:pass@127.0.0.1:8080) (@kuwabarahiroshi) - [#749](https://github.com/NodeRedis/node_redis/pull/749) Fix reconnection bug when client is in monitoring mode (@danielbprice) - [#786](https://github.com/NodeRedis/node_redis/pull/786) Refactor createClient. Fixes #651 (@BridgeAR) - [#793](https://github.com/NodeRedis/node_redis/pull/793) Refactor tests and improve test coverage (@erinspice, @bcoe) - [#733](https://github.com/NodeRedis/node_redis/pull/733) Fixes detect_buffers functionality in the context of exec. Fixes #732, #263 (@raydog) - [#785](https://github.com/NodeRedis/node_redis/pull/785) Tiny speedup by using 'use strict' (@BridgeAR) - Fix extraneous error output due to pubsub tests (Mikael Kohlmyr) ## v0.12.1 - Aug 10, 2014 - Fix IPv6/IPv4 family selection in node 0.11+ (Various) ## v0.12.0 - Aug 9, 2014 - Fix unix socket support (Jack Tang) - Improve createClient argument handling (Jack Tang) ## v0.11.0 - Jul 10, 2014 - IPv6 Support. (Yann Stephan) - Revert error emitting and go back to throwing errors. (Bryce Baril) - Set socket_keepalive to prevent long-lived client timeouts. (mohit) - Correctly reset retry timer. (ouotuo) - Domains protection from bad user exit. (Jake Verbaten) - Fix reconnection socket logic to prevent misqueued entries. (Iain Proctor) ## v0.10.3 - May 22, 2014 - Update command list to match Redis 2.8.9 (Charles Feng) ## v0.10.2 - May 18, 2014 - Better binary key handling for HGETALL. (Nick Apperson) - Fix test not resetting `error` handler. (CrypticSwarm) - Fix SELECT error semantics. (Bryan English) ## v0.10.1 - February 17, 2014 - Skip plucking redis version from the INFO stream if INFO results weren't provided. (Robert Sköld) ## v0.10.0 - December 21, 2013 - Instead of throwing errors asynchronously, emit errors on client. (Bryce Baril) ## v0.9.2 - December 15, 2013 - Regenerate commands for new 2.8.x Redis commands. (Marek Ventur) - Correctly time reconnect counts when using 'auth'. (William Hockey) ## v0.9.1 - November 23, 2013 - Allow hmset to accept numeric keys. (Alex Stokes) - Fix TypeError for multiple MULTI/EXEC errors. (Kwangsu Kim) ## v0.9.0 - October 17, 2013 - Domains support. (Forrest L Norvell) ## v0.8.6 - October 2, 2013 - If error is already an Error, don't wrap it in another Error. (Mathieu M-Gosselin) - Fix retry delay logic (Ian Babrou) - Return Errors instead of strings where Errors are expected (Ian Babrou) - Add experimental `.unref()` method to RedisClient (Bryce Baril / Olivier Lalonde) - Strengthen checking of reply to prevent conflating "message" or "pmessage" fields with pub_sub replies. (Bryce Baril) ## v0.8.5 - September 26, 2013 - Add `auth_pass` option to connect and immediately authenticate (Henrik Peinar) ## v0.8.4 - June 24, 2013 Many contributed features and fixes, including: - Ignore password set if not needed. (jbergknoff) - Improved compatibility with 0.10.X for tests and client.end() (Bryce Baril) - Protect connection retries from application exceptions. (Amos Barreto) - Better exception handling for Multi/Exec (Thanasis Polychronakis) - Renamed pubsub mode to subscriber mode (Luke Plaster) - Treat SREM like SADD when passed an array (Martin Ciparelli) - Fix empty unsub/punsub TypeError (Jeff Barczewski) - Only attempt to run a callback if it one was provided (jifeng) ## v0.8.3 - April 09, 2013 Many contributed features and fixes, including: - Fix some tests for Node.js version 0.9.x+ changes (Roman Ivanilov) - Fix error when commands submitted after idle event handler (roamm) - Bypass Redis for no-op SET/SETEX commands (jifeng) - Fix HMGET + detect_buffers (Joffrey F) - Fix CLIENT LOAD functionality (Jonas Dohse) - Add percentage outputs to diff_multi_bench_output.js (Bryce Baril) - Add retry_max_delay option (Tomasz Durka) - Fix parser off-by-one errors with nested multi-bulk replies (Bryce Baril) - Prevent parser from sinking application-side exceptions (Bryce Baril) - Fix parser incorrect buffer skip when parsing multi-bulk errors (Bryce Baril) - Reverted previous change with throwing on non-string values with HMSET (David Trejo) - Fix command queue sync issue when using pubsub (Tom Leach) - Fix compatibility with two-word Redis commands (Jonas Dohse) - Add EVAL with array syntax (dmoena) - Fix tests due to Redis reply order changes in 2.6.5+ (Bryce Baril) - Added a test for the SLOWLOG command (Nitesh Sinha) - Fix SMEMBERS order dependency in test broken by Redis changes (Garrett Johnson) - Update commands for new Redis commands (David Trejo) - Prevent exception from SELECT on subscriber reconnection (roamm) ## v0.8.2 - November 11, 2012 Another version bump because 0.8.1 didn't get applied properly for some mysterious reason. Sorry about that. Changed name of "faster" parser to "javascript". ## v0.8.1 - September 11, 2012 Important bug fix for null responses (Jerry Sievert) ## v0.8.0 - September 10, 2012 Many contributed features and fixes, including: - Pure JavaScript reply parser that is usually faster than hiredis (Jerry Sievert) - Remove hiredis as optionalDependency from package.json. It still works if you want it. - Restore client state on reconnect, including select, subscribe, and monitor. (Ignacio Burgueño) - Fix idle event (Trae Robrock) - Many documentation improvements and bug fixes (David Trejo) ## v0.7.2 - April 29, 2012 Many contributed fixes. Thank you, contributors. - [GH-190] - pub/sub mode fix (Brian Noguchi) - [GH-165] - parser selection fix (TEHEK) - numerous documentation and examples updates - auth errors emit Errors instead of Strings (David Trejo) ## v0.7.1 - November 15, 2011 Fix regression in reconnect logic. Very much need automated tests for reconnection and queue logic. ## v0.7.0 - November 14, 2011 Many contributed fixes. Thanks everybody. - [GH-127] - properly re-initialize parser on reconnect - [GH-136] - handle passing undefined as callback (Ian Babrou) - [GH-139] - properly handle exceptions thrown in pub/sub event handlers (Felix Geisendörfer) - [GH-141] - detect closing state on stream error (Felix Geisendörfer) - [GH-142] - re-select database on reconnection (Jean-Hugues Pinson) - [GH-146] - add sort example (Maksim Lin) Some more goodies: - Fix bugs with node 0.6 - Performance improvements - New version of `multi_bench.js` that tests more realistic scenarios - [GH-140] - support optional callback for subscribe commands - Properly flush and error out command queue when connection fails - Initial work on reconnection thresholds ## v0.6.7 - July 30, 2011 (accidentally skipped v0.6.6) Fix and test for [GH-123] Passing an Array as as the last argument should expand as users expect. The old behavior was to coerce the arguments into Strings, which did surprising things with Arrays. ## v0.6.5 - July 6, 2011 Contributed changes: - Support SlowBuffers (Umair Siddique) - Add Multi to exports (Louis-Philippe Perron) - Fix for drain event calculation (Vladimir Dronnikov) Thanks! ## v0.6.4 - June 30, 2011 Fix bug with optional callbacks for hmset. ## v0.6.2 - June 30, 2011 Bugs fixed: - authentication retry while server is loading db (danmaz74) [GH-101] - command arguments processing issue with arrays New features: - Auto update of new commands from redis.io (Dave Hoover) - Performance improvements and backpressure controls. - Commands now return the true/false value from the underlying socket write(s). - Implement command_queue high water and low water for more better control of queueing. See `examples/backpressure_drain.js` for more information. ## v0.6.1 - June 29, 2011 Add support and tests for Redis scripting through EXEC command. Bug fix for monitor mode. (forddg) Auto update of new commands from redis.io (Dave Hoover) ## v0.6.0 - April 21, 2011 Lots of bugs fixed. - connection error did not properly trigger reconnection logic [GH-85] - client.hmget(key, [val1, val2]) was not expanding properly [GH-66] - client.quit() while in pub/sub mode would throw an error [GH-87] - client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92] - unsubscribe before subscribe would make things very confused [GH-88] - Add BRPOPLPUSH [GH-79] ## v0.5.11 - April 7, 2011 Added DISCARD I originally didn't think DISCARD would do anything here because of the clever MULTI interface, but somebody pointed out to me that DISCARD can be used to flush the WATCH set. ## v0.5.10 - April 6, 2011 Added HVALS ## v0.5.9 - March 14, 2011 Fix bug with empty Array arguments - Andy Ray ## v0.5.8 - March 14, 2011 Add `MONITOR` command and special monitor command reply parsing. ## v0.5.7 - February 27, 2011 Add magical auth command. Authentication is now remembered by the client and will be automatically sent to the server on every connection, including any reconnections. ## v0.5.6 - February 22, 2011 Fix bug in ready check with `return_buffers` set to `true`. Thanks to Dean Mao and Austin Chau. ## v0.5.5 - February 16, 2011 Add probe for server readiness. When a Redis server starts up, it might take a while to load the dataset into memory. During this time, the server will accept connections, but will return errors for all non-INFO commands. Now node_redis will send an INFO command whenever it connects to a server. If the info command indicates that the server is not ready, the client will keep trying until the server is ready. Once it is ready, the client will emit a "ready" event as well as the "connect" event. The client will queue up all commands sent before the server is ready, just like it did before. When the server is ready, all offline/non-ready commands will be replayed. This should be backward compatible with previous versions. To disable this ready check behavior, set `options.no_ready_check` when creating the client. As a side effect of this change, the key/val params from the info command are available as `client.server_options`. Further, the version string is decomposed into individual elements in `client.server_options.versions`. ## v0.5.4 - February 11, 2011 Fix excess memory consumption from Queue backing store. Thanks to Gustaf Sjöberg. ## v0.5.3 - February 5, 2011 Fix multi/exec error reply callback logic. Thanks to Stella Laurenzo. ## v0.5.2 - January 18, 2011 Fix bug where unhandled error replies confuse the parser. ## v0.5.1 - January 18, 2011 Fix bug where subscribe commands would not handle redis-server startup error properly. ## v0.5.0 - December 29, 2010 Some bug fixes: - An important bug fix in reconnection logic. Previously, reply callbacks would be invoked twice after a reconnect. - Changed error callback argument to be an actual Error object. New feature: - Add friendly syntax for HMSET using an object. ## v0.4.1 - December 8, 2010 Remove warning about missing hiredis. You probably do want it though. ## v0.4.0 - December 5, 2010 Support for multiple response parsers and hiredis C library from Pieter Noordhuis. Return Strings instead of Buffers by default. Empty nested mb reply bug fix. ## v0.3.9 - November 30, 2010 Fix parser bug on failed EXECs. ## v0.3.8 - November 10, 2010 Fix for null MULTI response when WATCH condition fails. ## v0.3.7 - November 9, 2010 Add "drain" and "idle" events. ## v0.3.6 - November 3, 2010 Add all known Redis commands from Redis master, even ones that are coming in 2.2 and beyond. Send a friendlier "error" event message on stream errors like connection refused / reset. ## v0.3.5 - October 21, 2010 A few bug fixes. - Fixed bug with `nil` multi-bulk reply lengths that showed up with `BLPOP` timeouts. - Only emit `end` once when connection goes away. - Fixed bug in `test.js` where driver finished before all tests completed. ## unversioned wasteland See the git history for what happened before. node-redis-redis-4.5.1/CONTRIBUTING.md000066400000000000000000000075771433774114400171370ustar00rootroot00000000000000# Introduction First, thank you for considering contributing to Node Redis! It's people like you that make the open source community such a great community! 😊 We welcome any type of contribution, not just code. You can help with: - **QA**: file bug reports, the more details you can give the better (e.g. platform versions, screenshots, SDK versions, logs) - **Docs**: improve reference coverage, add more examples, fix typos or anything else you can spot - **Code**: take a look at the open issues and help triage them --- ## Project Guidelines As maintainers of this project, we want to ensure that the project lives and continues to grow. Progress should not be blocked by any one person's availability. One of the simplest ways of doing this is by encouraging a larger set of contributors. Using this approach we hope to mitigate the challenges of maintaining a project that needs regular updates. ### Getting Comfortable Contributing It is normal for your first pull request to be a potential fix for a problem but moving on from there to helping the project's direction can be difficult. We try to help contributors cross that barrier by identifying good first step issues (labelled `good-first-issue`). These issues are considered appropriate for first time contributors. Generally, these should be non-critical issues that are well defined. Established contributors will not work on these, to make space for others. New contributors may consider picking up issues labelled `needs-triage` or `help-wanted`. These may not necessarily require code changes but rather help with debugging and finding the cause of the issue whether it's a bug or a user's incorrect setup of the library or project. We keep all project discussion inside GitHub issues. This ensures that valuable information can be searched easily. GitHub issues are the go to tool for questions about how to use the library, or how the project is run. ### Expectations of Contributors You shouldn't feel bad for not contributing to open source. We want contributors like yourself to provide ideas, keep the ship shipping and to take some of the load from others. It is non-obligatory; we’re here to get things done in an enjoyable way. :trophy: We only ask that you follow the conduct guidelines set out in our [Code of Conduct](https://redis.com/community/community-guidelines-code-of-conduct/) throughout your contribution journey. #### Special Thanks A huge thank you to the original author of Node Redis, [Matthew Ranney](https://github.com/mranney). --- ## Code Guidelines ### Testing Code Node Redis has a full test suite with coverage setup. To run the tests, run `npm install` to install dependencies, then run `npm run build:tests-tools && npm test`. Note that the test suite assumes that [`docker`](https://www.docker.com/) is installed in your environment. ### Submitting Code for Review The bigger the pull request, the longer it will take to review and merge. Where possible try to break down large pull requests into smaller chunks that are easier to review and merge. It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you? What problem are you trying to solve? Tag in any relevant issues. To assist reviewers, we ask that you fill out the pull request template as much as possible. > Use a `draft` pull request if your pull request is not complete or ready for review. ### Code Review Process Pull Requests to the protected branches require peer-review approvals and passing status checks to be able to be merged. When reviewing a Pull Request please check the following steps as well as the existing automated checks: - Does your Pull Request provide or update the docs if docs changes are required? - Have the tests been updated or new tests been added to test any newly implemented or changed functionality? - Is the test coverage at the same level as before (preferably more!)? node-redis-redis-4.5.1/LICENSE000066400000000000000000000021011433774114400156650ustar00rootroot00000000000000MIT License Copyright (c) 2016-present Node Redis contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-redis-redis-4.5.1/README.md000066400000000000000000000435461433774114400161610ustar00rootroot00000000000000# Node-Redis [![Tests](https://img.shields.io/github/workflow/status/redis/node-redis/Tests/master.svg?label=tests)](https://github.com/redis/node-redis/actions/workflows/tests.yml) [![Coverage](https://codecov.io/gh/redis/node-redis/branch/master/graph/badge.svg?token=xcfqHhJC37)](https://codecov.io/gh/redis/node-redis) [![License](https://img.shields.io/github/license/redis/node-redis.svg)](https://github.com/redis/node-redis/blob/master/LICENSE) [![LGTM alerts](https://img.shields.io/lgtm/alerts/g/redis/node-redis.svg?logo=LGTM)](https://lgtm.com/projects/g/redis/node-redis/alerts) [![Discord](https://img.shields.io/discord/697882427875393627.svg?style=social&logo=discord)](https://discord.gg/redis) [![Twitch](https://img.shields.io/twitch/status/redisinc?style=social)](https://www.twitch.tv/redisinc) [![YouTube](https://img.shields.io/youtube/channel/views/UCD78lHSwYqMlyetR0_P4Vig?style=social)](https://www.youtube.com/redisinc) [![Twitter](https://img.shields.io/twitter/follow/redisinc?style=social)](https://twitter.com/redisinc) node-redis is a modern, high performance [Redis](https://redis.io) client for Node.js. ## Packages | Name | Description | |----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [redis](./) | [![Downloads](https://img.shields.io/npm/dm/redis.svg)](https://www.npmjs.com/package/redis) [![Version](https://img.shields.io/npm/v/redis.svg)](https://www.npmjs.com/package/redis) | | [@redis/client](./packages/client) | [![Downloads](https://img.shields.io/npm/dm/@redis/client.svg)](https://www.npmjs.com/package/@redis/client) [![Version](https://img.shields.io/npm/v/@redis/client.svg)](https://www.npmjs.com/package/@redis/client) [![Docs](https://img.shields.io/badge/-documentation-dc382c)](https://redis.js.org/documentation/client/) | | [@redis/bloom](./packages/bloom) | [![Downloads](https://img.shields.io/npm/dm/@redis/bloom.svg)](https://www.npmjs.com/package/@redis/bloom) [![Version](https://img.shields.io/npm/v/@redis/bloom.svg)](https://www.npmjs.com/package/@redis/bloom) [![Docs](https://img.shields.io/badge/-documentation-dc382c)](https://redis.js.org/documentation/bloom/) [Redis Bloom](https://oss.redis.com/redisbloom/) commands | | [@redis/graph](./packages/graph) | [![Downloads](https://img.shields.io/npm/dm/@redis/graph.svg)](https://www.npmjs.com/package/@redis/graph) [![Version](https://img.shields.io/npm/v/@redis/graph.svg)](https://www.npmjs.com/package/@redis/graph) [![Docs](https://img.shields.io/badge/-documentation-dc382c)](https://redis.js.org/documentation/graph/) [Redis Graph](https://oss.redis.com/redisgraph/) commands | | [@redis/json](./packages/json) | [![Downloads](https://img.shields.io/npm/dm/@redis/json.svg)](https://www.npmjs.com/package/@redis/json) [![Version](https://img.shields.io/npm/v/@redis/json.svg)](https://www.npmjs.com/package/@redis/json) [![Docs](https://img.shields.io/badge/-documentation-dc382c)](https://redis.js.org/documentation/json/) [Redis JSON](https://oss.redis.com/redisjson/) commands | | [@redis/search](./packages/search) | [![Downloads](https://img.shields.io/npm/dm/@redis/search.svg)](https://www.npmjs.com/package/@redis/search) [![Version](https://img.shields.io/npm/v/@redis/search.svg)](https://www.npmjs.com/package/@redis/search) [![Docs](https://img.shields.io/badge/-documentation-dc382c)](https://redis.js.org/documentation/search/) [RediSearch](https://oss.redis.com/redisearch/) commands | | [@redis/time-series](./packages/time-series) | [![Downloads](https://img.shields.io/npm/dm/@redis/time-series.svg)](https://www.npmjs.com/package/@redis/time-series) [![Version](https://img.shields.io/npm/v/@redis/time-series.svg)](https://www.npmjs.com/package/@redis/time-series) [![Docs](https://img.shields.io/badge/-documentation-dc382c)](https://redis.js.org/documentation/time-series/) [Redis Time-Series](https://oss.redis.com/redistimeseries/) commands | > :warning: In version 4.1.0 we moved our subpackages from `@node-redis` to `@redis`. If you're just using `npm install redis`, you don't need to do anything—it'll upgrade automatically. If you're using the subpackages directly, you'll need to point to the new scope (e.g. `@redis/client` instead of `@node-redis/client`). ## Installation ```bash npm install redis ``` > :warning: The new interface is clean and cool, but if you have an existing codebase, you'll want to read the [migration guide](./docs/v3-to-v4.md). Looking for a high-level library to handle object mapping? See [redis-om-node](https://github.com/redis/redis-om-node)! ## Usage ### Basic Example ```typescript import { createClient } from 'redis'; const client = createClient(); client.on('error', (err) => console.log('Redis Client Error', err)); await client.connect(); await client.set('key', 'value'); const value = await client.get('key'); await client.disconnect(); ``` The above code connects to localhost on port 6379. To connect to a different host or port, use a connection string in the format `redis[s]://[[username][:password]@][host][:port][/db-number]`: ```typescript createClient({ url: 'redis://alice:foobared@awesome.redis.server:6380' }); ``` You can also use discrete parameters, UNIX sockets, and even TLS to connect. Details can be found in the [client configuration guide](./docs/client-configuration.md). ### Redis Commands There is built-in support for all of the [out-of-the-box Redis commands](https://redis.io/commands). They are exposed using the raw Redis command names (`HSET`, `HGETALL`, etc.) and a friendlier camel-cased version (`hSet`, `hGetAll`, etc.): ```typescript // raw Redis commands await client.HSET('key', 'field', 'value'); await client.HGETALL('key'); // friendly JavaScript commands await client.hSet('key', 'field', 'value'); await client.hGetAll('key'); ``` Modifiers to commands are specified using a JavaScript object: ```typescript await client.set('key', 'value', { EX: 10, NX: true }); ``` Replies will be transformed into useful data structures: ```typescript 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()`: ```typescript await client.sendCommand(['SET', 'key', 'value', 'NX']); // 'OK' await client.sendCommand(['HGETALL', 'key']); // ['key1', 'field1', 'key2', 'field2'] ``` ### Transactions (Multi/Exec) Start a [transaction](https://redis.io/topics/transactions) by calling `.multi()`, then chaining your commands. When you're done, call `.exec()` and you'll get an array back with your results: ```typescript await client.set('another-key', 'another-value'); const [setKeyReply, otherKeyValue] = await client .multi() .set('key', 'value') .get('another-key') .exec(); // ['OK', 'another-value'] ``` You can also [watch](https://redis.io/topics/transactions#optimistic-locking-using-check-and-set) keys by calling `.watch()`. Your transaction will abort if any of the watched keys change. To dig deeper into transactions, check out the [Isolated Execution Guide](./docs/isolated-execution.md). ### Blocking Commands Any command can be run on a new connection by specifying the `isolated` option. The newly created connection is closed when the command's `Promise` is fulfilled. This pattern works especially well for blocking commands—such as `BLPOP` and `BLMOVE`: ```typescript import { commandOptions } from 'redis'; const blPopPromise = client.blPop( commandOptions({ isolated: true }), 'key', 0 ); await client.lPush('key', ['1', '2']); await blPopPromise; // '2' ``` To learn more about isolated execution, check out the [guide](./docs/isolated-execution.md). ### Pub/Sub Subscribing to a channel requires a dedicated stand-alone connection. You can easily get one by `.duplicate()`ing an existing Redis connection. ```typescript const subscriber = client.duplicate(); await subscriber.connect(); ``` Once you have one, simply subscribe and unsubscribe as needed: ```typescript await subscriber.subscribe('channel', (message) => { console.log(message); // 'message' }); await subscriber.pSubscribe('channe*', (message, channel) => { console.log(message, channel); // 'message', 'channel' }); await subscriber.unsubscribe('channel'); await subscriber.pUnsubscribe('channe*'); ``` Publish a message on a channel: ```typescript await publisher.publish('channel', 'message'); ``` There is support for buffers as well: ```typescript await subscriber.subscribe('channel', (message) => { console.log(message); // }, true); await subscriber.pSubscribe('channe*', (message, channel) => { console.log(message, channel); // , }, true); ``` ### Scan Iterator [`SCAN`](https://redis.io/commands/scan) results can be looped over using [async iterators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator): ```typescript for await (const key of client.scanIterator()) { // use the key! await client.get(key); } ``` This works with `HSCAN`, `SSCAN`, and `ZSCAN` too: ```typescript for await (const { field, value } of client.hScanIterator('hash')) {} for await (const member of client.sScanIterator('set')) {} for await (const { score, value } of client.zScanIterator('sorted-set')) {} ``` You can override the default options by providing a configuration object: ```typescript client.scanIterator({ TYPE: 'string', // `SCAN` only MATCH: 'patter*', COUNT: 100 }); ``` ### [Programmability](https://redis.io/docs/manual/programmability/) Redis provides a programming interface allowing code execution on the redis server. #### [Functions](https://redis.io/docs/manual/programmability/functions-intro/) The following example retrieves a key in redis, returning the value of the key, incremented by an integer. For example, if your key _foo_ has the value _17_ and we run `add('foo', 25)`, it returns the answer to Life, the Universe and Everything. ```lua #!lua name=library redis.register_function { function_name = 'add', callback = function(keys, args) return redis.call('GET', keys[1]) + args[1] end, flags = { 'no-writes' } } ``` Here is the same example, but in a format that can be pasted into the `redis-cli`. ``` FUNCTION LOAD "#!lua name=library\nredis.register_function{function_name=\"add\", callback=function(keys, args) return redis.call('GET', keys[1])+args[1] end, flags={\"no-writes\"}}" ``` Load the prior redis function on the _redis server_ before running the example below. ```typescript import { createClient } from 'redis'; const client = createClient({ functions: { library: { add: { NUMBER_OF_KEYS: 1, transformArguments(key: string, toAdd: number): Array { return [key, toAdd.toString()]; }, transformReply(reply: number): number { return reply; } } } } }); await client.connect(); await client.set('key', '1'); await client.library.add('key', 2); // 3 ``` #### [Lua Scripts](https://redis.io/docs/manual/programmability/eval-intro/) The following is an end-to-end example of the prior concept. ```typescript import { createClient, defineScript } from 'redis'; const client = createClient({ scripts: { add: defineScript({ NUMBER_OF_KEYS: 1, SCRIPT: 'return redis.call("GET", KEYS[1]) + ARGV[1];', transformArguments(key: string, toAdd: number): Array { return [key, toAdd.toString()]; }, transformReply(reply: number): number { return reply; } }) } }); await client.connect(); await client.set('key', '1'); await client.add('key', 2); // 3 ``` ### Disconnecting There are two functions that disconnect a client from the Redis server. In most scenarios you should use `.quit()` to ensure that pending commands are sent to Redis before closing a connection. #### `.QUIT()`/`.quit()` Gracefully close a client's connection to Redis, by sending the [`QUIT`](https://redis.io/commands/quit) command to the server. Before quitting, the client executes any remaining commands in its queue, and will receive replies from Redis for each of them. ```typescript const [ping, get, quit] = await Promise.all([ client.ping(), client.get('key'), client.quit() ]); // ['PONG', null, 'OK'] try { await client.get('key'); } catch (err) { // ClosedClient Error } ``` #### `.disconnect()` Forcibly close a client's connection to Redis immediately. Calling `disconnect` will not send further pending commands to the Redis server, or wait for or parse outstanding responses. ```typescript await client.disconnect(); ``` ### Auto-Pipelining Node Redis will automatically pipeline requests that are made during the same "tick". ```typescript client.set('Tm9kZSBSZWRpcw==', 'users:1'); client.sAdd('users:1:tokens', 'Tm9kZSBSZWRpcw=='); ``` Of course, if you don't do something with your Promises you're certain to get [unhandled Promise exceptions](https://nodejs.org/api/process.html#process_event_unhandledrejection). To take advantage of auto-pipelining and handle your Promises, use `Promise.all()`. ```typescript await Promise.all([ client.set('Tm9kZSBSZWRpcw==', 'users:1'), client.sAdd('users:1:tokens', 'Tm9kZSBSZWRpcw==') ]); ``` ### Clustering Check out the [Clustering Guide](./docs/clustering.md) when using Node Redis to connect to a Redis Cluster. ### Events The Node Redis client class is an Nodejs EventEmitter and it emits an event each time the network status changes: | Event name | Scenes | Arguments to be passed to the listener | |----------------|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| | `connect` | The client is initiating a connection to the server. | _No argument_ | | `ready` | The client successfully initiated the connection to the server. | _No argument_ | | `end` | The client disconnected the connection to the server via `.quit()` or `.disconnect()`. | _No argument_ | | `error` | When a network error has occurred, such as unable to connect to the server or the connection closed unexpectedly. | 1 argument: The error object, such as `SocketClosedUnexpectedlyError: Socket closed unexpectedly` or `Error: connect ECONNREFUSED [IP]:[PORT]` | | `reconnecting` | The client is trying to reconnect to the server. | _No argument_ | The client will not emit [any other events](./docs/v3-to-v4.md#all-the-removed-events) beyond those listed above. ## Supported Redis versions Node Redis is supported with the following versions of Redis: | Version | Supported | |---------|--------------------| | 7.0.z | :heavy_check_mark: | | 6.2.z | :heavy_check_mark: | | 6.0.z | :heavy_check_mark: | | 5.0.z | :heavy_check_mark: | | < 5.0 | :x: | > Node Redis should work with older versions of Redis, but it is not fully tested and we cannot offer support. ## Contributing If you'd like to contribute, check out the [contributing guide](CONTRIBUTING.md). Thank you to all the people who already contributed to Node Redis! [![Contributors](https://contrib.rocks/image?repo=redis/node-redis)](https://github.com/redis/node-redis/graphs/contributors) ## License This repository is licensed under the "MIT" license. See [LICENSE](LICENSE). node-redis-redis-4.5.1/SECURITY.md000066400000000000000000000012721433774114400164610ustar00rootroot00000000000000# Security Policy ## Supported Versions Node Redis is generally backwards compatible with very few exceptions, so we recommend users to always use the latest version to experience stability, performance and security. | Version | Supported | |---------|--------------------| | 4.0.z | :heavy_check_mark: | | 3.1.z | :heavy_check_mark: | | < 3.1 | :x: | ## Reporting a Vulnerability If you believe you’ve discovered a serious vulnerability, please contact the Node Redis core team at redis@redis.io. We will evaluate your report and if necessary issue a fix and an advisory. If the issue was previously undisclosed, we’ll also mention your name in the credits. node-redis-redis-4.5.1/benchmark/000077500000000000000000000000001433774114400166205ustar00rootroot00000000000000node-redis-redis-4.5.1/benchmark/.gitignore000066400000000000000000000000121433774114400206010ustar00rootroot00000000000000*.js.json node-redis-redis-4.5.1/benchmark/lib/000077500000000000000000000000001433774114400173665ustar00rootroot00000000000000node-redis-redis-4.5.1/benchmark/lib/defaults.yml000066400000000000000000000007721433774114400217260ustar00rootroot00000000000000version: 0.1 remote: - type: oss-standalone - setup: redis-small setups: - oss-standalone spec: setups: - name: oss-standalone type: oss-standalone redis_topology: primaries: 1 replicas: 0 resources: requests: cpus: "1" memory: "10g" exporter: output_path: "./*.js.json" redistimeseries: timemetric: "$.timestamp" metrics: - "$.p0" - "$.p50" - "$.p95" - "$.p99" - "$.p100" - "$.operationsPerSecond"node-redis-redis-4.5.1/benchmark/lib/index.js000066400000000000000000000030741433774114400210370ustar00rootroot00000000000000import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import { promises as fs } from 'fs'; import { fork } from 'child_process'; import { URL, fileURLToPath } from 'url'; import { once } from 'events'; import { extname } from 'path'; async function getPathChoices() { const dirents = await fs.readdir(new URL('.', import.meta.url), { withFileTypes: true }); const choices = []; for (const dirent of dirents) { if (!dirent.isDirectory()) continue; choices.push(dirent.name); } return choices; } const argv = hideBin(process.argv); async function getName() { return yargs(argv) .option('name', { demandOption: true, choices: await getPathChoices() }) .parseSync().name; } const runnerPath = fileURLToPath(new URL('runner.js', import.meta.url)), path = new URL(`${await getName()}/`, import.meta.url); async function getMetadata() { try { return await import(new URL('index.js', path)); } catch (err) { if (err.code === 'ERR_MODULE_NOT_FOUND') return; throw err; } } const metadata = await getMetadata(), timestamp = Date.now(); for (const file of await fs.readdir(path)) { if (file === 'index.js' || extname(file) !== '.js') continue; const benchmarkProcess = fork(runnerPath, [ ...argv, '--path', fileURLToPath(path) + file ]); await once(benchmarkProcess, 'message'); benchmarkProcess.send({ metadata, timestamp }); await once(benchmarkProcess, 'close'); } node-redis-redis-4.5.1/benchmark/lib/ping/000077500000000000000000000000001433774114400203235ustar00rootroot00000000000000node-redis-redis-4.5.1/benchmark/lib/ping/ioredis.js000066400000000000000000000005141433774114400223170ustar00rootroot00000000000000import Redis from 'ioredis'; export default async (host) => { const client = new Redis({ host, lazyConnect: true }); await client.connect(); return { benchmark() { return client.ping(); }, teardown() { return client.disconnect(); } } }; node-redis-redis-4.5.1/benchmark/lib/ping/ping.yml000066400000000000000000000003221433774114400220000ustar00rootroot00000000000000name: "ping" clientconfig: - command: | npm install -ws npm run build:tests-tools cd benchmark npm install npm run start -- --name ping --redis-server-host ${server_private_ip} node-redis-redis-4.5.1/benchmark/lib/ping/v3.js000066400000000000000000000007461433774114400212200ustar00rootroot00000000000000import { createClient } from 'redis-v3'; import { once } from 'events'; import { promisify } from 'util'; export default async (host) => { const client = createClient({ host }), pingAsync = promisify(client.ping).bind(client), quitAsync = promisify(client.quit).bind(client); await once(client, 'connect'); return { benchmark() { return pingAsync(); }, teardown() { return quitAsync(); } }; }; node-redis-redis-4.5.1/benchmark/lib/ping/v4.js000066400000000000000000000005461433774114400212170ustar00rootroot00000000000000import { createClient } from '@redis/client'; export default async (host) => { const client = createClient({ socket: { host } }); await client.connect(); return { benchmark() { return client.ping(); }, teardown() { return client.disconnect(); } }; }; node-redis-redis-4.5.1/benchmark/lib/runner.js000066400000000000000000000046051433774114400212420ustar00rootroot00000000000000import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import { basename } from 'path'; import { promises as fs } from 'fs'; import * as hdr from 'hdr-histogram-js'; hdr.initWebAssemblySync(); const { path, times, concurrency, 'redis-server-host': host } = yargs(hideBin(process.argv)) .option('path', { type: 'string', demandOption: true }) .option('times', { type: 'number', default: 1_000_000, demandOption: true }) .option('concurrency', { type: 'number', default: 100, demandOption: true }) .option('redis-server-host', { type: 'string' }) .parseSync(); const [ { metadata, timestamp }, module ] = await Promise.all([ new Promise(resolve => { process.once('message', resolve); process.send('ready'); }), import(path) ]), { benchmark, teardown } = await module.default(host, metadata); async function run(times) { return new Promise(resolve => { const histogram = hdr.build({ useWebAssembly: true }); let num = 0, inProgress = 0; async function run() { ++inProgress; ++num; const start = process.hrtime.bigint(); await benchmark(metadata); histogram.recordValue(Number(process.hrtime.bigint() - start)); --inProgress; if (num < times) { run(); } else if (inProgress === 0) { resolve(histogram); } } const toInitiate = Math.min(concurrency, times); for (let i = 0; i < toInitiate; i++) { run(); } }); } // warmup await run(Math.min(times * 0.1, 10_000)); // benchmark const benchmarkStart = process.hrtime.bigint(), histogram = await run(times), benchmarkNanoseconds = process.hrtime.bigint() - benchmarkStart, json = { timestamp, operationsPerSecond: times / Number(benchmarkNanoseconds) * 1_000_000_000, p0: histogram.getValueAtPercentile(0), p50: histogram.getValueAtPercentile(50), p95: histogram.getValueAtPercentile(95), p99: histogram.getValueAtPercentile(99), p100: histogram.getValueAtPercentile(100) }; console.log(`[${basename(path)}]:`); console.table(json); await fs.writeFile(`${path}.json`, JSON.stringify(json)); await teardown(); node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/000077500000000000000000000000001433774114400235025ustar00rootroot00000000000000node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/1KB.yml000066400000000000000000000004041433774114400246000ustar00rootroot00000000000000name: "set-get-delete-string-1KB" clientconfig: - command: | npm install -ws npm run build:tests-tools cd benchmark npm install npm run start -- --name set-get-delete-string --size 1024 --redis-server-host ${server_private_ip} node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/1MB.yml000066400000000000000000000004071433774114400246050ustar00rootroot00000000000000name: "set-get-delete-string-1MB" clientconfig: - command: | npm install -ws npm run build:tests-tools cd benchmark npm install npm run start -- --name set-get-delete-string --size 1048576 --redis-server-host ${server_private_ip} node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/8B.yml000066400000000000000000000004001433774114400244700ustar00rootroot00000000000000name: "set-get-delete-string-8B" clientconfig: - command: | npm install -ws npm run build:tests-tools cd benchmark npm install npm run start -- --name set-get-delete-string --size 8 --redis-server-host ${server_private_ip} node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/index.js000066400000000000000000000005241433774114400251500ustar00rootroot00000000000000import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import { randomBytes } from 'crypto'; const { size } = yargs(hideBin(process.argv)) .option('size', { type: 'number', default: 1024, demandOption: true }) .parseSync(); export const randomString = randomBytes(size).toString('ascii'); node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/ioredis.js000066400000000000000000000007701433774114400255020ustar00rootroot00000000000000import Redis from 'ioredis'; export default async (host, { randomString }) => { const client = new Redis({ host, lazyConnect: true }); await client.connect(); return { benchmark() { return Promise.all([ client.set(randomString, randomString), client.get(randomString), client.del(randomString) ]); }, teardown() { return client.disconnect(); } } }; node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/v3.js000066400000000000000000000013721433774114400243730ustar00rootroot00000000000000import { createClient } from 'redis-v3'; import { once } from 'events'; import { promisify } from 'util'; export default async (host, { randomString }) => { const client = createClient({ host }), setAsync = promisify(client.set).bind(client), getAsync = promisify(client.get).bind(client), delAsync = promisify(client.del).bind(client), quitAsync = promisify(client.quit).bind(client); await once(client, 'connect'); return { benchmark() { return Promise.all([ setAsync(randomString, randomString), getAsync(randomString), delAsync(randomString) ]); }, teardown() { return quitAsync(); } }; }; node-redis-redis-4.5.1/benchmark/lib/set-get-delete-string/v4.js000066400000000000000000000010221433774114400243640ustar00rootroot00000000000000import { createClient } from '@redis/client'; export default async (host, { randomString }) => { const client = createClient({ socket: { host } }); await client.connect(); return { benchmark() { return Promise.all([ client.set(randomString, randomString), client.get(randomString), client.del(randomString) ]); }, teardown() { return client.disconnect(); } }; }; node-redis-redis-4.5.1/benchmark/package-lock.json000066400000000000000000000600541433774114400220410ustar00rootroot00000000000000{ "name": "@redis/client-benchmark", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@redis/client-benchmark", "dependencies": { "@redis/client": "../packages/client", "hdr-histogram-js": "3.0.0", "ioredis": "5.2.2", "redis-v3": "npm:redis@3.1.2", "yargs": "17.5.1" } }, "../packages/client": { "name": "@redis/client", "version": "1.2.0", "license": "MIT", "dependencies": { "cluster-key-slot": "1.1.0", "generic-pool": "3.8.2", "yallist": "4.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.7.10", "@types/sinon": "^10.0.13", "@types/yallist": "^4.0.1", "@typescript-eslint/eslint-plugin": "^5.34.0", "@typescript-eslint/parser": "^5.34.0", "eslint": "^8.22.0", "nyc": "^15.1.0", "release-it": "^15.3.0", "sinon": "^14.0.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.10", "typescript": "^4.7.4" }, "engines": { "node": ">=14" } }, "node_modules/@assemblyscript/loader": { "version": "0.19.23", "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.19.23.tgz", "integrity": "sha512-ulkCYfFbYj01ie1MDOyxv2F6SpRN1TOj7fQxbP07D6HmeR+gr2JLSmINKjga2emB+b1L2KGrFKBTc+e00p54nw==" }, "node_modules/@ioredis/commands": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.1.1.tgz", "integrity": "sha512-fsR4P/ROllzf/7lXYyElUJCheWdTJVJvOTps8v9IWKFATxR61ANOlnoPqhH099xYLrJGpc2ZQ28B3rMeUt5VQg==" }, "node_modules/@redis/client": { "resolved": "../packages/client", "link": true }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "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/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "node_modules/cluster-key-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz", "integrity": "sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==", "engines": { "node": ">=0.10.0" } }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/denque": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", "integrity": "sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==", "engines": { "node": ">=0.10" } }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "engines": { "node": ">=6" } }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/hdr-histogram-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-3.0.0.tgz", "integrity": "sha512-/EpvQI2/Z98mNFYEnlqJ8Ogful8OpArLG/6Tf2bPnkutBVLIeMVNHjk1ZDfshF2BUweipzbk+dB1hgSB7SIakw==", "dependencies": { "@assemblyscript/loader": "^0.19.21", "base64-js": "^1.2.0", "pako": "^1.0.3" }, "engines": { "node": ">=14" } }, "node_modules/ioredis": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.2.2.tgz", "integrity": "sha512-wryKc1ur8PcCmNwfcGkw5evouzpbDXxxkMkzPK8wl4xQfQf7lHe11Jotell5ikMVAtikXJEu/OJVaoV51BggRQ==", "dependencies": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", "debug": "^4.3.4", "denque": "^2.0.1", "lodash.defaults": "^4.2.0", "lodash.isarguments": "^3.1.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0", "standard-as-callback": "^2.1.0" }, "engines": { "node": ">=12.22.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/ioredis" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "engines": { "node": ">=8" } }, "node_modules/lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" }, "node_modules/lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "node_modules/redis-commands": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" }, "node_modules/redis-errors": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", "integrity": "sha1-62LSrbFeTq9GEMBK/hUpOEJQq60=", "engines": { "node": ">=4" } }, "node_modules/redis-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", "integrity": "sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ=", "dependencies": { "redis-errors": "^1.0.0" }, "engines": { "node": ">=4" } }, "node_modules/redis-v3": { "name": "redis", "version": "3.1.2", "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", "dependencies": { "denque": "^1.5.0", "redis-commands": "^1.7.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0" }, "engines": { "node": ">=10" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/node-redis" } }, "node_modules/redis-v3/node_modules/denque": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", "engines": { "node": ">=0.10" } }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "engines": { "node": ">=0.10.0" } }, "node_modules/standard-as-callback": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "engines": { "node": ">=10" } }, "node_modules/yargs": { "version": "17.5.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.0.0" }, "engines": { "node": ">=12" } }, "node_modules/yargs-parser": { "version": "21.0.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", "engines": { "node": ">=12" } } }, "dependencies": { "@assemblyscript/loader": { "version": "0.19.23", "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.19.23.tgz", "integrity": "sha512-ulkCYfFbYj01ie1MDOyxv2F6SpRN1TOj7fQxbP07D6HmeR+gr2JLSmINKjga2emB+b1L2KGrFKBTc+e00p54nw==" }, "@ioredis/commands": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.1.1.tgz", "integrity": "sha512-fsR4P/ROllzf/7lXYyElUJCheWdTJVJvOTps8v9IWKFATxR61ANOlnoPqhH099xYLrJGpc2ZQ28B3rMeUt5VQg==" }, "@redis/client": { "version": "file:../packages/client", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.7.10", "@types/sinon": "^10.0.13", "@types/yallist": "^4.0.1", "@typescript-eslint/eslint-plugin": "^5.34.0", "@typescript-eslint/parser": "^5.34.0", "cluster-key-slot": "1.1.0", "eslint": "^8.22.0", "generic-pool": "3.8.2", "nyc": "^15.1.0", "release-it": "^15.3.0", "sinon": "^14.0.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.10", "typescript": "^4.7.4", "yallist": "4.0.0" } }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { "color-convert": "^2.0.1" } }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "cluster-key-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz", "integrity": "sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==" }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { "color-name": "~1.1.4" } }, "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } }, "denque": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", "integrity": "sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==" }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "hdr-histogram-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-3.0.0.tgz", "integrity": "sha512-/EpvQI2/Z98mNFYEnlqJ8Ogful8OpArLG/6Tf2bPnkutBVLIeMVNHjk1ZDfshF2BUweipzbk+dB1hgSB7SIakw==", "requires": { "@assemblyscript/loader": "^0.19.21", "base64-js": "^1.2.0", "pako": "^1.0.3" } }, "ioredis": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.2.2.tgz", "integrity": "sha512-wryKc1ur8PcCmNwfcGkw5evouzpbDXxxkMkzPK8wl4xQfQf7lHe11Jotell5ikMVAtikXJEu/OJVaoV51BggRQ==", "requires": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", "debug": "^4.3.4", "denque": "^2.0.1", "lodash.defaults": "^4.2.0", "lodash.isarguments": "^3.1.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0", "standard-as-callback": "^2.1.0" } }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" }, "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "redis-commands": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" }, "redis-errors": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", "integrity": "sha1-62LSrbFeTq9GEMBK/hUpOEJQq60=" }, "redis-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", "integrity": "sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ=", "requires": { "redis-errors": "^1.0.0" } }, "redis-v3": { "version": "npm:redis@3.1.2", "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", "requires": { "denque": "^1.5.0", "redis-commands": "^1.7.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0" }, "dependencies": { "denque": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==" } } }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "standard-as-callback": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { "ansi-regex": "^5.0.1" } }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, "yargs": { "version": "17.5.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.0.0" } }, "yargs-parser": { "version": "21.0.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" } } } node-redis-redis-4.5.1/benchmark/package.json000066400000000000000000000005021433774114400211030ustar00rootroot00000000000000{ "name": "@redis/client-benchmark", "private": true, "main": "./lib", "type": "module", "scripts": { "start": "node ." }, "dependencies": { "@redis/client": "../packages/client", "hdr-histogram-js": "3.0.0", "ioredis": "5.2.2", "redis-v3": "npm:redis@3.1.2", "yargs": "17.5.1" } } node-redis-redis-4.5.1/benchmark/requirements.txt000066400000000000000000000000311433774114400220760ustar00rootroot00000000000000redisbench_admin>=0.5.24 node-redis-redis-4.5.1/docs/000077500000000000000000000000001433774114400156165ustar00rootroot00000000000000node-redis-redis-4.5.1/docs/FAQ.md000066400000000000000000000036131433774114400165520ustar00rootroot00000000000000# F.A.Q. Nobody has *actually* asked these questions. But, we needed somewhere to put all the important bits and bobs that didn't fit anywhere else. So, here you go! ## What happens when the network goes down? When a socket closes unexpectedly, all the commands that were already sent will reject as they might have been executed on the server. The rest will remain queued in memory until a new socket is established. If the client is closed—either by returning an error from [`reconnectStrategy`](./client-configuration.md#reconnect-strategy) or by manually calling `.disconnect()`—they will be rejected. If don't want to queue commands in memory until a new socket is established, set the `disableOfflineQueue` option to `true` in the [client configuration](./client-configuration.md). This will result in those commands being rejected. ## How are commands batched? Commands are pipelined using [`queueMicrotask`](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback). If `socket.write()` returns `false`—meaning that ["all or part of the data was queued in user memory"](https://nodejs.org/api/net.html#net_socket_write_data_encoding_callback:~:text=all%20or%20part%20of%20the%20data%20was%20queued%20in%20user%20memory)—the commands will stack in memory until the [`drain`](https://nodejs.org/api/net.html#net_event_drain) event is fired. ## `RedisClientType` Redis has support for [modules](https://redis.io/modules) and running [Lua scripts](../README.md#lua-scripts) within the Redis context. To take advantage of typing within these scenarios, `RedisClient` and `RedisCluster` should be used with [typeof](https://www.typescriptlang.org/docs/handbook/2/typeof-types.html), rather than the base types `RedisClientType` and `RedisClusterType`. ```typescript import { createClient } from '@redis/client'; export const client = createClient(); export type RedisClientType = typeof client; ```node-redis-redis-4.5.1/docs/client-configuration.md000066400000000000000000000220441433774114400222650ustar00rootroot00000000000000# `createClient` configuration | Property | Default | Description | |--------------------------|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | url | | `redis[s]://[[username][:password]@][host][:port][/db-number]` (see [`redis`](https://www.iana.org/assignments/uri-schemes/prov/redis) and [`rediss`](https://www.iana.org/assignments/uri-schemes/prov/rediss) IANA registration for more details) | | socket | | Socket connection properties. Unlisted [`net.connect`](https://nodejs.org/api/net.html#socketconnectoptions-connectlistener) properties (and [`tls.connect`](https://nodejs.org/api/tls.html#tlsconnectoptions-callback)) are also supported | | socket.port | `6379` | Redis server port | | socket.host | `'localhost'` | Redis server hostname | | socket.family | `0` | IP Stack version (one of `4 \| 6 \| 0`) | | socket.path | | Path to the UNIX Socket | | socket.connectTimeout | `5000` | Connection Timeout (in milliseconds) | | socket.noDelay | `true` | Toggle [`Nagle's algorithm`](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) | | socket.keepAlive | `5000` | Toggle [`keep-alive`](https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay) functionality | | socket.tls | | See explanation and examples [below](#TLS) | | socket.reconnectStrategy | `retries => Math.min(retries * 50, 500)` | A function containing the [Reconnect Strategy](#reconnect-strategy) logic | | username | | ACL username ([see ACL guide](https://redis.io/topics/acl)) | | password | | ACL password or the old "--requirepass" password | | name | | Connection name ([see `CLIENT SETNAME`](https://redis.io/commands/client-setname)) | | database | | Redis database number (see [`SELECT`](https://redis.io/commands/select) command) | | modules | | Included [Redis Modules](../README.md#packages) | | scripts | | Script definitions (see [Lua Scripts](../README.md#lua-scripts)) | | functions | | Function definitions (see [Functions](../README.md#functions)) | | commandsQueueMaxLength | | Maximum length of the client's internal command queue | | disableOfflineQueue | `false` | Disables offline queuing, see [FAQ](./FAQ.md#what-happens-when-the-network-goes-down) | | readonly | `false` | Connect in [`READONLY`](https://redis.io/commands/readonly) mode | | legacyMode | `false` | Maintain some backwards compatibility (see the [Migration Guide](./v3-to-v4.md)) | | isolationPoolOptions | | See the [Isolated Execution Guide](./isolated-execution.md) | | pingInterval | | Send `PING` command at interval (in ms). Useful with "[Azure Cache for Redis](https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices-connection#idle-timeout)" | ## Reconnect Strategy You can implement a custom reconnect strategy as a function: - Receives the number of retries attempted so far. - Returns `number | Error`: - `number`: wait time in milliseconds prior to attempting a reconnect. - `Error`: closes the client and flushes internal command queues. ## TLS To enable TLS, set `socket.tls` to `true`. Below are some basic examples. > For configuration options see [tls.connect](https://nodejs.org/api/tls.html#tlsconnectoptions-callback) and [tls.createSecureContext](https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions), as those are the underlying functions used by this library. ### Create a SSL client ```typescript createClient({ socket: { tls: true, ca: '...', cert: '...' } }); ``` ### Create a SSL client using a self-signed certificate ```typescript createClient({ socket: { tls: true, rejectUnauthorized: false, cert: '...' } }); ``` node-redis-redis-4.5.1/docs/clustering.md000066400000000000000000000130211433774114400203140ustar00rootroot00000000000000# Clustering ## Basic Example Connecting to a cluster is a bit different. Create the client by specifying some (or all) of the nodes in your cluster and then use it like a regular client instance: ```typescript import { createCluster } from 'redis'; const cluster = createCluster({ rootNodes: [ { url: 'redis://10.0.0.1:30001' }, { url: 'redis://10.0.0.2:30002' } ] }); cluster.on('error', (err) => console.log('Redis Cluster Error', err)); await cluster.connect(); await cluster.set('key', 'value'); const value = await cluster.get('key'); ``` ## `createCluster` configuration > See the [client configuration](./client-configuration.md) page for the `rootNodes` and `defaults` configuration schemas. | Property | Default | Description | |------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | rootNodes | | An array of root nodes that are part of the cluster, which will be used to get the cluster topology. Each element in the array is a client configuration object. There is no need to specify every node in the cluster, 3 should be enough to reliably connect and obtain the cluster configuration from the server | | defaults | | The default configuration values for every client in the cluster. Use this for example when specifying an ACL user to connect with | | useReplicas | `false` | When `true`, distribute load by executing readonly commands (such as `GET`, `GEOSEARCH`, etc.) across all cluster nodes. When `false`, only use master nodes | | maxCommandRedirections | `16` | The maximum number of times a command will be redirected due to `MOVED` or `ASK` errors | | nodeAddressMap | | Defines the [node address mapping](#node-address-map) | | modules | | Included [Redis Modules](../README.md#packages) | | scripts | | Script definitions (see [Lua Scripts](../README.md#lua-scripts)) | | functions | | Function definitions (see [Functions](../README.md#functions)) | ## Node Address Map A node address map is required when a Redis cluster is configured with addresses that are inaccessible by the machine running the Redis client. This is a mapping of addresses and ports, with the values being the accessible address/port combination. Example: ```javascript createCluster({ rootNodes: [{ url: 'external-host-1.io:30001' }, { url: 'external-host-2.io:30002' }], nodeAddressMap: { '10.0.0.1:30001': { host: 'external-host-1.io', port: 30001 }, '10.0.0.2:30002': { host: 'external-host-2.io', port: 30002 } } }); ``` > This is a common problem when using ElastiCache. See [Accessing ElastiCache from outside AWS](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/accessing-elasticache.html) for more information on that. ## Command Routing ### Commands that operate on Redis Keys Commands such as `GET`, `SET`, etc. are routed by the first key, for instance `MGET 1 2 3` will be routed by the key `1`. ### [Server Commands](https://redis.io/commands#server) Admin commands such as `MEMORY STATS`, `FLUSHALL`, etc. are not attached to the cluster, and must be executed on a specific node via `.getSlotMaster()`. ### "Forwarded Commands" Certain commands (e.g. `PUBLISH`) are forwarded to other cluster nodes by the Redis server. This client sends these commands to a random node in order to spread the load across the cluster. node-redis-redis-4.5.1/docs/isolated-execution.md000066400000000000000000000037101433774114400217460ustar00rootroot00000000000000# Isolated Execution Sometimes you want to run your commands on an exclusive connection. There are a few reasons to do this: - You're using [transactions]() and need to `WATCH` a key or keys for changes. - You want to run a blocking command that will take over the connection, such as `BLPOP` or `BLMOVE`. - You're using the `MONITOR` command which also takes over a connection. Below are several examples of how to use isolated execution. > NOTE: Behind the scenes we're using [`generic-pool`](https://www.npmjs.com/package/generic-pool) to provide a pool of connections that can be isolated. Go there to learn more. ## The Simple Scenario This just isolates execution on a single connection. Do what you want with that connection: ```typescript await client.executeIsolated(async isolatedClient => { await isolatedClient.set('key', 'value'); await isolatedClient.get('key'); }); ``` ## Transactions Things get a little more complex with transactions. Here we are `.watch()`ing some keys. If the keys change during the transaction, a `WatchError` is thrown when `.exec()` is called: ```typescript try { await client.executeIsolated(async isolatedClient => { await isolatedClient.watch('key'); const multi = isolatedClient.multi() .ping() .get('key'); if (Math.random() > 0.5) { await isolatedClient.watch('another-key'); multi.set('another-key', await isolatedClient.get('another-key') / 2); } return multi.exec(); }); } catch (err) { if (err instanceof WatchError) { // the transaction aborted } } ``` ## Blocking Commands For blocking commands, you can execute a tidy little one-liner: ```typescript await client.executeIsolated(isolatedClient => isolatedClient.blPop('key')); ``` Or, you can just run the command directly, and provide the `isolated` option: ```typescript await client.blPop( commandOptions({ isolated: true }), 'key' ); ``` node-redis-redis-4.5.1/docs/v3-to-v4.md000066400000000000000000000051051433774114400174400ustar00rootroot00000000000000# v3 to v4 Migration Guide Version 4 of Node Redis is a major refactor. While we have tried to maintain backwards compatibility where possible, several interfaces have changed. Read this guide to understand the differences and how to implement version 4 in your application. ## All of the Breaking Changes See the [Change Log](../CHANGELOG.md). ### Promises Node Redis now uses native [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) by default for all functions. ### `createClient` The configuration object passed to `createClient` has changed significantly with this release. See the [client configuration guide](./client-configuration.md) for details. ### No Auto Connect In V4, the client does not automatically connect to the server. Instead you need to run `.connect()` after creating the client or you will receive an error: `ClientClosedError: The client is closed`. ```typescript import { createClient } from 'redis'; const client = createClient(); await client.connect(); await client.ping(); ``` ### All the removed events The following events that existed in V3 were removed in V4: 1. `warning` 2. `subscribe` 3. `psubscribe` 4. `unsubscribe` 5. `message` 6. `message_buffer` 7. `messageBuffer` 8. `pmessage` 9. `pmessage_buffer` 10. `pmessageBuffer` 11. `monitor` #### No `message`-like event In V4, you don't need to add a listener to the `message`-like events (items 5 to 10 of the above list), you can get the message directly in `subscribe`-like commands. The second argument of these commands is a callback, which will be triggered every time there is a message published to the channel. The third argument to these commands is a boolean to set `bufferMode` (default `false`). If it's set to `true` you will receive a buffer instead of a string. The `subscribe`-like commands return a promise. If the command is executed successfully the promise will be fulfilled, otherwise the promise will be rejected. ```typescript import { createClient } from 'redis'; const subscriber = createClient(); await subscriber.connect(); await subscriber.subscribe('channel_name', (message, channelName) => { console.info(message, channelName); }); ``` ## Legacy Mode Use legacy mode to preserve the backwards compatibility of commands while still getting access to the updated experience: ```typescript const client = createClient({ legacyMode: true }); // legacy mode client.set('key', 'value', 'NX', (err, reply) => { // ... }); // version 4 interface is still accessible await client.v4.set('key', 'value', { NX: true }); ``` node-redis-redis-4.5.1/examples/000077500000000000000000000000001433774114400165045ustar00rootroot00000000000000node-redis-redis-4.5.1/examples/.gitignore000066400000000000000000000000221433774114400204660ustar00rootroot00000000000000package-lock.json node-redis-redis-4.5.1/examples/README.md000066400000000000000000000156051433774114400177720ustar00rootroot00000000000000# Node Redis: Examples This folder contains example scripts showing how to use Node Redis in different scenarios. | File Name | Description | | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | `blocking-list-pop.js` | Block until an element is pushed to a list | | `bloom-filter.js` | Space efficient set membership checks with a [Bloom Filter](https://en.wikipedia.org/wiki/Bloom_filter) using [RedisBloom](https://redisbloom.io) | | `command-with-modifiers.js` | Define a script that allows to run a command with several modifiers | | `connect-as-acl-user.js` | Connect to Redis 6 using an ACL user | | `connect-to-cluster.js` | Connect to Redis cluster | | `count-min-sketch.js` | Estimate the frequency of a given event using the [RedisBloom](https://redisbloom.io) Count-Min Sketch | | `cuckoo-filter.js` | Space efficient set membership checks with a [Cuckoo Filter](https://en.wikipedia.org/wiki/Cuckoo_filter) using [RedisBloom](https://redisbloom.io) | | `get-server-time.js` | Get the time from the Redis server | | `hyperloglog.js` | Showing use of Hyperloglog commands [PFADD, PFCOUNT and PFMERGE](https://redis.io/commands/?group=hyperloglog) | | `lua-multi-incr.js` | Define a custom lua script that allows you to perform INCRBY on multiple keys | | `managing-json.js` | Store, retrieve and manipulate JSON data atomically with [RedisJSON](https://redisjson.io/) | | `pubsub-publisher.js` | Adds multiple messages on 2 different channels messages to Redis | | `pubsub-subscriber.js` | Reads messages from channels using `PSUBSCRIBE` command | | `search-hashes.js` | Uses [RediSearch](https://redisearch.io) to index and search data in hashes | | `search-json.js` | Uses [RediSearch](https://redisearch.io/) and [RedisJSON](https://redisjson.io/) to index and search JSON data | | `set-scan.js` | An example script that shows how to use the SSCAN iterator functionality | | `sorted-set.js` | Add members with scores to a Sorted Set and retrieve them using the ZSCAN iteractor functionality | | `stream-producer.js` | Adds entries to a [Redis Stream](https://redis.io/topics/streams-intro) using the `XADD` command | | `stream-consumer.js` | Reads entries from a [Redis Stream](https://redis.io/topics/streams-intro) using the blocking `XREAD` command | | `time-series.js` | Create, populate and query timeseries data with [Redis Timeseries](https://redistimeseries.io) | | `topk.js` | Use the [RedisBloom](https://redisbloom.io) TopK to track the most frequently seen items. | | `stream-consumer-group.js` | Reads entties from a [Redis Stream](https://redis.io/topics/streams-intro) as part of a consumer group using the blocking `XREADGROUP` command | | `transaction-with-watch.js` | An Example of [Redis transaction](https://redis.io/docs/manual/transactions) with `WATCH` command on isolated connection with optimistic locking | ## Contributing We'd love to see more examples here. If you have an idea that you'd like to see included here, submit a Pull Request and we'll be sure to review it! Don't forget to check out our [contributing guide](../CONTRIBUTING.md). ## Setup To set up the examples folder so that you can run an example / develop one of your own: ``` $ git clone https://github.com/redis/node-redis.git $ cd node-redis $ npm install -ws && npm run build-all $ cd examples $ npm install ``` ### Coding Guidelines for Examples When adding a new example, please follow these guidelines: - Add your code in a single JavaScript or TypeScript file per example, directly in the `examples` folder - Do not introduce other dependencies in your example - Give your `.js` file a meaningful name using `-` separators e.g. `adding-to-a-stream.js` / `adding-to-a-stream.ts` - Indent your code using 2 spaces - Use the single line `//` comment style and comment your code - Add a comment at the top of your `.js` / `.ts` file describing what your example does - Add a comment at the top of your `.js` / `.ts` file describing any Redis commands that need to be run to set up data for your example (try and keep this minimal) - Use semicolons - Use `async` and `await` - Use single quotes, `'hello'` not `"hello"` - Use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) when embedding expressions in strings - Unless your example requires a connection string, assume Redis is on the default localhost port 6379 with no password - Use meaningful example data, let's not use `foo`, `bar`, `baz` etc! - Leave an empty line at the end of your `.js` file - Update this `README.md` file to add your example to the table Use [connect-as-acl-user.js](./connect-as-acl-user.js) as a guide to develop a well formatted example script. ### Example Template Here's a starter template for adding a new example, imagine this is stored in `do-something.js`: ```javascript // This comment should describe what the example does // and can extend to multiple lines. // Set up the data in redis-cli using these commands: // // // Alternatively, add code that sets up the data. import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Add your example code here... await client.quit(); ``` node-redis-redis-4.5.1/examples/blocking-list-pop.js000066400000000000000000000014441433774114400224020ustar00rootroot00000000000000// This example shows how to use the blocking LPUSH command. // This code shows how to run with isolation the blPop Command to block the script while waiting for a value to be pushed to the list. // The script will be blocked until the LPUSH command is executed. // After which we log the list and quit the client. import { createClient, commandOptions } from 'redis'; const client = createClient(); await client.connect(); const keyName = 'keyName'; const blpopPromise = client.blPop( commandOptions({ isolated: true }), keyName, 0 ); await client.lPush(keyName, 'value'); const listItem = await blpopPromise; console.log('blpopPromise resolved'); // listItem will be: // {"key":"keyName","element":"value"} console.log(`listItem is '${JSON.stringify(listItem)}'`); await client.quit(); node-redis-redis-4.5.1/examples/bloom-filter.js000066400000000000000000000045451433774114400214450ustar00rootroot00000000000000// This example demonstrates the use of the Bloom Filter // in the RedisBloom module (https://redis.io/docs/stack/bloom/) import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Delete any pre-existing Bloom Filter. await client.del('mybloom'); // Reserve a Bloom Filter with configurable error rate and capacity. // https://redis.io/commands/bf.reserve/ try { await client.bf.reserve('mybloom', 0.01, 1000); console.log('Reserved Bloom Filter.'); } catch (e) { if (e.message.endsWith('item exists')) { console.log('Bloom Filter already reserved.'); } else { console.log('Error, maybe RedisBloom is not installed?:'); console.log(e); } } // Add items to Bloom Filter individually with BF.ADD command. // https://redis.io/commands/bf.add/ await Promise.all([ client.bf.add('mybloom', 'leibale'), client.bf.add('mybloom', 'simon'), client.bf.add('mybloom', 'guy'), client.bf.add('mybloom', 'suze'), client.bf.add('mybloom', 'brian'), client.bf.add('mybloom', 'steve'), client.bf.add('mybloom', 'kyle'), client.bf.add('mybloom', 'josefin'), client.bf.add('mybloom', 'alex'), client.bf.add('mybloom', 'nava'), ]); // Add multiple items to Bloom Filter at once with BF.MADD command. // https://redis.io/commands/bf.madd/ await client.bf.mAdd('mybloom', [ 'kaitlyn', 'rachel' ]); console.log('Added members to Bloom Filter.'); // Check whether a member exists with the BF.EXISTS command. // https://redis.io/commands/bf.exists/ const simonExists = await client.bf.exists('mybloom', 'simon'); console.log(`simon ${simonExists ? 'may' : 'does not'} exist in the Bloom Filter.`); // Check whether multiple members exist with the BF.MEXISTS command. // https://redis.io/commands/bf.mexists/ const [ lanceExists, leibaleExists ] = await client.bf.mExists('mybloom', [ 'lance', 'leibale' ]); console.log(`lance ${lanceExists ? 'may' : 'does not'} exist in the Bloom Filter.`); console.log(`leibale ${leibaleExists ? 'may' : 'does not'} exist in the Bloom Filter.`); // Get stats for the Bloom Filter with the BF.INFO command. // https://redis.io/commands/bf.info/ const info = await client.bf.info('mybloom'); // info looks like this: // // { // capacity: 1000, // size: 1531, // numberOfFilters: 1, // numberOfInsertedItems: 12, // expansionRate: 2 // } console.log(info); await client.quit(); node-redis-redis-4.5.1/examples/command-with-modifiers.js000066400000000000000000000007001433774114400234050ustar00rootroot00000000000000// Define a custom script that shows example of SET command // with several modifiers. import { createClient } from 'redis'; const client = createClient(); await client.connect(); await client.del('mykey'); let result = await client.set('mykey', 'myvalue', { EX: 60, GET: true }); console.log(result); //null result = await client.set('mykey', 'newvalue', { EX: 60, GET: true }); console.log(result); //myvalue await client.quit(); node-redis-redis-4.5.1/examples/connect-as-acl-user.js000066400000000000000000000013601433774114400226050ustar00rootroot00000000000000// Connect to Redis 6.x as an ACL user. Attempt to run a command // that the user is allowed to execute, and a command that the // user is not allowed to execute. // Create the test user in redis-cli with this command: // acl setuser testuser on >testpassword +ping import { createClient } from 'redis'; const client = createClient({ url: 'redis://testuser:testpassword@127.0.0.1:6379' }); await client.connect(); // Returns PONG console.log(`Response from PING command: ${await client.ping()}`); try { // This will error as this user is not allowed to run this command... console.log(`Response from GET command: ${await client.get('somekey')}`); } catch (e) { console.log(`GET command failed: ${e.message}`); } await client.quit(); node-redis-redis-4.5.1/examples/connect-to-cluster.js000066400000000000000000000014461433774114400225770ustar00rootroot00000000000000// This is an example script to connect to a running cluster. // After connecting to the cluster the code sets and get a value. // To setup this cluster you can follow the guide here: // https://redis.io/docs/manual/scaling/ // In this guide the ports which are being used are 7000 - 7005 import { createCluster } from 'redis'; const cluster = createCluster({ rootNodes : [ { url : 'redis://127.0.0.1:7001' }, { url : 'redis://127.0.0.1:7002' }, { url : 'redis://127.0.0.1:7003' } ] }); cluster.on('error', (err) => console.log('Redis Client Error', err)); await cluster.connect(); await cluster.set('hello', 'cluster'); const value = await cluster.get('hello'); console.log(value); await cluster.quit(); node-redis-redis-4.5.1/examples/count-min-sketch.js000066400000000000000000000036701433774114400222400ustar00rootroot00000000000000// This example demonstrates the use of the Count-Min Sketch // in the RedisBloom module (https://redis.io/docs/stack/bloom/) import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Delete any pre-existing Count-Min Sketch. await client.del('mycms'); // Initialize a Count-Min Sketch with error rate and probability: // https://redis.io/commands/cms.initbyprob/ try { await client.cms.initByProb('mycms', 0.001, 0.01); console.log('Reserved Count Min Sketch.'); } catch (e) { console.log('Error, maybe RedisBloom is not installed?:'); console.log(e); } const teamMembers = [ 'leibale', 'simon', 'guy', 'suze', 'brian', 'steve', 'kyleb', 'kyleo', 'josefin', 'alex', 'nava', 'lance', 'rachel', 'kaitlyn' ]; // Store actual counts for comparison with CMS. let actualCounts = {}; // Randomly emit a team member and count them with the CMS. // https://redis.io/commands/cms.incrby/ for (let n = 0; n < 1000; n++) { const teamMember = teamMembers[Math.floor(Math.random() * teamMembers.length)]; await client.cms.incrBy('mycms', { item: teamMember, incrementBy: 1 }); actualCounts[teamMember] = actualCounts[teamMember] ? actualCounts[teamMember] + 1 : 1; console.log(`Incremented score for ${teamMember}.`); } // Get count estimate for some team members: // https://redis.io/commands/cms.query/ const [ alexCount, rachelCount ] = await client.cms.query('mycms', [ 'alex', 'rachel' ]); console.log(`Count estimate for alex: ${alexCount} (actual ${actualCounts.alex}).`); console.log(`Count estimate for rachel: ${rachelCount} (actual ${actualCounts.rachel}).`); // Get overall information about the Count-Min Sketch: // https://redis.io/commands/cms.info/ const info = await client.cms.info('mycms'); console.log('Count-Min Sketch info:'); // info looks like this: // { // width: 2000, // depth: 7, // count: 1000 // } console.log(info); await client.quit(); node-redis-redis-4.5.1/examples/cuckoo-filter.js000066400000000000000000000043001433774114400216050ustar00rootroot00000000000000// This example demonstrates the use of the Cuckoo Filter // in the RedisBloom module (https://redis.io/docs/stack/bloom/) import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Delete any pre-existing Cuckoo Filter. await client.del('mycuckoo'); // Reserve a Cuckoo Filter with a capacity of 10000 items. // https://redis.io/commands/cf.reserve/ try { await client.cf.reserve('mycuckoo', 10000); console.log('Reserved Cuckoo Filter.'); } catch (e) { console.log('Error, maybe RedisBloom is not installed?:'); console.log(e); } // Add items to Cuckoo Filter individually with CF.ADD command. // https://redis.io/commands/cf.add/ await Promise.all([ client.cf.add('mycuckoo', 'leibale'), client.cf.add('mycuckoo', 'simon'), client.cf.add('mycuckoo', 'guy'), client.cf.add('mycuckoo', 'suze'), client.cf.add('mycuckoo', 'brian'), client.cf.add('mycuckoo', 'steve'), client.cf.add('mycuckoo', 'kyle'), client.cf.add('mycuckoo', 'josefin'), client.cf.add('mycuckoo', 'alex'), client.cf.add('mycuckoo', 'nava'), ]); // Add items to the Cuckoo Filter only if they don't exist in it... // https://redis.io/commands/cf.addnx/ const nxReply = await Promise.all([ client.cf.addNX('mycuckoo', 'kaitlyn'), // New client.cf.addNX('mycuckoo', 'rachel'), // New client.cf.addNX('mycuckoo', 'brian') // Previously added ]); console.log('Added members to Cuckoo Filter.'); console.log('nxReply:'); // nxReply looks like this: // [ // true, // true, // false // ] console.log(nxReply); // Check whether a member exists with the CF.EXISTS command. // https://redis.io/commands/cf.exists/ const simonExists = await client.bf.exists('mycuckoo', 'simon'); console.log(`simon ${simonExists ? 'may' : 'does not'} exist in the Cuckoo Filter.`); // Get stats for the Cuckoo Filter with the CF.INFO command: // https://redis.io/commands/cf.info/ const info = await client.cf.info('mycuckoo'); // info looks like this: // { // size: 16440, // numberOfBuckets: 8192, // numberOfFilters: 1, // numberOfInsertedItems: 12, // numberOfDeletedItems: 0, // bucketSize: 2, // expansionRate: 1, // maxIteration: 20 // } console.log(info); await client.quit(); node-redis-redis-4.5.1/examples/get-server-time.js000066400000000000000000000004231433774114400220600ustar00rootroot00000000000000// Get the time from the Redis Server. import { createClient } from 'redis'; const client = createClient(); await client.connect(); const serverTime = await client.time(); // 2022-02-25T12:57:40.000Z { microseconds: 351346 } console.log(serverTime); await client.quit(); node-redis-redis-4.5.1/examples/hyperloglog.js000066400000000000000000000040531433774114400213770ustar00rootroot00000000000000// Example to log traffic data at intersections for the city of San Francisco. // Log license plates of each car scanned at each intersection and add to the intersections Hyperloglog. // Reference: https://www.youtube.com/watch?v=MunL8nnwscQ import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Use `pfAdd` to add an element to a Hyperloglog, creating the Hyperloglog if necessary. // await client.pfAdd(key, value) // To get a count, the `pfCount` method is used. // await client.pfCount(key) try { // Corner of Market Street (ID: 12) and 10th street (ID:27). await client.pfAdd('count:sf:12:27', 'GHN34X'); await client.pfAdd('count:sf:12:27', 'ECN94Y'); await client.pfAdd('count:sf:12:27', 'VJL12V'); await client.pfAdd('count:sf:12:27', 'ORV87O'); // To get the count of Corner of Market Street (ID: 12) and 10th street (ID:27). const countForMarket10thStreet = await client.pfCount('count:sf:12:27'); console.log(`Count for Market Street & 10th Street is ${countForMarket10thStreet}`); // Count for Market Street & 10th Street is 4. // Corner of Market Street (ID: 12) and 11 street (ID:26). await client.pfAdd('count:sf:12:26', 'GHN34X'); await client.pfAdd('count:sf:12:26', 'ECN94Y'); await client.pfAdd('count:sf:12:26', 'IRV84E'); await client.pfAdd('count:sf:12:26', 'ORV87O'); await client.pfAdd('count:sf:12:26', 'TEY34S'); // To get the count of Corner of Market Street (ID: 12) and 11th street (ID:26). const countForMarket11thStreet = await client.pfCount('count:sf:12:26'); console.log(`Count for Market Street & 11th Street is ${countForMarket11thStreet}`); // Count for Market Street & 11th Street is 5. // To merge the Hyperloglogs `count:sf:12:26` and `count:sf:12:27`. await client.pfMerge('count:merge', ['count:sf:12:27', 'count:sf:12:26']); const countMerge = await client.pfCount('count:merge'); console.log(`Count for the merge is ${countMerge}`); // Count for the merge is 6. } catch (e) { // something went wrong. console.error(e); } await client.quit(); node-redis-redis-4.5.1/examples/lua-multi-incr.js000066400000000000000000000012511433774114400217030ustar00rootroot00000000000000// Define a custome lua script that accepts two keys and an amount to // increment each of them by import { createClient, defineScript } from 'redis'; const client = createClient({ scripts: { mincr: defineScript({ NUMBER_OF_KEYS: 2, SCRIPT: 'return {' + 'redis.pcall("INCRBY", KEYS[1], ARGV[1]),' + 'redis.pcall("INCRBY", KEYS[2], ARGV[1])' + '}', transformArguments(key1, key2, increment) { return [key1, key2, increment.toString()]; }, }), }, }); await client.connect(); await client.set('mykey', '5'); console.log(await client.mincr('mykey', 'myotherkey', 10)); // [ 15, 10 ] await client.quit(); node-redis-redis-4.5.1/examples/managing-json.js000066400000000000000000000031631433774114400215750ustar00rootroot00000000000000// Store, retrieve and manipulate JSON data atomically with RedisJSON. import { createClient } from 'redis'; const client = createClient(); await client.connect(); await client.del('noderedis:jsondata'); // Store a JSON object... await client.json.set('noderedis:jsondata', '$', { name: 'Roberta McDonald', pets: [ { name: 'Fluffy', species: 'dog', age: 5, isMammal: true }, { name: 'Rex', species: 'dog', age: 3, isMammal: true }, { name: 'Goldie', species: 'fish', age: 2, isMammal: false } ], address: { number: 99, street: 'Main Street', city: 'Springfield', state: 'OH', country: 'USA' } }); // Retrieve the name and age of the second pet in the pets array. let results = await client.json.get('noderedis:jsondata', { path: [ '$.pets[1].name', '$.pets[1].age' ] }); // { '$.pets[1].name': [ 'Rex' ], '$.pets[1].age': [ 3 ] } console.log(results); // Goldie had a birthday, increment the age... await client.json.numIncrBy('noderedis:jsondata', '$.pets[2].age', 1); results = await client.json.get('noderedis:jsondata', { path: '$.pets[2].age' }); // Goldie is 3 years old now. console.log(`Goldie is ${JSON.stringify(results[0])} years old now.`); // Add a new pet... await client.json.arrAppend('noderedis:jsondata', '$.pets', { name: 'Robin', species: 'bird', isMammal: false, age: 1 }); // How many pets do we have now? const numPets = await client.json.arrLen('noderedis:jsondata', '$.pets'); // We now have 4 pets. console.log(`We now have ${numPets} pets.`); await client.quit(); node-redis-redis-4.5.1/examples/package.json000066400000000000000000000003241433774114400207710ustar00rootroot00000000000000{ "name": "node-redis-examples", "version": "1.0.0", "description": "node-redis 4 example script", "main": "index.js", "private": true, "type": "module", "dependencies": { "redis": "../" } } node-redis-redis-4.5.1/examples/pubsub-publisher.js000066400000000000000000000014111433774114400223320ustar00rootroot00000000000000// A sample publisher using the publish function to put message on different channels. // https://redis.io/commands/publish/ import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Declare constant variables for the name of the clients we will publish to as they will be required for logging. const channel1 = 'chan1nel'; const channel2 = 'chan2nel'; for (let i = 0; i < 10000; i++) { // 1st channel created to publish 10000 messages. await client.publish(channel1, `channel1_message_${i}`); console.log(`publishing message on ${channel1}`); // 2nd channel created to publish 10000 messages. await client.publish(channel2, `channel2_message_${i}`); console.log(`publishing message on ${channel2}`); } node-redis-redis-4.5.1/examples/pubsub-subscriber.js000066400000000000000000000034111433774114400225020ustar00rootroot00000000000000// A sample subscriber showing how the subscribe method and pSubscribe method work. // https://redis.io/commands/subscribe/ // https://redis.io/commands/pSubscribe/ // This consumes messages published by pubsub-publisher.js import { createClient} from 'redis'; // Create and connect client before executing any Redis commands. const client = createClient(); await client.connect(); // Each subscriber needs to connect individually therefore we duplicate the client. const channel1Sub = client.duplicate(); const channel2Sub = client.duplicate(); const noChannelsSub = client.duplicate(); const allChannelsSub = client.duplicate(); await channel1Sub.connect(); await channel2Sub.connect(); await noChannelsSub.connect(); await allChannelsSub.connect(); // This subscriber only will receive messages from channel 1 as they are using the subscribe method and subscribed to chan1nel. await channel1Sub.subscribe('chan1nel', (message) => { console.log(`Channel1 subscriber collected message: ${message}`); },true); // This subscriber only will receive messages from channel 2 as they are using the subscribe method and subscribed to chan2nel. await channel2Sub.subscribe('chan2nel', (message) => { console.log(`Channel2 subscriber collected message: ${message}`); },true); // This subscriber will not receive any messages as its channel does not exist. await noChannelsSub.subscribe('chan*nel', (message) => { console.log(`This message will never be seen as we are not using pSubscribe here. ${message}`); },true); // This subscriber receive messages from both channel 1 and channel 2 using the pSubscribe method. await allChannelsSub.pSubscribe('chan*nel', (message, channel) => { console.log(`Channel ${channel} sent message: ${message}`); },true);node-redis-redis-4.5.1/examples/search-hashes.js000066400000000000000000000043251433774114400215640ustar00rootroot00000000000000// This example demonstrates how to use RediSearch to index and query data // stored in Redis hashes. import { createClient, SchemaFieldTypes } from 'redis'; const client = createClient(); await client.connect(); // Create an index... try { // Documentation: https://redis.io/commands/ft.create/ await client.ft.create('idx:animals', { name: { type: SchemaFieldTypes.TEXT, sortable: true }, species: SchemaFieldTypes.TAG, age: SchemaFieldTypes.NUMERIC }, { ON: 'HASH', PREFIX: 'noderedis:animals' }); } catch (e) { if (e.message === 'Index already exists') { console.log('Index exists already, skipped creation.'); } else { // Something went wrong, perhaps RediSearch isn't installed... console.error(e); process.exit(1); } } // Add some sample data... // https://redis.io/commands/hset/ await Promise.all([ client.hSet('noderedis:animals:1', {name: 'Fluffy', species: 'cat', age: 3}), client.hSet('noderedis:animals:2', {name: 'Ginger', species: 'cat', age: 4}), client.hSet('noderedis:animals:3', {name: 'Rover', species: 'dog', age: 9}), client.hSet('noderedis:animals:4', {name: 'Fido', species: 'dog', age: 7}) ]); // Perform a search query, find all the dogs... sort by age, descending. // Documentation: https://redis.io/commands/ft.search/ // Query syntax: https://redis.io/docs/stack/search/reference/query_syntax/ const results = await client.ft.search( 'idx:animals', '@species:{dog}', { SORTBY: { BY: 'age', DIRECTION: 'DESC' // or 'ASC (default if DIRECTION is not present) } } ); // results: // { // total: 2, // documents: [ // { // id: 'noderedis:animals:3', // value: { // name: 'Rover', // species: 'dog', // age: '9' // } // }, // { // id: 'noderedis:animals:4', // value: { // name: 'Fido', // species: 'dog', // age: '7' // } // } // ] // } console.log(`Results found: ${results.total}.`); for (const doc of results.documents) { // noderedis:animals:3: Rover, 9 years old. // noderedis:animals:4: Fido, 7 years old. console.log(`${doc.id}: ${doc.value.name}, ${doc.value.age} years old.`); } await client.quit(); node-redis-redis-4.5.1/examples/search-json.js000066400000000000000000000064201433774114400212600ustar00rootroot00000000000000// This example demonstrates how to use RediSearch and RedisJSON together. // Requires both the RediSearch and RedisJSON modules: // https://redis.io/docs/stack/search/ // https://redis.io/docs/stack/json/ import { createClient, SchemaFieldTypes, AggregateGroupByReducers, AggregateSteps } from 'redis'; const client = createClient(); await client.connect(); // Create an index. // https://redis.io/commands/ft.create/ try { await client.ft.create('idx:users', { '$.name': { type: SchemaFieldTypes.TEXT, SORTABLE: 'UNF' }, '$.age': { type: SchemaFieldTypes.NUMERIC, AS: 'age' }, '$.coins': { type: SchemaFieldTypes.NUMERIC, AS: 'coins' }, '$.email': { type: SchemaFieldTypes.TAG, AS: 'email' } }, { ON: 'JSON', PREFIX: 'noderedis:users' }); } catch (e) { if (e.message === 'Index already exists') { console.log('Index exists already, skipped creation.'); } else { // Something went wrong, perhaps RediSearch isn't installed... console.error(e); process.exit(1); } } // Add some users. // https://redis.io/commands/json.set/ await Promise.all([ client.json.set('noderedis:users:1', '$', { name: 'Alice', age: 32, coins: 100, email: 'alice@nonexist.com' }), client.json.set('noderedis:users:2', '$', { name: 'Bob', age: 23, coins: 15, email: 'bob@somewhere.gov' }) ]); // Search all users under 30 console.log('Users under 30 years old:'); console.log( // https://redis.io/commands/ft.search/ JSON.stringify( await client.ft.search('idx:users', '@age:[0 30]'), null, 2 ) ); // { // "total": 1, // "documents": [ // { // "id": "noderedis:users:2", // "value": { // "name": "Bob", // "age": 23, // "coins": 15, // "email": "bob@somewhere.gov" // } // } // ] // } // Find a user by email - note we need to escape . and @ characters // in the email address. This applies for other punctuation too. // https://redis.io/docs/stack/search/reference/tags/#including-punctuation-in-tags console.log('Users with email "bob@somewhere.gov":'); const emailAddress = 'bob@somewhere.gov'.replace(/[.@\\]/g, '\\$&'); console.log( JSON.stringify( await client.ft.search('idx:users', `@email:{${emailAddress}}`), null, 2 ) ); // { // "total": 1, // "documents": [ // { // "id": "noderedis:users:2", // "value": { // "name": "Bob", // "age": 23, // "coins": 15, // "email": "bob@somewhere.gov" // } // } // ] // } // Some aggregrations, what's the average age and total number of coins... // https://redis.io/commands/ft.aggregate/ console.log('Aggregation Demo:'); console.log( JSON.stringify( await client.ft.aggregate('idx:users', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: [{ type: AggregateGroupByReducers.AVG, property: 'age', AS: 'averageAge' }, { type: AggregateGroupByReducers.SUM, property: 'coins', AS: 'totalCoins' }] }] }), null, 2 ) ); // { // "total": 1, // "results": [ // { // "averageAge": "27.5", // "totalCoins": "115" // } // ] // } await client.quit(); node-redis-redis-4.5.1/examples/set-scan.js000066400000000000000000000007031433774114400205570ustar00rootroot00000000000000// An example script that shows how to use the SSCAN iterator functionality to retrieve the contents of a Redis set. // Create the set in redis-cli with this command: // sadd setName a b c d e f g h i j k l m n o p q import { createClient } from 'redis'; const client = createClient(); await client.connect(); const setName = 'setName'; for await (const member of client.sScanIterator(setName)) { console.log(member); } await client.quit(); node-redis-redis-4.5.1/examples/sorted-set.js000066400000000000000000000011721433774114400211340ustar00rootroot00000000000000// Add several values with their scores to a Sorted Set, // then retrieve them all using ZSCAN. import { createClient } from 'redis'; const client = createClient(); await client.connect(); await client.zAdd('mysortedset', [ { score: 99, value: 'Ninety Nine' }, { score: 100, value: 'One Hundred' }, { score: 101, value: 'One Hundred and One' } ]); // Get all of the values/scores from the sorted set using // the scan approach: // https://redis.io/commands/zscan for await (const memberWithScore of client.zScanIterator('mysortedset')) { console.log(memberWithScore); } await client.quit(); node-redis-redis-4.5.1/examples/stream-consumer-group.js000066400000000000000000000055031433774114400233230ustar00rootroot00000000000000// A sample stream consumer using the blocking variant of XREADGROUP. // https://redis.io/commands/xreadgroup/ // This consumer works in collaboration with other instances of itself // in the same consumer group such that the group as a whole receives // every entry from the stream. // // This consumes entries from a stream created by stream-producer.js // // Run this as follows: // // $ node stream-consumer-group.js // // Run multiple instances with different values of // to see them processing the stream as a group: // // $ node stream-consumer-group.js consumer1 // // In another terminal: // // $ node stream-consumer-group.js consumer2 import { createClient, commandOptions } from 'redis'; const client = createClient(); if (process.argv.length !== 3) { console.log(`usage: node stream-consumer-group.js `); process.exit(1); } const consumerName = process.argv[2]; await client.connect(); // Create the consumer group (and stream) if needed... try { // https://redis.io/commands/xgroup-create/ await client.xGroupCreate('mystream', 'myconsumergroup', '0', { MKSTREAM: true }); console.log('Created consumer group.'); } catch (e) { console.log('Consumer group already exists, skipped creation.'); } console.log(`Starting consumer ${consumerName}.`); while (true) { try { // https://redis.io/commands/xreadgroup/ let response = await client.xReadGroup( commandOptions({ isolated: true }), 'myconsumergroup', consumerName, [ // XREADGROUP can read from multiple streams, starting at a // different ID for each... { key: 'mystream', id: '>' // Next entry ID that no consumer in this group has read } ], { // Read 1 entry at a time, block for 5 seconds if there are none. COUNT: 1, BLOCK: 5000 } ); if (response) { // Response is an array of streams, each containing an array of // entries: // // [ // { // "name": "mystream", // "messages": [ // { // "id": "1642088708425-0", // "message": { // "num": "999" // } // } // ] // } // ] console.log(JSON.stringify(response)); // Use XACK to acknowledge successful processing of this // stream entry. // https://redis.io/commands/xack/ const entryId = response[0].messages[0].id; await client.xAck('mystream', 'myconsumergroup', entryId); console.log(`Acknowledged processing of entry ${entryId}.`); } else { // Response is null, we have read everything that is // in the stream right now... console.log('No new stream entries.'); } } catch (err) { console.error(err); } } node-redis-redis-4.5.1/examples/stream-consumer.js000066400000000000000000000030131433774114400221630ustar00rootroot00000000000000// A sample stream consumer using the blocking variant of XREAD. // https://redis.io/commands/xread/ // This consumes entries from a stream created by stream-producer.js import { createClient, commandOptions } from 'redis'; const client = createClient(); await client.connect(); let currentId = '0-0'; // Start at lowest possible stream ID while (true) { try { let response = await client.xRead( commandOptions({ isolated: true }), [ // XREAD can read from multiple streams, starting at a // different ID for each... { key: 'mystream', id: currentId } ], { // Read 1 entry at a time, block for 5 seconds if there are none. COUNT: 1, BLOCK: 5000 } ); if (response) { // Response is an array of streams, each containing an array of // entries: // [ // { // "name": "mystream", // "messages": [ // { // "id": "1642088708425-0", // "message": { // "num": "999" // } // } // ] // } // ] console.log(JSON.stringify(response)); // Get the ID of the first (only) entry returned. currentId = response[0].messages[0].id; console.log(currentId); } else { // Response is null, we have read everything that is // in the stream right now... console.log('No new stream entries.'); } } catch (err) { console.error(err); } } node-redis-redis-4.5.1/examples/stream-producer.js000066400000000000000000000025101433774114400221540ustar00rootroot00000000000000// A sample stream producer using XADD. // https://redis.io/commands/xadd/ import { createClient } from 'redis'; const client = createClient(); await client.connect(); for (let i = 0; i < 10000; i++) { await client.xAdd( 'mystream', '*', // * = Let Redis generate a timestamp ID for this new entry. // Payload to add to the stream: { i: i.toString() // Other name/value pairs can go here as required... } ); // Also add to a stream whose length we will cap at approximately // 1000 entries using the MAXLEN trimming strategy: // https://redis.io/commands/xadd/ await client.xAdd( 'mytrimmedstream', '*', // Payload to add to the stream: { i: i.toString() // Other name/value pairs can go here as required... }, // Specify a trimming strategy... { TRIM: { strategy: 'MAXLEN', // Trim by length. strategyModifier: '~', // Approximate trimming. threshold: 1000 // Retain around 1000 entries. } } ); } // Take a look at how many entries are in the streams... // https://redis.io/commands/xlen/ // Should be 10000: console.log(`Length of mystream: ${await client.xLen('mystream')}.`); // Should be approximately 1000: console.log(`Length of mytrimmedstream: ${await client.xLen('mytrimmedstream')}.`); await client.quit(); node-redis-redis-4.5.1/examples/time-series.js000066400000000000000000000074251433774114400213000ustar00rootroot00000000000000// Add data to a Redis TimeSeries and query it. // Requires the RedisTimeSeries module: https://redis.io/docs/stack/timeseries/ import { createClient } from 'redis'; import { TimeSeriesDuplicatePolicies, TimeSeriesEncoding, TimeSeriesAggregationType } from '@redis/time-series'; const client = createClient(); await client.connect(); await client.del('mytimeseries'); try { // Create a timeseries // https://redis.io/commands/ts.create/ const created = await client.ts.create('mytimeseries', { RETENTION: 86400000, // 1 day in milliseconds ENCODING: TimeSeriesEncoding.UNCOMPRESSED, // No compression DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.BLOCK // No duplicates }); if (created === 'OK') { console.log('Created timeseries.'); } else { console.log('Error creating timeseries :('); process.exit(1); } let value = Math.floor(Math.random() * 1000) + 1; // Random data point value let currentTimestamp = 1640995200000; // Jan 1 2022 00:00:00 let num = 0; while (num < 10000) { // Add a new value to the timeseries, providing our own timestamp: // https://redis.io/commands/ts.add/ await client.ts.add('mytimeseries', currentTimestamp, value); console.log(`Added timestamp ${currentTimestamp}, value ${value}.`); num += 1; value = Math.floor(Math.random() * 1000) + 1; // Get another random value currentTimestamp += 1000; // Move on one second. } // Add multiple values to the timeseries in round trip to the server: // https://redis.io/commands/ts.madd/ const response = await client.ts.mAdd([{ key: 'mytimeseries', timestamp: currentTimestamp + 60000, value: Math.floor(Math.random() * 1000) + 1 }, { key: 'mytimeseries', timestamp: currentTimestamp + 120000, value: Math.floor(Math.random() * 1000) + 1 }]); // response = array of timestamps added by TS.MADD command. if (response.length === 2) { console.log('Added 2 entries to timeseries with TS.MADD.'); } // Update timeseries retention with TS.ALTER: // https://redis.io/commands/ts.alter/ const alterResponse = await client.ts.alter('mytimeseries', { RETENTION: 0 // Keep the entries forever }); if (alterResponse === 'OK') { console.log('Timeseries retention settings altered successfully.'); } // Query the timeseries with TS.RANGE: // https://redis.io/commands/ts.range/ const fromTimestamp = 1640995200000; // Jan 1 2022 00:00:00 const toTimestamp = 1640995260000; // Jan 1 2022 00:01:00 const rangeResponse = await client.ts.range('mytimeseries', fromTimestamp, toTimestamp, { // Group into 10 second averages. AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 10000 } }); console.log('RANGE RESPONSE:'); // rangeResponse looks like: // [ // { timestamp: 1640995200000, value: 356.8 }, // { timestamp: 1640995210000, value: 534.8 }, // { timestamp: 1640995220000, value: 481.3 }, // { timestamp: 1640995230000, value: 437 }, // { timestamp: 1640995240000, value: 507.3 }, // { timestamp: 1640995250000, value: 581.2 }, // { timestamp: 1640995260000, value: 600 } // ] console.log(rangeResponse); // Get some information about the state of the timeseries. // https://redis.io/commands/ts.info/ const tsInfo = await client.ts.info('mytimeseries'); // tsInfo looks like this: // { // totalSamples: 1440, // memoryUsage: 28904, // firstTimestamp: 1641508920000, // lastTimestamp: 1641595320000, // retentionTime: 86400000, // chunkCount: 7, // chunkSize: 4096, // chunkType: 'uncompressed', // duplicatePolicy: 'block', // labels: [], // sourceKey: null, // rules: [] // } console.log('Timeseries info:'); console.log(tsInfo); } catch (e) { console.error(e); } await client.quit(); node-redis-redis-4.5.1/examples/topk.js000066400000000000000000000062001433774114400200150ustar00rootroot00000000000000// This example demonstrates the use of the Top K // in the RedisBloom module (https://redis.io/docs/stack/bloom/) import { createClient } from 'redis'; const client = createClient(); await client.connect(); // Delete any pre-existing Top K. await client.del('mytopk'); // Reserve a Top K to track the 10 most common items. // https://redis.io/commands/topk.reserve/ try { await client.topK.reserve('mytopk', 10, { width: 400, depth: 10, decay: 0.9 }); console.log('Reserved Top K.'); } catch (e) { if (e.message.endsWith('key already exists')) { console.log('Top K already reserved.'); } else { console.log('Error, maybe RedisBloom is not installed?:'); console.log(e); } } const teamMembers = [ 'leibale', 'simon', 'guy', 'suze', 'brian', 'steve', 'kyleb', 'kyleo', 'josefin', 'alex', 'nava', 'lance', 'rachel', 'kaitlyn' ]; // Add random counts for random team members with TOPK.INCRBY // https://redis.io/commands/topk.incrby/ for (let n = 0; n < 1000; n++) { const teamMember = teamMembers[Math.floor(Math.random() * teamMembers.length)]; const points = Math.floor(Math.random() * 1000) + 1; await client.topK.incrBy('mytopk', { item: teamMember, incrementBy: points }); console.log(`Added ${points} points for ${teamMember}.`); } // List out the top 10 with TOPK.LIST // https://redis.io/commands/topk.list/ const top10 = await client.topK.list('mytopk'); console.log('The top 10:'); // top10 looks like this: // [ // 'guy', 'nava', // 'kaitlyn', 'brian', // 'simon', 'suze', // 'lance', 'alex', // 'steve', 'kyleo' // ] console.log(top10); // List out the top 10 with their counts (requires RedisBloom >=2.2.9) // https://redis.io/commands/topk.list/ const top10WithCounts = await client.topK.listWithCount('mytopk'); console.log('The top 10 with counts:'); console.log(top10WithCounts); // top10WithCounts looks like this: // [ // { item: 'suze', count: 42363 }, // { item: 'lance', count: 41982 }, // { item: 'simon', count: 41831 }, // { item: 'steve', count: 39237 }, // { item: 'guy', count: 39078 }, // { item: 'kyleb', count: 37338 }, // { item: 'leibale', count: 34230 }, // { item: 'kyleo', count: 33812 }, // { item: 'alex', count: 33679 }, // { item: 'nava', count: 32663 } // ] // Check if a few team members are in the top 10 with TOPK.QUERY: // https://redis.io/commands/topk.query/ const [ steve, suze, leibale, frederick ] = await client.topK.query('mytopk', [ 'steve', 'suze', 'leibale', 'frederick' ]); console.log(`steve ${steve === 1 ? 'is': 'is not'} in the top 10.`); console.log(`suze ${suze === 1 ? 'is': 'is not'} in the top 10.`); console.log(`leibale ${leibale === 1 ? 'is': 'is not'} in the top 10.`); console.log(`frederick ${frederick === 1 ? 'is': 'is not'} in the top 10.`); // Get count estimate for some team members with TOPK.COUNT: // https://redis.io/commands/topk.count/ const [ simonCount, lanceCount ] = await client.topK.count('mytopk', [ 'simon', 'lance' ]); console.log(`Count estimate for simon: ${simonCount}.`); console.log(`Count estimate for lance: ${lanceCount}.`); await client.quit(); node-redis-redis-4.5.1/examples/transaction-with-watch.js000066400000000000000000000022121433774114400234410ustar00rootroot00000000000000import { createClient, WatchError } from 'redis'; const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); const client = createClient(); await client.connect(); function restrictFunctionCalls(fn, maxCalls) { let count = 1; return function (...args) { return count++ < maxCalls ? fn(...args) : false; }; } const fn = restrictFunctionCalls(transaction, 4); async function transaction() { try { await client.executeIsolated(async (isolatedClient) => { await isolatedClient.watch('paymentId:1259'); const multi = isolatedClient .multi() .set('paymentId:1259', 'Payment Successfully Completed!') .set('paymentId:1260', 'Refund Processed Successfully!'); await delay(5000); // Do some changes to the watched key during this time... await multi.exec(); console.log('Transaction completed Successfully!'); client.quit(); }); } catch (error) { if (error instanceof WatchError) { console.log('Transaction Failed Due To Concurrent Modification!'); fn(); } else { console.log(`Error: ${error}`); client.quit(); } } } transaction(); node-redis-redis-4.5.1/index.ts000066400000000000000000000037721433774114400163560ustar00rootroot00000000000000import { RedisModules, RedisFunctions, RedisScripts, createClient as _createClient, RedisClientOptions, RedisClientType as _RedisClientType, createCluster as _createCluster, RedisClusterOptions, RedisClusterType as _RedisClusterType } from '@redis/client'; import RedisBloomModules from '@redis/bloom'; import RedisGraph from '@redis/graph'; import RedisJSON from '@redis/json'; import RediSearch from '@redis/search'; import RedisTimeSeries from '@redis/time-series'; export * from '@redis/client'; export * from '@redis/bloom'; export * from '@redis/graph'; export * from '@redis/json'; export * from '@redis/search'; export * from '@redis/time-series'; const modules = { ...RedisBloomModules, graph: RedisGraph, json: RedisJSON, ft: RediSearch, ts: RedisTimeSeries }; export type RedisDefaultModules = typeof modules; export type RedisClientType< M extends RedisModules = RedisDefaultModules, F extends RedisFunctions = Record, S extends RedisScripts = Record > = _RedisClientType; export function createClient< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( options?: RedisClientOptions ): _RedisClientType { return _createClient({ ...options, modules: { ...modules, ...(options?.modules as M) } }); } export type RedisClusterType< M extends RedisModules = RedisDefaultModules, F extends RedisFunctions = Record, S extends RedisScripts = Record > = _RedisClusterType; export function createCluster< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( options: RedisClusterOptions ): RedisClusterType { return _createCluster({ ...options, modules: { ...modules, ...(options?.modules as M) } }); } node-redis-redis-4.5.1/package-lock.json000066400000000000000000020260431433774114400201110ustar00rootroot00000000000000{ "name": "redis", "version": "4.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "redis", "version": "4.5.1", "license": "MIT", "workspaces": [ "./packages/*" ], "dependencies": { "@redis/bloom": "1.1.0", "@redis/client": "1.4.2", "@redis/graph": "1.1.0", "@redis/json": "1.0.4", "@redis/search": "1.1.0", "@redis/time-series": "1.0.4" }, "devDependencies": { "@tsconfig/node14": "^1.0.3", "gh-pages": "^4.0.0", "release-it": "^15.3.0", "typescript": "^4.7.4" } }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.1.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { "@babel/highlight": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.4.tgz", "integrity": "sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.6.tgz", "integrity": "sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", "@babel/generator": "^7.19.6", "@babel/helper-compilation-targets": "^7.19.3", "@babel/helper-module-transforms": "^7.19.6", "@babel/helpers": "^7.19.4", "@babel/parser": "^7.19.6", "@babel/template": "^7.18.10", "@babel/traverse": "^7.19.6", "@babel/types": "^7.19.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.1", "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" }, "funding": { "type": "opencollective", "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.19.6", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.6.tgz", "integrity": "sha512-oHGRUQeoX1QrKeJIKVe0hwjGqNnVYsM5Nep5zo0uE0m42sLH+Fsd2pStJ5sRM1bNyTUUoz0pe2lTeMJrb/taTA==", "dev": true, "dependencies": { "@babel/types": "^7.19.4", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/helper-compilation-targets": { "version": "7.19.3", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz", "integrity": "sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg==", "dev": true, "dependencies": { "@babel/compat-data": "^7.19.3", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { "@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.18.9", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { "version": "7.19.0", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", "dev": true, "dependencies": { "@babel/template": "^7.18.10", "@babel/types": "^7.19.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "dependencies": { "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "dependencies": { "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz", "integrity": "sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-module-imports": "^7.18.6", "@babel/helper-simple-access": "^7.19.4", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", "@babel/template": "^7.18.10", "@babel/traverse": "^7.19.6", "@babel/types": "^7.19.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz", "integrity": "sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==", "dev": true, "dependencies": { "@babel/types": "^7.19.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "dependencies": { "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.4.tgz", "integrity": "sha512-G+z3aOx2nfDHwX/kyVii5fJq+bgscg89/dJNWpYeKeBv3v9xX8EIabmx1k6u9LS04H7nROFVRVK+e3k0VHp+sw==", "dev": true, "dependencies": { "@babel/template": "^7.18.10", "@babel/traverse": "^7.19.4", "@babel/types": "^7.19.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { "color-convert": "^1.9.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { "color-name": "1.1.3" } }, "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "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", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { "has-flag": "^3.0.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/parser": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.6.tgz", "integrity": "sha512-h1IUp81s2JYJ3mRkdxJgs4UvmSsRvDrx5ICSJbPvtWYv5i1nTBGcBpnog+89rAFMwvvru6E5NUHdBe01UeSzYA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/template": { "version": "7.18.10", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", "@babel/parser": "^7.18.10", "@babel/types": "^7.18.10" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.6.tgz", "integrity": "sha512-6l5HrUCzFM04mfbG09AagtYyR2P0B71B1wN7PfSPiksDPz2k5H9CBC1tcZpz2M8OxbKTPccByoOJ22rUKbpmQQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", "@babel/generator": "^7.19.6", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/parser": "^7.19.6", "@babel/types": "^7.19.4", "debug": "^4.1.0", "globals": "^11.1.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse/node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/@babel/types": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.4.tgz", "integrity": "sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, "engines": { "node": ">=12" } }, "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@eslint/eslintrc": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.6", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.6.tgz", "integrity": "sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" }, "engines": { "node": ">=10.10.0" } }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "engines": { "node": ">=12.22" }, "funding": { "type": "github", "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "node_modules/@iarna/toml": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } }, "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": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "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", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/nyc-config-typescript": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.2.tgz", "integrity": "sha512-iKGIyMoyJuFnJRSVTZ78POIRvNnwZaWIf8vG4ZS3rQq58MMDrqEX2nnzx0R28V2X8JvmKYiqY9FP2hlJsm8A0w==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2" }, "engines": { "node": ">=8" }, "peerDependencies": { "nyc": ">=15" } }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.0", "@jridgewell/sourcemap-codec": "^1.4.10" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.17", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "3.1.0", "@jridgewell/sourcemap-codec": "1.4.14" } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { "node": ">= 8" } }, "node_modules/@octokit/auth-token": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.2.tgz", "integrity": "sha512-pq7CwIMV1kmzkFTimdwjAINCXKTajZErLB4wMLYapR2nuB/Jpr66+05wOTZMSCBXP6n4DdDWT2W19Bm17vU69Q==", "dev": true, "dependencies": { "@octokit/types": "^8.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/core": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.1.0.tgz", "integrity": "sha512-Czz/59VefU+kKDy+ZfDwtOIYIkFjExOKf+HA92aiTZJ6EfWpFzYQWw0l54ji8bVmyhc+mGaLUbSUmXazG7z5OQ==", "dev": true, "dependencies": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", "@octokit/request": "^6.0.0", "@octokit/request-error": "^3.0.0", "@octokit/types": "^8.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/endpoint": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.3.tgz", "integrity": "sha512-57gRlb28bwTsdNXq+O3JTQ7ERmBTuik9+LelgcLIVfYwf235VHbN9QNo4kXExtp/h8T423cR5iJThKtFYxC7Lw==", "dev": true, "dependencies": { "@octokit/types": "^8.0.0", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/graphql": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.4.tgz", "integrity": "sha512-amO1M5QUQgYQo09aStR/XO7KAl13xpigcy/kI8/N1PnZYSS69fgte+xA4+c2DISKqUZfsh0wwjc2FaCt99L41A==", "dev": true, "dependencies": { "@octokit/request": "^6.0.0", "@octokit/types": "^8.0.0", "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/openapi-types": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-14.0.0.tgz", "integrity": "sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==", "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.3.1.tgz", "integrity": "sha512-h8KKxESmSFTcXX409CAxlaOYscEDvN2KGQRsLCGT1NSqRW+D6EXLVQ8vuHhFznS9MuH9QYw1GfsUN30bg8hjVA==", "dev": true, "dependencies": { "@octokit/types": "^7.5.0" }, "engines": { "node": ">= 14" }, "peerDependencies": { "@octokit/core": ">=4" } }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { "version": "13.13.1", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", "dev": true }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { "version": "7.5.1", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", "dev": true, "dependencies": { "@octokit/openapi-types": "^13.11.0" } }, "node_modules/@octokit/plugin-request-log": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", "dev": true, "peerDependencies": { "@octokit/core": ">=3" } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.7.0.tgz", "integrity": "sha512-orxQ0fAHA7IpYhG2flD2AygztPlGYNAdlzYz8yrD8NDgelPfOYoRPROfEyIe035PlxvbYrgkfUZIhSBKju/Cvw==", "dev": true, "dependencies": { "@octokit/types": "^8.0.0", "deprecation": "^2.3.1" }, "engines": { "node": ">= 14" }, "peerDependencies": { "@octokit/core": ">=3" } }, "node_modules/@octokit/request": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.2.tgz", "integrity": "sha512-6VDqgj0HMc2FUX2awIs+sM6OwLgwHvAi4KCK3mT2H2IKRt6oH9d0fej5LluF5mck1lRR/rFWN0YIDSYXYSylbw==", "dev": true, "dependencies": { "@octokit/endpoint": "^7.0.0", "@octokit/request-error": "^3.0.0", "@octokit/types": "^8.0.0", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/request-error": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.2.tgz", "integrity": "sha512-WMNOFYrSaX8zXWoJg9u/pKgWPo94JXilMLb2VManNOby9EZxrQaBe/QSC4a1TzpAlpxofg2X/jMnCyZgL6y7eg==", "dev": true, "dependencies": { "@octokit/types": "^8.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/request/node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, "engines": { "node": "4.x || >=6.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "peerDependenciesMeta": { "encoding": { "optional": true } } }, "node_modules/@octokit/rest": { "version": "19.0.4", "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.4.tgz", "integrity": "sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA==", "dev": true, "dependencies": { "@octokit/core": "^4.0.0", "@octokit/plugin-paginate-rest": "^4.0.0", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-rest-endpoint-methods": "^6.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/types": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-8.0.0.tgz", "integrity": "sha512-65/TPpOJP1i3K4lBJMnWqPUJ6zuOtzhtagDvydAWbEXpbFYA0oMKKyLb95NFZZP0lSh/4b6K+DQlzvYQJQQePg==", "dev": true, "dependencies": { "@octokit/openapi-types": "^14.0.0" } }, "node_modules/@pnpm/network.ca-file": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", "dev": true, "dependencies": { "graceful-fs": "4.2.10" }, "engines": { "node": ">=12.22.0" } }, "node_modules/@pnpm/npm-conf": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-1.0.5.tgz", "integrity": "sha512-hD8ml183638O3R6/Txrh0L8VzGOrFXgRtRDG4qQC4tONdZ5Z1M+tlUUDUvrjYdmK6G+JTBTeaCLMna11cXzi8A==", "dev": true, "dependencies": { "@pnpm/network.ca-file": "^1.0.1", "config-chain": "^1.1.11" }, "engines": { "node": ">=12" } }, "node_modules/@redis/bloom": { "resolved": "packages/bloom", "link": true }, "node_modules/@redis/client": { "resolved": "packages/client", "link": true }, "node_modules/@redis/graph": { "resolved": "packages/graph", "link": true }, "node_modules/@redis/json": { "resolved": "packages/json", "link": true }, "node_modules/@redis/search": { "resolved": "packages/search", "link": true }, "node_modules/@redis/test-utils": { "resolved": "packages/test-utils", "link": true }, "node_modules/@redis/time-series": { "resolved": "packages/time-series", "link": true }, "node_modules/@sindresorhus/is": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", "dev": true, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/is?sponsor=1" } }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", "dev": true, "dependencies": { "@sinonjs/commons": "^1.7.0" } }, "node_modules/@sinonjs/samsam": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.1.1.tgz", "integrity": "sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA==", "dev": true, "dependencies": { "@sinonjs/commons": "^1.6.0", "lodash.get": "^4.4.2", "type-detect": "^4.0.8" } }, "node_modules/@sinonjs/text-encoding": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", "dev": true }, "node_modules/@szmarczak/http-timer": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, "dependencies": { "defer-to-connect": "^2.0.1" }, "engines": { "node": ">=14.16" } }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true, "engines": { "node": ">= 6" } }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", "dev": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "node_modules/@tsconfig/node16": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, "node_modules/@types/http-cache-semantics": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/mocha": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.0.tgz", "integrity": "sha512-rADY+HtTOA52l9VZWtgQfn4p+UDVM2eDVkMZT1I6syp0YKxW2F9v+0pbRZLsvskhQv/vMb6ZfCay81GHbz5SHg==", "dev": true }, "node_modules/@types/node": { "version": "18.11.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.6.tgz", "integrity": "sha512-j3CEDa2vd96K0AXF8Wur7UucACvnjkk8hYyQAHhUNciabZLDl9nfAEVUSwmh245OOZV15bRA3Y590Gi5jUcDJg==", "dev": true }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, "node_modules/@types/semver": { "version": "7.3.12", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.12.tgz", "integrity": "sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==", "dev": true }, "node_modules/@types/sinon": { "version": "10.0.13", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", "dev": true, "dependencies": { "@types/sinonjs__fake-timers": "*" } }, "node_modules/@types/sinonjs__fake-timers": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz", "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", "dev": true }, "node_modules/@types/yallist": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/yallist/-/yallist-4.0.1.tgz", "integrity": "sha512-G3FNJfaYtN8URU6wd6+uwFI62KO79j7n3XTYcwcFncP8gkfoi0b821GoVVt0oqKVnCqKYOMNKIGpakPoFhzAGA==", "dev": true }, "node_modules/@types/yargs": { "version": "17.0.13", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz", "integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { "version": "21.0.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz", "integrity": "sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==", "dev": true, "dependencies": { "@typescript-eslint/scope-manager": "5.41.0", "@typescript-eslint/type-utils": "5.41.0", "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "ignore": "^5.2.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "@typescript-eslint/parser": "^5.0.0", "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/parser": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.41.0.tgz", "integrity": "sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==", "dev": true, "dependencies": { "@typescript-eslint/scope-manager": "5.41.0", "@typescript-eslint/types": "5.41.0", "@typescript-eslint/typescript-estree": "5.41.0", "debug": "^4.3.4" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", "dev": true, "dependencies": { "@typescript-eslint/types": "5.41.0", "@typescript-eslint/visitor-keys": "5.41.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/type-utils": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz", "integrity": "sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==", "dev": true, "dependencies": { "@typescript-eslint/typescript-estree": "5.41.0", "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "*" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/types": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/typescript-estree": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", "dev": true, "dependencies": { "@typescript-eslint/types": "5.41.0", "@typescript-eslint/visitor-keys": "5.41.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/utils": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.41.0.tgz", "integrity": "sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", "@typescript-eslint/scope-manager": "5.41.0", "@typescript-eslint/types": "5.41.0", "@typescript-eslint/typescript-estree": "5.41.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", "dev": true, "dependencies": { "@typescript-eslint/types": "5.41.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, "bin": { "acorn": "bin/acorn" }, "engines": { "node": ">=0.4.0" } }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "dependencies": { "debug": "4" }, "engines": { "node": ">= 6.0.0" } }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "dependencies": { "string-width": "^4.1.0" } }, "node_modules/ansi-align/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "node_modules/ansi-align/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/ansi-escapes": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "dependencies": { "type-fest": "^1.0.2" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-escapes/node_modules/type-fest": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "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", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" }, "engines": { "node": ">= 8" } }, "node_modules/append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "dependencies": { "default-require-extensions": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "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/array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/array.prototype.map": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.4.tgz", "integrity": "sha512-Qds9QnX7A0qISY7JT5WuJO0NJPE9CMlC6JzHQfhpqAAQQzufVRoeH7EzUY5GcPTx72voG8LV/5eo+b8Qi8hmhA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.0", "es-array-method-boxes-properly": "^1.0.0", "is-string": "^1.0.7" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/ast-types": { "version": "0.13.4", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", "dev": true, "dependencies": { "tslib": "^2.0.1" }, "engines": { "node": ">=4" } }, "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "dependencies": { "lodash": "^4.17.14" } }, "node_modules/async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", "dev": true, "dependencies": { "retry": "0.13.1" } }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "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/before-after-hook": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/bl": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "dev": true, "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "node_modules/boxen": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", "integrity": "sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==", "dev": true, "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^7.0.0", "chalk": "^5.0.1", "cli-boxes": "^3.0.0", "string-width": "^5.1.2", "type-fest": "^2.13.0", "widest-line": "^4.0.1", "wrap-ansi": "^8.0.1" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/boxen/node_modules/camelcase": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", "dev": true, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/boxen/node_modules/chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/boxen/node_modules/type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "dependencies": { "fill-range": "^7.0.1" }, "engines": { "node": ">=8" } }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "node_modules/browserslist": { "version": "4.21.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" } ], "dependencies": { "caniuse-lite": "^1.0.30001400", "electron-to-chromium": "^1.4.251", "node-releases": "^2.0.6", "update-browserslist-db": "^1.0.9" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "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" } ], "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, "engines": { "node": ">= 0.8" } }, "node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, "engines": { "node": ">=14.16" } }, "node_modules/cacheable-request": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.2.tgz", "integrity": "sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==", "dev": true, "dependencies": { "@types/http-cache-semantics": "^4.0.1", "get-stream": "^6.0.1", "http-cache-semantics": "^4.1.0", "keyv": "^4.5.0", "mimic-response": "^4.0.0", "normalize-url": "^7.2.0", "responselike": "^3.0.0" }, "engines": { "node": ">=14.16" } }, "node_modules/caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "dependencies": { "hasha": "^5.0.0", "make-dir": "^3.0.0", "package-hash": "^4.0.0", "write-file-atomic": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "engines": { "node": ">=6" } }, "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/caniuse-lite": { "version": "1.0.30001425", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001425.tgz", "integrity": "sha512-/pzFv0OmNG6W0ym80P3NtapU0QEiDS3VuYAZMGoLLqiC7f6FJFe1MjpQDREGApeenD9wloeytmVDj+JLXPC6qw==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" } ] }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { "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.5.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", "dev": true }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/cli-boxes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "dependencies": { "restore-cursor": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-spinners": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", "dev": true, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-width": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==", "dev": true, "engines": { "node": ">= 12" } }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12" } }, "node_modules/cliui/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "node_modules/cliui/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "dev": true, "engines": { "node": ">=0.8" } }, "node_modules/cluster-key-slot": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.1.tgz", "integrity": "sha512-rwHwUfXL40Chm1r08yrhU3qpUvdVlgkKNeyeGPOxnW8/SyVDvgRaed/Uz54AqWNaTCAThlj6QAs3TZcKI0xDEw==", "engines": { "node": ">=0.10.0" } }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, "engines": { "node": ">= 0.8" } }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" } }, "node_modules/config-chain/node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, "node_modules/configstore": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", "dev": true, "dependencies": { "dot-prop": "^6.0.1", "graceful-fs": "^4.2.6", "unique-string": "^3.0.0", "write-file-atomic": "^3.0.3", "xdg-basedir": "^5.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/yeoman/configstore?sponsor=1" } }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "node_modules/cosmiconfig": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", "dev": true, "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" }, "engines": { "node": ">=10" } }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" }, "engines": { "node": ">= 8" } }, "node_modules/crypto-random-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", "dev": true, "dependencies": { "type-fest": "^1.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/crypto-random-string/node_modules/type-fest": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/data-uri-to-buffer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", "dev": true, "engines": { "node": ">= 12" } }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, "dependencies": { "mimic-response": "^3.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/decompress-response/node_modules/mimic-response": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "engines": { "node": ">=4.0.0" } }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/default-require-extensions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", "dev": true, "dependencies": { "strip-bom": "^4.0.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "dependencies": { "clone": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/degenerator": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-3.0.2.tgz", "integrity": "sha512-c0mef3SNQo56t6urUU6tdQAs+ThoD0o9B9MJ8HEt7NQcGEILCRFqQb7ZbP9JAv+QF1Ky5plydhMR/IrqWDm+TQ==", "dev": true, "dependencies": { "ast-types": "^0.13.2", "escodegen": "^1.8.1", "esprima": "^4.0.0", "vm2": "^3.9.8" }, "engines": { "node": ">= 6" } }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "engines": { "node": ">= 0.8" } }, "node_modules/deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "dependencies": { "path-type": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "dependencies": { "esutils": "^2.0.2" }, "engines": { "node": ">=6.0.0" } }, "node_modules/dot-prop": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, "dependencies": { "is-obj": "^2.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "node_modules/electron-to-chromium": { "version": "1.4.284", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", "dev": true }, "node_modules/email-addresses": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==", "dev": true }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/es-abstract": { "version": "1.20.4", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-weakref": "^1.0.2", "object-inspect": "^1.12.2", "object-keys": "^1.1.1", "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", "safe-regex-test": "^1.0.0", "string.prototype.trimend": "^1.0.5", "string.prototype.trimstart": "^1.0.5", "unbox-primitive": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es-array-method-boxes-properly": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true }, "node_modules/es-get-iterator": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.0", "has-symbols": "^1.0.1", "is-arguments": "^1.1.0", "is-map": "^2.0.2", "is-set": "^2.0.2", "is-string": "^1.0.5", "isarray": "^2.0.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/escape-goat": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "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/escodegen": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, "dependencies": { "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", "esgenerate": "bin/esgenerate.js" }, "engines": { "node": ">=4.0" }, "optionalDependencies": { "source-map": "~0.6.1" } }, "node_modules/escodegen/node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/escodegen/node_modules/optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "dependencies": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", "word-wrap": "~1.2.3" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/escodegen/node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/escodegen/node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, "dependencies": { "prelude-ls": "~1.1.2" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/eslint": { "version": "8.26.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.3", "@humanwhocodes/config-array": "^0.11.6", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", "espree": "^9.4.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.15.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/eslint-utils": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^2.0.0" }, "engines": { "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { "eslint": ">=5" } }, "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/eslint-visitor-keys": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/eslint/node_modules/eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/eslint/node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/espree": { "version": "9.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { "node": ">=4" } }, "node_modules/esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "dependencies": { "estraverse": "^5.1.0" }, "engines": { "node": ">=0.10" } }, "node_modules/esquery/node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "dependencies": { "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/execa": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", "human-signals": "^3.0.1", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", "signal-exit": "^3.0.7", "strip-final-newline": "^3.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/execa/node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "dependencies": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" }, "engines": { "node": ">=4" } }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" }, "engines": { "node": ">=8.6.0" } }, "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", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/jimmywarting" }, { "type": "paypal", "url": "https://paypal.me/jimmywarting" } ], "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" }, "engines": { "node": "^12.20 || >= 14.13" } }, "node_modules/figures": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, "dependencies": { "escape-string-regexp": "^5.0.0", "is-unicode-supported": "^1.2.0" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/figures/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/figures/node_modules/is-unicode-supported": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { "flat-cache": "^3.0.4" }, "engines": { "node": "^10.12.0 || >=12.0.0" } }, "node_modules/file-uri-to-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz", "integrity": "sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg==", "dev": true, "engines": { "node": ">= 6" } }, "node_modules/filename-reserved-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", "integrity": "sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/filenamify": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", "dev": true, "dependencies": { "filename-reserved-regex": "^2.0.0", "strip-outer": "^1.0.1", "trim-repeated": "^1.0.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "dependencies": { "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, "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==", "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, "bin": { "flat": "cli.js" } }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" }, "engines": { "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^3.0.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "mime-types": "^2.1.12" }, "engines": { "node": ">= 6" } }, "node_modules/form-data-encoder": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true, "engines": { "node": ">= 14.17" } }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "dev": true, "dependencies": { "fetch-blob": "^3.1.2" }, "engines": { "node": ">=12.20.0" } }, "node_modules/fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "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/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" }, "engines": { "node": ">=6 <7 || >=8" } }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, "optional": true, "os": [ "darwin" ], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/ftp": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", "integrity": "sha512-faFVML1aBx2UoDStmLwv2Wptt4vw5x03xxX172nhA5Y5HBshW5JweqQ2W4xL4dezQTG8inJsuYcpPHHU3X5OTQ==", "dev": true, "dependencies": { "readable-stream": "1.1.x", "xregexp": "2.0.0" }, "engines": { "node": ">=0.8.0" } }, "node_modules/ftp/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "node_modules/ftp/node_modules/readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "node_modules/ftp/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.0", "functions-have-names": "^1.2.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/generic-pool": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", "engines": { "node": ">= 4" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, "engines": { "node": ">=8.0.0" } }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-uri": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz", "integrity": "sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg==", "dev": true, "dependencies": { "@tootallnate/once": "1", "data-uri-to-buffer": "3", "debug": "4", "file-uri-to-path": "2", "fs-extra": "^8.1.0", "ftp": "^0.3.10" }, "engines": { "node": ">= 6" } }, "node_modules/get-uri/node_modules/data-uri-to-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", "dev": true, "engines": { "node": ">= 6" } }, "node_modules/gh-pages": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-4.0.0.tgz", "integrity": "sha512-p8S0T3aGJc68MtwOcZusul5qPSNZCalap3NWbhRUZYu1YOdp+EjZ+4kPmRM8h3NNRdqw00yuevRjlkuSzCn7iQ==", "dev": true, "dependencies": { "async": "^2.6.1", "commander": "^2.18.0", "email-addresses": "^3.0.1", "filenamify": "^4.3.0", "find-cache-dir": "^3.3.1", "fs-extra": "^8.1.0", "globby": "^6.1.0" }, "bin": { "gh-pages": "bin/gh-pages.js", "gh-pages-clean": "bin/gh-pages-clean.js" }, "engines": { "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": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", "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": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", "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": "7.0.0", "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", "dev": true, "dependencies": { "is-ssh": "^1.4.0", "parse-url": "^8.1.0" } }, "node_modules/git-url-parse": { "version": "13.1.0", "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.0.tgz", "integrity": "sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA==", "dev": true, "dependencies": { "git-up": "^7.0.0" } }, "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/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/global-dirs": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", "dev": true, "dependencies": { "ini": "2.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globals": { "version": "13.17.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/got": { "version": "12.5.1", "resolved": "https://registry.npmjs.org/got/-/got-12.5.1.tgz", "integrity": "sha512-sD16AK8cCyUoPtKr/NMvLTFFa+T3i3S+zoiuvhq0HP2YiqBZA9AtlBjAdsQBsLBK7slPuvmfE0OxhGi7N5dD4w==", "dev": true, "dependencies": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", "cacheable-lookup": "^7.0.0", "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", "form-data-encoder": "^2.1.2", "get-stream": "^6.0.1", "http2-wrapper": "^2.1.10", "lowercase-keys": "^3.0.0", "p-cancelable": "^3.0.0", "responselike": "^3.0.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/got?sponsor=1" } }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "node_modules/grapheme-splitter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { "function-bind": "^1.1.1" }, "engines": { "node": ">= 0.4.0" } }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-yarn": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "dependencies": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hasha/node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, "bin": { "he": "bin/he" } }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" }, "engines": { "node": ">= 0.8" } }, "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dev": true, "dependencies": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" }, "engines": { "node": ">= 6" } }, "node_modules/http2-wrapper": { "version": "2.1.11", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", "dev": true, "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" }, "engines": { "node": ">=10.19.0" } }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { "agent-base": "6", "debug": "4" }, "engines": { "node": ">= 6" } }, "node_modules/human-signals": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, "engines": { "node": ">=12.20.0" } }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, "engines": { "node": ">=0.10.0" } }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "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/ignore": { "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" } }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" } }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "node_modules/ini": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/inquirer": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.2.tgz", "integrity": "sha512-Hj2Ml1WpxKJU2npP2Rj0OURGkHV+GtNW2CwFdHDiXlqUBAUrWTcZHxCkFywX/XHzOS7wrG/kExgJFbUkVgyHzg==", "dev": true, "dependencies": { "ansi-escapes": "^5.0.0", "chalk": "^5.0.1", "cli-cursor": "^4.0.0", "cli-width": "^4.0.0", "external-editor": "^3.0.3", "figures": "^5.0.0", "lodash": "^4.17.21", "mute-stream": "0.0.8", "ora": "^6.1.2", "run-async": "^2.4.0", "rxjs": "^7.5.6", "string-width": "^5.1.2", "strip-ansi": "^7.0.1", "through": "^2.3.6", "wrap-ansi": "^8.0.1" }, "engines": { "node": ">=12.0.0" } }, "node_modules/inquirer/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/inquirer/node_modules/chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/inquirer/node_modules/strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, "engines": { "node": ">= 0.4" } }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, "engines": { "node": ">= 0.10" } }, "node_modules/ip": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", "dev": true }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-ci": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, "dependencies": { "ci-info": "^3.2.0" }, "bin": { "is-ci": "bin.js" } }, "node_modules/is-core-module": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "dependencies": { "has": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, "bin": { "is-docker": "cli.js" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, "engines": { "node": ">=0.10.0" } }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-interactive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-map": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-npm": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-set": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, "dependencies": { "call-bind": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-ssh": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz", "integrity": "sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==", "dev": true, "dependencies": { "protocols": "^2.0.1" } }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-symbol": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "dependencies": { "is-docker": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/is-yarn-global": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.0.tgz", "integrity": "sha512-HneQBCrXGBy15QnaDfcn6OLoU8AQPAa0Qn0IeJR/QCo4E8dNZaGGwxpCwWyEBQC5QvFonP8d6t60iGpAHVAfNA==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-hook": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "dependencies": { "append-transform": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "dependencies": { "@babel/core": "^7.7.5", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" }, "engines": { "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.3", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", "dev": true, "dependencies": { "archy": "^1.0.0", "cross-spawn": "^7.0.3", "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", "rimraf": "^3.0.0", "uuid": "^8.3.2" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" }, "engines": { "node": ">=10" } }, "node_modules/istanbul-reports": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/iterate-iterator": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.2.tgz", "integrity": "sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/iterate-value": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", "dev": true, "dependencies": { "es-get-iterator": "^1.0.2", "iterate-iterator": "^1.0.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/js-sdsl": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", "dev": true }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, "bin": { "jsesc": "bin/jsesc" }, "engines": { "node": ">=4" } }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "node_modules/json5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, "bin": { "json5": "lib/cli.js" }, "engines": { "node": ">=6" } }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, "node_modules/keyv": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.0.tgz", "integrity": "sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA==", "dev": true, "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/latest-version": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", "dev": true, "dependencies": { "package-json": "^8.1.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, "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/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "dependencies": { "yallist": "^3.0.2" } }, "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, "node_modules/macos-release": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.1.0.tgz", "integrity": "sha512-/M/R0gCDgM+Cv1IuBG1XGdfTFnMEG6PZeT+KGWHO/OG+imqmaD9CH5vHBTycEM3+Kc4uG2Il+tFAuUWLqQOeUA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { "semver": "^6.0.0" }, "engines": { "node": ">=8" }, "funding": { "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", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "node_modules/marked": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", "dev": true, "bin": { "marked": "bin/marked.js" }, "engines": { "node": ">= 12" } }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "dependencies": { "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" } }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mimic-response": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { "node": "*" } }, "node_modules/minimist": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/mocha": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.1.0.tgz", "integrity": "sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha.js" }, "engines": { "node": ">= 14.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/mocha/node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "node_modules/mocha/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "node_modules/mocha/node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/mocha/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/mocha/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/mocha/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" }, "engines": { "node": ">=10" } }, "node_modules/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/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "node_modules/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "node_modules/netmask": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", "dev": true, "engines": { "node": ">= 0.4.0" } }, "node_modules/new-github-release-url": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/new-github-release-url/-/new-github-release-url-2.0.0.tgz", "integrity": "sha512-NHDDGYudnvRutt/VhKFlX26IotXe1w0cmkDm6JGquh5bz/bDTw0LufSmH/GxTjEdpHEO+bVKFTwdrcGa/9XlKQ==", "dev": true, "dependencies": { "type-fest": "^2.5.1" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/new-github-release-url/node_modules/type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/nise": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.1.tgz", "integrity": "sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A==", "dev": true, "dependencies": { "@sinonjs/commons": "^1.8.3", "@sinonjs/fake-timers": ">=5", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", "path-to-regexp": "^1.7.0" } }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/jimmywarting" }, { "type": "github", "url": "https://paypal.me/jimmywarting" } ], "engines": { "node": ">=10.5.0" } }, "node_modules/node-fetch": { "version": "3.2.10", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", "dev": true, "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/node-fetch" } }, "node_modules/node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "dependencies": { "process-on-spawn": "^1.0.0" }, "engines": { "node": ">=8" } }, "node_modules/node-releases": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", "dev": true }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/normalize-url": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", "dev": true, "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm-run-path": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, "dependencies": { "path-key": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm-run-path/node_modules/path-key": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "dependencies": { "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", "caching-transform": "^4.0.0", "convert-source-map": "^1.7.0", "decamelize": "^1.2.0", "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", "foreground-child": "^2.0.0", "get-package-type": "^0.1.0", "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", "istanbul-lib-instrument": "^4.0.0", "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", "make-dir": "^3.0.0", "node-preload": "^0.2.1", "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "spawn-wrap": "^2.0.0", "test-exclude": "^6.0.0", "yargs": "^15.0.2" }, "bin": { "nyc": "bin/nyc.js" }, "engines": { "node": ">=8.9" } }, "node_modules/nyc/node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "node_modules/nyc/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "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", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "node_modules/nyc/node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" }, "engines": { "node": ">=6" } }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/object-inspect": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { "mimic-fn": "^4.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/open": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", "dev": true, "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.3" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/ora": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", "dev": true, "dependencies": { "bl": "^5.0.0", "chalk": "^5.0.0", "cli-cursor": "^4.0.0", "cli-spinners": "^2.6.1", "is-interactive": "^2.0.0", "is-unicode-supported": "^1.1.0", "log-symbols": "^5.1.0", "strip-ansi": "^7.0.1", "wcwidth": "^1.0.1" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ora/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ora/node_modules/chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/ora/node_modules/is-unicode-supported": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ora/node_modules/log-symbols": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", "dev": true, "dependencies": { "chalk": "^5.0.0", "is-unicode-supported": "^1.1.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ora/node_modules/strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/os-name": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", "integrity": "sha512-0EQpaHUHq7olp2/YFUr+0vZi9tMpDTblHGz+Ch5RntKxiRXOAY0JOz1UlxhSjMSksHvkm13eD6elJj3M8Ht/kw==", "dev": true, "dependencies": { "macos-release": "^3.0.1", "windows-release": "^5.0.1" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/p-cancelable": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, "engines": { "node": ">=12.20" } }, "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/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/p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "dependencies": { "aggregate-error": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/pac-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz", "integrity": "sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ==", "dev": true, "dependencies": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4", "get-uri": "3", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "5", "pac-resolver": "^5.0.0", "raw-body": "^2.2.0", "socks-proxy-agent": "5" }, "engines": { "node": ">= 8" } }, "node_modules/pac-resolver": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-5.0.1.tgz", "integrity": "sha512-cy7u00ko2KVgBAjuhevqpPeHIkCIqPe1v24cydhWjmeuzaBfmUWFCZJ1iAh5TuVzVZoUzXIW7K8sMYOZ84uZ9Q==", "dev": true, "dependencies": { "degenerator": "^3.0.2", "ip": "^1.1.5", "netmask": "^2.0.2" }, "engines": { "node": ">= 8" } }, "node_modules/package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "dependencies": { "graceful-fs": "^4.1.15", "hasha": "^5.0.0", "lodash.flattendeep": "^4.4.0", "release-zalgo": "^1.0.0" }, "engines": { "node": ">=8" } }, "node_modules/package-json": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", "dev": true, "dependencies": { "got": "^12.1.0", "registry-auth-token": "^5.0.1", "registry-url": "^6.0.0", "semver": "^7.3.7" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "dependencies": { "callsites": "^3.0.0" }, "engines": { "node": ">=6" } }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parse-path": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-7.0.0.tgz", "integrity": "sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==", "dev": true, "dependencies": { "protocols": "^2.0.0" } }, "node_modules/parse-url": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-8.1.0.tgz", "integrity": "sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==", "dev": true, "dependencies": { "parse-path": "^7.0.0" } }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "dev": true, "dependencies": { "isarray": "0.0.1" } }, "node_modules/path-to-regexp/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dev": true, "dependencies": { "pinkie": "^2.0.0" }, "engines": { "node": ">=0.10.0" } }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "dependencies": { "find-up": "^4.0.0" }, "engines": { "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", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, "dependencies": { "fromentries": "^1.2.0" }, "engines": { "node": ">=8" } }, "node_modules/promise.allsettled": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.5.tgz", "integrity": "sha512-tVDqeZPoBC0SlzJHzWGZ2NKAguVq2oiYj7gbggbiTvH2itHohijTp7njOUA0aQ/nl+0lr/r6egmhoYu63UZ/pQ==", "dev": true, "dependencies": { "array.prototype.map": "^1.0.4", "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.1", "get-intrinsic": "^1.1.1", "iterate-value": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, "node_modules/protocols": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", "dev": true }, "node_modules/proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz", "integrity": "sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g==", "dev": true, "dependencies": { "agent-base": "^6.0.0", "debug": "4", "http-proxy-agent": "^4.0.0", "https-proxy-agent": "^5.0.0", "lru-cache": "^5.1.1", "pac-proxy-agent": "^5.0.0", "proxy-from-env": "^1.0.0", "socks-proxy-agent": "^5.0.0" }, "engines": { "node": ">= 8" } }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/pupa": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", "dev": true, "dependencies": { "escape-goat": "^4.0.0" }, "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "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/quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/raw-body": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dev": true, "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, "engines": { "node": ">= 0.8" } }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "cli.js" } }, "node_modules/rc/node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "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": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "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", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { "picomatch": "^2.2.1" }, "engines": { "node": ">=8.10.0" } }, "node_modules/rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "dependencies": { "resolve": "^1.1.6" }, "engines": { "node": ">= 0.10" } }, "node_modules/regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "functions-have-names": "^1.2.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/registry-auth-token": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz", "integrity": "sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA==", "dev": true, "dependencies": { "@pnpm/npm-conf": "^1.0.4" }, "engines": { "node": ">=14" } }, "node_modules/registry-url": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", "dev": true, "dependencies": { "rc": "1.2.8" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/release-it": { "version": "15.5.0", "resolved": "https://registry.npmjs.org/release-it/-/release-it-15.5.0.tgz", "integrity": "sha512-/pQo/PwEXAWRBgVGLE+3IQ3hUoeiDZMGAo/Egin1envCyLyjzrU7+0P2w4iZ1Xv5OxhC2AcaPaN5eY1ql47cBA==", "dev": true, "dependencies": { "@iarna/toml": "2.2.5", "@octokit/rest": "19.0.4", "async-retry": "1.3.3", "chalk": "5.0.1", "cosmiconfig": "7.0.1", "execa": "6.1.0", "form-data": "4.0.0", "git-url-parse": "13.1.0", "globby": "13.1.2", "got": "12.5.1", "inquirer": "9.1.2", "is-ci": "3.0.1", "lodash": "4.17.21", "mime-types": "2.1.35", "new-github-release-url": "2.0.0", "node-fetch": "3.2.10", "open": "8.4.0", "ora": "6.1.2", "os-name": "5.0.1", "promise.allsettled": "1.0.5", "proxy-agent": "5.0.0", "semver": "7.3.7", "shelljs": "0.8.5", "update-notifier": "6.0.2", "url-join": "5.0.0", "wildcard-match": "5.1.2", "yargs-parser": "21.1.1" }, "bin": { "release-it": "bin/release-it.js" }, "engines": { "node": ">=14.9" } }, "node_modules/release-it/node_modules/chalk": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/release-it/node_modules/globby": { "version": "13.1.2", "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", "dev": true, "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.2.11", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/release-it/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { "yallist": "^4.0.0" }, "engines": { "node": ">=10" } }, "node_modules/release-it/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" }, "engines": { "node": ">=10" } }, "node_modules/release-it/node_modules/slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/release-it/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "node_modules/release-it/node_modules/yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, "dependencies": { "es6-error": "^4.0.1" }, "engines": { "node": ">=4" } }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "dependencies": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-alpn": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", "dev": true }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/responselike": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "dependencies": { "lowercase-keys": "^3.0.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/restore-cursor/node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/restore-cursor/node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true, "engines": { "node": ">= 4" } }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, "engines": { "node": ">=0.12.0" } }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "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" } ], "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/rxjs": { "version": "7.5.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", "dev": true, "dependencies": { "tslib": "^2.1.0" } }, "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/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", "is-regex": "^1.1.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "node_modules/semver": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" }, "engines": { "node": ">=10" } }, "node_modules/semver-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, "dependencies": { "semver": "^7.3.5" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { "yallist": "^4.0.0" }, "engines": { "node": ">=10" } }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/shelljs": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", "rechoir": "^0.6.2" }, "bin": { "shjs": "bin/shjs" }, "engines": { "node": ">=4" } }, "node_modules/shiki": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.11.1.tgz", "integrity": "sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==", "dev": true, "dependencies": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", "vscode-textmate": "^6.0.0" } }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", "object-inspect": "^1.9.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/sinon": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.1.tgz", "integrity": "sha512-JhJ0jCiyBWVAHDS+YSjgEbDn7Wgz9iIjA1/RK+eseJN0vAAWIWiXBdrnb92ELPyjsfreCYntD1ORtLSfIrlvSQ==", "dev": true, "dependencies": { "@sinonjs/commons": "^1.8.3", "@sinonjs/fake-timers": "^9.1.2", "@sinonjs/samsam": "^6.1.1", "diff": "^5.0.0", "nise": "^5.1.1", "supports-color": "^7.2.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/sinon" } }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" } }, "node_modules/socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "dependencies": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" }, "engines": { "node": ">= 10.13.0", "npm": ">= 3.0.0" } }, "node_modules/socks-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz", "integrity": "sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ==", "dev": true, "dependencies": { "agent-base": "^6.0.2", "debug": "4", "socks": "^2.3.3" }, "engines": { "node": ">= 6" } }, "node_modules/socks/node_modules/ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", "dev": true }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "node_modules/spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "dependencies": { "foreground-child": "^2.0.0", "is-windows": "^1.0.2", "make-dir": "^3.0.0", "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "which": "^2.0.1" }, "engines": { "node": ">=8" } }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "engines": { "node": ">= 0.8" } }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/string-width/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/string-width/node_modules/strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/string.prototype.trimend": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "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/strip-outer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", "dev": true, "dependencies": { "escape-string-regexp": "^1.0.2" }, "engines": { "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "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", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" }, "engines": { "node": ">=8" } }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "dependencies": { "os-tmpdir": "~1.0.2" }, "engines": { "node": ">=0.6.0" } }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "dependencies": { "is-number": "^7.0.0" }, "engines": { "node": ">=8.0" } }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "engines": { "node": ">=0.6" } }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, "node_modules/trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", "integrity": "sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==", "dev": true, "dependencies": { "escape-string-regexp": "^1.0.2" }, "engines": { "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", "ts-node-cwd": "dist/bin-cwd.js", "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", "@types/node": "*", "typescript": ">=2.7" }, "peerDependenciesMeta": { "@swc/core": { "optional": true }, "@swc/wasm": { "optional": true } } }, "node_modules/ts-node/node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "dependencies": { "tslib": "^1.8.1" }, "engines": { "node": ">= 6" }, "peerDependencies": { "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, "node_modules/tsutils/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "engines": { "node": ">=4" } }, "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==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "dependencies": { "is-typedarray": "^1.0.0" } }, "node_modules/typedoc": { "version": "0.23.18", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.18.tgz", "integrity": "sha512-0Tq/uFkUuWyRYyjOShTkhsOm6u5E8wf0i6L76/k5znEaxvWKHGeT2ywZThGrDrryV/skO/REM824D1gm8ccQuA==", "dev": true, "dependencies": { "lunr": "^2.3.9", "marked": "^4.0.19", "minimatch": "^5.1.0", "shiki": "^0.11.1" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { "node": ">= 14.14" }, "peerDependencies": { "typescript": "4.6.x || 4.7.x || 4.8.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/typedoc/node_modules/minimatch": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, "node_modules/typescript": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, "dependencies": { "crypto-random-string": "^4.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", "dev": true }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, "engines": { "node": ">= 4.0.0" } }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, "engines": { "node": ">= 0.8" } }, "node_modules/update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" } ], "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" }, "bin": { "browserslist-lint": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" } }, "node_modules/update-notifier": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", "dev": true, "dependencies": { "boxen": "^7.0.0", "chalk": "^5.0.1", "configstore": "^6.0.0", "has-yarn": "^3.0.0", "import-lazy": "^4.0.0", "is-ci": "^3.0.1", "is-installed-globally": "^0.4.0", "is-npm": "^6.0.0", "is-yarn-global": "^0.4.0", "latest-version": "^7.0.0", "pupa": "^3.1.0", "semver": "^7.3.7", "semver-diff": "^4.0.0", "xdg-basedir": "^5.1.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/yeoman/update-notifier?sponsor=1" } }, "node_modules/update-notifier/node_modules/chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "dependencies": { "punycode": "^2.1.0" } }, "node_modules/url-join": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "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==", "dev": true, "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, "node_modules/vm2": { "version": "3.9.11", "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.11.tgz", "integrity": "sha512-PFG8iJRSjvvBdisowQ7iVF580DXb1uCIiGaXgm7tynMR1uTBlv7UJlB1zdv5KJ+Tmq1f0Upnj3fayoEOPpCBKg==", "dev": true, "dependencies": { "acorn": "^8.7.0", "acorn-walk": "^8.2.0" }, "bin": { "vm2": "bin/vm2" }, "engines": { "node": ">=6.0" } }, "node_modules/vscode-oniguruma": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", "dev": true }, "node_modules/vscode-textmate": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-6.0.0.tgz", "integrity": "sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==", "dev": true }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, "dependencies": { "defaults": "^1.0.3" } }, "node_modules/web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" }, "engines": { "node": ">= 8" } }, "node_modules/which-boxed-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", "is-number-object": "^1.0.4", "is-string": "^1.0.5", "is-symbol": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, "node_modules/widest-line": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", "dev": true, "dependencies": { "string-width": "^5.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/wildcard-match": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.2.tgz", "integrity": "sha512-qNXwI591Z88c8bWxp+yjV60Ch4F8Riawe3iGxbzquhy8Xs9m+0+SLFBGb/0yCTIDElawtaImC37fYZ+dr32KqQ==", "dev": true }, "node_modules/windows-release": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.0.1.tgz", "integrity": "sha512-y1xFdFvdMiDXI3xiOhMbJwt1Y7dUxidha0CWPs1NgjZIjZANTcX7+7bMqNjuezhzb8s5JGEiBAbQjQQYYy7ulw==", "dev": true, "dependencies": { "execa": "^5.1.1" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/windows-release/node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/windows-release/node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "engines": { "node": ">=10.17.0" } }, "node_modules/windows-release/node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/windows-release/node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { "path-key": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/windows-release/node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/windows-release/node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "node_modules/wrap-ansi": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", "signal-exit": "^3.0.2", "typedarray-to-buffer": "^3.1.5" } }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/xregexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", "integrity": "sha512-xl/50/Cf32VsGq/1R8jJE5ajH1yMCQkpmoS10QbFZWl2Oor4H0Me64Pu2yxvsRWK3m6soJbmGfzSR7BYmDcWAA==", "dev": true, "engines": { "node": "*" } }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, "engines": { "node": ">= 6" } }, "node_modules/yargs": { "version": "17.6.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz", "integrity": "sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==", "dev": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.0.0" }, "engines": { "node": ">=12" } }, "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/yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", "flat": "^5.0.2", "is-plain-obj": "^2.1.0" }, "engines": { "node": ">=10" } }, "node_modules/yargs-unparser/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "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", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yargs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "node_modules/yargs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/yargs/node_modules/yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "packages/bloom": { "name": "@redis/bloom", "version": "1.1.0", "license": "MIT", "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "peerDependencies": { "@redis/client": "^1.0.0" } }, "packages/client": { "name": "@redis/client", "version": "1.4.2", "license": "MIT", "dependencies": { "cluster-key-slot": "1.1.1", "generic-pool": "3.9.0", "yallist": "4.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "@types/sinon": "^10.0.13", "@types/yallist": "^4.0.1", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", "eslint": "^8.26.0", "nyc": "^15.1.0", "release-it": "^15.5.0", "sinon": "^14.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "engines": { "node": ">=14" } }, "packages/client/node_modules/yallist": { "version": "4.0.0", "license": "ISC" }, "packages/graph": { "name": "@redis/graph", "version": "1.1.0", "license": "MIT", "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "peerDependencies": { "@redis/client": "^1.0.0" } }, "packages/json": { "name": "@redis/json", "version": "1.0.4", "license": "MIT", "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "peerDependencies": { "@redis/client": "^1.0.0" } }, "packages/search": { "name": "@redis/search", "version": "1.1.0", "license": "MIT", "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "peerDependencies": { "@redis/client": "^1.0.0" } }, "packages/test-utils": { "name": "@redis/test-utils", "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^10.0.0", "@types/node": "^18.11.6", "@types/yargs": "^17.0.13", "mocha": "^10.1.0", "nyc": "^15.1.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typescript": "^4.8.4", "yargs": "^17.6.0" }, "peerDependencies": { "@redis/client": "^1.0.0" } }, "packages/time-series": { "name": "@redis/time-series", "version": "1.0.4", "license": "MIT", "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "peerDependencies": { "@redis/client": "^1.0.0" } } }, "dependencies": { "@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", "dev": true, "requires": { "@jridgewell/gen-mapping": "^0.1.0", "@jridgewell/trace-mapping": "^0.3.9" } }, "@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "requires": { "@babel/highlight": "^7.18.6" } }, "@babel/compat-data": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.4.tgz", "integrity": "sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw==", "dev": true }, "@babel/core": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.6.tgz", "integrity": "sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", "@babel/generator": "^7.19.6", "@babel/helper-compilation-targets": "^7.19.3", "@babel/helper-module-transforms": "^7.19.6", "@babel/helpers": "^7.19.4", "@babel/parser": "^7.19.6", "@babel/template": "^7.18.10", "@babel/traverse": "^7.19.6", "@babel/types": "^7.19.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.1", "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/generator": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.6.tgz", "integrity": "sha512-oHGRUQeoX1QrKeJIKVe0hwjGqNnVYsM5Nep5zo0uE0m42sLH+Fsd2pStJ5sRM1bNyTUUoz0pe2lTeMJrb/taTA==", "dev": true, "requires": { "@babel/types": "^7.19.4", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, "dependencies": { "@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.9" } } } }, "@babel/helper-compilation-targets": { "version": "7.19.3", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz", "integrity": "sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg==", "dev": true, "requires": { "@babel/compat-data": "^7.19.3", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", "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": { "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", "dev": true }, "@babel/helper-function-name": { "version": "7.19.0", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", "dev": true, "requires": { "@babel/template": "^7.18.10", "@babel/types": "^7.19.0" } }, "@babel/helper-hoist-variables": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "requires": { "@babel/types": "^7.18.6" } }, "@babel/helper-module-imports": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "requires": { "@babel/types": "^7.18.6" } }, "@babel/helper-module-transforms": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz", "integrity": "sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-module-imports": "^7.18.6", "@babel/helper-simple-access": "^7.19.4", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", "@babel/template": "^7.18.10", "@babel/traverse": "^7.19.6", "@babel/types": "^7.19.4" } }, "@babel/helper-simple-access": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz", "integrity": "sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==", "dev": true, "requires": { "@babel/types": "^7.19.4" } }, "@babel/helper-split-export-declaration": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "requires": { "@babel/types": "^7.18.6" } }, "@babel/helper-string-parser": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true }, "@babel/helper-validator-identifier": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, "@babel/helper-validator-option": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true }, "@babel/helpers": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.4.tgz", "integrity": "sha512-G+z3aOx2nfDHwX/kyVii5fJq+bgscg89/dJNWpYeKeBv3v9xX8EIabmx1k6u9LS04H7nROFVRVK+e3k0VHp+sw==", "dev": true, "requires": { "@babel/template": "^7.18.10", "@babel/traverse": "^7.19.4", "@babel/types": "^7.19.4" } }, "@babel/highlight": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, "dependencies": { "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" } }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" } }, "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" } } } }, "@babel/parser": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.6.tgz", "integrity": "sha512-h1IUp81s2JYJ3mRkdxJgs4UvmSsRvDrx5ICSJbPvtWYv5i1nTBGcBpnog+89rAFMwvvru6E5NUHdBe01UeSzYA==", "dev": true }, "@babel/template": { "version": "7.18.10", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", "@babel/parser": "^7.18.10", "@babel/types": "^7.18.10" } }, "@babel/traverse": { "version": "7.19.6", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.6.tgz", "integrity": "sha512-6l5HrUCzFM04mfbG09AagtYyR2P0B71B1wN7PfSPiksDPz2k5H9CBC1tcZpz2M8OxbKTPccByoOJ22rUKbpmQQ==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", "@babel/generator": "^7.19.6", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/parser": "^7.19.6", "@babel/types": "^7.19.4", "debug": "^4.1.0", "globals": "^11.1.0" }, "dependencies": { "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true } } }, "@babel/types": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.4.tgz", "integrity": "sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" } }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" }, "dependencies": { "@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } } } }, "@eslint/eslintrc": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "@humanwhocodes/config-array": { "version": "0.11.6", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.6.tgz", "integrity": "sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" } }, "@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "@iarna/toml": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", "dev": true }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", "find-up": "^4.1.0", "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, "dependencies": { "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" } }, "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", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", "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", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true } } }, "@istanbuljs/nyc-config-typescript": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.2.tgz", "integrity": "sha512-iKGIyMoyJuFnJRSVTZ78POIRvNnwZaWIf8vG4ZS3rQq58MMDrqEX2nnzx0R28V2X8JvmKYiqY9FP2hlJsm8A0w==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2" } }, "@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true }, "@jridgewell/gen-mapping": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.0", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true }, "@jridgewell/set-array": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true }, "@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, "@jridgewell/trace-mapping": { "version": "0.3.17", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", "dev": true, "requires": { "@jridgewell/resolve-uri": "3.1.0", "@jridgewell/sourcemap-codec": "1.4.14" } }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "@octokit/auth-token": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.2.tgz", "integrity": "sha512-pq7CwIMV1kmzkFTimdwjAINCXKTajZErLB4wMLYapR2nuB/Jpr66+05wOTZMSCBXP6n4DdDWT2W19Bm17vU69Q==", "dev": true, "requires": { "@octokit/types": "^8.0.0" } }, "@octokit/core": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.1.0.tgz", "integrity": "sha512-Czz/59VefU+kKDy+ZfDwtOIYIkFjExOKf+HA92aiTZJ6EfWpFzYQWw0l54ji8bVmyhc+mGaLUbSUmXazG7z5OQ==", "dev": true, "requires": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", "@octokit/request": "^6.0.0", "@octokit/request-error": "^3.0.0", "@octokit/types": "^8.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "@octokit/endpoint": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.3.tgz", "integrity": "sha512-57gRlb28bwTsdNXq+O3JTQ7ERmBTuik9+LelgcLIVfYwf235VHbN9QNo4kXExtp/h8T423cR5iJThKtFYxC7Lw==", "dev": true, "requires": { "@octokit/types": "^8.0.0", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" } }, "@octokit/graphql": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.4.tgz", "integrity": "sha512-amO1M5QUQgYQo09aStR/XO7KAl13xpigcy/kI8/N1PnZYSS69fgte+xA4+c2DISKqUZfsh0wwjc2FaCt99L41A==", "dev": true, "requires": { "@octokit/request": "^6.0.0", "@octokit/types": "^8.0.0", "universal-user-agent": "^6.0.0" } }, "@octokit/openapi-types": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-14.0.0.tgz", "integrity": "sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==", "dev": true }, "@octokit/plugin-paginate-rest": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.3.1.tgz", "integrity": "sha512-h8KKxESmSFTcXX409CAxlaOYscEDvN2KGQRsLCGT1NSqRW+D6EXLVQ8vuHhFznS9MuH9QYw1GfsUN30bg8hjVA==", "dev": true, "requires": { "@octokit/types": "^7.5.0" }, "dependencies": { "@octokit/openapi-types": { "version": "13.13.1", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", "dev": true }, "@octokit/types": { "version": "7.5.1", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", "dev": true, "requires": { "@octokit/openapi-types": "^13.11.0" } } } }, "@octokit/plugin-request-log": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", "dev": true, "requires": {} }, "@octokit/plugin-rest-endpoint-methods": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.7.0.tgz", "integrity": "sha512-orxQ0fAHA7IpYhG2flD2AygztPlGYNAdlzYz8yrD8NDgelPfOYoRPROfEyIe035PlxvbYrgkfUZIhSBKju/Cvw==", "dev": true, "requires": { "@octokit/types": "^8.0.0", "deprecation": "^2.3.1" } }, "@octokit/request": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.2.tgz", "integrity": "sha512-6VDqgj0HMc2FUX2awIs+sM6OwLgwHvAi4KCK3mT2H2IKRt6oH9d0fej5LluF5mck1lRR/rFWN0YIDSYXYSylbw==", "dev": true, "requires": { "@octokit/endpoint": "^7.0.0", "@octokit/request-error": "^3.0.0", "@octokit/types": "^8.0.0", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" }, "dependencies": { "node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dev": true, "requires": { "whatwg-url": "^5.0.0" } } } }, "@octokit/request-error": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.2.tgz", "integrity": "sha512-WMNOFYrSaX8zXWoJg9u/pKgWPo94JXilMLb2VManNOby9EZxrQaBe/QSC4a1TzpAlpxofg2X/jMnCyZgL6y7eg==", "dev": true, "requires": { "@octokit/types": "^8.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "@octokit/rest": { "version": "19.0.4", "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.4.tgz", "integrity": "sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA==", "dev": true, "requires": { "@octokit/core": "^4.0.0", "@octokit/plugin-paginate-rest": "^4.0.0", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-rest-endpoint-methods": "^6.0.0" } }, "@octokit/types": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-8.0.0.tgz", "integrity": "sha512-65/TPpOJP1i3K4lBJMnWqPUJ6zuOtzhtagDvydAWbEXpbFYA0oMKKyLb95NFZZP0lSh/4b6K+DQlzvYQJQQePg==", "dev": true, "requires": { "@octokit/openapi-types": "^14.0.0" } }, "@pnpm/network.ca-file": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", "dev": true, "requires": { "graceful-fs": "4.2.10" } }, "@pnpm/npm-conf": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-1.0.5.tgz", "integrity": "sha512-hD8ml183638O3R6/Txrh0L8VzGOrFXgRtRDG4qQC4tONdZ5Z1M+tlUUDUvrjYdmK6G+JTBTeaCLMna11cXzi8A==", "dev": true, "requires": { "@pnpm/network.ca-file": "^1.0.1", "config-chain": "^1.1.11" } }, "@redis/bloom": { "version": "file:packages/bloom", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } }, "@redis/client": { "version": "file:packages/client", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "@types/sinon": "^10.0.13", "@types/yallist": "^4.0.1", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", "cluster-key-slot": "1.1.1", "eslint": "^8.26.0", "generic-pool": "3.9.0", "nyc": "^15.1.0", "release-it": "^15.5.0", "sinon": "^14.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4", "yallist": "4.0.0" }, "dependencies": { "yallist": { "version": "4.0.0" } } }, "@redis/graph": { "version": "file:packages/graph", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } }, "@redis/json": { "version": "file:packages/json", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } }, "@redis/search": { "version": "file:packages/search", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } }, "@redis/test-utils": { "version": "file:packages/test-utils", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^10.0.0", "@types/node": "^18.11.6", "@types/yargs": "^17.0.13", "mocha": "^10.1.0", "nyc": "^15.1.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typescript": "^4.8.4", "yargs": "^17.6.0" } }, "@redis/time-series": { "version": "file:packages/time-series", "requires": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } }, "@sindresorhus/is": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", "dev": true }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0" } }, "@sinonjs/samsam": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.1.1.tgz", "integrity": "sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA==", "dev": true, "requires": { "@sinonjs/commons": "^1.6.0", "lodash.get": "^4.4.2", "type-detect": "^4.0.8" } }, "@sinonjs/text-encoding": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", "dev": true }, "@szmarczak/http-timer": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, "requires": { "defer-to-connect": "^2.0.1" } }, "@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", "dev": true }, "@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "@tsconfig/node16": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, "@types/http-cache-semantics": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/mocha": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.0.tgz", "integrity": "sha512-rADY+HtTOA52l9VZWtgQfn4p+UDVM2eDVkMZT1I6syp0YKxW2F9v+0pbRZLsvskhQv/vMb6ZfCay81GHbz5SHg==", "dev": true }, "@types/node": { "version": "18.11.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.6.tgz", "integrity": "sha512-j3CEDa2vd96K0AXF8Wur7UucACvnjkk8hYyQAHhUNciabZLDl9nfAEVUSwmh245OOZV15bRA3Y590Gi5jUcDJg==", "dev": true }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, "@types/semver": { "version": "7.3.12", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.12.tgz", "integrity": "sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==", "dev": true }, "@types/sinon": { "version": "10.0.13", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", "dev": true, "requires": { "@types/sinonjs__fake-timers": "*" } }, "@types/sinonjs__fake-timers": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz", "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", "dev": true }, "@types/yallist": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/yallist/-/yallist-4.0.1.tgz", "integrity": "sha512-G3FNJfaYtN8URU6wd6+uwFI62KO79j7n3XTYcwcFncP8gkfoi0b821GoVVt0oqKVnCqKYOMNKIGpakPoFhzAGA==", "dev": true }, "@types/yargs": { "version": "17.0.13", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz", "integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==", "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { "version": "21.0.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "@typescript-eslint/eslint-plugin": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz", "integrity": "sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==", "dev": true, "requires": { "@typescript-eslint/scope-manager": "5.41.0", "@typescript-eslint/type-utils": "5.41.0", "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "ignore": "^5.2.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.41.0.tgz", "integrity": "sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==", "dev": true, "requires": { "@typescript-eslint/scope-manager": "5.41.0", "@typescript-eslint/types": "5.41.0", "@typescript-eslint/typescript-estree": "5.41.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", "dev": true, "requires": { "@typescript-eslint/types": "5.41.0", "@typescript-eslint/visitor-keys": "5.41.0" } }, "@typescript-eslint/type-utils": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz", "integrity": "sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==", "dev": true, "requires": { "@typescript-eslint/typescript-estree": "5.41.0", "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", "dev": true }, "@typescript-eslint/typescript-estree": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", "dev": true, "requires": { "@typescript-eslint/types": "5.41.0", "@typescript-eslint/visitor-keys": "5.41.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/utils": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.41.0.tgz", "integrity": "sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", "@typescript-eslint/scope-manager": "5.41.0", "@typescript-eslint/types": "5.41.0", "@typescript-eslint/typescript-estree": "5.41.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", "dev": true, "requires": { "@typescript-eslint/types": "5.41.0", "eslint-visitor-keys": "^3.3.0" } }, "acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "requires": { "debug": "4" } }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "requires": { "string-width": "^4.1.0" }, "dependencies": { "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } } } }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-escapes": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "requires": { "type-fest": "^1.0.2" }, "dependencies": { "type-fest": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true } } }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" } }, "anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "requires": { "default-require-extensions": "^3.0.0" } }, "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "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 }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", "dev": true }, "array.prototype.map": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.4.tgz", "integrity": "sha512-Qds9QnX7A0qISY7JT5WuJO0NJPE9CMlC6JzHQfhpqAAQQzufVRoeH7EzUY5GcPTx72voG8LV/5eo+b8Qi8hmhA==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.0", "es-array-method-boxes-properly": "^1.0.0", "is-string": "^1.0.7" } }, "ast-types": { "version": "0.13.4", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", "dev": true, "requires": { "tslib": "^2.0.1" } }, "async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" } }, "async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", "dev": true, "requires": { "retry": "0.13.1" } }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true }, "before-after-hook": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "bl": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "dev": true, "requires": { "buffer": "^6.0.3", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "boxen": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", "integrity": "sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==", "dev": true, "requires": { "ansi-align": "^3.0.1", "camelcase": "^7.0.0", "chalk": "^5.0.1", "cli-boxes": "^3.0.0", "string-width": "^5.1.2", "type-fest": "^2.13.0", "widest-line": "^4.0.1", "wrap-ansi": "^8.0.1" }, "dependencies": { "camelcase": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", "dev": true }, "chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true }, "type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true } } }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" } }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "browserslist": { "version": "4.21.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", "dev": true, "requires": { "caniuse-lite": "^1.0.30001400", "electron-to-chromium": "^1.4.251", "node-releases": "^2.0.6", "update-browserslist-db": "^1.0.9" } }, "buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true }, "cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true }, "cacheable-request": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.2.tgz", "integrity": "sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==", "dev": true, "requires": { "@types/http-cache-semantics": "^4.0.1", "get-stream": "^6.0.1", "http-cache-semantics": "^4.1.0", "keyv": "^4.5.0", "mimic-response": "^4.0.0", "normalize-url": "^7.2.0", "responselike": "^3.0.0" } }, "caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "requires": { "hasha": "^5.0.0", "make-dir": "^3.0.0", "package-hash": "^4.0.0", "write-file-atomic": "^3.0.0" } }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" } }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camelcase": { "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.30001425", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001425.tgz", "integrity": "sha512-/pzFv0OmNG6W0ym80P3NtapU0QEiDS3VuYAZMGoLLqiC7f6FJFe1MjpQDREGApeenD9wloeytmVDj+JLXPC6qw==", "dev": true }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", "braces": "~3.0.2", "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "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": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", "dev": true }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, "cli-boxes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", "dev": true }, "cli-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "requires": { "restore-cursor": "^4.0.0" } }, "cli-spinners": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", "dev": true }, "cli-width": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==", "dev": true }, "cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" }, "dependencies": { "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } } } }, "clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "dev": true }, "cluster-key-slot": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.1.tgz", "integrity": "sha512-rwHwUfXL40Chm1r08yrhU3qpUvdVlgkKNeyeGPOxnW8/SyVDvgRaed/Uz54AqWNaTCAThlj6QAs3TZcKI0xDEw==" }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, "requires": { "ini": "^1.3.4", "proto-list": "~1.2.1" }, "dependencies": { "ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true } } }, "configstore": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", "dev": true, "requires": { "dot-prop": "^6.0.1", "graceful-fs": "^4.2.6", "unique-string": "^3.0.0", "write-file-atomic": "^3.0.3", "xdg-basedir": "^5.0.1" } }, "convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "cosmiconfig": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "crypto-random-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", "dev": true, "requires": { "type-fest": "^1.0.1" }, "dependencies": { "type-fest": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true } } }, "data-uri-to-buffer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", "dev": true }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" } }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true }, "decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, "requires": { "mimic-response": "^3.1.0" }, "dependencies": { "mimic-response": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true } } }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "default-require-extensions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", "dev": true, "requires": { "strip-bom": "^4.0.0" } }, "defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "requires": { "clone": "^1.0.2" } }, "defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true }, "define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true }, "define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "requires": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "degenerator": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-3.0.2.tgz", "integrity": "sha512-c0mef3SNQo56t6urUU6tdQAs+ThoD0o9B9MJ8HEt7NQcGEILCRFqQb7ZbP9JAv+QF1Ky5plydhMR/IrqWDm+TQ==", "dev": true, "requires": { "ast-types": "^0.13.2", "escodegen": "^1.8.1", "esprima": "^4.0.0", "vm2": "^3.9.8" } }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true }, "deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, "diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { "path-type": "^4.0.0" } }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" } }, "dot-prop": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, "requires": { "is-obj": "^2.0.0" } }, "eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "electron-to-chromium": { "version": "1.4.284", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", "dev": true }, "email-addresses": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==", "dev": true }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, "es-abstract": { "version": "1.20.4", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", "dev": true, "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-weakref": "^1.0.2", "object-inspect": "^1.12.2", "object-keys": "^1.1.1", "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", "safe-regex-test": "^1.0.0", "string.prototype.trimend": "^1.0.5", "string.prototype.trimstart": "^1.0.5", "unbox-primitive": "^1.0.2" } }, "es-array-method-boxes-properly": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true }, "es-get-iterator": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.0", "has-symbols": "^1.0.1", "is-arguments": "^1.1.0", "is-map": "^2.0.2", "is-set": "^2.0.2", "is-string": "^1.0.5", "isarray": "^2.0.5" } }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" } }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true }, "escape-goat": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", "dev": true }, "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 }, "escodegen": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, "requires": { "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1", "source-map": "~0.6.1" }, "dependencies": { "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, "requires": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" } }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", "word-wrap": "~1.2.3" } }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, "requires": { "prelude-ls": "~1.1.2" } } } }, "eslint": { "version": "8.26.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.3", "@humanwhocodes/config-array": "^0.11.6", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", "espree": "^9.4.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.15.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "dependencies": { "eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "eslint-utils": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" }, "dependencies": { "eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } }, "eslint-visitor-keys": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, "espree": { "version": "9.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "requires": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { "estraverse": "^5.2.0" }, "dependencies": { "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "execa": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, "requires": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", "human-signals": "^3.0.1", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", "signal-exit": "^3.0.7", "strip-final-newline": "^3.0.0" }, "dependencies": { "is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true } } }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "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": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" } }, "fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", "dev": true, "requires": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" } }, "figures": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, "requires": { "escape-string-regexp": "^5.0.0", "is-unicode-supported": "^1.2.0" }, "dependencies": { "escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true }, "is-unicode-supported": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true } } }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "requires": { "flat-cache": "^3.0.4" } }, "file-uri-to-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz", "integrity": "sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg==", "dev": true }, "filename-reserved-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", "integrity": "sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==", "dev": true }, "filenamify": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", "dev": true, "requires": { "filename-reserved-regex": "^2.0.0", "strip-outer": "^1.0.1", "trim-repeated": "^1.0.0" } }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" } }, "find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "requires": { "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" } }, "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==", "dev": true, "requires": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { "flatted": "^3.1.0", "rimraf": "^3.0.2" } }, "flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", "signal-exit": "^3.0.2" } }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, "form-data-encoder": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true }, "formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "dev": true, "requires": { "fetch-blob": "^3.1.2" } }, "fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, "ftp": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", "integrity": "sha512-faFVML1aBx2UoDStmLwv2Wptt4vw5x03xxX172nhA5Y5HBshW5JweqQ2W4xL4dezQTG8inJsuYcpPHHU3X5OTQ==", "dev": true, "requires": { "readable-stream": "1.1.x", "xregexp": "2.0.0" }, "dependencies": { "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true } } }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "function.prototype.name": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.0", "functions-have-names": "^1.2.2" } }, "functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true }, "generic-pool": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==" }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.3" } }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, "get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" } }, "get-uri": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz", "integrity": "sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg==", "dev": true, "requires": { "@tootallnate/once": "1", "data-uri-to-buffer": "3", "debug": "4", "file-uri-to-path": "2", "fs-extra": "^8.1.0", "ftp": "^0.3.10" }, "dependencies": { "data-uri-to-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", "dev": true } } }, "gh-pages": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-4.0.0.tgz", "integrity": "sha512-p8S0T3aGJc68MtwOcZusul5qPSNZCalap3NWbhRUZYu1YOdp+EjZ+4kPmRM8h3NNRdqw00yuevRjlkuSzCn7iQ==", "dev": true, "requires": { "async": "^2.6.1", "commander": "^2.18.0", "email-addresses": "^3.0.1", "filenamify": "^4.3.0", "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": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", "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": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", "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": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", "dev": true, "requires": { "is-ssh": "^1.4.0", "parse-url": "^8.1.0" } }, "git-url-parse": { "version": "13.1.0", "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.0.tgz", "integrity": "sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA==", "dev": true, "requires": { "git-up": "^7.0.0" } }, "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" } }, "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" } }, "global-dirs": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", "dev": true, "requires": { "ini": "2.0.0" } }, "globals": { "version": "13.17.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, "globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" } }, "got": { "version": "12.5.1", "resolved": "https://registry.npmjs.org/got/-/got-12.5.1.tgz", "integrity": "sha512-sD16AK8cCyUoPtKr/NMvLTFFa+T3i3S+zoiuvhq0HP2YiqBZA9AtlBjAdsQBsLBK7slPuvmfE0OxhGi7N5dD4w==", "dev": true, "requires": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", "cacheable-lookup": "^7.0.0", "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", "form-data-encoder": "^2.1.2", "get-stream": "^6.0.1", "http2-wrapper": "^2.1.10", "lowercase-keys": "^3.0.0", "p-cancelable": "^3.0.0", "responselike": "^3.0.0" } }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "grapheme-splitter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "^1.1.1" } }, "has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", "dev": true, "requires": { "get-intrinsic": "^1.1.1" } }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, "has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, "requires": { "has-symbols": "^1.0.2" } }, "has-yarn": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", "dev": true }, "hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "requires": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" }, "dependencies": { "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true } } }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, "http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "requires": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" } }, "http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dev": true, "requires": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" } }, "http2-wrapper": { "version": "2.1.11", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", "dev": true, "requires": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" } }, "https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "requires": { "agent-base": "6", "debug": "4" } }, "human-signals": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ini": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true }, "inquirer": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.2.tgz", "integrity": "sha512-Hj2Ml1WpxKJU2npP2Rj0OURGkHV+GtNW2CwFdHDiXlqUBAUrWTcZHxCkFywX/XHzOS7wrG/kExgJFbUkVgyHzg==", "dev": true, "requires": { "ansi-escapes": "^5.0.0", "chalk": "^5.0.1", "cli-cursor": "^4.0.0", "cli-width": "^4.0.0", "external-editor": "^3.0.3", "figures": "^5.0.0", "lodash": "^4.17.21", "mute-stream": "0.0.8", "ora": "^6.1.2", "run-async": "^2.4.0", "rxjs": "^7.5.6", "string-width": "^5.1.2", "strip-ansi": "^7.0.1", "through": "^2.3.6", "wrap-ansi": "^8.0.1" }, "dependencies": { "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true }, "strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "requires": { "ansi-regex": "^6.0.1" } } } }, "internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", "dev": true, "requires": { "get-intrinsic": "^1.1.0", "has": "^1.0.3", "side-channel": "^1.0.4" } }, "interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, "ip": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", "dev": true }, "is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" } }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, "requires": { "has-bigints": "^1.0.1" } }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { "binary-extensions": "^2.0.0" } }, "is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" } }, "is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, "is-ci": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, "requires": { "ci-info": "^3.2.0" } }, "is-core-module": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "requires": { "has": "^1.0.3" } }, "is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" } }, "is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, "is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, "requires": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" } }, "is-interactive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "dev": true }, "is-map": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true }, "is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true }, "is-npm": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", "dev": true }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, "is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" } }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, "is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" } }, "is-set": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "dev": true }, "is-shared-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, "requires": { "call-bind": "^1.0.2" } }, "is-ssh": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz", "integrity": "sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==", "dev": true, "requires": { "protocols": "^2.0.1" } }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, "is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" } }, "is-symbol": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "requires": { "has-symbols": "^1.0.2" } }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, "is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "requires": { "call-bind": "^1.0.2" } }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "requires": { "is-docker": "^2.0.0" } }, "is-yarn-global": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.0.tgz", "integrity": "sha512-HneQBCrXGBy15QnaDfcn6OLoU8AQPAa0Qn0IeJR/QCo4E8dNZaGGwxpCwWyEBQC5QvFonP8d6t60iGpAHVAfNA==", "dev": true }, "isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true }, "istanbul-lib-hook": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "requires": { "append-transform": "^2.0.0" } }, "istanbul-lib-instrument": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { "@babel/core": "^7.7.5", "@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": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", "dev": true, "requires": { "archy": "^1.0.0", "cross-spawn": "^7.0.3", "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", "rimraf": "^3.0.0", "uuid": "^8.3.2" } }, "istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" } }, "istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "requires": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" } }, "istanbul-reports": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", "dev": true, "requires": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" } }, "iterate-iterator": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.2.tgz", "integrity": "sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw==", "dev": true }, "iterate-value": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", "dev": true, "requires": { "es-get-iterator": "^1.0.2", "iterate-iterator": "^1.0.1" } }, "js-sdsl": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", "dev": true }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" } }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, "json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "json5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true }, "jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, "requires": { "graceful-fs": "^4.1.6" } }, "just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, "keyv": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.0.tgz", "integrity": "sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA==", "dev": true, "requires": { "json-buffer": "3.0.1" } }, "latest-version": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", "dev": true, "requires": { "package-json": "^8.1.0" } }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, "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" } }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" } }, "lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { "yallist": "^3.0.2" } }, "lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, "macos-release": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.1.0.tgz", "integrity": "sha512-/M/R0gCDgM+Cv1IuBG1XGdfTFnMEG6PZeT+KGWHO/OG+imqmaD9CH5vHBTycEM3+Kc4uG2Il+tFAuUWLqQOeUA==", "dev": true }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "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": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "marked": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", "dev": true }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" } }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true }, "mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { "mime-db": "1.52.0" } }, "mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true }, "mimic-response": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "mocha": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.1.0.tgz", "integrity": "sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg==", "dev": true, "requires": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "dependencies": { "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" } }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" } }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { "has-flag": "^4.0.0" } }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } } } }, "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 }, "mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "netmask": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", "dev": true }, "new-github-release-url": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/new-github-release-url/-/new-github-release-url-2.0.0.tgz", "integrity": "sha512-NHDDGYudnvRutt/VhKFlX26IotXe1w0cmkDm6JGquh5bz/bDTw0LufSmH/GxTjEdpHEO+bVKFTwdrcGa/9XlKQ==", "dev": true, "requires": { "type-fest": "^2.5.1" }, "dependencies": { "type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true } } }, "nise": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.1.tgz", "integrity": "sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A==", "dev": true, "requires": { "@sinonjs/commons": "^1.8.3", "@sinonjs/fake-timers": ">=5", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", "path-to-regexp": "^1.7.0" } }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", "dev": true }, "node-fetch": { "version": "3.2.10", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", "dev": true, "requires": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "requires": { "process-on-spawn": "^1.0.0" } }, "node-releases": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", "dev": true }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "normalize-url": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", "dev": true }, "npm-run-path": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, "requires": { "path-key": "^4.0.0" }, "dependencies": { "path-key": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true } } }, "nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", "caching-transform": "^4.0.0", "convert-source-map": "^1.7.0", "decamelize": "^1.2.0", "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", "foreground-child": "^2.0.0", "get-package-type": "^0.1.0", "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", "istanbul-lib-instrument": "^4.0.0", "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", "make-dir": "^3.0.0", "node-preload": "^0.2.1", "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "spawn-wrap": "^2.0.0", "test-exclude": "^6.0.0", "yargs": "^15.0.2" }, "dependencies": { "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "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" } }, "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", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" } } } }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true }, "object-inspect": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" } }, "onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "requires": { "mimic-fn": "^4.0.0" } }, "open": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", "dev": true, "requires": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.3" } }, "ora": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", "dev": true, "requires": { "bl": "^5.0.0", "chalk": "^5.0.0", "cli-cursor": "^4.0.0", "cli-spinners": "^2.6.1", "is-interactive": "^2.0.0", "is-unicode-supported": "^1.1.0", "log-symbols": "^5.1.0", "strip-ansi": "^7.0.1", "wcwidth": "^1.0.1" }, "dependencies": { "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true }, "is-unicode-supported": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true }, "log-symbols": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", "dev": true, "requires": { "chalk": "^5.0.0", "is-unicode-supported": "^1.1.0" } }, "strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "requires": { "ansi-regex": "^6.0.1" } } } }, "os-name": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", "integrity": "sha512-0EQpaHUHq7olp2/YFUr+0vZi9tMpDTblHGz+Ch5RntKxiRXOAY0JOz1UlxhSjMSksHvkm13eD6elJj3M8Ht/kw==", "dev": true, "requires": { "macos-release": "^3.0.1", "windows-release": "^5.0.1" } }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true }, "p-cancelable": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "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" } }, "p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { "aggregate-error": "^3.0.0" } }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pac-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz", "integrity": "sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ==", "dev": true, "requires": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4", "get-uri": "3", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "5", "pac-resolver": "^5.0.0", "raw-body": "^2.2.0", "socks-proxy-agent": "5" } }, "pac-resolver": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-5.0.1.tgz", "integrity": "sha512-cy7u00ko2KVgBAjuhevqpPeHIkCIqPe1v24cydhWjmeuzaBfmUWFCZJ1iAh5TuVzVZoUzXIW7K8sMYOZ84uZ9Q==", "dev": true, "requires": { "degenerator": "^3.0.2", "ip": "^1.1.5", "netmask": "^2.0.2" } }, "package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "requires": { "graceful-fs": "^4.1.15", "hasha": "^5.0.0", "lodash.flattendeep": "^4.4.0", "release-zalgo": "^1.0.0" } }, "package-json": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", "dev": true, "requires": { "got": "^12.1.0", "registry-auth-token": "^5.0.1", "registry-url": "^6.0.0", "semver": "^7.3.7" } }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "requires": { "callsites": "^3.0.0" } }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "parse-path": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-7.0.0.tgz", "integrity": "sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==", "dev": true, "requires": { "protocols": "^2.0.0" } }, "parse-url": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-8.1.0.tgz", "integrity": "sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==", "dev": true, "requires": { "parse-path": "^7.0.0" } }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "dev": true, "requires": { "isarray": "0.0.1" }, "dependencies": { "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true } } }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dev": true, "requires": { "pinkie": "^2.0.0" } }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "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": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, "requires": { "fromentries": "^1.2.0" } }, "promise.allsettled": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.5.tgz", "integrity": "sha512-tVDqeZPoBC0SlzJHzWGZ2NKAguVq2oiYj7gbggbiTvH2itHohijTp7njOUA0aQ/nl+0lr/r6egmhoYu63UZ/pQ==", "dev": true, "requires": { "array.prototype.map": "^1.0.4", "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.1", "get-intrinsic": "^1.1.1", "iterate-value": "^1.0.2" } }, "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, "protocols": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", "dev": true }, "proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz", "integrity": "sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g==", "dev": true, "requires": { "agent-base": "^6.0.0", "debug": "4", "http-proxy-agent": "^4.0.0", "https-proxy-agent": "^5.0.0", "lru-cache": "^5.1.1", "pac-proxy-agent": "^5.0.0", "proxy-from-env": "^1.0.0", "socks-proxy-agent": "^5.0.0" } }, "proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "pupa": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", "dev": true, "requires": { "escape-goat": "^4.0.0" } }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, "quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "dev": true }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" } }, "raw-body": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dev": true, "requires": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "dependencies": { "ini": { "version": "1.3.8", "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": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true } } }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" } }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "requires": { "resolve": "^1.1.6" } }, "regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "functions-have-names": "^1.2.2" } }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "registry-auth-token": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz", "integrity": "sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA==", "dev": true, "requires": { "@pnpm/npm-conf": "^1.0.4" } }, "registry-url": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", "dev": true, "requires": { "rc": "1.2.8" } }, "release-it": { "version": "15.5.0", "resolved": "https://registry.npmjs.org/release-it/-/release-it-15.5.0.tgz", "integrity": "sha512-/pQo/PwEXAWRBgVGLE+3IQ3hUoeiDZMGAo/Egin1envCyLyjzrU7+0P2w4iZ1Xv5OxhC2AcaPaN5eY1ql47cBA==", "dev": true, "requires": { "@iarna/toml": "2.2.5", "@octokit/rest": "19.0.4", "async-retry": "1.3.3", "chalk": "5.0.1", "cosmiconfig": "7.0.1", "execa": "6.1.0", "form-data": "4.0.0", "git-url-parse": "13.1.0", "globby": "13.1.2", "got": "12.5.1", "inquirer": "9.1.2", "is-ci": "3.0.1", "lodash": "4.17.21", "mime-types": "2.1.35", "new-github-release-url": "2.0.0", "node-fetch": "3.2.10", "open": "8.4.0", "ora": "6.1.2", "os-name": "5.0.1", "promise.allsettled": "1.0.5", "proxy-agent": "5.0.0", "semver": "7.3.7", "shelljs": "0.8.5", "update-notifier": "6.0.2", "url-join": "5.0.0", "wildcard-match": "5.1.2", "yargs-parser": "21.1.1" }, "dependencies": { "chalk": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", "dev": true }, "globby": { "version": "13.1.2", "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", "dev": true, "requires": { "dir-glob": "^3.0.1", "fast-glob": "^3.2.11", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^4.0.0" } }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" } }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" } }, "slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true } } }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, "requires": { "es6-error": "^4.0.1" } }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "requires": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-alpn": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", "dev": true }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "responselike": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "requires": { "lowercase-keys": "^3.0.0" } }, "restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "requires": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "dependencies": { "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { "mimic-fn": "^2.1.0" } } } }, "retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" } }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "requires": { "queue-microtask": "^1.2.2" } }, "rxjs": { "version": "7.5.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", "dev": true, "requires": { "tslib": "^2.1.0" } }, "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 }, "safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", "is-regex": "^1.1.4" } }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "requires": { "lru-cache": "^6.0.0" }, "dependencies": { "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" } }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } }, "semver-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, "requires": { "semver": "^7.3.5" } }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" } }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { "shebang-regex": "^3.0.0" } }, "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "shelljs": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, "requires": { "glob": "^7.0.0", "interpret": "^1.0.0", "rechoir": "^0.6.2" } }, "shiki": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.11.1.tgz", "integrity": "sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==", "dev": true, "requires": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", "vscode-textmate": "^6.0.0" } }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", "object-inspect": "^1.9.0" } }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "sinon": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.1.tgz", "integrity": "sha512-JhJ0jCiyBWVAHDS+YSjgEbDn7Wgz9iIjA1/RK+eseJN0vAAWIWiXBdrnb92ELPyjsfreCYntD1ORtLSfIrlvSQ==", "dev": true, "requires": { "@sinonjs/commons": "^1.8.3", "@sinonjs/fake-timers": "^9.1.2", "@sinonjs/samsam": "^6.1.1", "diff": "^5.0.0", "nise": "^5.1.1", "supports-color": "^7.2.0" } }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true }, "socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "requires": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" }, "dependencies": { "ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", "dev": true } } }, "socks-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz", "integrity": "sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ==", "dev": true, "requires": { "agent-base": "^6.0.2", "debug": "4", "socks": "^2.3.3" } }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "requires": { "foreground-child": "^2.0.0", "is-windows": "^1.0.2", "make-dir": "^3.0.0", "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "which": "^2.0.1" } }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { "safe-buffer": "~5.2.0" } }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "requires": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" }, "dependencies": { "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "requires": { "ansi-regex": "^6.0.1" } } } }, "string.prototype.trimend": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "es-abstract": "^1.19.5" } }, "string.prototype.trimstart": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "es-abstract": "^1.19.5" } }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { "ansi-regex": "^5.0.1" } }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, "strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "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 }, "strip-outer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true } } }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" } }, "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" } }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" } }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { "is-number": "^7.0.0" } }, "toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, "trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", "integrity": "sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==", "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true } } }, "ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "dependencies": { "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true } } }, "tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, "tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" }, "dependencies": { "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true } } }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { "prelude-ls": "^1.2.1" } }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, "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 }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "requires": { "is-typedarray": "^1.0.0" } }, "typedoc": { "version": "0.23.18", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.18.tgz", "integrity": "sha512-0Tq/uFkUuWyRYyjOShTkhsOm6u5E8wf0i6L76/k5znEaxvWKHGeT2ywZThGrDrryV/skO/REM824D1gm8ccQuA==", "dev": true, "requires": { "lunr": "^2.3.9", "marked": "^4.0.19", "minimatch": "^5.1.0", "shiki": "^0.11.1" }, "dependencies": { "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" } }, "minimatch": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" } } } }, "typescript": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true }, "unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, "unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, "requires": { "crypto-random-string": "^4.0.0" } }, "universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", "dev": true }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true }, "update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", "dev": true, "requires": { "escalade": "^3.1.1", "picocolors": "^1.0.0" } }, "update-notifier": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", "dev": true, "requires": { "boxen": "^7.0.0", "chalk": "^5.0.1", "configstore": "^6.0.0", "has-yarn": "^3.0.0", "import-lazy": "^4.0.0", "is-ci": "^3.0.1", "is-installed-globally": "^0.4.0", "is-npm": "^6.0.0", "is-yarn-global": "^0.4.0", "latest-version": "^7.0.0", "pupa": "^3.1.0", "semver": "^7.3.7", "semver-diff": "^4.0.0", "xdg-basedir": "^5.1.0" }, "dependencies": { "chalk": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true } } }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "requires": { "punycode": "^2.1.0" } }, "url-join": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", "dev": true }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "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==", "dev": true }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, "vm2": { "version": "3.9.11", "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.11.tgz", "integrity": "sha512-PFG8iJRSjvvBdisowQ7iVF580DXb1uCIiGaXgm7tynMR1uTBlv7UJlB1zdv5KJ+Tmq1f0Upnj3fayoEOPpCBKg==", "dev": true, "requires": { "acorn": "^8.7.0", "acorn-walk": "^8.2.0" } }, "vscode-oniguruma": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", "dev": true }, "vscode-textmate": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-6.0.0.tgz", "integrity": "sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==", "dev": true }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, "requires": { "defaults": "^1.0.3" } }, "web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", "dev": true }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" } }, "which-boxed-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, "requires": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", "is-number-object": "^1.0.4", "is-string": "^1.0.5", "is-symbol": "^1.0.3" } }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, "widest-line": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", "dev": true, "requires": { "string-width": "^5.0.1" } }, "wildcard-match": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.2.tgz", "integrity": "sha512-qNXwI591Z88c8bWxp+yjV60Ch4F8Riawe3iGxbzquhy8Xs9m+0+SLFBGb/0yCTIDElawtaImC37fYZ+dr32KqQ==", "dev": true }, "windows-release": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.0.1.tgz", "integrity": "sha512-y1xFdFvdMiDXI3xiOhMbJwt1Y7dUxidha0CWPs1NgjZIjZANTcX7+7bMqNjuezhzb8s5JGEiBAbQjQQYYy7ulw==", "dev": true, "requires": { "execa": "^5.1.1" }, "dependencies": { "execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "requires": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "requires": { "path-key": "^3.0.0" } }, "onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { "mimic-fn": "^2.1.0" } }, "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true } } }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "wrap-ansi": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", "dev": true, "requires": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" }, "dependencies": { "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, "strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "requires": { "ansi-regex": "^6.0.1" } } } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "requires": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", "signal-exit": "^3.0.2", "typedarray-to-buffer": "^3.1.5" } }, "xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", "dev": true }, "xregexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", "integrity": "sha512-xl/50/Cf32VsGq/1R8jJE5ajH1yMCQkpmoS10QbFZWl2Oor4H0Me64Pu2yxvsRWK3m6soJbmGfzSR7BYmDcWAA==", "dev": true }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true }, "yargs": { "version": "17.6.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz", "integrity": "sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==", "dev": true, "requires": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.0.0" }, "dependencies": { "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true } } }, "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 }, "yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", "flat": "^5.0.2", "is-plain-obj": "^2.1.0" }, "dependencies": { "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, "decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true } } }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true } } } node-redis-redis-4.5.1/package.json000066400000000000000000000027751433774114400171670ustar00rootroot00000000000000{ "name": "redis", "description": "A modern, high performance Redis client", "version": "4.5.1", "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ "dist/" ], "workspaces": [ "./packages/*" ], "scripts": { "test": "npm run test -ws --if-present", "build:client": "npm run build -w ./packages/client", "build:test-utils": "npm run build -w ./packages/test-utils", "build:tests-tools": "npm run build:client && npm run build:test-utils", "build:modules": "find ./packages -mindepth 1 -maxdepth 1 -type d ! -name 'client' ! -name 'test-utils' -exec npm run build -w {} \\;", "build": "tsc", "build-all": "npm run build:client && npm run build:test-utils && npm run build:modules && npm run build", "documentation": "npm run documentation -ws --if-present", "gh-pages": "gh-pages -d ./documentation -e ./documentation -u 'documentation-bot '" }, "dependencies": { "@redis/bloom": "1.1.0", "@redis/client": "1.4.2", "@redis/graph": "1.1.0", "@redis/json": "1.0.4", "@redis/search": "1.1.0", "@redis/time-series": "1.0.4" }, "devDependencies": { "@tsconfig/node14": "^1.0.3", "gh-pages": "^4.0.0", "release-it": "^15.3.0", "typescript": "^4.7.4" }, "repository": { "type": "git", "url": "git://github.com/redis/node-redis.git" }, "bugs": { "url": "https://github.com/redis/node-redis/issues" }, "homepage": "https://github.com/redis/node-redis" } node-redis-redis-4.5.1/packages/000077500000000000000000000000001433774114400164445ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/000077500000000000000000000000001433774114400175545ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/.npmignore000066400000000000000000000001071433774114400215510ustar00rootroot00000000000000.nyc_output/ coverage/ lib/ .nycrc.json .release-it.json tsconfig.json node-redis-redis-4.5.1/packages/bloom/.nycrc.json000066400000000000000000000001511433774114400216400ustar00rootroot00000000000000{ "extends": "@istanbuljs/nyc-config-typescript", "exclude": ["**/*.spec.ts", "lib/test-utils.ts"] } node-redis-redis-4.5.1/packages/bloom/.release-it.json000066400000000000000000000003051433774114400225550ustar00rootroot00000000000000{ "git": { "tagName": "bloom@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" }, "npm": { "publishArgs": ["--access", "public"] } } node-redis-redis-4.5.1/packages/bloom/README.md000066400000000000000000000015421433774114400210350ustar00rootroot00000000000000# @redis/bloom This package provides support for the [RedisBloom](https://redisbloom.io) module, which adds additional probabilistic data structures to Redis. It extends the [Node Redis client](https://github.com/redis/node-redis) to include functions for each of the RediBloom commands. To use these extra commands, your Redis server must have the RedisBloom module installed. RedisBloom provides the following probabilistic data structures: * Bloom Filter: for checking set membership with a high degree of certainty. * Cuckoo Filter: for checking set membership with a high degree of certainty. * Count-Min Sketch: Determine the frequency of events in a stream. * Top-K: Maintain a list of k most frequently seen items. For complete examples, see `bloom-filter.js`, `cuckoo-filter.js`, `count-min-sketch.js` and `topk.js` in the Node Redis examples folder. node-redis-redis-4.5.1/packages/bloom/lib/000077500000000000000000000000001433774114400203225ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/000077500000000000000000000000001433774114400221235ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/000077500000000000000000000000001433774114400232335ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/ADD.spec.ts000066400000000000000000000010241433774114400251210ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './ADD'; describe('BF ADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['BF.ADD', 'key', 'item'] ); }); testUtils.testWithClient('client.bf.add', async client => { assert.equal( await client.bf.add('key', 'item'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/ADD.ts000066400000000000000000000004071433774114400241740ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, item: string): Array { return ['BF.ADD', key, item]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/EXISTS.spec.ts000066400000000000000000000010441433774114400255520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './EXISTS'; describe('BF EXISTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['BF.EXISTS', 'key', 'item'] ); }); testUtils.testWithClient('client.bf.exists', async client => { assert.equal( await client.bf.exists('key', 'item'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/EXISTS.ts000066400000000000000000000004551433774114400246260ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, item: string): Array { return ['BF.EXISTS', key, item]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/INFO.spec.ts000066400000000000000000000015241433774114400252710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INFO'; describe('BF INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('bloom'), ['BF.INFO', 'bloom'] ); }); testUtils.testWithClient('client.bf.info', async client => { await client.bf.reserve('key', 0.01, 100); const info = await client.bf.info('key'); assert.equal(typeof info, 'object'); assert.equal(info.capacity, 100); assert.equal(typeof info.size, 'number'); assert.equal(typeof info.numberOfFilters, 'number'); assert.equal(typeof info.numberOfInsertedItems, 'number'); assert.equal(typeof info.expansionRate, 'number'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/INFO.ts000066400000000000000000000014601433774114400243370ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['BF.INFO', key]; } export type InfoRawReply = [ _: string, capacity: number, _: string, size: number, _: string, numberOfFilters: number, _: string, numberOfInsertedItems: number, _: string, expansionRate: number, ]; export interface InfoReply { capacity: number; size: number; numberOfFilters: number; numberOfInsertedItems: number; expansionRate: number; } export function transformReply(reply: InfoRawReply): InfoReply { return { capacity: reply[1], size: reply[3], numberOfFilters: reply[5], numberOfInsertedItems: reply[7], expansionRate: reply[9] }; } node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/INSERT.spec.ts000066400000000000000000000044121433774114400255410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INSERT'; describe('BF INSERT', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'item'), ['BF.INSERT', 'key', 'ITEMS', 'item'] ); }); it('with CAPACITY', () => { assert.deepEqual( transformArguments('key', 'item', { CAPACITY: 100 }), ['BF.INSERT', 'key', 'CAPACITY', '100', 'ITEMS', 'item'] ); }); it('with ERROR', () => { assert.deepEqual( transformArguments('key', 'item', { ERROR: 0.01 }), ['BF.INSERT', 'key', 'ERROR', '0.01', 'ITEMS', 'item'] ); }); it('with EXPANSION', () => { assert.deepEqual( transformArguments('key', 'item', { EXPANSION: 1 }), ['BF.INSERT', 'key', 'EXPANSION', '1', 'ITEMS', 'item'] ); }); it('with NOCREATE', () => { assert.deepEqual( transformArguments('key', 'item', { NOCREATE: true }), ['BF.INSERT', 'key', 'NOCREATE', 'ITEMS', 'item'] ); }); it('with NONSCALING', () => { assert.deepEqual( transformArguments('key', 'item', { NONSCALING: true }), ['BF.INSERT', 'key', 'NONSCALING', 'ITEMS', 'item'] ); }); it('with CAPACITY, ERROR, EXPANSION, NOCREATE and NONSCALING', () => { assert.deepEqual( transformArguments('key', 'item', { CAPACITY: 100, ERROR: 0.01, EXPANSION: 1, NOCREATE: true, NONSCALING: true }), ['BF.INSERT', 'key', 'CAPACITY', '100', 'ERROR', '0.01', 'EXPANSION', '1', 'NOCREATE', 'NONSCALING', 'ITEMS', 'item'] ); }); }); testUtils.testWithClient('client.bf.insert', async client => { assert.deepEqual( await client.bf.insert('key', 'item'), [true] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/INSERT.ts000066400000000000000000000022371433774114400246130ustar00rootroot00000000000000import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; interface InsertOptions { CAPACITY?: number; ERROR?: number; EXPANSION?: number; NOCREATE?: true; NONSCALING?: true; } export function transformArguments( key: string, items: RedisCommandArgument | Array, options?: InsertOptions ): RedisCommandArguments { const args = ['BF.INSERT', key]; if (options?.CAPACITY) { args.push('CAPACITY', options.CAPACITY.toString()); } if (options?.ERROR) { args.push('ERROR', options.ERROR.toString()); } if (options?.EXPANSION) { args.push('EXPANSION', options.EXPANSION.toString()); } if (options?.NOCREATE) { args.push('NOCREATE'); } if (options?.NONSCALING) { args.push('NONSCALING'); } args.push('ITEMS'); return pushVerdictArguments(args, items); } export { transformBooleanArrayReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/LOADCHUNK.spec.ts000066400000000000000000000015321433774114400260450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './LOADCHUNK'; describe('BF LOADCHUNK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, ''), ['BF.LOADCHUNK', 'key', '0', ''] ); }); testUtils.testWithClient('client.bf.loadChunk', async client => { const [, { iterator, chunk }] = await Promise.all([ client.bf.reserve('source', 0.01, 100), client.bf.scanDump( client.commandOptions({ returnBuffers: true }), 'source', 0 ) ]); assert.equal( await client.bf.loadChunk('destination', iterator, chunk), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/LOADCHUNK.ts000066400000000000000000000005721433774114400251170ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: string, iteretor: number, chunk: RedisCommandArgument ): RedisCommandArguments { return ['BF.LOADCHUNK', key, iteretor.toString(), chunk]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/MADD.spec.ts000066400000000000000000000010571433774114400252440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './MADD'; describe('BF MADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['BF.MADD', 'key', '1', '2'] ); }); testUtils.testWithClient('client.ts.mAdd', async client => { assert.deepEqual( await client.bf.mAdd('key', ['1', '2']), [true, true] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/MADD.ts000066400000000000000000000004311433774114400243060ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, items: Array): Array { return ['BF.MADD', key, ...items]; } export { transformBooleanArrayReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/MEXISTS.spec.ts000066400000000000000000000011001433774114400256600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './MEXISTS'; describe('BF MEXISTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['BF.MEXISTS', 'key', '1', '2'] ); }); testUtils.testWithClient('client.bf.mExists', async client => { assert.deepEqual( await client.bf.mExists('key', ['1', '2']), [false, false] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/MEXISTS.ts000066400000000000000000000004771433774114400247470ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, items: Array): Array { return ['BF.MEXISTS', key, ...items]; } export { transformBooleanArrayReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/RESERVE.spec.ts000066400000000000000000000027601433774114400256540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './RESERVE'; describe('BF RESERVE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 0.01, 100), ['BF.RESERVE', 'key', '0.01', '100'] ); }); it('with EXPANSION', () => { assert.deepEqual( transformArguments('key', 0.01, 100, { EXPANSION: 1 }), ['BF.RESERVE', 'key', '0.01', '100', 'EXPANSION', '1'] ); }); it('with NONSCALING', () => { assert.deepEqual( transformArguments('key', 0.01, 100, { NONSCALING: true }), ['BF.RESERVE', 'key', '0.01', '100', 'NONSCALING'] ); }); it('with EXPANSION and NONSCALING', () => { assert.deepEqual( transformArguments('key', 0.01, 100, { EXPANSION: 1, NONSCALING: true }), ['BF.RESERVE', 'key', '0.01', '100', 'EXPANSION', '1', 'NONSCALING'] ); }); }); testUtils.testWithClient('client.bf.reserve', async client => { assert.equal( await client.bf.reserve('bloom', 0.01, 100), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/RESERVE.ts000066400000000000000000000011021433774114400247100ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; interface ReserveOptions { EXPANSION?: number; NONSCALING?: true; } export function transformArguments( key: string, errorRate: number, capacity: number, options?: ReserveOptions ): Array { const args = ['BF.RESERVE', key, errorRate.toString(), capacity.toString()]; if (options?.EXPANSION) { args.push('EXPANSION', options.EXPANSION.toString()); } if (options?.NONSCALING) { args.push('NONSCALING'); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/SCANDUMP.spec.ts000066400000000000000000000013471433774114400257530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './SCANDUMP'; describe('BF SCANDUMP', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0), ['BF.SCANDUMP', 'key', '0'] ); }); testUtils.testWithClient('client.bf.scanDump', async client => { const [, dump] = await Promise.all([ client.bf.reserve('key', 0.01, 100), client.bf.scanDump('key', 0) ]); assert.equal(typeof dump, 'object'); assert.equal(typeof dump.iterator, 'number'); assert.equal(typeof dump.chunk, 'string'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/SCANDUMP.ts000066400000000000000000000007511433774114400250200ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, iterator: number): Array { return ['BF.SCANDUMP', key, iterator.toString()]; } type ScanDumpRawReply = [ iterator: number, chunk: string ]; interface ScanDumpReply { iterator: number; chunk: string; } export function transformReply([iterator, chunk]: ScanDumpRawReply): ScanDumpReply { return { iterator, chunk }; } node-redis-redis-4.5.1/packages/bloom/lib/commands/bloom/index.ts000066400000000000000000000011701433774114400247110ustar00rootroot00000000000000import * as ADD from './ADD'; import * as EXISTS from './EXISTS'; import * as INFO from './INFO'; import * as INSERT from './INSERT'; import * as LOADCHUNK from './LOADCHUNK'; import * as MADD from './MADD'; import * as MEXISTS from './MEXISTS'; import * as RESERVE from './RESERVE'; import * as SCANDUMP from './SCANDUMP'; export default { ADD, add: ADD, EXISTS, exists: EXISTS, INFO, info: INFO, INSERT, insert: INSERT, LOADCHUNK, loadChunk: LOADCHUNK, MADD, mAdd: MADD, MEXISTS, mExists: MEXISTS, RESERVE, reserve: RESERVE, SCANDUMP, scanDump: SCANDUMP }; node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/000077500000000000000000000000001433774114400253135ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INCRBY.spec.ts000066400000000000000000000022631433774114400276050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INCRBY'; describe('CMS INCRBY', () => { describe('transformArguments', () => { it('single item', () => { assert.deepEqual( transformArguments('key', { item: 'item', incrementBy: 1 }), ['CMS.INCRBY', 'key', 'item', '1'] ); }); it('multiple items', () => { assert.deepEqual( transformArguments('key', [{ item: 'a', incrementBy: 1 }, { item: 'b', incrementBy: 2 }]), ['CMS.INCRBY', 'key', 'a', '1', 'b', '2'] ); }); }); testUtils.testWithClient('client.cms.incrBy', async client => { await client.cms.initByDim('key', 1000, 5); assert.deepEqual( await client.cms.incrBy('key', { item: 'item', incrementBy: 1 }), [1] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INCRBY.ts000066400000000000000000000012051433774114400266470ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; interface IncrByItem { item: string; incrementBy: number; } export function transformArguments( key: string, items: IncrByItem | Array ): Array { const args = ['CMS.INCRBY', key]; if (Array.isArray(items)) { for (const item of items) { pushIncrByItem(args, item); } } else { pushIncrByItem(args, items); } return args; } function pushIncrByItem(args: Array, { item, incrementBy }: IncrByItem): void { args.push(item, incrementBy.toString()); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INFO.spec.ts000066400000000000000000000012311433774114400273440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INFO'; describe('CMS INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['CMS.INFO', 'key'] ); }); testUtils.testWithClient('client.cms.info', async client => { await client.cms.initByDim('key', 1000, 5); assert.deepEqual( await client.cms.info('key'), { width: 1000, depth: 5, count: 0 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INFO.ts000066400000000000000000000010501433774114400264120ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['CMS.INFO', key]; } export type InfoRawReply = [ _: string, width: number, _: string, depth: number, _: string, count: number ]; export interface InfoReply { width: number; depth: number; count: number; } export function transformReply(reply: InfoRawReply): InfoReply { return { width: reply[1], depth: reply[3], count: reply[5] }; } node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INITBYDIM.spec.ts000066400000000000000000000010751433774114400301470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INITBYDIM'; describe('CMS INITBYDIM', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1000, 5), ['CMS.INITBYDIM', 'key', '1000', '5'] ); }); testUtils.testWithClient('client.cms.initByDim', async client => { assert.equal( await client.cms.initByDim('key', 1000, 5), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INITBYDIM.ts000066400000000000000000000003741433774114400272170ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, width: number, depth: number): Array { return ['CMS.INITBYDIM', key, width.toString(), depth.toString()]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INITBYPROB.spec.ts000066400000000000000000000011161433774114400302740ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INITBYPROB'; describe('CMS INITBYPROB', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0.001, 0.01), ['CMS.INITBYPROB', 'key', '0.001', '0.01'] ); }); testUtils.testWithClient('client.cms.initByProb', async client => { assert.equal( await client.cms.initByProb('key', 0.001, 0.01), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/INITBYPROB.ts000066400000000000000000000004111433774114400273400ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, error: number, probability: number): Array { return ['CMS.INITBYPROB', key, error.toString(), probability.toString()]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/MERGE.spec.ts000066400000000000000000000020421433774114400274510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './MERGE'; describe('CMS MERGE', () => { describe('transformArguments', () => { it('without WEIGHTS', () => { assert.deepEqual( transformArguments('dest', ['src']), ['CMS.MERGE', 'dest', '1', 'src'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('dest', [{ name: 'src', weight: 1 }]), ['CMS.MERGE', 'dest', '1', 'src', 'WEIGHTS', '1'] ); }); }); testUtils.testWithClient('client.cms.merge', async client => { await Promise.all([ client.cms.initByDim('src', 1000, 5), client.cms.initByDim('dest', 1000, 5), ]); assert.equal( await client.cms.merge('dest', ['src']), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/MERGE.ts000066400000000000000000000014131433774114400265210ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; interface Sketch { name: string; weight: number; } type Sketches = Array | Array; export function transformArguments(dest: string, src: Sketches): Array { const args = [ 'CMS.MERGE', dest, src.length.toString() ]; if (isStringSketches(src)) { args.push(...src); } else { for (const sketch of src) { args.push(sketch.name); } args.push('WEIGHTS'); for (const sketch of src) { args.push(sketch.weight.toString()); } } return args; } function isStringSketches(src: Sketches): src is Array { return typeof src[0] === 'string'; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/QUERY.spec.ts000066400000000000000000000011331433774114400275170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './QUERY'; describe('CMS QUERY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['CMS.QUERY', 'key', 'item'] ); }); testUtils.testWithClient('client.cms.query', async client => { await client.cms.initByDim('key', 1000, 5); assert.deepEqual( await client.cms.query('key', 'item'), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/QUERY.ts000066400000000000000000000007271433774114400265760ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: string, items: string | Array ): RedisCommandArguments { return pushVerdictArguments(['CMS.QUERY', key], items); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/count-min-sketch/index.ts000066400000000000000000000006731433774114400270000ustar00rootroot00000000000000import * as INCRBY from './INCRBY'; import * as INFO from './INFO'; import * as INITBYDIM from './INITBYDIM'; import * as INITBYPROB from './INITBYPROB'; import * as MERGE from './MERGE'; import * as QUERY from './QUERY'; export default { INCRBY, incrBy: INCRBY, INFO, info: INFO, INITBYDIM, initByDim: INITBYDIM, INITBYPROB, initByProb: INITBYPROB, MERGE, merge: MERGE, QUERY, query: QUERY }; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/000077500000000000000000000000001433774114400234065ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/ADD.spec.ts000066400000000000000000000010441433774114400252760ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments, transformReply } from './ADD'; describe('CF ADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['CF.ADD', 'key', 'item'] ); }); testUtils.testWithClient('client.cf.add', async client => { assert.equal( await client.cf.add('key', 'item'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/ADD.ts000066400000000000000000000004071433774114400243470ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, item: string): Array { return ['CF.ADD', key, item]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/ADDNX.spec.ts000066400000000000000000000011361433774114400255460ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './ADDNX'; describe('CF ADDNX', () => { describe('transformArguments', () => { it('basic add', () => { assert.deepEqual( transformArguments('key', 'item'), ['CF.ADDNX', 'key', 'item'] ); }); }); testUtils.testWithClient('client.cf.add', async client => { assert.equal( await client.cf.addNX('key', 'item'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/ADDNX.ts000066400000000000000000000004111433774114400246100ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, item: string): Array { return ['CF.ADDNX', key, item]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/COUNT.spec.ts000066400000000000000000000010331433774114400255740ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './COUNT'; describe('CF COUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['CF.COUNT', 'key', 'item'] ); }); testUtils.testWithClient('client.cf.count', async client => { assert.equal( await client.cf.count('key', 'item'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/COUNT.ts000066400000000000000000000003131433774114400246430ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, item: string): Array { return ['CF.COUNT', key, item]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/DEL.spec.ts000066400000000000000000000011011433774114400253040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './DEL'; describe('CF DEL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['CF.DEL', 'key', 'item'] ); }); testUtils.testWithClient('client.cf.del', async client => { await client.cf.reserve('key', 4); assert.equal( await client.cf.del('key', 'item'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/DEL.ts000066400000000000000000000004071433774114400243630ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, item: string): Array { return ['CF.DEL', key, item]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/EXISTS.spec.ts000066400000000000000000000010441433774114400257250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './EXISTS'; describe('CF EXISTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['CF.EXISTS', 'key', 'item'] ); }); testUtils.testWithClient('client.cf.exists', async client => { assert.equal( await client.cf.exists('key', 'item'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/EXISTS.ts000066400000000000000000000004551433774114400250010ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, item: string): Array { return ['CF.EXISTS', key, item]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/INFO.spec.ts000066400000000000000000000020251433774114400254410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INFO'; describe('CF INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('cuckoo'), ['CF.INFO', 'cuckoo'] ); }); testUtils.testWithClient('client.cf.info', async client => { await client.cf.reserve('key', 4); const info = await client.cf.info('key'); assert.equal(typeof info, 'object'); assert.equal(typeof info.size, 'number'); assert.equal(typeof info.numberOfBuckets, 'number'); assert.equal(typeof info.numberOfFilters, 'number'); assert.equal(typeof info.numberOfInsertedItems, 'number'); assert.equal(typeof info.numberOfDeletedItems, 'number'); assert.equal(typeof info.bucketSize, 'number'); assert.equal(typeof info.expansionRate, 'number'); assert.equal(typeof info.maxIteration, 'number'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/INFO.ts000066400000000000000000000022021433774114400245050ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['CF.INFO', key]; } export type InfoRawReply = [ _: string, size: number, _: string, numberOfBuckets: number, _: string, numberOfFilters: number, _: string, numberOfInsertedItems: number, _: string, numberOfDeletedItems: number, _: string, bucketSize: number, _: string, expansionRate: number, _: string, maxIteration: number ]; export interface InfoReply { size: number; numberOfBuckets: number; numberOfFilters: number; numberOfInsertedItems: number; numberOfDeletedItems: number; bucketSize: number; expansionRate: number; maxIteration: number; } export function transformReply(reply: InfoRawReply): InfoReply { return { size: reply[1], numberOfBuckets: reply[3], numberOfFilters: reply[5], numberOfInsertedItems: reply[7], numberOfDeletedItems: reply[9], bucketSize: reply[11], expansionRate: reply[13], maxIteration: reply[15] }; } node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/INSERT.spec.ts000066400000000000000000000012411433774114400257110ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INSERT'; describe('CF INSERT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item', { CAPACITY: 100, NOCREATE: true }), ['CF.INSERT', 'key', 'CAPACITY', '100', 'NOCREATE', 'ITEMS', 'item'] ); }); testUtils.testWithClient('client.cf.insert', async client => { assert.deepEqual( await client.cf.insert('key', 'item'), [true] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/INSERT.ts000066400000000000000000000010121433774114400247540ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { InsertOptions, pushInsertOptions } from "."; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: string, items: string | Array, options?: InsertOptions ): RedisCommandArguments { return pushInsertOptions( ['CF.INSERT', key], items, options ); } export { transformBooleanArrayReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/INSERTNX.spec.ts000066400000000000000000000012531433774114400261620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INSERTNX'; describe('CF INSERTNX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item', { CAPACITY: 100, NOCREATE: true }), ['CF.INSERTNX', 'key', 'CAPACITY', '100', 'NOCREATE', 'ITEMS', 'item'] ); }); testUtils.testWithClient('client.cf.insertnx', async client => { assert.deepEqual( await client.cf.insertNX('key', 'item'), [true] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/INSERTNX.ts000066400000000000000000000010141433774114400252240ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { InsertOptions, pushInsertOptions } from "."; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: string, items: string | Array, options?: InsertOptions ): RedisCommandArguments { return pushInsertOptions( ['CF.INSERTNX', key], items, options ); } export { transformBooleanArrayReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/LOADCHUNK.spec.ts000066400000000000000000000016561433774114400262270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './LOADCHUNK'; describe('CF LOADCHUNK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('item', 0, ''), ['CF.LOADCHUNK', 'item', '0', ''] ); }); testUtils.testWithClient('client.cf.loadChunk', async client => { const [,, { iterator, chunk }] = await Promise.all([ client.cf.reserve('source', 4), client.cf.add('source', 'item'), client.cf.scanDump( client.commandOptions({ returnBuffers: true }), 'source', 0 ) ]); assert.ok(Buffer.isBuffer(chunk)); assert.equal( await client.cf.loadChunk('destination', iterator, chunk), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/LOADCHUNK.ts000066400000000000000000000005721433774114400252720ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: string, iterator: number, chunk: RedisCommandArgument ): RedisCommandArguments { return ['CF.LOADCHUNK', key, iterator.toString(), chunk]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/RESERVE.spec.ts000066400000000000000000000025511433774114400260250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './RESERVE'; describe('CF RESERVE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 4), ['CF.RESERVE', 'key', '4'] ); }); it('with EXPANSION', () => { assert.deepEqual( transformArguments('key', 4, { EXPANSION: 1 }), ['CF.RESERVE', 'key', '4', 'EXPANSION', '1'] ); }); it('with BUCKETSIZE', () => { assert.deepEqual( transformArguments('key', 4, { BUCKETSIZE: 2 }), ['CF.RESERVE', 'key', '4', 'BUCKETSIZE', '2'] ); }); it('with MAXITERATIONS', () => { assert.deepEqual( transformArguments('key', 4, { MAXITERATIONS: 1 }), ['CF.RESERVE', 'key', '4', 'MAXITERATIONS', '1'] ); }); }); testUtils.testWithClient('client.cf.reserve', async client => { assert.equal( await client.cf.reserve('key', 4), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/RESERVE.ts000066400000000000000000000013011433774114400250640ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; interface ReserveOptions { BUCKETSIZE?: number; MAXITERATIONS?: number; EXPANSION?: number; } export function transformArguments( key: string, capacity: number, options?: ReserveOptions ): Array { const args = ['CF.RESERVE', key, capacity.toString()]; if (options?.BUCKETSIZE) { args.push('BUCKETSIZE', options.BUCKETSIZE.toString()); } if (options?.MAXITERATIONS) { args.push('MAXITERATIONS', options.MAXITERATIONS.toString()); } if (options?.EXPANSION) { args.push('EXPANSION', options.EXPANSION.toString()); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/SCANDUMP.spec.ts000066400000000000000000000012231433774114400261170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './SCANDUMP'; describe('CF SCANDUMP', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0), ['CF.SCANDUMP', 'key', '0'] ); }); testUtils.testWithClient('client.cf.scanDump', async client => { await client.cf.reserve('key', 4); assert.deepEqual( await client.cf.scanDump('key', 0), { iterator: 0, chunk: null } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/SCANDUMP.ts000066400000000000000000000007241433774114400251730ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, iterator: number): Array { return ['CF.SCANDUMP', key, iterator.toString()]; } type ScanDumpRawReply = [ iterator: number, chunk: string | null ]; interface ScanDumpReply { iterator: number; chunk: string | null; } export function transformReply([iterator, chunk]: ScanDumpRawReply): ScanDumpReply { return { iterator, chunk }; } node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/index.spec.ts000066400000000000000000000023111433774114400260130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { pushInsertOptions } from '.'; describe('pushInsertOptions', () => { describe('single item', () => { it('single item', () => { assert.deepEqual( pushInsertOptions([], 'item'), ['ITEMS', 'item'] ); }); it('multiple items', () => { assert.deepEqual( pushInsertOptions([], ['1', '2']), ['ITEMS', '1', '2'] ); }); }); it('with CAPACITY', () => { assert.deepEqual( pushInsertOptions([], 'item', { CAPACITY: 100 }), ['CAPACITY', '100', 'ITEMS', 'item'] ); }); it('with NOCREATE', () => { assert.deepEqual( pushInsertOptions([], 'item', { NOCREATE: true }), ['NOCREATE', 'ITEMS', 'item'] ); }); it('with CAPACITY and NOCREATE', () => { assert.deepEqual( pushInsertOptions([], 'item', { CAPACITY: 100, NOCREATE: true }), ['CAPACITY', '100', 'NOCREATE', 'ITEMS', 'item'] ); }); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/cuckoo/index.ts000066400000000000000000000026121433774114400250660ustar00rootroot00000000000000 import * as ADD from './ADD'; import * as ADDNX from './ADDNX'; import * as COUNT from './COUNT'; import * as DEL from './DEL'; import * as EXISTS from './EXISTS'; import * as INFO from './INFO'; import * as INSERT from './INSERT'; import * as INSERTNX from './INSERTNX'; import * as LOADCHUNK from './LOADCHUNK'; import * as RESERVE from './RESERVE'; import * as SCANDUMP from './SCANDUMP'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; export default { ADD, add: ADD, ADDNX, addNX: ADDNX, COUNT, count: COUNT, DEL, del: DEL, EXISTS, exists: EXISTS, INFO, info: INFO, INSERT, insert: INSERT, INSERTNX, insertNX: INSERTNX, LOADCHUNK, loadChunk: LOADCHUNK, RESERVE, reserve: RESERVE, SCANDUMP, scanDump: SCANDUMP }; export interface InsertOptions { CAPACITY?: number; NOCREATE?: true; } export function pushInsertOptions( args: RedisCommandArguments, items: string | Array, options?: InsertOptions ): RedisCommandArguments { if (options?.CAPACITY) { args.push('CAPACITY'); args.push(options.CAPACITY.toString()); } if (options?.NOCREATE) { args.push('NOCREATE'); } args.push('ITEMS'); return pushVerdictArguments(args, items); } node-redis-redis-4.5.1/packages/bloom/lib/commands/index.ts000066400000000000000000000003351433774114400236030ustar00rootroot00000000000000import bf from './bloom'; import cms from './count-min-sketch'; import cf from './cuckoo'; import tDigest from './t-digest'; import topK from './top-k'; export default { bf, cms, cf, tDigest, topK }; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/000077500000000000000000000000001433774114400236435ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/ADD.spec.ts000066400000000000000000000011701433774114400255330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './ADD'; describe('TDIGEST.ADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.ADD', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.add', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.add('key', [1]) ]); assert.equal(reply, 'OK'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/ADD.ts000066400000000000000000000006621433774114400246070ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, values: Array ): RedisCommandArguments { const args = ['TDIGEST.ADD', key]; for (const item of values) { args.push(item.toString()); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/BYRANK.spec.ts000066400000000000000000000012141433774114400261300ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './BYRANK'; describe('TDIGEST.BYRANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.BYRANK', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.byRank', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.byRank('key', [1]) ]); assert.deepEqual(reply, [NaN]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/BYRANK.ts000066400000000000000000000007431433774114400252050ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, ranks: Array ): RedisCommandArguments { const args = ['TDIGEST.BYRANK', key]; for (const rank of ranks) { args.push(rank.toString()); } return args; } export { transformDoublesReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/BYREVRANK.spec.ts000066400000000000000000000012331433774114400265060ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './BYREVRANK'; describe('TDIGEST.BYREVRANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.BYREVRANK', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.byRevRank', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.byRevRank('key', [1]) ]); assert.deepEqual(reply, [NaN]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/BYREVRANK.ts000066400000000000000000000007461433774114400255650ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, ranks: Array ): RedisCommandArguments { const args = ['TDIGEST.BYREVRANK', key]; for (const rank of ranks) { args.push(rank.toString()); } return args; } export { transformDoublesReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/CDF.spec.ts000066400000000000000000000011751433774114400255440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './CDF'; describe('TDIGEST.CDF', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.CDF', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.cdf', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.cdf('key', [1]) ]); assert.deepEqual(reply, [NaN]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/CDF.ts000066400000000000000000000007421433774114400246120ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, values: Array ): RedisCommandArguments { const args = ['TDIGEST.CDF', key]; for (const item of values) { args.push(item.toString()); } return args; } export { transformDoublesReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/CREATE.spec.ts000066400000000000000000000015551433774114400261150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './CREATE'; describe('TDIGEST.CREATE', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key'), ['TDIGEST.CREATE', 'key'] ); }); it('with COMPRESSION', () => { assert.deepEqual( transformArguments('key', { COMPRESSION: 100 }), ['TDIGEST.CREATE', 'key', 'COMPRESSION', '100'] ); }); }); testUtils.testWithClient('client.tDigest.create', async client => { assert.equal( await client.tDigest.create('key'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/CREATE.ts000066400000000000000000000007201433774114400251550ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { CompressionOption, pushCompressionArgument } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, options?: CompressionOption ): RedisCommandArguments { return pushCompressionArgument( ['TDIGEST.CREATE', key], options ); } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/INFO.spec.ts000066400000000000000000000016131433774114400257000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INFO'; describe('TDIGEST.INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TDIGEST.INFO', 'key'] ); }); testUtils.testWithClient('client.tDigest.info', async client => { await client.tDigest.create('key'); const info = await client.tDigest.info('key'); assert(typeof info.capacity, 'number'); assert(typeof info.mergedNodes, 'number'); assert(typeof info.unmergedNodes, 'number'); assert(typeof info.mergedWeight, 'number'); assert(typeof info.unmergedWeight, 'number'); assert(typeof info.totalCompression, 'number'); assert(typeof info.totalCompression, 'number'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/INFO.ts000066400000000000000000000021201433774114400247410ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'TDIGEST.INFO', key ]; } type InfoRawReply = [ 'Compression', number, 'Capacity', number, 'Merged nodes', number, 'Unmerged nodes', number, 'Merged weight', string, 'Unmerged weight', string, 'Total compressions', number ]; interface InfoReply { comperssion: number; capacity: number; mergedNodes: number; unmergedNodes: number; mergedWeight: number; unmergedWeight: number; totalCompression: number; } export function transformReply(reply: InfoRawReply): InfoReply { return { comperssion: reply[1], capacity: reply[3], mergedNodes: reply[5], unmergedNodes: reply[7], mergedWeight: Number(reply[9]), unmergedWeight: Number(reply[11]), totalCompression: reply[13] }; }node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/MAX.spec.ts000066400000000000000000000011641433774114400255730ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments, transformReply } from './MAX'; describe('TDIGEST.MAX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TDIGEST.MAX', 'key'] ); }); testUtils.testWithClient('client.tDigest.max', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.max('key') ]); assert.deepEqual(reply, NaN); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/MAX.ts000066400000000000000000000005631433774114400246440ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'TDIGEST.MAX', key ]; } export { transformDoubleReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/MERGE.spec.ts000066400000000000000000000030431433774114400260030ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments, transformReply } from './MERGE'; describe('TDIGEST.MERGE', () => { describe('transformArguments', () => { describe('srcKeys', () => { it('string', () => { assert.deepEqual( transformArguments('dest', 'src'), ['TDIGEST.MERGE', 'dest', '1', 'src'] ); }); it('Array', () => { assert.deepEqual( transformArguments('dest', ['1', '2']), ['TDIGEST.MERGE', 'dest', '2', '1', '2'] ); }); }); it('with COMPRESSION', () => { assert.deepEqual( transformArguments('dest', 'src', { COMPRESSION: 100 }), ['TDIGEST.MERGE', 'dest', '1', 'src', 'COMPRESSION', '100'] ); }); it('with OVERRIDE', () => { assert.deepEqual( transformArguments('dest', 'src', { OVERRIDE: true }), ['TDIGEST.MERGE', 'dest', '1', 'src', 'OVERRIDE'] ); }); }); testUtils.testWithClient('client.tDigest.merge', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('src'), client.tDigest.merge('dest', 'src') ]); assert.equal(reply, 'OK'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/MERGE.ts000066400000000000000000000015011433774114400250470ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArgument } from '@redis/client/dist/lib/commands/generic-transformers'; import { CompressionOption, pushCompressionArgument } from '.'; export const FIRST_KEY_INDEX = 1; interface MergeOptions extends CompressionOption { OVERRIDE?: boolean; } export function transformArguments( destKey: RedisCommandArgument, srcKeys: RedisCommandArgument | Array, options?: MergeOptions ): RedisCommandArguments { const args = pushVerdictArgument( ['TDIGEST.MERGE', destKey], srcKeys ); pushCompressionArgument(args, options); if (options?.OVERRIDE) { args.push('OVERRIDE'); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/MIN.spec.ts000066400000000000000000000011601433774114400255650ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments, transformReply } from './MIN'; describe('TDIGEST.MIN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TDIGEST.MIN', 'key'] ); }); testUtils.testWithClient('client.tDigest.min', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.min('key') ]); assert.equal(reply, NaN); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/MIN.ts000066400000000000000000000005631433774114400246420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'TDIGEST.MIN', key ]; } export { transformDoubleReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/QUANTILE.spec.ts000066400000000000000000000012661433774114400263730ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './QUANTILE'; describe('TDIGEST.QUANTILE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.QUANTILE', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.quantile', async client => { const [, reply] = await Promise.all([ client.tDigest.create('key'), client.tDigest.quantile('key', [1]) ]); assert.deepEqual( reply, [NaN] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/QUANTILE.ts000066400000000000000000000010141433774114400254310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, quantiles: Array ): RedisCommandArguments { const args = [ 'TDIGEST.QUANTILE', key ]; for (const quantile of quantiles) { args.push(quantile.toString()); } return args; } export { transformDoublesReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/RANK.spec.ts000066400000000000000000000012011433774114400256710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './RANK'; describe('TDIGEST.RANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.RANK', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.rank', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.rank('key', [1]) ]); assert.deepEqual(reply, [-2]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/RANK.ts000066400000000000000000000007371433774114400247550ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, values: Array ): RedisCommandArguments { const args = ['TDIGEST.RANK', key]; for (const item of values) { args.push(item.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/RESET.spec.ts000066400000000000000000000011511433774114400260240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './RESET'; describe('TDIGEST.RESET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TDIGEST.RESET', 'key'] ); }); testUtils.testWithClient('client.tDigest.reset', async client => { const [, reply] = await Promise.all([ client.tDigest.create('key'), client.tDigest.reset('key') ]); assert.equal(reply, 'OK'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/RESET.ts000066400000000000000000000004601433774114400250750ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['TDIGEST.RESET', key]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/REVRANK.spec.ts000066400000000000000000000012201433774114400262470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './REVRANK'; describe('TDIGEST.REVRANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [1, 2]), ['TDIGEST.REVRANK', 'key', '1', '2'] ); }); testUtils.testWithClient('client.tDigest.revRank', async client => { const [ , reply ] = await Promise.all([ client.tDigest.create('key'), client.tDigest.revRank('key', [1]) ]); assert.deepEqual(reply, [-2]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/REVRANK.ts000066400000000000000000000007421433774114400253260ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, values: Array ): RedisCommandArguments { const args = ['TDIGEST.REVRANK', key]; for (const item of values) { args.push(item.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/TRIMMED_MEAN.spec.ts000066400000000000000000000012511433774114400270440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments, transformReply } from './TRIMMED_MEAN'; describe('TDIGEST.RESET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 1), ['TDIGEST.TRIMMED_MEAN', 'key', '0', '1'] ); }); testUtils.testWithClient('client.tDigest.trimmedMean', async client => { const [, reply] = await Promise.all([ client.tDigest.create('key'), client.tDigest.trimmedMean('key', 0, 1) ]); assert.equal(reply, NaN); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/TRIMMED_MEAN.ts000066400000000000000000000010121433774114400261060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, lowCutPercentile: number, highCutPercentile: number ): RedisCommandArguments { return [ 'TDIGEST.TRIMMED_MEAN', key, lowCutPercentile.toString(), highCutPercentile.toString() ]; } export { transformDoubleReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/index.spec.ts000066400000000000000000000022351433774114400262550ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { pushCompressionArgument, transformDoubleReply, transformDoublesReply } from '.'; describe('pushCompressionArgument', () => { it('undefined', () => { assert.deepEqual( pushCompressionArgument([]), [] ); }); it('100', () => { assert.deepEqual( pushCompressionArgument([], { COMPRESSION: 100 }), ['COMPRESSION', '100'] ); }); }); describe('transformDoubleReply', () => { it('inf', () => { assert.equal( transformDoubleReply('inf'), Infinity ); }); it('-inf', () => { assert.equal( transformDoubleReply('-inf'), -Infinity ); }); it('nan', () => { assert.equal( transformDoubleReply('nan'), NaN ); }); it('0', () => { assert.equal( transformDoubleReply('0'), 0 ); }); }); it('transformDoublesReply', () => { assert.deepEqual( transformDoublesReply(['inf', '-inf', 'nan', '0']), [Infinity, -Infinity, NaN, 0] ); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/t-digest/index.ts000066400000000000000000000033341433774114400253250ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import * as ADD from './ADD'; import * as BYRANK from './BYRANK'; import * as BYREVRANK from './BYREVRANK'; import * as CDF from './CDF'; import * as CREATE from './CREATE'; import * as INFO from './INFO'; import * as MAX from './MAX'; import * as MERGE from './MERGE'; import * as MIN from './MIN'; import * as QUANTILE from './QUANTILE'; import * as RANK from './RANK'; import * as RESET from './RESET'; import * as REVRANK from './REVRANK'; import * as TRIMMED_MEAN from './TRIMMED_MEAN'; export default { ADD, add: ADD, BYRANK, byRank: BYRANK, BYREVRANK, byRevRank: BYREVRANK, CDF, cdf: CDF, CREATE, create: CREATE, INFO, info: INFO, MAX, max: MAX, MERGE, merge: MERGE, MIN, min: MIN, QUANTILE, quantile: QUANTILE, RANK, rank: RANK, RESET, reset: RESET, REVRANK, revRank: REVRANK, TRIMMED_MEAN, trimmedMean: TRIMMED_MEAN }; export interface CompressionOption { COMPRESSION?: number; } export function pushCompressionArgument( args: RedisCommandArguments, options?: CompressionOption ): RedisCommandArguments { if (options?.COMPRESSION) { args.push('COMPRESSION', options.COMPRESSION.toString()); } return args; } export function transformDoubleReply(reply: string): number { switch (reply) { case 'inf': return Infinity; case '-inf': return -Infinity; case 'nan': return NaN; default: return parseFloat(reply); } } export function transformDoublesReply(reply: Array): Array { return reply.map(transformDoubleReply); } node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/000077500000000000000000000000001433774114400231555ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/ADD.spec.ts000066400000000000000000000011231433774114400250430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './ADD'; describe('TOPK ADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['TOPK.ADD', 'key', 'item'] ); }); testUtils.testWithClient('client.topK.add', async client => { await client.topK.reserve('topK', 3); assert.deepEqual( await client.topK.add('topK', 'item'), [null] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/ADD.ts000066400000000000000000000006721433774114400241220ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: string, items: string | Array ): RedisCommandArguments { return pushVerdictArguments(['TOPK.ADD', key], items); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/COUNT.spec.ts000066400000000000000000000011271433774114400253470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './COUNT'; describe('TOPK COUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['TOPK.COUNT', 'key', 'item'] ); }); testUtils.testWithClient('client.topK.count', async client => { await client.topK.reserve('key', 3); assert.deepEqual( await client.topK.count('key', 'item'), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/COUNT.ts000066400000000000000000000007301433774114400244150ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: string, items: string | Array ): RedisCommandArguments { return pushVerdictArguments(['TOPK.COUNT', key], items); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/INCRBY.spec.ts000066400000000000000000000022651433774114400254510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INCRBY'; describe('TOPK INCRBY', () => { describe('transformArguments', () => { it('single item', () => { assert.deepEqual( transformArguments('key', { item: 'item', incrementBy: 1 }), ['TOPK.INCRBY', 'key', 'item', '1'] ); }); it('multiple items', () => { assert.deepEqual( transformArguments('key', [{ item: 'a', incrementBy: 1 }, { item: 'b', incrementBy: 2 }]), ['TOPK.INCRBY', 'key', 'a', '1', 'b', '2'] ); }); }); testUtils.testWithClient('client.topK.incrby', async client => { await client.topK.reserve('key', 5); assert.deepEqual( await client.topK.incrBy('key', { item: 'item', incrementBy: 1 }), [null] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/INCRBY.ts000066400000000000000000000012151433774114400245120ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; interface IncrByItem { item: string; incrementBy: number; } export function transformArguments( key: string, items: IncrByItem | Array ): Array { const args = ['TOPK.INCRBY', key]; if (Array.isArray(items)) { for (const item of items) { pushIncrByItem(args, item); } } else { pushIncrByItem(args, items); } return args; } function pushIncrByItem(args: Array, { item, incrementBy }: IncrByItem): void { args.push(item, incrementBy.toString()); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/INFO.spec.ts000066400000000000000000000013651433774114400252160ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './INFO'; describe('TOPK INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TOPK.INFO', 'key'] ); }); testUtils.testWithClient('client.topK.info', async client => { await client.topK.reserve('key', 3); const info = await client.topK.info('key'); assert.equal(typeof info, 'object'); assert.equal(info.k, 3); assert.equal(typeof info.width, 'number'); assert.equal(typeof info.depth, 'number'); assert.equal(typeof info.decay, 'number'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/INFO.ts000066400000000000000000000011631433774114400242610ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['TOPK.INFO', key]; } export type InfoRawReply = [ _: string, k: number, _: string, width: number, _: string, depth: number, _: string, decay: string ]; export interface InfoReply { k: number, width: number; depth: number; decay: number; } export function transformReply(reply: InfoRawReply): InfoReply { return { k: reply[1], width: reply[3], depth: reply[5], decay: Number(reply[7]) }; } node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/LIST.spec.ts000066400000000000000000000010711433774114400252300ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './LIST'; describe('TOPK LIST', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TOPK.LIST', 'key'] ); }); testUtils.testWithClient('client.topK.list', async client => { await client.topK.reserve('key', 3); assert.deepEqual( await client.topK.list('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/LIST.ts000066400000000000000000000003511433774114400242770ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['TOPK.LIST', key]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/LIST_WITHCOUNT.spec.ts000066400000000000000000000015311433774114400266750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './LIST_WITHCOUNT'; describe('TOPK LIST WITHCOUNT', () => { testUtils.isVersionGreaterThanHook([2, 2, 9]); it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TOPK.LIST', 'key', 'WITHCOUNT'] ); }); testUtils.testWithClient('client.topK.listWithCount', async client => { const [,, list] = await Promise.all([ client.topK.reserve('key', 3), client.topK.add('key', 'item'), client.topK.listWithCount('key') ]); assert.deepEqual( list, [{ item: 'item', count: 1 }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/LIST_WITHCOUNT.ts000066400000000000000000000011661433774114400257500ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['TOPK.LIST', key, 'WITHCOUNT']; } type ListWithCountRawReply = Array; type ListWithCountReply = Array<{ item: string, count: number }>; export function transformReply(rawReply: ListWithCountRawReply): ListWithCountReply { const reply: ListWithCountReply = []; for (let i = 0; i < rawReply.length; i++) { reply.push({ item: rawReply[i] as string, count: rawReply[++i] as number }); } return reply; }node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/QUERY.spec.ts000066400000000000000000000011261433774114400253630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './QUERY'; describe('TOPK QUERY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'item'), ['TOPK.QUERY', 'key', 'item'] ); }); testUtils.testWithClient('client.cms.query', async client => { await client.topK.reserve('key', 3); assert.deepEqual( await client.topK.query('key', 'item'), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/QUERY.ts000066400000000000000000000007301433774114400244320ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: string, items: string | Array ): RedisCommandArguments { return pushVerdictArguments(['TOPK.QUERY', key], items); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/RESERVE.spec.ts000066400000000000000000000016401433774114400255720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../../test-utils'; import { transformArguments } from './RESERVE'; describe('TOPK RESERVE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('topK', 3), ['TOPK.RESERVE', 'topK', '3'] ); }); it('with options', () => { assert.deepEqual( transformArguments('topK', 3, { width: 8, depth: 7, decay: 0.9 }), ['TOPK.RESERVE', 'topK', '3', '8', '7', '0.9'] ); }); }); testUtils.testWithClient('client.topK.reserve', async client => { assert.equal( await client.topK.reserve('topK', 3), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/RESERVE.ts000066400000000000000000000010731433774114400246410ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface ReserveOptions { width: number; depth: number; decay: number; } export function transformArguments( key: string, topK: number, options?: ReserveOptions ): Array { const args = ['TOPK.RESERVE', key, topK.toString()]; if (options) { args.push( options.width.toString(), options.depth.toString(), options.decay.toString() ); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/bloom/lib/commands/top-k/index.ts000066400000000000000000000010631433774114400246340ustar00rootroot00000000000000import * as ADD from './ADD'; import * as COUNT from './COUNT'; import * as INCRBY from './INCRBY'; import * as INFO from './INFO'; import * as LIST_WITHCOUNT from './LIST_WITHCOUNT'; import * as LIST from './LIST'; import * as QUERY from './QUERY'; import * as RESERVE from './RESERVE'; export default { ADD, add: ADD, COUNT, count: COUNT, INCRBY, incrBy: INCRBY, INFO, info: INFO, LIST_WITHCOUNT, listWithCount: LIST_WITHCOUNT, LIST, list: LIST, QUERY, query: QUERY, RESERVE, reserve: RESERVE }; node-redis-redis-4.5.1/packages/bloom/lib/index.ts000066400000000000000000000000461433774114400220010ustar00rootroot00000000000000export { default } from './commands'; node-redis-redis-4.5.1/packages/bloom/lib/test-utils.ts000066400000000000000000000007501433774114400230110ustar00rootroot00000000000000import TestUtils from '@redis/test-utils'; import RedisBloomModules from '.'; export default new TestUtils({ dockerImageName: 'redislabs/rebloom', dockerImageVersionArgument: 'redisbloom-version', defaultDockerVersion: 'edge' }); export const GLOBAL = { SERVERS: { OPEN: { serverArguments: ['--loadmodule /usr/lib/redis/modules/redisbloom.so'], clientOptions: { modules: RedisBloomModules } } } }; node-redis-redis-4.5.1/packages/bloom/package.json000066400000000000000000000013211433774114400220370ustar00rootroot00000000000000{ "name": "@redis/bloom", "version": "1.1.0", "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", "documentation": "typedoc" }, "peerDependencies": { "@redis/client": "^1.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } } node-redis-redis-4.5.1/packages/bloom/tsconfig.json000066400000000000000000000005371433774114400222700ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./lib/**/*.ts" ], "exclude": [ "./lib/test-utils.ts", "./lib/**/*.spec.ts" ], "typedocOptions": { "entryPoints": [ "./lib" ], "entryPointStrategy": "expand", "out": "../../documentation/bloom" } } node-redis-redis-4.5.1/packages/client/000077500000000000000000000000001433774114400177225ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/.eslintrc.json000066400000000000000000000004771433774114400225260ustar00rootroot00000000000000{ "root": true, "parser": "@typescript-eslint/parser", "plugins": [ "@typescript-eslint" ], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended" ], "rules": { "semi": [2, "always"] } } node-redis-redis-4.5.1/packages/client/.npmignore000066400000000000000000000001671433774114400217250ustar00rootroot00000000000000.nyc_output/ coverage/ documentation/ lib/ .eslintrc.json .nycrc.json .release-it.json dump.rdb index.ts tsconfig.json node-redis-redis-4.5.1/packages/client/.nycrc.json000066400000000000000000000001671433774114400220150ustar00rootroot00000000000000{ "extends": "@istanbuljs/nyc-config-typescript", "exclude": ["**/*.spec.ts", "lib/test-utils.ts", "examples/*"] } node-redis-redis-4.5.1/packages/client/.release-it.json000066400000000000000000000003061433774114400227240ustar00rootroot00000000000000{ "git": { "tagName": "client@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" }, "npm": { "publishArgs": ["--access", "public"] } } node-redis-redis-4.5.1/packages/client/README.md000066400000000000000000000002141433774114400211760ustar00rootroot00000000000000# @redis/client The source code and documentation for this package are in the main [node-redis](https://github.com/redis/node-redis) repo. node-redis-redis-4.5.1/packages/client/index.ts000066400000000000000000000012241433774114400214000ustar00rootroot00000000000000import RedisClient from './lib/client'; import RedisCluster from './lib/cluster'; export { RedisClientType, RedisClientOptions } from './lib/client'; export { RedisModules, RedisFunctions, RedisScripts } from './lib/commands'; export const createClient = RedisClient.create; export const commandOptions = RedisClient.commandOptions; export { RedisClusterType, RedisClusterOptions } from './lib/cluster'; export const createCluster = RedisCluster.create; export { defineScript } from './lib/lua-script'; export { GeoReplyWith } from './lib/commands/generic-transformers'; export * from './lib/errors'; export { SetOptions } from "./lib/commands/SET"; node-redis-redis-4.5.1/packages/client/lib/000077500000000000000000000000001433774114400204705ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/client/000077500000000000000000000000001433774114400217465ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/client/RESP2/000077500000000000000000000000001433774114400226015ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/client/RESP2/composers/000077500000000000000000000000001433774114400246135ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/client/RESP2/composers/buffer.spec.ts000066400000000000000000000005671433774114400273750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import BufferComposer from './buffer'; describe('Buffer Composer', () => { const composer = new BufferComposer(); it('should compose two buffers', () => { composer.write(Buffer.from([0])); assert.deepEqual( composer.end(Buffer.from([1])), Buffer.from([0, 1]) ); }); }); node-redis-redis-4.5.1/packages/client/lib/client/RESP2/composers/buffer.ts000066400000000000000000000006111433774114400264320ustar00rootroot00000000000000import { Composer } from './interface'; export default class BufferComposer implements Composer { private chunks: Array = []; write(buffer: Buffer): void { this.chunks.push(buffer); } end(buffer: Buffer): Buffer { this.write(buffer); return Buffer.concat(this.chunks.splice(0)); } reset() { this.chunks = []; } } node-redis-redis-4.5.1/packages/client/lib/client/RESP2/composers/interface.ts000066400000000000000000000001631433774114400271230ustar00rootroot00000000000000export interface Composer { write(buffer: Buffer): void; end(buffer: Buffer): T; reset(): void; } node-redis-redis-4.5.1/packages/client/lib/client/RESP2/composers/string.spec.ts000066400000000000000000000006021433774114400274200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import StringComposer from './string'; describe('String Composer', () => { const composer = new StringComposer(); it('should compose two strings', () => { composer.write(Buffer.from([0])); assert.deepEqual( composer.end(Buffer.from([1])), Buffer.from([0, 1]).toString() ); }); }); node-redis-redis-4.5.1/packages/client/lib/client/RESP2/composers/string.ts000066400000000000000000000010061433774114400264660ustar00rootroot00000000000000import { StringDecoder } from 'string_decoder'; import { Composer } from './interface'; export default class StringComposer implements Composer { private decoder = new StringDecoder(); private string = ''; write(buffer: Buffer): void { this.string += this.decoder.write(buffer); } end(buffer: Buffer): string { const string = this.string + this.decoder.end(buffer); this.string = ''; return string; } reset() { this.string = ''; } } node-redis-redis-4.5.1/packages/client/lib/client/RESP2/decoder.spec.ts000066400000000000000000000122271433774114400255130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { SinonSpy, spy } from 'sinon'; import RESP2Decoder from './decoder'; import { ErrorReply } from '../../errors'; interface DecoderAndSpies { decoder: RESP2Decoder; returnStringsAsBuffersSpy: SinonSpy; onReplySpy: SinonSpy; } function createDecoderAndSpies(returnStringsAsBuffers: boolean): DecoderAndSpies { const returnStringsAsBuffersSpy = spy(() => returnStringsAsBuffers), onReplySpy = spy(); return { decoder: new RESP2Decoder({ returnStringsAsBuffers: returnStringsAsBuffersSpy, onReply: onReplySpy }), returnStringsAsBuffersSpy, onReplySpy }; } function writeChunks(stream: RESP2Decoder, buffer: Buffer) { let i = 0; while (i < buffer.length) { stream.write(buffer.slice(i, ++i)); } } type Replies = Array>; interface TestsOptions { toWrite: Buffer; returnStringsAsBuffers: boolean; replies: Replies; } function generateTests({ toWrite, returnStringsAsBuffers, replies }: TestsOptions): void { it('single chunk', () => { const { decoder, returnStringsAsBuffersSpy, onReplySpy } = createDecoderAndSpies(returnStringsAsBuffers); decoder.write(toWrite); assert.equal(returnStringsAsBuffersSpy.callCount, replies.length); testReplies(onReplySpy, replies); }); it('multiple chunks', () => { const { decoder, returnStringsAsBuffersSpy, onReplySpy } = createDecoderAndSpies(returnStringsAsBuffers); writeChunks(decoder, toWrite); assert.equal(returnStringsAsBuffersSpy.callCount, replies.length); testReplies(onReplySpy, replies); }); } function testReplies(spy: SinonSpy, replies: Replies): void { if (!replies) { assert.equal(spy.callCount, 0); return; } assert.equal(spy.callCount, replies.length); for (const [i, reply] of replies.entries()) { assert.deepEqual( spy.getCall(i).args, reply ); } } describe('RESP2Parser', () => { describe('Simple String', () => { describe('as strings', () => { generateTests({ toWrite: Buffer.from('+OK\r\n'), returnStringsAsBuffers: false, replies: [['OK']] }); }); describe('as buffers', () => { generateTests({ toWrite: Buffer.from('+OK\r\n'), returnStringsAsBuffers: true, replies: [[Buffer.from('OK')]] }); }); }); describe('Error', () => { generateTests({ toWrite: Buffer.from('-ERR\r\n'), returnStringsAsBuffers: false, replies: [[new ErrorReply('ERR')]] }); }); describe('Integer', () => { describe('-1', () => { generateTests({ toWrite: Buffer.from(':-1\r\n'), returnStringsAsBuffers: false, replies: [[-1]] }); }); describe('0', () => { generateTests({ toWrite: Buffer.from(':0\r\n'), returnStringsAsBuffers: false, replies: [[0]] }); }); }); describe('Bulk String', () => { describe('null', () => { generateTests({ toWrite: Buffer.from('$-1\r\n'), returnStringsAsBuffers: false, replies: [[null]] }); }); describe('as strings', () => { generateTests({ toWrite: Buffer.from('$2\r\naa\r\n'), returnStringsAsBuffers: false, replies: [['aa']] }); }); describe('as buffers', () => { generateTests({ toWrite: Buffer.from('$2\r\naa\r\n'), returnStringsAsBuffers: true, replies: [[Buffer.from('aa')]] }); }); }); describe('Array', () => { describe('null', () => { generateTests({ toWrite: Buffer.from('*-1\r\n'), returnStringsAsBuffers: false, replies: [[null]] }); }); const arrayBuffer = Buffer.from( '*5\r\n' + '+OK\r\n' + '-ERR\r\n' + ':0\r\n' + '$1\r\na\r\n' + '*0\r\n' ); describe('as strings', () => { generateTests({ toWrite: arrayBuffer, returnStringsAsBuffers: false, replies: [[[ 'OK', new ErrorReply('ERR'), 0, 'a', [] ]]] }); }); describe('as buffers', () => { generateTests({ toWrite: arrayBuffer, returnStringsAsBuffers: true, replies: [[[ Buffer.from('OK'), new ErrorReply('ERR'), 0, Buffer.from('a'), [] ]]] }); }); }); }); node-redis-redis-4.5.1/packages/client/lib/client/RESP2/decoder.ts000066400000000000000000000167471433774114400245750ustar00rootroot00000000000000import { ErrorReply } from '../../errors'; import { Composer } from './composers/interface'; import BufferComposer from './composers/buffer'; import StringComposer from './composers/string'; // RESP2 specification // https://redis.io/topics/protocol enum Types { SIMPLE_STRING = 43, // + ERROR = 45, // - INTEGER = 58, // : BULK_STRING = 36, // $ ARRAY = 42 // * } enum ASCII { CR = 13, // \r ZERO = 48, MINUS = 45 } export type Reply = string | Buffer | ErrorReply | number | null | Array; type ArrayReply = Array | null; export type ReturnStringsAsBuffers = () => boolean; interface RESP2Options { returnStringsAsBuffers: ReturnStringsAsBuffers; onReply(reply: Reply): unknown; } interface ArrayInProcess { array: Array; pushCounter: number; } // Using TypeScript `private` and not the build-in `#` to avoid __classPrivateFieldGet and __classPrivateFieldSet export default class RESP2Decoder { constructor(private options: RESP2Options) {} private cursor = 0; private type?: Types; private bufferComposer = new BufferComposer(); private stringComposer = new StringComposer(); private currentStringComposer: BufferComposer | StringComposer = this.stringComposer; reset() { this.cursor = 0; this.type = undefined; this.bufferComposer.reset(); this.stringComposer.reset(); this.currentStringComposer = this.stringComposer; } write(chunk: Buffer): void { while (this.cursor < chunk.length) { if (!this.type) { this.currentStringComposer = this.options.returnStringsAsBuffers() ? this.bufferComposer : this.stringComposer; this.type = chunk[this.cursor]; if (++this.cursor >= chunk.length) break; } const reply = this.parseType(chunk, this.type); if (reply === undefined) break; this.type = undefined; this.options.onReply(reply); } this.cursor -= chunk.length; } private parseType(chunk: Buffer, type: Types, arraysToKeep?: number): Reply | undefined { switch (type) { case Types.SIMPLE_STRING: return this.parseSimpleString(chunk); case Types.ERROR: return this.parseError(chunk); case Types.INTEGER: return this.parseInteger(chunk); case Types.BULK_STRING: return this.parseBulkString(chunk); case Types.ARRAY: return this.parseArray(chunk, arraysToKeep); } } private compose< C extends Composer, T = C extends Composer ? TT : never >( chunk: Buffer, composer: C ): T | undefined { for (let i = this.cursor; i < chunk.length; i++) { if (chunk[i] === ASCII.CR) { const reply = composer.end( chunk.subarray(this.cursor, i) ); this.cursor = i + 2; return reply; } } const toWrite = chunk.subarray(this.cursor); composer.write(toWrite); this.cursor = chunk.length; } private parseSimpleString(chunk: Buffer): string | Buffer | undefined { return this.compose(chunk, this.currentStringComposer); } private parseError(chunk: Buffer): ErrorReply | undefined { const message = this.compose(chunk, this.stringComposer); if (message !== undefined) { return new ErrorReply(message); } } private integer = 0; private isNegativeInteger?: boolean; private parseInteger(chunk: Buffer): number | undefined { if (this.isNegativeInteger === undefined) { this.isNegativeInteger = chunk[this.cursor] === ASCII.MINUS; if (this.isNegativeInteger && ++this.cursor === chunk.length) return; } do { const byte = chunk[this.cursor]; if (byte === ASCII.CR) { const integer = this.isNegativeInteger ? -this.integer : this.integer; this.integer = 0; this.isNegativeInteger = undefined; this.cursor += 2; return integer; } this.integer = this.integer * 10 + byte - ASCII.ZERO; } while (++this.cursor < chunk.length); } private bulkStringRemainingLength?: number; private parseBulkString(chunk: Buffer): string | Buffer | null | undefined { if (this.bulkStringRemainingLength === undefined) { const length = this.parseInteger(chunk); if (length === undefined) return; if (length === -1) return null; this.bulkStringRemainingLength = length; if (this.cursor >= chunk.length) return; } const end = this.cursor + this.bulkStringRemainingLength; if (chunk.length >= end) { const reply = this.currentStringComposer.end( chunk.subarray(this.cursor, end) ); this.bulkStringRemainingLength = undefined; this.cursor = end + 2; return reply; } const toWrite = chunk.subarray(this.cursor); this.currentStringComposer.write(toWrite); this.bulkStringRemainingLength -= toWrite.length; this.cursor = chunk.length; } private arraysInProcess: Array = []; private initializeArray = false; private arrayItemType?: Types; private parseArray(chunk: Buffer, arraysToKeep = 0): ArrayReply | undefined { if (this.initializeArray || this.arraysInProcess.length === arraysToKeep) { const length = this.parseInteger(chunk); if (length === undefined) { this.initializeArray = true; return undefined; } this.initializeArray = false; this.arrayItemType = undefined; if (length === -1) { return this.returnArrayReply(null, arraysToKeep); } else if (length === 0) { return this.returnArrayReply([], arraysToKeep); } this.arraysInProcess.push({ array: new Array(length), pushCounter: 0 }); } while (this.cursor < chunk.length) { if (!this.arrayItemType) { this.arrayItemType = chunk[this.cursor]; if (++this.cursor >= chunk.length) break; } const item = this.parseType( chunk, this.arrayItemType, arraysToKeep + 1 ); if (item === undefined) break; this.arrayItemType = undefined; const reply = this.pushArrayItem(item, arraysToKeep); if (reply !== undefined) return reply; } } private returnArrayReply(reply: ArrayReply, arraysToKeep: number): ArrayReply | undefined { if (this.arraysInProcess.length <= arraysToKeep) return reply; return this.pushArrayItem(reply, arraysToKeep); } private pushArrayItem(item: Reply, arraysToKeep: number): ArrayReply | undefined { const to = this.arraysInProcess[this.arraysInProcess.length - 1]!; to.array[to.pushCounter] = item; if (++to.pushCounter === to.array.length) { return this.returnArrayReply( this.arraysInProcess.pop()!.array, arraysToKeep ); } } } node-redis-redis-4.5.1/packages/client/lib/client/RESP2/encoder.spec.ts000066400000000000000000000014711433774114400255240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { describe } from 'mocha'; import encodeCommand from './encoder'; describe('RESP2 Encoder', () => { it('1 byte', () => { assert.deepEqual( encodeCommand(['a', 'z']), ['*2\r\n$1\r\na\r\n$1\r\nz\r\n'] ); }); it('2 bytes', () => { assert.deepEqual( encodeCommand(['א', 'ת']), ['*2\r\n$2\r\nא\r\n$2\r\nת\r\n'] ); }); it('4 bytes', () => { assert.deepEqual( [...encodeCommand(['🐣', '🐤'])], ['*2\r\n$4\r\n🐣\r\n$4\r\n🐤\r\n'] ); }); it('buffer', () => { assert.deepEqual( encodeCommand([Buffer.from('string')]), ['*1\r\n$6\r\n', Buffer.from('string'), '\r\n'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/client/RESP2/encoder.ts000066400000000000000000000014641433774114400245750ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '../../commands'; const CRLF = '\r\n'; export default function encodeCommand(args: RedisCommandArguments): Array { const toWrite: Array = []; let strings = '*' + args.length + CRLF; for (let i = 0; i < args.length; i++) { const arg = args[i]; if (typeof arg === 'string') { strings += '$' + Buffer.byteLength(arg) + CRLF + arg + CRLF; } else if (arg instanceof Buffer) { toWrite.push( strings + '$' + arg.length.toString() + CRLF, arg ); strings = CRLF; } else { throw new TypeError('Invalid argument type'); } } toWrite.push(strings); return toWrite; } node-redis-redis-4.5.1/packages/client/lib/client/commands-queue.ts000066400000000000000000000327161433774114400252520ustar00rootroot00000000000000import * as LinkedList from 'yallist'; import { AbortError, ErrorReply } from '../errors'; import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from '../commands'; import RESP2Decoder from './RESP2/decoder'; import encodeCommand from './RESP2/encoder'; export interface QueueCommandOptions { asap?: boolean; chainId?: symbol; signal?: AbortSignal; returnBuffers?: boolean; ignorePubSubMode?: boolean; } interface CommandWaitingToBeSent extends CommandWaitingForReply { args: RedisCommandArguments; chainId?: symbol; abort?: { signal: AbortSignal; listener(): void; }; } interface CommandWaitingForReply { resolve(reply?: unknown): void; reject(err: unknown): void; channelsCounter?: number; returnBuffers?: boolean; } export enum PubSubSubscribeCommands { SUBSCRIBE = 'SUBSCRIBE', PSUBSCRIBE = 'PSUBSCRIBE' } export enum PubSubUnsubscribeCommands { UNSUBSCRIBE = 'UNSUBSCRIBE', PUNSUBSCRIBE = 'PUNSUBSCRIBE' } export type PubSubListener< RETURN_BUFFERS extends boolean = false, T = RETURN_BUFFERS extends true ? Buffer : string > = (message: T, channel: T) => unknown; interface PubSubListeners { buffers: Set>; strings: Set>; } type PubSubListenersMap = Map; export default class RedisCommandsQueue { static #flushQueue(queue: LinkedList, err: Error): void { while (queue.length) { queue.shift()!.reject(err); } } static #emitPubSubMessage(listenersMap: PubSubListenersMap, message: Buffer, channel: Buffer, pattern?: Buffer): void { const keyString = (pattern ?? channel).toString(), listeners = listenersMap.get(keyString); if (!listeners) return; for (const listener of listeners.buffers) { listener(message, channel); } if (!listeners.strings.size) return; const channelString = pattern ? channel.toString() : keyString, messageString = channelString === '__redis__:invalidate' ? // https://github.com/redis/redis/pull/7469 // https://github.com/redis/redis/issues/7463 (message === null ? null : (message as any as Array).map(x => x.toString())) as any : message.toString(); for (const listener of listeners.strings) { listener(messageString, channelString); } } readonly #maxLength: number | null | undefined; readonly #waitingToBeSent = new LinkedList(); readonly #waitingForReply = new LinkedList(); readonly #pubSubState = { isActive: false, subscribing: 0, subscribed: 0, unsubscribing: 0, listeners: { channels: new Map(), patterns: new Map() } }; static readonly #PUB_SUB_MESSAGES = { message: Buffer.from('message'), pMessage: Buffer.from('pmessage'), subscribe: Buffer.from('subscribe'), pSubscribe: Buffer.from('psubscribe'), unsubscribe: Buffer.from('unsubscribe'), pUnsubscribe: Buffer.from('punsubscribe') }; #chainInExecution: symbol | undefined; #decoder = new RESP2Decoder({ returnStringsAsBuffers: () => { return !!this.#waitingForReply.head?.value.returnBuffers || this.#pubSubState.isActive; }, onReply: reply => { if (this.#handlePubSubReply(reply)) { return; } else if (!this.#waitingForReply.length) { throw new Error('Got an unexpected reply from Redis'); } const { resolve, reject } = this.#waitingForReply.shift()!; if (reply instanceof ErrorReply) { reject(reply); } else { resolve(reply); } } }); constructor(maxLength: number | null | undefined) { this.#maxLength = maxLength; } addCommand(args: RedisCommandArguments, options?: QueueCommandOptions): Promise { if (this.#pubSubState.isActive && !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) { return Promise.reject(new Error('The queue is full')); } else if (options?.signal?.aborted) { return Promise.reject(new AbortError()); } return new Promise((resolve, reject) => { const node = new LinkedList.Node({ args, chainId: options?.chainId, returnBuffers: options?.returnBuffers, resolve, reject }); if (options?.signal) { const listener = () => { this.#waitingToBeSent.removeNode(node); node.value.reject(new AbortError()); }; node.value.abort = { signal: options.signal, listener }; // AbortSignal type is incorrent (options.signal as any).addEventListener('abort', listener, { once: true }); } if (options?.asap) { this.#waitingToBeSent.unshiftNode(node); } else { this.#waitingToBeSent.pushNode(node); } }); } subscribe( command: PubSubSubscribeCommands, channels: RedisCommandArgument | Array, listener: PubSubListener, returnBuffers?: T ): Promise { const channelsToSubscribe: Array = [], listenersMap = command === PubSubSubscribeCommands.SUBSCRIBE ? this.#pubSubState.listeners.channels : this.#pubSubState.listeners.patterns; for (const channel of (Array.isArray(channels) ? channels : [channels])) { const channelString = typeof channel === 'string' ? channel : channel.toString(); let listeners = listenersMap.get(channelString); if (!listeners) { listeners = { buffers: new Set(), strings: new Set() }; listenersMap.set(channelString, listeners); channelsToSubscribe.push(channel); } // https://github.com/microsoft/TypeScript/issues/23132 (returnBuffers ? listeners.buffers : listeners.strings).add(listener as any); } if (!channelsToSubscribe.length) { return Promise.resolve(); } return this.#pushPubSubCommand(command, channelsToSubscribe); } unsubscribe( command: PubSubUnsubscribeCommands, channels?: string | Array, listener?: PubSubListener, returnBuffers?: T ): Promise { const listeners = command === PubSubUnsubscribeCommands.UNSUBSCRIBE ? this.#pubSubState.listeners.channels : this.#pubSubState.listeners.patterns; if (!channels) { const size = listeners.size; listeners.clear(); return this.#pushPubSubCommand(command, size); } const channelsToUnsubscribe = []; for (const channel of (Array.isArray(channels) ? channels : [channels])) { const sets = listeners.get(channel); if (!sets) continue; let shouldUnsubscribe; if (listener) { // https://github.com/microsoft/TypeScript/issues/23132 (returnBuffers ? sets.buffers : sets.strings).delete(listener as any); shouldUnsubscribe = !sets.buffers.size && !sets.strings.size; } else { shouldUnsubscribe = true; } if (shouldUnsubscribe) { channelsToUnsubscribe.push(channel); listeners.delete(channel); } } if (!channelsToUnsubscribe.length) { return Promise.resolve(); } return this.#pushPubSubCommand(command, channelsToUnsubscribe); } #pushPubSubCommand(command: PubSubSubscribeCommands | PubSubUnsubscribeCommands, channels: number | Array): Promise { return new Promise((resolve, reject) => { const isSubscribe = command === PubSubSubscribeCommands.SUBSCRIBE || command === PubSubSubscribeCommands.PSUBSCRIBE, inProgressKey = isSubscribe ? 'subscribing' : 'unsubscribing', commandArgs: Array = [command]; let channelsCounter: number; if (typeof channels === 'number') { // unsubscribe only channelsCounter = channels; } else { commandArgs.push(...channels); channelsCounter = channels.length; } this.#pubSubState.isActive = true; this.#pubSubState[inProgressKey] += channelsCounter; this.#waitingToBeSent.push({ args: commandArgs, channelsCounter, returnBuffers: true, resolve: () => { this.#pubSubState[inProgressKey] -= channelsCounter; this.#pubSubState.subscribed += channelsCounter * (isSubscribe ? 1 : -1); this.#updatePubSubActiveState(); resolve(); }, reject: err => { this.#pubSubState[inProgressKey] -= channelsCounter * (isSubscribe ? 1 : -1); this.#updatePubSubActiveState(); reject(err); } }); }); } #updatePubSubActiveState(): void { if ( !this.#pubSubState.subscribed && !this.#pubSubState.subscribing && !this.#pubSubState.subscribed ) { this.#pubSubState.isActive = false; } } resubscribe(): Promise | undefined { this.#pubSubState.subscribed = 0; this.#pubSubState.subscribing = 0; this.#pubSubState.unsubscribing = 0; const promises = [], { channels, patterns } = this.#pubSubState.listeners; if (channels.size) { promises.push( this.#pushPubSubCommand( PubSubSubscribeCommands.SUBSCRIBE, [...channels.keys()] ) ); } if (patterns.size) { promises.push( this.#pushPubSubCommand( PubSubSubscribeCommands.PSUBSCRIBE, [...patterns.keys()] ) ); } if (promises.length) { return Promise.all(promises); } } getCommandToSend(): RedisCommandArguments | undefined { const toSend = this.#waitingToBeSent.shift(); if (!toSend) return; let encoded: RedisCommandArguments; try { encoded = encodeCommand(toSend.args); } catch (err) { toSend.reject(err); return; } this.#waitingForReply.push({ resolve: toSend.resolve, reject: toSend.reject, channelsCounter: toSend.channelsCounter, returnBuffers: toSend.returnBuffers }); this.#chainInExecution = toSend.chainId; return encoded; } onReplyChunk(chunk: Buffer): void { this.#decoder.write(chunk); } #handlePubSubReply(reply: any): boolean { if (!this.#pubSubState.isActive || !Array.isArray(reply)) return false; if (RedisCommandsQueue.#PUB_SUB_MESSAGES.message.equals(reply[0])) { RedisCommandsQueue.#emitPubSubMessage( this.#pubSubState.listeners.channels, reply[2], reply[1] ); } else if (RedisCommandsQueue.#PUB_SUB_MESSAGES.pMessage.equals(reply[0])) { RedisCommandsQueue.#emitPubSubMessage( this.#pubSubState.listeners.patterns, reply[3], reply[2], reply[1] ); } else if ( RedisCommandsQueue.#PUB_SUB_MESSAGES.subscribe.equals(reply[0]) || RedisCommandsQueue.#PUB_SUB_MESSAGES.pSubscribe.equals(reply[0]) || RedisCommandsQueue.#PUB_SUB_MESSAGES.unsubscribe.equals(reply[0]) || RedisCommandsQueue.#PUB_SUB_MESSAGES.pUnsubscribe.equals(reply[0]) ) { if (--this.#waitingForReply.head!.value.channelsCounter! === 0) { this.#waitingForReply.shift()!.resolve(); } } return true; } flushWaitingForReply(err: Error): void { this.#decoder.reset(); this.#pubSubState.isActive = false; RedisCommandsQueue.#flushQueue(this.#waitingForReply, err); if (!this.#chainInExecution) return; while (this.#waitingToBeSent.head?.value.chainId === this.#chainInExecution) { this.#waitingToBeSent.shift(); } this.#chainInExecution = undefined; } flushAll(err: Error): void { RedisCommandsQueue.#flushQueue(this.#waitingForReply, err); RedisCommandsQueue.#flushQueue(this.#waitingToBeSent, err); } } node-redis-redis-4.5.1/packages/client/lib/client/commands.ts000066400000000000000000000302061433774114400241200ustar00rootroot00000000000000import CLUSTER_COMMANDS from '../cluster/commands'; import * as ACL_CAT from '../commands/ACL_CAT'; import * as ACL_DELUSER from '../commands/ACL_DELUSER'; import * as ACL_DRYRUN from '../commands/ACL_DRYRUN'; import * as ACL_GENPASS from '../commands/ACL_GENPASS'; import * as ACL_GETUSER from '../commands/ACL_GETUSER'; import * as ACL_LIST from '../commands/ACL_LIST'; import * as ACL_LOAD from '../commands/ACL_LOAD'; import * as ACL_LOG_RESET from '../commands/ACL_LOG_RESET'; import * as ACL_LOG from '../commands/ACL_LOG'; import * as ACL_SAVE from '../commands/ACL_SAVE'; import * as ACL_SETUSER from '../commands/ACL_SETUSER'; import * as ACL_USERS from '../commands/ACL_USERS'; import * as ACL_WHOAMI from '../commands/ACL_WHOAMI'; import * as ASKING from '../commands/ASKING'; import * as AUTH from '../commands/AUTH'; import * as BGREWRITEAOF from '../commands/BGREWRITEAOF'; import * as BGSAVE from '../commands/BGSAVE'; import * as CLIENT_CACHING from '../commands/CLIENT_CACHING'; import * as CLIENT_GETNAME from '../commands/CLIENT_GETNAME'; import * as CLIENT_GETREDIR from '../commands/CLIENT_GETREDIR'; import * as CLIENT_ID from '../commands/CLIENT_ID'; import * as CLIENT_KILL from '../commands/CLIENT_KILL'; import * as CLIENT_NO_EVICT from '../commands/CLIENT_NO-EVICT'; import * as CLIENT_PAUSE from '../commands/CLIENT_PAUSE'; import * as CLIENT_SETNAME from '../commands/CLIENT_SETNAME'; import * as CLIENT_TRACKING from '../commands/CLIENT_TRACKING'; import * as CLIENT_TRACKINGINFO from '../commands/CLIENT_TRACKINGINFO'; import * as CLIENT_UNPAUSE from '../commands/CLIENT_UNPAUSE'; import * as CLIENT_INFO from '../commands/CLIENT_INFO'; import * as CLUSTER_ADDSLOTS from '../commands/CLUSTER_ADDSLOTS'; import * as CLUSTER_ADDSLOTSRANGE from '../commands/CLUSTER_ADDSLOTSRANGE'; import * as CLUSTER_BUMPEPOCH from '../commands/CLUSTER_BUMPEPOCH'; import * as CLUSTER_COUNT_FAILURE_REPORTS from '../commands/CLUSTER_COUNT-FAILURE-REPORTS'; import * as CLUSTER_COUNTKEYSINSLOT from '../commands/CLUSTER_COUNTKEYSINSLOT'; import * as CLUSTER_DELSLOTS from '../commands/CLUSTER_DELSLOTS'; import * as CLUSTER_DELSLOTSRANGE from '../commands/CLUSTER_DELSLOTSRANGE'; import * as CLUSTER_FAILOVER from '../commands/CLUSTER_FAILOVER'; import * as CLUSTER_FLUSHSLOTS from '../commands/CLUSTER_FLUSHSLOTS'; import * as CLUSTER_FORGET from '../commands/CLUSTER_FORGET'; import * as CLUSTER_GETKEYSINSLOT from '../commands/CLUSTER_GETKEYSINSLOT'; import * as CLUSTER_INFO from '../commands/CLUSTER_INFO'; import * as CLUSTER_KEYSLOT from '../commands/CLUSTER_KEYSLOT'; import * as CLUSTER_LINKS from '../commands/CLUSTER_LINKS'; import * as CLUSTER_MEET from '../commands/CLUSTER_MEET'; import * as CLUSTER_MYID from '../commands/CLUSTER_MYID'; import * as CLUSTER_NODES from '../commands/CLUSTER_NODES'; import * as CLUSTER_REPLICAS from '../commands/CLUSTER_REPLICAS'; import * as CLUSTER_REPLICATE from '../commands/CLUSTER_REPLICATE'; import * as CLUSTER_RESET from '../commands/CLUSTER_RESET'; import * as CLUSTER_SAVECONFIG from '../commands/CLUSTER_SAVECONFIG'; import * as CLUSTER_SET_CONFIG_EPOCH from '../commands/CLUSTER_SET-CONFIG-EPOCH'; import * as CLUSTER_SETSLOT from '../commands/CLUSTER_SETSLOT'; import * as CLUSTER_SLOTS from '../commands/CLUSTER_SLOTS'; import * as COMMAND_COUNT from '../commands/COMMAND_COUNT'; import * as COMMAND_GETKEYS from '../commands/COMMAND_GETKEYS'; import * as COMMAND_GETKEYSANDFLAGS from '../commands/COMMAND_GETKEYSANDFLAGS'; import * as COMMAND_INFO from '../commands/COMMAND_INFO'; import * as COMMAND_LIST from '../commands/COMMAND_LIST'; import * as COMMAND from '../commands/COMMAND'; import * as CONFIG_GET from '../commands/CONFIG_GET'; import * as CONFIG_RESETASTAT from '../commands/CONFIG_RESETSTAT'; import * as CONFIG_REWRITE from '../commands/CONFIG_REWRITE'; import * as CONFIG_SET from '../commands/CONFIG_SET'; import * as DBSIZE from '../commands/DBSIZE'; import * as DISCARD from '../commands/DISCARD'; import * as ECHO from '../commands/ECHO'; import * as FAILOVER from '../commands/FAILOVER'; import * as FLUSHALL from '../commands/FLUSHALL'; import * as FLUSHDB from '../commands/FLUSHDB'; import * as FUNCTION_DELETE from '../commands/FUNCTION_DELETE'; import * as FUNCTION_DUMP from '../commands/FUNCTION_DUMP'; import * as FUNCTION_FLUSH from '../commands/FUNCTION_FLUSH'; import * as FUNCTION_KILL from '../commands/FUNCTION_KILL'; import * as FUNCTION_LIST_WITHCODE from '../commands/FUNCTION_LIST_WITHCODE'; import * as FUNCTION_LIST from '../commands/FUNCTION_LIST'; import * as FUNCTION_LOAD from '../commands/FUNCTION_LOAD'; import * as FUNCTION_RESTORE from '../commands/FUNCTION_RESTORE'; import * as FUNCTION_STATS from '../commands/FUNCTION_STATS'; import * as HELLO from '../commands/HELLO'; import * as INFO from '../commands/INFO'; import * as KEYS from '../commands/KEYS'; import * as LASTSAVE from '../commands/LASTSAVE'; import * as LOLWUT from '../commands/LOLWUT'; import * as MEMORY_DOCTOR from '../commands/MEMORY_DOCTOR'; import * as MEMORY_MALLOC_STATS from '../commands/MEMORY_MALLOC-STATS'; import * as MEMORY_PURGE from '../commands/MEMORY_PURGE'; import * as MEMORY_STATS from '../commands/MEMORY_STATS'; import * as MEMORY_USAGE from '../commands/MEMORY_USAGE'; import * as MODULE_LIST from '../commands/MODULE_LIST'; import * as MODULE_LOAD from '../commands/MODULE_LOAD'; import * as MODULE_UNLOAD from '../commands/MODULE_UNLOAD'; import * as MOVE from '../commands/MOVE'; import * as PING from '../commands/PING'; import * as PUBSUB_CHANNELS from '../commands/PUBSUB_CHANNELS'; import * as PUBSUB_NUMPAT from '../commands/PUBSUB_NUMPAT'; import * as PUBSUB_NUMSUB from '../commands/PUBSUB_NUMSUB'; import * as RANDOMKEY from '../commands/RANDOMKEY'; import * as READONLY from '../commands/READONLY'; import * as READWRITE from '../commands/READWRITE'; import * as REPLICAOF from '../commands/REPLICAOF'; import * as RESTORE_ASKING from '../commands/RESTORE-ASKING'; import * as ROLE from '../commands/ROLE'; import * as SAVE from '../commands/SAVE'; import * as SCAN from '../commands/SCAN'; import * as SCRIPT_DEBUG from '../commands/SCRIPT_DEBUG'; import * as SCRIPT_EXISTS from '../commands/SCRIPT_EXISTS'; import * as SCRIPT_FLUSH from '../commands/SCRIPT_FLUSH'; import * as SCRIPT_KILL from '../commands/SCRIPT_KILL'; import * as SCRIPT_LOAD from '../commands/SCRIPT_LOAD'; import * as SHUTDOWN from '../commands/SHUTDOWN'; import * as SWAPDB from '../commands/SWAPDB'; import * as TIME from '../commands/TIME'; import * as UNWATCH from '../commands/UNWATCH'; import * as WAIT from '../commands/WAIT'; import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR'; export default { ...CLUSTER_COMMANDS, ACL_CAT, aclCat: ACL_CAT, ACL_DELUSER, aclDelUser: ACL_DELUSER, ACL_DRYRUN, aclDryRun: ACL_DRYRUN, ACL_GENPASS, aclGenPass: ACL_GENPASS, ACL_GETUSER, aclGetUser: ACL_GETUSER, ACL_LIST, aclList: ACL_LIST, ACL_LOAD, aclLoad: ACL_LOAD, ACL_LOG_RESET, aclLogReset: ACL_LOG_RESET, ACL_LOG, aclLog: ACL_LOG, ACL_SAVE, aclSave: ACL_SAVE, ACL_SETUSER, aclSetUser: ACL_SETUSER, ACL_USERS, aclUsers: ACL_USERS, ACL_WHOAMI, aclWhoAmI: ACL_WHOAMI, ASKING, asking: ASKING, AUTH, auth: AUTH, BGREWRITEAOF, bgRewriteAof: BGREWRITEAOF, BGSAVE, bgSave: BGSAVE, CLIENT_CACHING, clientCaching: CLIENT_CACHING, CLIENT_GETNAME, clientGetName: CLIENT_GETNAME, CLIENT_GETREDIR, clientGetRedir: CLIENT_GETREDIR, CLIENT_ID, clientId: CLIENT_ID, CLIENT_KILL, clientKill: CLIENT_KILL, 'CLIENT_NO-EVICT': CLIENT_NO_EVICT, clientNoEvict: CLIENT_NO_EVICT, CLIENT_PAUSE, clientPause: CLIENT_PAUSE, CLIENT_SETNAME, clientSetName: CLIENT_SETNAME, CLIENT_TRACKING, clientTracking: CLIENT_TRACKING, CLIENT_TRACKINGINFO, clientTrackingInfo: CLIENT_TRACKINGINFO, CLIENT_UNPAUSE, clientUnpause: CLIENT_UNPAUSE, CLIENT_INFO, clientInfo: CLIENT_INFO, CLUSTER_ADDSLOTS, clusterAddSlots: CLUSTER_ADDSLOTS, CLUSTER_ADDSLOTSRANGE, clusterAddSlotsRange: CLUSTER_ADDSLOTSRANGE, CLUSTER_BUMPEPOCH, clusterBumpEpoch: CLUSTER_BUMPEPOCH, CLUSTER_COUNT_FAILURE_REPORTS, clusterCountFailureReports: CLUSTER_COUNT_FAILURE_REPORTS, CLUSTER_COUNTKEYSINSLOT, clusterCountKeysInSlot: CLUSTER_COUNTKEYSINSLOT, CLUSTER_DELSLOTS, clusterDelSlots: CLUSTER_DELSLOTS, CLUSTER_DELSLOTSRANGE, clusterDelSlotsRange: CLUSTER_DELSLOTSRANGE, CLUSTER_FAILOVER, clusterFailover: CLUSTER_FAILOVER, CLUSTER_FLUSHSLOTS, clusterFlushSlots: CLUSTER_FLUSHSLOTS, CLUSTER_FORGET, clusterForget: CLUSTER_FORGET, CLUSTER_GETKEYSINSLOT, clusterGetKeysInSlot: CLUSTER_GETKEYSINSLOT, CLUSTER_INFO, clusterInfo: CLUSTER_INFO, CLUSTER_KEYSLOT, clusterKeySlot: CLUSTER_KEYSLOT, CLUSTER_LINKS, clusterLinks: CLUSTER_LINKS, CLUSTER_MEET, clusterMeet: CLUSTER_MEET, CLUSTER_MYID, clusterMyId: CLUSTER_MYID, CLUSTER_NODES, clusterNodes: CLUSTER_NODES, CLUSTER_REPLICAS, clusterReplicas: CLUSTER_REPLICAS, CLUSTER_REPLICATE, clusterReplicate: CLUSTER_REPLICATE, CLUSTER_RESET, clusterReset: CLUSTER_RESET, CLUSTER_SAVECONFIG, clusterSaveConfig: CLUSTER_SAVECONFIG, CLUSTER_SET_CONFIG_EPOCH, clusterSetConfigEpoch: CLUSTER_SET_CONFIG_EPOCH, CLUSTER_SETSLOT, clusterSetSlot: CLUSTER_SETSLOT, CLUSTER_SLOTS, clusterSlots: CLUSTER_SLOTS, COMMAND_COUNT, commandCount: COMMAND_COUNT, COMMAND_GETKEYS, commandGetKeys: COMMAND_GETKEYS, COMMAND_GETKEYSANDFLAGS, commandGetKeysAndFlags: COMMAND_GETKEYSANDFLAGS, COMMAND_INFO, commandInfo: COMMAND_INFO, COMMAND_LIST, commandList: COMMAND_LIST, COMMAND, command: COMMAND, CONFIG_GET, configGet: CONFIG_GET, CONFIG_RESETASTAT, configResetStat: CONFIG_RESETASTAT, CONFIG_REWRITE, configRewrite: CONFIG_REWRITE, CONFIG_SET, configSet: CONFIG_SET, DBSIZE, dbSize: DBSIZE, DISCARD, discard: DISCARD, ECHO, echo: ECHO, FAILOVER, failover: FAILOVER, FLUSHALL, flushAll: FLUSHALL, FLUSHDB, flushDb: FLUSHDB, FUNCTION_DELETE, functionDelete: FUNCTION_DELETE, FUNCTION_DUMP, functionDump: FUNCTION_DUMP, FUNCTION_FLUSH, functionFlush: FUNCTION_FLUSH, FUNCTION_KILL, functionKill: FUNCTION_KILL, FUNCTION_LIST_WITHCODE, functionListWithCode: FUNCTION_LIST_WITHCODE, FUNCTION_LIST, functionList: FUNCTION_LIST, FUNCTION_LOAD, functionLoad: FUNCTION_LOAD, FUNCTION_RESTORE, functionRestore: FUNCTION_RESTORE, FUNCTION_STATS, functionStats: FUNCTION_STATS, HELLO, hello: HELLO, INFO, info: INFO, KEYS, keys: KEYS, LASTSAVE, lastSave: LASTSAVE, LATENCY_DOCTOR, latencyDoctor: LATENCY_DOCTOR, LOLWUT, lolwut: LOLWUT, MEMORY_DOCTOR, memoryDoctor: MEMORY_DOCTOR, 'MEMORY_MALLOC-STATS': MEMORY_MALLOC_STATS, memoryMallocStats: MEMORY_MALLOC_STATS, MEMORY_PURGE, memoryPurge: MEMORY_PURGE, MEMORY_STATS, memoryStats: MEMORY_STATS, MEMORY_USAGE, memoryUsage: MEMORY_USAGE, MODULE_LIST, moduleList: MODULE_LIST, MODULE_LOAD, moduleLoad: MODULE_LOAD, MODULE_UNLOAD, moduleUnload: MODULE_UNLOAD, MOVE, move: MOVE, PING, ping: PING, PUBSUB_CHANNELS, pubSubChannels: PUBSUB_CHANNELS, PUBSUB_NUMPAT, pubSubNumPat: PUBSUB_NUMPAT, PUBSUB_NUMSUB, pubSubNumSub: PUBSUB_NUMSUB, RANDOMKEY, randomKey: RANDOMKEY, READONLY, readonly: READONLY, READWRITE, readwrite: READWRITE, REPLICAOF, replicaOf: REPLICAOF, 'RESTORE-ASKING': RESTORE_ASKING, restoreAsking: RESTORE_ASKING, ROLE, role: ROLE, SAVE, save: SAVE, SCAN, scan: SCAN, SCRIPT_DEBUG, scriptDebug: SCRIPT_DEBUG, SCRIPT_EXISTS, scriptExists: SCRIPT_EXISTS, SCRIPT_FLUSH, scriptFlush: SCRIPT_FLUSH, SCRIPT_KILL, scriptKill: SCRIPT_KILL, SCRIPT_LOAD, scriptLoad: SCRIPT_LOAD, SHUTDOWN, shutdown: SHUTDOWN, SWAPDB, swapDb: SWAPDB, TIME, time: TIME, UNWATCH, unwatch: UNWATCH, WAIT, wait: WAIT }; node-redis-redis-4.5.1/packages/client/lib/client/index.spec.ts000066400000000000000000000700431433774114400243620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL, waitTillBeenCalled } from '../test-utils'; import RedisClient, { RedisClientType } from '.'; import { RedisClientMultiCommandType } from './multi-command'; import { RedisCommandArguments, RedisCommandRawReply, RedisModules, RedisFunctions, RedisScripts } from '../commands'; import { AbortError, ClientClosedError, ClientOfflineError, ConnectionTimeoutError, DisconnectsClientError, SocketClosedUnexpectedlyError, WatchError } from '../errors'; import { defineScript } from '../lua-script'; import { spy } from 'sinon'; import { once } from 'events'; import { ClientKillFilters } from '../commands/CLIENT_KILL'; export const SQUARE_SCRIPT = defineScript({ SCRIPT: 'return ARGV[1] * ARGV[1];', NUMBER_OF_KEYS: 0, transformArguments(number: number): Array { return [number.toString()]; } }); export const MATH_FUNCTION = { name: 'math', engine: 'LUA', code: `#!LUA name=math redis.register_function{ function_name = "square", callback = function(keys, args) return args[1] * args[1] end, flags = { "no-writes" } }`, library: { square: { NAME: 'square', IS_READ_ONLY: true, NUMBER_OF_KEYS: 0, transformArguments(number: number): Array { return [number.toString()]; } } } }; export async function loadMathFunction( client: RedisClientType ): Promise { await client.functionLoad( MATH_FUNCTION.code, { REPLACE: true } ); } describe('Client', () => { describe('parseURL', () => { it('redis://user:secret@localhost:6379/0', () => { assert.deepEqual( RedisClient.parseURL('redis://user:secret@localhost:6379/0'), { socket: { host: 'localhost', port: 6379 }, username: 'user', password: 'secret', database: 0 } ); }); it('rediss://user:secret@localhost:6379/0', () => { assert.deepEqual( RedisClient.parseURL('rediss://user:secret@localhost:6379/0'), { socket: { host: 'localhost', port: 6379, tls: true }, username: 'user', password: 'secret', database: 0 } ); }); it('Invalid protocol', () => { assert.throws( () => RedisClient.parseURL('redi://user:secret@localhost:6379/0'), TypeError ); }); it('Invalid pathname', () => { assert.throws( () => RedisClient.parseURL('redis://user:secret@localhost:6379/NaN'), TypeError ); }); it('redis://localhost', () => { assert.deepEqual( RedisClient.parseURL('redis://localhost'), { socket: { host: 'localhost', } } ); }); }); describe('authentication', () => { testUtils.testWithClient('Client should be authenticated', async client => { assert.equal( await client.ping(), 'PONG' ); }, GLOBAL.SERVERS.PASSWORD); testUtils.testWithClient('should execute AUTH before SELECT', async client => { assert.equal( (await client.clientInfo()).db, 2 ); }, { ...GLOBAL.SERVERS.PASSWORD, clientOptions: { ...GLOBAL.SERVERS.PASSWORD.clientOptions, database: 2 }, minimumDockerVersion: [6, 2] }); }); testUtils.testWithClient('should set connection name', async client => { assert.equal( await client.clientGetName(), 'name' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { name: 'name' } }); describe('legacyMode', () => { function sendCommandAsync< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( client: RedisClientType, args: RedisCommandArguments ): Promise { return new Promise((resolve, reject) => { (client as any).sendCommand(args, (err: Error | undefined, reply: RedisCommandRawReply) => { if (err) return reject(err); resolve(reply); }); }); } testUtils.testWithClient('client.sendCommand should call the callback', async client => { assert.equal( await sendCommandAsync(client, ['PING']), 'PONG' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.sendCommand should work without callback', async client => { client.sendCommand(['PING']); await client.v4.ping(); // make sure the first command was replied }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.v4.sendCommand should return a promise', async client => { assert.equal( await client.v4.sendCommand(['PING']), 'PONG' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); function setAsync< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( client: RedisClientType, ...args: Array ): Promise { return new Promise((resolve, reject) => { (client as any).set(...args, (err: Error | undefined, reply: RedisCommandRawReply) => { if (err) return reject(err); resolve(reply); }); }); } testUtils.testWithClient('client.{command} should accept vardict arguments', async client => { assert.equal( await setAsync(client, 'a', 'b'), 'OK' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.{command} should accept arguments array', async client => { assert.equal( await setAsync(client, ['a', 'b']), 'OK' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.{command} should accept mix of arrays and arguments', async client => { assert.equal( await setAsync(client, ['a'], 'b', ['EX', 1]), 'OK' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); function multiExecAsync< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(multi: RedisClientMultiCommandType): Promise> { return new Promise((resolve, reject) => { (multi as any).exec((err: Error | undefined, replies: Array) => { if (err) return reject(err); resolve(replies); }); }); } testUtils.testWithClient('client.multi.ping.exec should call the callback', async client => { assert.deepEqual( await multiExecAsync( client.multi().ping() ), ['PONG'] ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.multi.ping.exec should call the callback', async client => { client.multi() .ping() .exec(); await client.v4.ping(); // make sure the first command was replied }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.multi.ping.v4.ping.v4.exec should return a promise', async client => { assert.deepEqual( await client.multi() .ping() .v4.ping() .v4.exec(), ['PONG', 'PONG'] ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); testUtils.testWithClient('client.{script} should return a promise', async client => { assert.equal( await client.square(2), 4 ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true, scripts: { square: SQUARE_SCRIPT } } }); testUtils.testWithClient('client.multi.{command}.exec should flatten array arguments', async client => { assert.deepEqual( await client.multi() .sAdd('a', ['b', 'c']) .v4.exec(), [2] ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { legacyMode: true } }); }); describe('events', () => { testUtils.testWithClient('connect, ready, end', async client => { await Promise.all([ once(client, 'connect'), once(client, 'ready'), client.connect() ]); await Promise.all([ once(client, 'end'), client.disconnect() ]); }, { ...GLOBAL.SERVERS.OPEN, disableClientSetup: true }); }); describe('sendCommand', () => { testUtils.testWithClient('PING', async client => { assert.equal(await client.sendCommand(['PING']), 'PONG'); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('returnBuffers', async client => { assert.deepEqual( await client.sendCommand(['PING'], { returnBuffers: true }), Buffer.from('PONG') ); }, GLOBAL.SERVERS.OPEN); describe('AbortController', () => { before(function () { if (!global.AbortController) { this.skip(); } }); testUtils.testWithClient('success', async client => { await client.sendCommand(['PING'], { signal: new AbortController().signal }); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('AbortError', client => { const controller = new AbortController(); controller.abort(); return assert.rejects( client.sendCommand(['PING'], { signal: controller.signal }), AbortError ); }, GLOBAL.SERVERS.OPEN); }); testUtils.testWithClient('undefined and null should not break the client', async client => { await assert.rejects( client.sendCommand([null as any, undefined as any]), TypeError ); assert.equal( await client.ping(), 'PONG' ); }, GLOBAL.SERVERS.OPEN); }); describe('multi', () => { testUtils.testWithClient('simple', async client => { assert.deepEqual( await client.multi() .ping() .set('key', 'value') .get('key') .exec(), ['PONG', 'OK', 'value'] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should reject the whole chain on error', client => { return assert.rejects( client.multi() .ping() .addCommand(['INVALID COMMAND']) .ping() .exec() ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should reject the whole chain upon client disconnect', async client => { await client.disconnect(); return assert.rejects( client.multi() .ping() .set('key', 'value') .get('key') .exec(), ClientClosedError ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with script', async client => { assert.deepEqual( await client.multi() .square(2) .exec(), [4] ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { scripts: { square: SQUARE_SCRIPT } } }); testUtils.testWithClient('WatchError', async client => { await client.watch('key'); await client.set( RedisClient.commandOptions({ isolated: true }), 'key', '1' ); await assert.rejects( client.multi() .decr('key') .exec(), WatchError ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('execAsPipeline', async client => { assert.deepEqual( await client.multi() .ping() .exec(true), ['PONG'] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should remember selected db', async client => { await client.multi() .select(1) .exec(); await killClient(client); assert.equal( (await client.clientInfo()).db, 1 ); }, { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [6, 2] // CLIENT INFO }); }); testUtils.testWithClient('scripts', async client => { assert.equal( await client.square(2), 4 ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { scripts: { square: SQUARE_SCRIPT } } }); const module = { echo: { transformArguments(message: string): Array { return ['ECHO', message]; }, transformReply(reply: string): string { return reply; } } }; testUtils.testWithClient('modules', async client => { assert.equal( await client.module.echo('message'), 'message' ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { modules: { module } } }); testUtils.testWithClient('functions', async client => { await loadMathFunction(client); assert.equal( await client.math.square(2), 4 ); }, { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [7, 0], clientOptions: { functions: { math: MATH_FUNCTION.library } } }); testUtils.testWithClient('executeIsolated', async client => { const id = await client.clientId(), isolatedId = await client.executeIsolated(isolatedClient => isolatedClient.clientId()); assert.ok(id !== isolatedId); }, GLOBAL.SERVERS.OPEN); async function killClient< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( client: RedisClientType, errorClient: RedisClientType = client ): Promise { const onceErrorPromise = once(errorClient, 'error'); await client.sendCommand(['QUIT']); await Promise.all([ onceErrorPromise, assert.rejects(client.ping(), SocketClosedUnexpectedlyError) ]); } testUtils.testWithClient('should reconnect when socket disconnects', async client => { await killClient(client); await assert.doesNotReject(client.ping()); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should remember selected db', async client => { await client.select(1); await killClient(client); assert.equal( (await client.clientInfo()).db, 1 ); }, { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [6, 2] // CLIENT INFO }); testUtils.testWithClient('should propagated errors from "isolated" clients', client => { return client.executeIsolated(isolated => killClient(isolated, client)); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('scanIterator', async client => { const promises = [], keys = new Set(); for (let i = 0; i < 100; i++) { const key = i.toString(); keys.add(key); promises.push(client.set(key, '')); } await Promise.all(promises); const results = new Set(); for await (const key of client.scanIterator()) { results.add(key); } assert.deepEqual(keys, results); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('hScanIterator', async client => { const hash: Record = {}; for (let i = 0; i < 100; i++) { hash[i.toString()] = i.toString(); } await client.hSet('key', hash); const results: Record = {}; for await (const { field, value } of client.hScanIterator('key')) { results[field] = value; } assert.deepEqual(hash, results); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('sScanIterator', async client => { const members = new Set(); for (let i = 0; i < 100; i++) { members.add(i.toString()); } await client.sAdd('key', Array.from(members)); const results = new Set(); for await (const key of client.sScanIterator('key')) { results.add(key); } assert.deepEqual(members, results); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('zScanIterator', async client => { const members = []; for (let i = 0; i < 100; i++) { members.push({ score: 1, value: i.toString() }); } await client.zAdd('key', members); const map = new Map(); for await (const member of client.zScanIterator('key')) { map.set(member.value, member.score); } type MemberTuple = [string, number]; function sort(a: MemberTuple, b: MemberTuple) { return Number(b[0]) - Number(a[0]); } assert.deepEqual( [...map.entries()].sort(sort), members.map(member => [member.value, member.score]).sort(sort) ); }, GLOBAL.SERVERS.OPEN); describe('PubSub', () => { testUtils.testWithClient('should be able to publish and subscribe to messages', async publisher => { function assertStringListener(message: string, channel: string) { assert.equal(typeof message, 'string'); assert.equal(typeof channel, 'string'); } function assertBufferListener(message: Buffer, channel: Buffer) { assert.ok(Buffer.isBuffer(message)); assert.ok(Buffer.isBuffer(channel)); } const subscriber = publisher.duplicate(); await subscriber.connect(); try { const channelListener1 = spy(assertBufferListener), channelListener2 = spy(assertStringListener), patternListener = spy(assertStringListener); await Promise.all([ subscriber.subscribe('channel', channelListener1, true), subscriber.subscribe('channel', channelListener2), subscriber.pSubscribe('channel*', patternListener) ]); await Promise.all([ waitTillBeenCalled(channelListener1), waitTillBeenCalled(channelListener2), waitTillBeenCalled(patternListener), publisher.publish(Buffer.from('channel'), Buffer.from('message')) ]); assert.ok(channelListener1.calledOnceWithExactly(Buffer.from('message'), Buffer.from('channel'))); assert.ok(channelListener2.calledOnceWithExactly('message', 'channel')); assert.ok(patternListener.calledOnceWithExactly('message', 'channel')); await subscriber.unsubscribe('channel', channelListener1, true); await Promise.all([ waitTillBeenCalled(channelListener2), waitTillBeenCalled(patternListener), publisher.publish('channel', 'message') ]); assert.ok(channelListener1.calledOnce); assert.ok(channelListener2.calledTwice); assert.ok(channelListener2.secondCall.calledWithExactly('message', 'channel')); assert.ok(patternListener.calledTwice); assert.ok(patternListener.secondCall.calledWithExactly('message', 'channel')); await subscriber.unsubscribe('channel'); await Promise.all([ waitTillBeenCalled(patternListener), publisher.publish('channel', 'message') ]); assert.ok(channelListener1.calledOnce); assert.ok(channelListener2.calledTwice); assert.ok(patternListener.calledThrice); assert.ok(patternListener.thirdCall.calledWithExactly('message', 'channel')); await subscriber.pUnsubscribe(); await publisher.publish('channel', 'message'); assert.ok(channelListener1.calledOnce); assert.ok(channelListener2.calledTwice); assert.ok(patternListener.calledThrice); // should be able to send commands when unsubsribed from all channels (see #1652) await assert.doesNotReject(subscriber.ping()); } finally { await subscriber.disconnect(); } }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should resubscribe', async publisher => { const subscriber = publisher.duplicate(); await subscriber.connect(); try { const channelListener = spy(); await subscriber.subscribe('channel', channelListener); const patternListener = spy(); await subscriber.pSubscribe('channe*', patternListener); await Promise.all([ once(subscriber, 'error'), publisher.clientKill({ filter: ClientKillFilters.SKIP_ME, skipMe: true }) ]); await once(subscriber, 'ready'); await Promise.all([ waitTillBeenCalled(channelListener), waitTillBeenCalled(patternListener), publisher.publish('channel', 'message') ]); } finally { await subscriber.disconnect(); } }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should not fail when message arrives right after subscribe', async publisher => { const subscriber = publisher.duplicate(); await subscriber.connect(); try { await assert.doesNotReject(Promise.all([ subscriber.subscribe('channel', () => { // noop }), publisher.publish('channel', 'message') ])); } finally { await subscriber.disconnect(); } }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should be able to quit in PubSub mode', async client => { await client.subscribe('channel', () => { // noop }); await assert.doesNotReject(client.quit()); assert.equal(client.isOpen, false); }, GLOBAL.SERVERS.OPEN); }); testUtils.testWithClient('ConnectionTimeoutError', async client => { const promise = assert.rejects(client.connect(), ConnectionTimeoutError), start = process.hrtime.bigint(); while (process.hrtime.bigint() - start < 1_000_000) { // block the event loop for 1ms, to make sure the connection will timeout } await promise; }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { socket: { connectTimeout: 1 } }, disableClientSetup: true }); testUtils.testWithClient('client.quit', async client => { await client.connect(); const pingPromise = client.ping(), quitPromise = client.quit(); assert.equal(client.isOpen, false); const [ping] = await Promise.all([ pingPromise, assert.doesNotReject(quitPromise), assert.rejects(client.ping(), ClientClosedError) ]); assert.equal(ping, 'PONG'); }, { ...GLOBAL.SERVERS.OPEN, disableClientSetup: true }); testUtils.testWithClient('client.disconnect', async client => { const pingPromise = client.ping(), disconnectPromise = client.disconnect(); assert.equal(client.isOpen, false); await Promise.all([ assert.rejects(pingPromise, DisconnectsClientError), assert.doesNotReject(disconnectPromise), assert.rejects(client.ping(), ClientClosedError) ]); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should be able to connect after disconnect (see #1801)', async client => { await client.disconnect(); await client.connect(); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('should be able to use ref and unref', client => { client.unref(); client.ref(); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('pingInterval', async client => { assert.deepEqual( await once(client, 'ping-interval'), ['PONG'] ); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { pingInterval: 1 } }); testUtils.testWithClient('should reject commands in connect phase when `disableOfflineQueue`', async client => { const connectPromise = client.connect(); await assert.rejects( client.ping(), ClientOfflineError ); await connectPromise; await client.disconnect(); }, { ...GLOBAL.SERVERS.OPEN, clientOptions: { disableOfflineQueue: true }, disableClientSetup: true }); }); node-redis-redis-4.5.1/packages/client/lib/client/index.ts000066400000000000000000000551561433774114400234410ustar00rootroot00000000000000import COMMANDS from './commands'; import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisFunctions, RedisModules, RedisExtensions, RedisScript, RedisScripts, RedisCommandSignature, ConvertArgumentType, RedisFunction, ExcludeMappedString } from '../commands'; import RedisSocket, { RedisSocketOptions, RedisTlsSocketOptions } from './socket'; import RedisCommandsQueue, { PubSubListener, PubSubSubscribeCommands, PubSubUnsubscribeCommands, QueueCommandOptions } from './commands-queue'; import RedisClientMultiCommand, { RedisClientMultiCommandType } from './multi-command'; import { RedisMultiQueuedCommand } from '../multi-command'; import { EventEmitter } from 'events'; import { CommandOptions, commandOptions, isCommandOptions } from '../command-options'; import { ScanOptions, ZMember } from '../commands/generic-transformers'; import { ScanCommandOptions } from '../commands/SCAN'; import { HScanTuple } from '../commands/HSCAN'; import { attachCommands, attachExtensions, fCallArguments, transformCommandArguments, transformCommandReply, transformLegacyCommandArguments } from '../commander'; import { Pool, Options as PoolOptions, createPool } from 'generic-pool'; import { ClientClosedError, ClientOfflineError, DisconnectsClientError } from '../errors'; import { URL } from 'url'; import { TcpSocketConnectOpts } from 'net'; export interface RedisClientOptions< M extends RedisModules = RedisModules, F extends RedisFunctions = RedisFunctions, S extends RedisScripts = RedisScripts > extends RedisExtensions { url?: string; socket?: RedisSocketOptions; username?: string; password?: string; name?: string; database?: number; commandsQueueMaxLength?: number; disableOfflineQueue?: boolean; readonly?: boolean; legacyMode?: boolean; isolationPoolOptions?: PoolOptions; pingInterval?: number; } type WithCommands = { [P in keyof typeof COMMANDS]: RedisCommandSignature<(typeof COMMANDS)[P]>; }; export type WithModules = { [P in keyof M as ExcludeMappedString

]: { [C in keyof M[P] as ExcludeMappedString]: RedisCommandSignature; }; }; export type WithFunctions = { [P in keyof F as ExcludeMappedString

]: { [FF in keyof F[P] as ExcludeMappedString]: RedisCommandSignature; }; }; export type WithScripts = { [P in keyof S as ExcludeMappedString

]: RedisCommandSignature; }; export type RedisClientType< M extends RedisModules = Record, F extends RedisFunctions = Record, S extends RedisScripts = Record > = RedisClient & WithCommands & WithModules & WithFunctions & WithScripts; export type InstantiableRedisClient< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = new (options?: RedisClientOptions) => RedisClientType; export interface ClientCommandOptions extends QueueCommandOptions { isolated?: boolean; } type ClientLegacyCallback = (err: Error | null, reply?: RedisCommandRawReply) => void; export default class RedisClient< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > extends EventEmitter { static commandOptions(options: T): CommandOptions { return commandOptions(options); } commandOptions = RedisClient.commandOptions; static extend< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(extensions?: RedisExtensions): InstantiableRedisClient { const Client = attachExtensions({ BaseClass: RedisClient, modulesExecutor: RedisClient.prototype.commandsExecutor, modules: extensions?.modules, functionsExecutor: RedisClient.prototype.functionsExecuter, functions: extensions?.functions, scriptsExecutor: RedisClient.prototype.scriptsExecuter, scripts: extensions?.scripts }); if (Client !== RedisClient) { Client.prototype.Multi = RedisClientMultiCommand.extend(extensions); } return Client; } static create< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(options?: RedisClientOptions): RedisClientType { return new (RedisClient.extend(options))(options); } static parseURL(url: string): RedisClientOptions { // https://www.iana.org/assignments/uri-schemes/prov/redis const { hostname, port, protocol, username, password, pathname } = new URL(url), parsed: RedisClientOptions = { socket: { host: hostname } }; if (protocol === 'rediss:') { (parsed.socket as RedisTlsSocketOptions).tls = true; } else if (protocol !== 'redis:') { throw new TypeError('Invalid protocol'); } if (port) { (parsed.socket as TcpSocketConnectOpts).port = Number(port); } if (username) { parsed.username = decodeURIComponent(username); } if (password) { parsed.password = decodeURIComponent(password); } if (pathname.length > 1) { const database = Number(pathname.substring(1)); if (isNaN(database)) { throw new TypeError('Invalid pathname'); } parsed.database = database; } return parsed; } readonly #options?: RedisClientOptions; readonly #socket: RedisSocket; readonly #queue: RedisCommandsQueue; readonly #isolationPool: Pool>; readonly #v4: Record = {}; #selectedDB = 0; get options(): RedisClientOptions | undefined { return this.#options; } get isOpen(): boolean { return this.#socket.isOpen; } get isReady(): boolean { return this.#socket.isReady; } get v4(): Record { if (!this.#options?.legacyMode) { throw new Error('the client is not in "legacy mode"'); } return this.#v4; } constructor(options?: RedisClientOptions) { super(); this.#options = this.#initiateOptions(options); this.#queue = this.#initiateQueue(); this.#socket = this.#initiateSocket(); this.#isolationPool = createPool({ create: async () => { const duplicate = this.duplicate({ isolationPoolOptions: undefined }).on('error', err => this.emit('error', err)); await duplicate.connect(); return duplicate; }, destroy: client => client.disconnect() }, options?.isolationPoolOptions); this.#legacyMode(); } #initiateOptions(options?: RedisClientOptions): RedisClientOptions | undefined { if (options?.url) { const parsed = RedisClient.parseURL(options.url); if (options.socket) { parsed.socket = Object.assign(options.socket, parsed.socket); } Object.assign(options, parsed); } if (options?.database) { this.#selectedDB = options.database; } return options; } #initiateQueue(): RedisCommandsQueue { return new RedisCommandsQueue(this.#options?.commandsQueueMaxLength); } #initiateSocket(): RedisSocket { const socketInitiator = async (): Promise => { const promises = []; if (this.#selectedDB !== 0) { promises.push( this.#queue.addCommand( ['SELECT', this.#selectedDB.toString()], { asap: true } ) ); } if (this.#options?.readonly) { promises.push( this.#queue.addCommand( COMMANDS.READONLY.transformArguments(), { asap: true } ) ); } if (this.#options?.name) { promises.push( this.#queue.addCommand( COMMANDS.CLIENT_SETNAME.transformArguments(this.#options.name), { asap: true } ) ); } if (this.#options?.username || this.#options?.password) { promises.push( this.#queue.addCommand( COMMANDS.AUTH.transformArguments({ username: this.#options.username, password: this.#options.password ?? '' }), { asap: true } ) ); } const resubscribePromise = this.#queue.resubscribe(); if (resubscribePromise) { promises.push(resubscribePromise); } if (promises.length) { this.#tick(true); await Promise.all(promises); } }; return new RedisSocket(socketInitiator, this.#options?.socket) .on('data', chunk => this.#queue.onReplyChunk(chunk)) .on('error', err => { this.emit('error', err); if (this.#socket.isOpen && !this.#options?.disableOfflineQueue) { this.#queue.flushWaitingForReply(err); } else { this.#queue.flushAll(err); } }) .on('connect', () => { this.emit('connect'); }) .on('ready', () => { this.emit('ready'); this.#setPingTimer(); this.#tick(); }) .on('reconnecting', () => this.emit('reconnecting')) .on('drain', () => this.#tick()) .on('end', () => this.emit('end')); } #legacyMode(): void { if (!this.#options?.legacyMode) return; (this as any).#v4.sendCommand = this.#sendCommand.bind(this); (this as any).sendCommand = (...args: Array): void => { let callback: ClientLegacyCallback; if (typeof args[args.length - 1] === 'function') { callback = args.pop() as ClientLegacyCallback; } this.#sendCommand(transformLegacyCommandArguments(args)) .then((reply: RedisCommandRawReply) => { if (!callback) return; // https://github.com/NodeRedis/node-redis#commands:~:text=minimal%20parsing callback(null, reply); }) .catch((err: Error) => { if (!callback) { this.emit('error', err); return; } callback(err); }); }; for (const name of Object.keys(COMMANDS)) { this.#defineLegacyCommand(name); } for (const name of Object.keys(COMMANDS)) { (this as any)[name.toLowerCase()] = (this as any)[name]; } // hard coded commands this.#defineLegacyCommand('SELECT'); this.#defineLegacyCommand('select'); this.#defineLegacyCommand('SUBSCRIBE'); this.#defineLegacyCommand('subscribe'); this.#defineLegacyCommand('PSUBSCRIBE'); this.#defineLegacyCommand('pSubscribe'); this.#defineLegacyCommand('UNSUBSCRIBE'); this.#defineLegacyCommand('unsubscribe'); this.#defineLegacyCommand('PUNSUBSCRIBE'); this.#defineLegacyCommand('pUnsubscribe'); this.#defineLegacyCommand('QUIT'); this.#defineLegacyCommand('quit'); } #defineLegacyCommand(name: string): void { this.#v4[name] = (this as any)[name].bind(this); (this as any)[name] = (...args: Array): void => (this as any).sendCommand(name, ...args); } #pingTimer?: NodeJS.Timer; #setPingTimer(): void { if (!this.#options?.pingInterval || !this.#socket.isReady) return; clearTimeout(this.#pingTimer); this.#pingTimer = setTimeout(() => { if (!this.#socket.isReady) return; (this as unknown as RedisClientType).ping() .then(reply => this.emit('ping-interval', reply)) .catch(err => this.emit('error', err)) .finally(() => this.#setPingTimer()); }, this.#options.pingInterval); } duplicate(overrides?: Partial>): RedisClientType { return new (Object.getPrototypeOf(this).constructor)({ ...this.#options, ...overrides }); } async connect(): Promise { await this.#socket.connect(); } async commandsExecutor( command: C, args: Array ): Promise> { const { args: redisArgs, options } = transformCommandArguments(command, args); return transformCommandReply( command, await this.#sendCommand(redisArgs, options), redisArgs.preserve ); } 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 ): Promise { if (!this.#socket.isOpen) { return Promise.reject(new ClientClosedError()); } else if (options?.isolated) { return this.executeIsolated(isolatedClient => isolatedClient.sendCommand(args, { ...options, isolated: false }) ); } else if (!this.#socket.isReady && this.#options?.disableOfflineQueue) { return Promise.reject(new ClientOfflineError()); } const promise = this.#queue.addCommand(args, options); this.#tick(); return promise; } async functionsExecuter( fn: F, args: Array, name: string ): Promise> { const { args: redisArgs, options } = transformCommandArguments(fn, args); return transformCommandReply( fn, await this.executeFunction(name, fn, redisArgs, options), redisArgs.preserve ); } executeFunction( name: string, fn: RedisFunction, args: RedisCommandArguments, options?: ClientCommandOptions ): Promise { return this.#sendCommand( fCallArguments(name, fn, args), options ); } async scriptsExecuter( script: S, args: Array ): Promise> { const { args: redisArgs, options } = transformCommandArguments(script, args); return transformCommandReply( script, await this.executeScript(script, redisArgs, options), redisArgs.preserve ); } async executeScript( script: RedisScript, args: RedisCommandArguments, options?: ClientCommandOptions ): Promise { const redisArgs: RedisCommandArguments = ['EVALSHA', script.SHA1]; if (script.NUMBER_OF_KEYS !== undefined) { redisArgs.push(script.NUMBER_OF_KEYS.toString()); } redisArgs.push(...args); try { return await this.#sendCommand(redisArgs, options); } catch (err: any) { if (!err?.message?.startsWith?.('NOSCRIPT')) { throw err; } redisArgs[0] = 'EVAL'; redisArgs[1] = script.SCRIPT; return this.#sendCommand(redisArgs, options); } } async SELECT(db: number): Promise; async SELECT(options: CommandOptions, db: number): Promise; async SELECT(options?: any, db?: any): Promise { if (!isCommandOptions(options)) { db = options; options = null; } await this.#sendCommand(['SELECT', db.toString()], options); this.#selectedDB = db; } select = this.SELECT; #subscribe( command: PubSubSubscribeCommands, channels: string | Array, listener: PubSubListener, bufferMode?: T ): Promise { const promise = this.#queue.subscribe( command, channels, listener, bufferMode ); this.#tick(); return promise; } SUBSCRIBE( channels: string | Array, listener: PubSubListener, bufferMode?: T ): Promise { return this.#subscribe( PubSubSubscribeCommands.SUBSCRIBE, channels, listener, bufferMode ); } subscribe = this.SUBSCRIBE; PSUBSCRIBE( patterns: string | Array, listener: PubSubListener, bufferMode?: T ): Promise { return this.#subscribe( PubSubSubscribeCommands.PSUBSCRIBE, patterns, listener, bufferMode ); } pSubscribe = this.PSUBSCRIBE; #unsubscribe( command: PubSubUnsubscribeCommands, channels?: string | Array, listener?: PubSubListener, bufferMode?: T ): Promise { const promise = this.#queue.unsubscribe(command, channels, listener, bufferMode); this.#tick(); return promise; } UNSUBSCRIBE( channels?: string | Array, listener?: PubSubListener, bufferMode?: T ): Promise { return this.#unsubscribe( PubSubUnsubscribeCommands.UNSUBSCRIBE, channels, listener, bufferMode ); } unsubscribe = this.UNSUBSCRIBE; PUNSUBSCRIBE( patterns?: string | Array, listener?: PubSubListener, bufferMode?: T ): Promise { return this.#unsubscribe( PubSubUnsubscribeCommands.PUNSUBSCRIBE, patterns, listener, bufferMode ); } pUnsubscribe = this.PUNSUBSCRIBE; QUIT(): Promise { return this.#socket.quit(() => { const quitPromise = this.#queue.addCommand(['QUIT'], { ignorePubSubMode: true }); this.#tick(); return Promise.all([ quitPromise, this.#destroyIsolationPool() ]); }); } quit = this.QUIT; #tick(force = false): void { if (this.#socket.writableNeedDrain || (!force && !this.#socket.isReady)) { return; } this.#socket.cork(); while (!this.#socket.writableNeedDrain) { const args = this.#queue.getCommandToSend(); if (args === undefined) break; this.#socket.writeCommand(args); } } executeIsolated(fn: (client: RedisClientType) => T | Promise): Promise { return this.#isolationPool.use(fn); } MULTI(): RedisClientMultiCommandType { return new (this as any).Multi( this.multiExecutor.bind(this), this.#options?.legacyMode ); } multi = this.MULTI; async multiExecutor( commands: Array, selectedDB?: number, chainId?: symbol ): Promise> { if (!this.#socket.isOpen) { return Promise.reject(new ClientClosedError()); } const promise = Promise.all( commands.map(({ args }) => { return this.#queue.addCommand(args, { chainId }); }) ); this.#tick(); const results = await promise; if (selectedDB !== undefined) { this.#selectedDB = selectedDB; } return results; } async* scanIterator(options?: ScanCommandOptions): AsyncIterable { let cursor = 0; do { const reply = await (this as any).scan(cursor, options); cursor = reply.cursor; for (const key of reply.keys) { yield key; } } while (cursor !== 0); } async* hScanIterator(key: string, options?: ScanOptions): AsyncIterable> { let cursor = 0; do { const reply = await (this as any).hScan(key, cursor, options); cursor = reply.cursor; for (const tuple of reply.tuples) { yield tuple; } } while (cursor !== 0); } async* sScanIterator(key: string, options?: ScanOptions): AsyncIterable { let cursor = 0; do { const reply = await (this as any).sScan(key, cursor, options); cursor = reply.cursor; for (const member of reply.members) { yield member; } } while (cursor !== 0); } async* zScanIterator(key: string, options?: ScanOptions): AsyncIterable> { let cursor = 0; do { const reply = await (this as any).zScan(key, cursor, options); cursor = reply.cursor; for (const member of reply.members) { yield member; } } while (cursor !== 0); } async disconnect(): Promise { this.#queue.flushAll(new DisconnectsClientError()); this.#socket.disconnect(); await this.#destroyIsolationPool(); } async #destroyIsolationPool(): Promise { await this.#isolationPool.drain(); await this.#isolationPool.clear(); } ref(): void { this.#socket.ref(); } unref(): void { this.#socket.unref(); } } attachCommands({ BaseClass: RedisClient, commands: COMMANDS, executor: RedisClient.prototype.commandsExecutor }); (RedisClient.prototype as any).Multi = RedisClientMultiCommand; node-redis-redis-4.5.1/packages/client/lib/client/multi-command.ts000066400000000000000000000144241433774114400250710ustar00rootroot00000000000000import COMMANDS from './commands'; import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisFunctions, RedisModules, RedisExtensions, RedisScript, RedisScripts, ExcludeMappedString, RedisFunction } from '../commands'; import RedisMultiCommand, { RedisMultiQueuedCommand } from '../multi-command'; import { attachCommands, attachExtensions, transformLegacyCommandArguments } from '../commander'; type CommandSignature< C extends RedisCommand, M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = (...args: Parameters) => RedisClientMultiCommandType; type WithCommands< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof typeof COMMANDS]: CommandSignature<(typeof COMMANDS)[P], M, F, S>; }; type WithModules< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof M as ExcludeMappedString

]: { [C in keyof M[P] as ExcludeMappedString]: CommandSignature; }; }; type WithFunctions< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof F as ExcludeMappedString

]: { [FF in keyof F[P] as ExcludeMappedString]: CommandSignature; }; }; type WithScripts< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof S as ExcludeMappedString

]: CommandSignature; }; export type RedisClientMultiCommandType< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = RedisClientMultiCommand & WithCommands & WithModules & WithFunctions & WithScripts; type InstantiableRedisMultiCommand< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = new (...args: ConstructorParameters) => RedisClientMultiCommandType; export type RedisClientMultiExecutor = ( queue: Array, selectedDB?: number, chainId?: symbol ) => Promise>; export default class RedisClientMultiCommand { static extend< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(extensions?: RedisExtensions): InstantiableRedisMultiCommand { return attachExtensions({ BaseClass: RedisClientMultiCommand, modulesExecutor: RedisClientMultiCommand.prototype.commandsExecutor, modules: extensions?.modules, functionsExecutor: RedisClientMultiCommand.prototype.functionsExecutor, functions: extensions?.functions, scriptsExecutor: RedisClientMultiCommand.prototype.scriptsExecutor, scripts: extensions?.scripts }); } readonly #multi = new RedisMultiCommand(); readonly #executor: RedisClientMultiExecutor; readonly v4: Record = {}; #selectedDB?: number; constructor(executor: RedisClientMultiExecutor, legacyMode = false) { this.#executor = executor; if (legacyMode) { this.#legacyMode(); } } #legacyMode(): void { this.v4.addCommand = this.addCommand.bind(this); (this as any).addCommand = (...args: Array): this => { this.#multi.addCommand(transformLegacyCommandArguments(args)); return this; }; this.v4.exec = this.exec.bind(this); (this as any).exec = (callback?: (err: Error | null, replies?: Array) => unknown): void => { this.v4.exec() .then((reply: Array) => { if (!callback) return; callback(null, reply); }) .catch((err: Error) => { if (!callback) { // this.emit('error', err); return; } callback(err); }); }; for (const name of Object.keys(COMMANDS)) { this.#defineLegacyCommand(name); } for (const name of Object.keys(COMMANDS)) { (this as any)[name.toLowerCase()] = (this as any)[name]; } } #defineLegacyCommand(name: string): void { this.v4[name] = (this as any)[name].bind(this.v4); (this as any)[name] = (...args: Array): void => (this as any).addCommand(name, ...args); } commandsExecutor(command: RedisCommand, args: Array): this { return this.addCommand( command.transformArguments(...args), command.transformReply ); } SELECT(db: number, transformReply?: RedisCommand['transformReply']): this { this.#selectedDB = db; return this.addCommand(['SELECT', db.toString()], transformReply); } select = this.SELECT; addCommand(args: RedisCommandArguments, transformReply?: RedisCommand['transformReply']): this { this.#multi.addCommand(args, transformReply); return this; } functionsExecutor(fn: RedisFunction, args: Array, name: string): this { this.#multi.addFunction(name, fn, args); return this; } scriptsExecutor(script: RedisScript, args: Array): this { this.#multi.addScript(script, args); return this; } async exec(execAsPipeline = false): Promise> { if (execAsPipeline) { return this.execAsPipeline(); } const commands = this.#multi.exec(); if (!commands) return []; return this.#multi.handleExecReplies( await this.#executor( commands, this.#selectedDB, RedisMultiCommand.generateChainId() ) ); } EXEC = this.exec; async execAsPipeline(): Promise> { return this.#multi.transformReplies( await this.#executor( this.#multi.queue, this.#selectedDB ) ); } } attachCommands({ BaseClass: RedisClientMultiCommand, commands: COMMANDS, executor: RedisClientMultiCommand.prototype.commandsExecutor }); node-redis-redis-4.5.1/packages/client/lib/client/socket.spec.ts000066400000000000000000000032431433774114400245410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { spy } from 'sinon'; import RedisSocket, { RedisSocketOptions } from './socket'; describe('Socket', () => { function createSocket(options: RedisSocketOptions): RedisSocket { const socket = new RedisSocket( () => Promise.resolve(), options ); socket.on('error', () => { // ignore errors }); return socket; } describe('reconnectStrategy', () => { it('custom strategy', async () => { const numberOfRetries = 10; const reconnectStrategy = spy((retries: number) => { assert.equal(retries + 1, reconnectStrategy.callCount); if (retries === numberOfRetries) return new Error(`${numberOfRetries}`); const time = retries * 2; return time; }); const socket = createSocket({ host: 'error', connectTimeout: 1, reconnectStrategy }); await assert.rejects(socket.connect(), { message: `${numberOfRetries}` }); assert.equal(socket.isOpen, false); }); it('should handle errors', async () => { const socket = createSocket({ host: 'error', connectTimeout: 1, reconnectStrategy(retries: number) { if (retries === 1) return new Error('done'); throw new Error(); } }); await assert.rejects(socket.connect()); assert.equal(socket.isOpen, false); }); }); }); node-redis-redis-4.5.1/packages/client/lib/client/socket.ts000066400000000000000000000176421433774114400236200ustar00rootroot00000000000000import { EventEmitter } from 'events'; import * as net from 'net'; import * as tls from 'tls'; import { RedisCommandArguments } from '../commands'; import { ConnectionTimeoutError, ClientClosedError, SocketClosedUnexpectedlyError, ReconnectStrategyError } from '../errors'; import { promiseTimeout } from '../utils'; export interface RedisSocketCommonOptions { connectTimeout?: number; noDelay?: boolean; keepAlive?: number | false; reconnectStrategy?(retries: number): number | Error; } type RedisNetSocketOptions = Partial & { tls?: false; }; export interface RedisTlsSocketOptions extends tls.ConnectionOptions { tls: true; } export type RedisSocketOptions = RedisSocketCommonOptions & (RedisNetSocketOptions | RedisTlsSocketOptions); interface CreateSocketReturn { connectEvent: string; socket: T; } export type RedisSocketInitiator = () => Promise; export default class RedisSocket extends EventEmitter { static #initiateOptions(options?: RedisSocketOptions): RedisSocketOptions { options ??= {}; if (!(options as net.IpcSocketConnectOpts).path) { (options as net.TcpSocketConnectOpts).port ??= 6379; (options as net.TcpSocketConnectOpts).host ??= 'localhost'; } options.connectTimeout ??= 5000; options.keepAlive ??= 5000; options.noDelay ??= true; return options; } static #isTlsSocket(options: RedisSocketOptions): options is RedisTlsSocketOptions { return (options as RedisTlsSocketOptions).tls === true; } readonly #initiator: RedisSocketInitiator; readonly #options: RedisSocketOptions; #socket?: net.Socket | tls.TLSSocket; #isOpen = false; get isOpen(): boolean { return this.#isOpen; } #isReady = false; get isReady(): boolean { return this.#isReady; } // `writable.writableNeedDrain` was added in v15.2.0 and therefore can't be used // https://nodejs.org/api/stream.html#stream_writable_writableneeddrain #writableNeedDrain = false; get writableNeedDrain(): boolean { return this.#writableNeedDrain; } #isSocketUnrefed = false; constructor(initiator: RedisSocketInitiator, options?: RedisSocketOptions) { super(); this.#initiator = initiator; this.#options = RedisSocket.#initiateOptions(options); } reconnectStrategy(retries: number): number | Error { if (this.#options.reconnectStrategy) { try { const retryIn = this.#options.reconnectStrategy(retries); if (typeof retryIn !== 'number' && !(retryIn instanceof Error)) { throw new TypeError('Reconnect strategy should return `number | Error`'); } return retryIn; } catch (err) { this.emit('error', err); } } return Math.min(retries * 50, 500); } async connect(): Promise { if (this.#isOpen) { throw new Error('Socket already opened'); } this.#isOpen = true; return this.#connect(); } async #connect(hadError?: boolean): Promise { let retries = 0; do { if (retries > 0 || hadError) { this.emit('reconnecting'); } try { this.#socket = await this.#createSocket(); this.#writableNeedDrain = false; this.emit('connect'); try { await this.#initiator(); } catch (err) { this.#socket.destroy(); this.#socket = undefined; throw err; } this.#isReady = true; this.emit('ready'); } catch (err) { const retryIn = this.reconnectStrategy(retries); if (retryIn instanceof Error) { this.#isOpen = false; this.emit('error', err); throw new ReconnectStrategyError(retryIn, err); } this.emit('error', err); await promiseTimeout(retryIn); } retries++; } while (this.#isOpen && !this.#isReady); } #createSocket(): Promise { return new Promise((resolve, reject) => { const { connectEvent, socket } = RedisSocket.#isTlsSocket(this.#options) ? this.#createTlsSocket() : this.#createNetSocket(); if (this.#options.connectTimeout) { socket.setTimeout(this.#options.connectTimeout, () => socket.destroy(new ConnectionTimeoutError())); } if (this.#isSocketUnrefed) { socket.unref(); } socket .setNoDelay(this.#options.noDelay) .once('error', reject) .once(connectEvent, () => { socket .setTimeout(0) // https://github.com/nodejs/node/issues/31663 .setKeepAlive(this.#options.keepAlive !== false, this.#options.keepAlive || 0) .off('error', reject) .once('error', (err: Error) => this.#onSocketError(err)) .once('close', hadError => { if (!hadError && this.#isOpen && this.#socket === socket) { this.#onSocketError(new SocketClosedUnexpectedlyError()); } }) .on('drain', () => { this.#writableNeedDrain = false; this.emit('drain'); }) .on('data', data => this.emit('data', data)); resolve(socket); }); }); } #createNetSocket(): CreateSocketReturn { return { connectEvent: 'connect', socket: net.connect(this.#options as net.NetConnectOpts) // TODO }; } #createTlsSocket(): CreateSocketReturn { return { connectEvent: 'secureConnect', socket: tls.connect(this.#options as tls.ConnectionOptions) // TODO }; } #onSocketError(err: Error): void { this.#isReady = false; this.emit('error', err); if (!this.#isOpen) return; this.#connect(true).catch(() => { // the error was already emitted, silently ignore it }); } writeCommand(args: RedisCommandArguments): void { if (!this.#socket) { throw new ClientClosedError(); } for (const toWrite of args) { this.#writableNeedDrain = !this.#socket.write(toWrite); } } disconnect(): void { if (!this.#isOpen) { throw new ClientClosedError(); } this.#isOpen = false; this.#disconnect(); } #disconnect(): void { this.#isReady = false; if (this.#socket) { this.#socket.destroy(); this.#socket = undefined; } this.emit('end'); } async quit(fn: () => Promise): Promise { if (!this.#isOpen) { throw new ClientClosedError(); } this.#isOpen = false; await fn(); this.#disconnect(); } #isCorked = false; cork(): void { if (!this.#socket || this.#isCorked) { return; } this.#socket.cork(); this.#isCorked = true; queueMicrotask(() => { this.#socket?.uncork(); this.#isCorked = false; }); } ref(): void { this.#isSocketUnrefed = false; this.#socket?.ref(); } unref(): void { this.#isSocketUnrefed = true; this.#socket?.unref(); } } node-redis-redis-4.5.1/packages/client/lib/cluster/000077500000000000000000000000001433774114400221515ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/cluster/cluster-slots.ts000066400000000000000000000223001433774114400253410ustar00rootroot00000000000000import RedisClient, { InstantiableRedisClient, RedisClientType } from '../client'; import { RedisClusterMasterNode, RedisClusterReplicaNode } from '../commands/CLUSTER_NODES'; import { RedisClusterClientOptions, RedisClusterOptions } from '.'; import { RedisCommandArgument, RedisFunctions, RedisModules, RedisScripts } from '../commands'; import { RootNodesUnavailableError } from '../errors'; // We need to use 'require', because it's not possible with Typescript to import // function that are exported as 'module.exports = function`, without esModuleInterop // set to true. const calculateSlot = require('cluster-key-slot'); export interface ClusterNode< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > { id: string; client: RedisClientType; } interface NodeAddress { host: string; port: number; } export type NodeAddressMap = { [address: string]: NodeAddress; } | ((address: string) => NodeAddress | undefined); interface SlotNodes< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > { master: ClusterNode; replicas: Array>; clientIterator: IterableIterator> | undefined; } type OnError = (err: unknown) => void; export default class RedisClusterSlots< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > { readonly #options: RedisClusterOptions; readonly #Client: InstantiableRedisClient; readonly #onError: OnError; readonly #nodeByAddress = new Map>(); readonly #slots: Array> = []; constructor(options: RedisClusterOptions, onError: OnError) { this.#options = options; this.#Client = RedisClient.extend(options); this.#onError = onError; } async connect(): Promise { for (const rootNode of this.#options.rootNodes) { if (await this.#discoverNodes(rootNode)) return; } throw new RootNodesUnavailableError(); } async #discoverNodes(clientOptions?: RedisClusterClientOptions): Promise { const client = this.#initiateClient(clientOptions); await client.connect(); try { await this.#reset(await client.clusterNodes()); return true; } catch (err) { this.#onError(err); return false; } finally { if (client.isOpen) { await client.disconnect(); } } } #runningRediscoverPromise?: Promise; async rediscover(startWith: RedisClientType): Promise { if (!this.#runningRediscoverPromise) { this.#runningRediscoverPromise = this.#rediscover(startWith) .finally(() => this.#runningRediscoverPromise = undefined); } return this.#runningRediscoverPromise; } async #rediscover(startWith: RedisClientType): Promise { if (await this.#discoverNodes(startWith.options)) return; for (const { client } of this.#nodeByAddress.values()) { if (client === startWith) continue; if (await this.#discoverNodes(client.options)) return; } throw new Error('None of the cluster nodes is available'); } async #reset(masters: Array): Promise { // Override this.#slots and add not existing clients to this.#nodeByAddress const promises: Array> = [], clientsInUse = new Set(); for (const master of masters) { const slot = { master: this.#initiateClientForNode(master, false, clientsInUse, promises), replicas: this.#options.useReplicas ? master.replicas.map(replica => this.#initiateClientForNode(replica, true, clientsInUse, promises)) : [], clientIterator: undefined // will be initiated in use }; for (const { from, to } of master.slots) { for (let i = from; i <= to; i++) { this.#slots[i] = slot; } } } // Remove unused clients from this.#nodeByAddress using clientsInUse for (const [address, { client }] of this.#nodeByAddress.entries()) { if (clientsInUse.has(address)) continue; promises.push(client.disconnect()); this.#nodeByAddress.delete(address); } await Promise.all(promises); } #clientOptionsDefaults(options?: RedisClusterClientOptions): RedisClusterClientOptions | undefined { if (!this.#options.defaults) return options; return { ...this.#options.defaults, ...options, socket: this.#options.defaults.socket && options?.socket ? { ...this.#options.defaults.socket, ...options.socket } : this.#options.defaults.socket ?? options?.socket }; } #initiateClient(options?: RedisClusterClientOptions): RedisClientType { return new this.#Client(this.#clientOptionsDefaults(options)) .on('error', this.#onError); } #getNodeAddress(address: string): NodeAddress | undefined { switch (typeof this.#options.nodeAddressMap) { case 'object': return this.#options.nodeAddressMap[address]; case 'function': return this.#options.nodeAddressMap(address); } } #initiateClientForNode( nodeData: RedisClusterMasterNode | RedisClusterReplicaNode, readonly: boolean, clientsInUse: Set, promises: Array> ): ClusterNode { const address = `${nodeData.host}:${nodeData.port}`; clientsInUse.add(address); let node = this.#nodeByAddress.get(address); if (!node) { node = { id: nodeData.id, client: this.#initiateClient({ socket: this.#getNodeAddress(address) ?? { host: nodeData.host, port: nodeData.port }, readonly }) }; promises.push(node.client.connect()); this.#nodeByAddress.set(address, node); } return node; } getSlotMaster(slot: number): ClusterNode { return this.#slots[slot].master; } *#slotClientIterator(slotNumber: number): IterableIterator> { const slot = this.#slots[slotNumber]; yield slot.master.client; for (const replica of slot.replicas) { yield replica.client; } } #getSlotClient(slotNumber: number): RedisClientType { const slot = this.#slots[slotNumber]; if (!slot.clientIterator) { slot.clientIterator = this.#slotClientIterator(slotNumber); } const {done, value} = slot.clientIterator.next(); if (done) { slot.clientIterator = undefined; return this.#getSlotClient(slotNumber); } return value; } #randomClientIterator?: IterableIterator>; #getRandomClient(): RedisClientType { if (!this.#nodeByAddress.size) { throw new Error('Cluster is not connected'); } if (!this.#randomClientIterator) { this.#randomClientIterator = this.#nodeByAddress.values(); } const {done, value} = this.#randomClientIterator.next(); if (done) { this.#randomClientIterator = undefined; return this.#getRandomClient(); } return value.client; } getClient(firstKey?: RedisCommandArgument, isReadonly?: boolean): RedisClientType { if (!firstKey) { return this.#getRandomClient(); } const slot = calculateSlot(firstKey); if (!isReadonly || !this.#options.useReplicas) { return this.getSlotMaster(slot).client; } return this.#getSlotClient(slot); } getMasters(): Array> { const masters = []; for (const node of this.#nodeByAddress.values()) { if (node.client.options?.readonly) continue; masters.push(node); } return masters; } getNodeByAddress(address: string): ClusterNode | undefined { const mappedAddress = this.#getNodeAddress(address); return this.#nodeByAddress.get( mappedAddress ? `${mappedAddress.host}:${mappedAddress.port}` : address ); } quit(): Promise { return this.#destroy(client => client.quit()); } disconnect(): Promise { return this.#destroy(client => client.disconnect()); } async #destroy(fn: (client: RedisClientType) => Promise): Promise { const promises = []; for (const { client } of this.#nodeByAddress.values()) { promises.push(fn(client)); } await Promise.all(promises); this.#nodeByAddress.clear(); this.#slots.splice(0); } } node-redis-redis-4.5.1/packages/client/lib/cluster/commands.ts000066400000000000000000000451211433774114400243250ustar00rootroot00000000000000 import * as APPEND from '../commands/APPEND'; import * as BITCOUNT from '../commands/BITCOUNT'; import * as BITFIELD_RO from '../commands/BITFIELD_RO'; import * as BITFIELD from '../commands/BITFIELD'; import * as BITOP from '../commands/BITOP'; import * as BITPOS from '../commands/BITPOS'; import * as BLMOVE from '../commands/BLMOVE'; import * as BLMPOP from '../commands/BLMPOP'; import * as BLPOP from '../commands/BLPOP'; import * as BRPOP from '../commands/BRPOP'; import * as BRPOPLPUSH from '../commands/BRPOPLPUSH'; import * as BZMPOP from '../commands/BZMPOP'; import * as BZPOPMAX from '../commands/BZPOPMAX'; import * as BZPOPMIN from '../commands/BZPOPMIN'; import * as COPY from '../commands/COPY'; import * as DECR from '../commands/DECR'; import * as DECRBY from '../commands/DECRBY'; import * as DEL from '../commands/DEL'; import * as DUMP from '../commands/DUMP'; import * as EVAL_RO from '../commands/EVAL_RO'; import * as EVAL from '../commands/EVAL'; import * as EVALSHA_RO from '../commands/EVALSHA_RO'; import * as EVALSHA from '../commands/EVALSHA'; import * as EXISTS from '../commands/EXISTS'; import * as EXPIRE from '../commands/EXPIRE'; import * as EXPIREAT from '../commands/EXPIREAT'; import * as EXPIRETIME from '../commands/EXPIRETIME'; import * as FCALL_RO from '../commands/FCALL_RO'; import * as FCALL from '../commands/FCALL'; import * as GEOADD from '../commands/GEOADD'; import * as GEODIST from '../commands/GEODIST'; import * as GEOHASH from '../commands/GEOHASH'; import * as GEOPOS from '../commands/GEOPOS'; import * as GEORADIUS_RO_WITH from '../commands/GEORADIUS_RO_WITH'; import * as GEORADIUS_RO from '../commands/GEORADIUS_RO'; import * as GEORADIUS_WITH from '../commands/GEORADIUS_WITH'; import * as GEORADIUS from '../commands/GEORADIUS'; import * as GEORADIUSBYMEMBER_RO_WITH from '../commands/GEORADIUSBYMEMBER_RO_WITH'; import * as GEORADIUSBYMEMBER_RO from '../commands/GEORADIUSBYMEMBER_RO'; import * as GEORADIUSBYMEMBER_WITH from '../commands/GEORADIUSBYMEMBER_WITH'; import * as GEORADIUSBYMEMBER from '../commands/GEORADIUSBYMEMBER'; import * as GEORADIUSBYMEMBERSTORE from '../commands/GEORADIUSBYMEMBERSTORE'; import * as GEORADIUSSTORE from '../commands/GEORADIUSSTORE'; import * as GEOSEARCH_WITH from '../commands/GEOSEARCH_WITH'; import * as GEOSEARCH from '../commands/GEOSEARCH'; import * as GEOSEARCHSTORE from '../commands/GEOSEARCHSTORE'; import * as GET from '../commands/GET'; import * as GETBIT from '../commands/GETBIT'; import * as GETDEL from '../commands/GETDEL'; import * as GETEX from '../commands/GETEX'; 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 from '../commands/HGET'; 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 from '../commands/HRANDFIELD_COUNT_WITHVALUES'; import * as HRANDFIELD_COUNT from '../commands/HRANDFIELD_COUNT'; import * as HRANDFIELD from '../commands/HRANDFIELD'; import * as HSCAN from '../commands/HSCAN'; import * as HSET from '../commands/HSET'; import * as HSETNX from '../commands/HSETNX'; import * as HSTRLEN from '../commands/HSTRLEN'; import * as HVALS from '../commands/HVALS'; import * as INCR from '../commands/INCR'; import * as INCRBY from '../commands/INCRBY'; import * as INCRBYFLOAT from '../commands/INCRBYFLOAT'; import * as LCS_IDX_WITHMATCHLEN from '../commands/LCS_IDX_WITHMATCHLEN'; import * as LCS_IDX from '../commands/LCS_IDX'; import * as LCS_LEN from '../commands/LCS_LEN'; import * as LCS from '../commands/LCS'; import * as LINDEX from '../commands/LINDEX'; import * as LINSERT from '../commands/LINSERT'; import * as LLEN from '../commands/LLEN'; import * as LMOVE from '../commands/LMOVE'; import * as LMPOP from '../commands/LMPOP'; import * as LPOP_COUNT from '../commands/LPOP_COUNT'; import * as LPOP from '../commands/LPOP'; import * as LPOS_COUNT from '../commands/LPOS_COUNT'; import * as LPOS from '../commands/LPOS'; import * as LPUSH from '../commands/LPUSH'; import * as LPUSHX from '../commands/LPUSHX'; import * as LRANGE from '../commands/LRANGE'; import * as LREM from '../commands/LREM'; import * as LSET from '../commands/LSET'; import * as LTRIM from '../commands/LTRIM'; import * as MGET from '../commands/MGET'; import * as MIGRATE from '../commands/MIGRATE'; import * as MSET from '../commands/MSET'; import * as MSETNX from '../commands/MSETNX'; import * as OBJECT_ENCODING from '../commands/OBJECT_ENCODING'; import * as OBJECT_FREQ from '../commands/OBJECT_FREQ'; import * as OBJECT_IDLETIME from '../commands/OBJECT_IDLETIME'; import * as OBJECT_REFCOUNT from '../commands/OBJECT_REFCOUNT'; import * as PERSIST from '../commands/PERSIST'; import * as PEXPIRE from '../commands/PEXPIRE'; import * as PEXPIREAT from '../commands/PEXPIREAT'; import * as PEXPIRETIME from '../commands/PEXPIRETIME'; import * as PFADD from '../commands/PFADD'; import * as PFCOUNT from '../commands/PFCOUNT'; import * as PFMERGE from '../commands/PFMERGE'; import * as PSETEX from '../commands/PSETEX'; import * as PTTL from '../commands/PTTL'; import * as PUBLISH from '../commands/PUBLISH'; import * as RENAME from '../commands/RENAME'; import * as RENAMENX from '../commands/RENAMENX'; import * as RPOP_COUNT from '../commands/RPOP_COUNT'; import * as RPOP from '../commands/RPOP'; import * as RPOPLPUSH from '../commands/RPOPLPUSH'; import * as RPUSH from '../commands/RPUSH'; import * as RPUSHX from '../commands/RPUSHX'; import * as SADD from '../commands/SADD'; import * as SCARD from '../commands/SCARD'; import * as SDIFF from '../commands/SDIFF'; import * as SDIFFSTORE from '../commands/SDIFFSTORE'; import * as SET from '../commands/SET'; import * as SETBIT from '../commands/SETBIT'; import * as SETEX from '../commands/SETEX'; import * as SETNX from '../commands/SETNX'; import * as SETRANGE from '../commands/SETRANGE'; import * as SINTER from '../commands/SINTER'; import * as SINTERCARD from '../commands/SINTERCARD'; import * as SINTERSTORE from '../commands/SINTERSTORE'; import * as SISMEMBER from '../commands/SISMEMBER'; import * as SMEMBERS from '../commands/SMEMBERS'; import * as SMISMEMBER from '../commands/SMISMEMBER'; import * as SMOVE from '../commands/SMOVE'; import * as SORT_RO from '../commands/SORT_RO'; import * as SORT_STORE from '../commands/SORT_STORE'; import * as SORT from '../commands/SORT'; import * as SPOP from '../commands/SPOP'; import * as SRANDMEMBER_COUNT from '../commands/SRANDMEMBER_COUNT'; import * as SRANDMEMBER from '../commands/SRANDMEMBER'; import * as SREM from '../commands/SREM'; import * as SSCAN from '../commands/SSCAN'; import * as STRLEN from '../commands/STRLEN'; import * as SUNION from '../commands/SUNION'; import * as SUNIONSTORE from '../commands/SUNIONSTORE'; import * as TOUCH from '../commands/TOUCH'; import * as TTL from '../commands/TTL'; import * as TYPE from '../commands/TYPE'; 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 from '../commands/XAUTOCLAIM_JUSTID'; import * as XAUTOCLAIM from '../commands/XAUTOCLAIM'; import * as XCLAIM_JUSTID from '../commands/XCLAIM_JUSTID'; import * as XCLAIM from '../commands/XCLAIM'; import * as XDEL from '../commands/XDEL'; import * as XGROUP_CREATE from '../commands/XGROUP_CREATE'; import * as XGROUP_CREATECONSUMER from '../commands/XGROUP_CREATECONSUMER'; import * as XGROUP_DELCONSUMER from '../commands/XGROUP_DELCONSUMER'; import * as XGROUP_DESTROY from '../commands/XGROUP_DESTROY'; import * as XGROUP_SETID from '../commands/XGROUP_SETID'; import * as XINFO_CONSUMERS from '../commands/XINFO_CONSUMERS'; import * as XINFO_GROUPS from '../commands/XINFO_GROUPS'; 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 from '../commands/XRANGE'; import * as XREAD from '../commands/XREAD'; import * as XREADGROUP from '../commands/XREADGROUP'; import * as XREVRANGE from '../commands/XREVRANGE'; import * as XSETID from '../commands/XSETID'; import * as XTRIM from '../commands/XTRIM'; import * as ZADD from '../commands/ZADD'; import * as ZCARD from '../commands/ZCARD'; import * as ZCOUNT from '../commands/ZCOUNT'; import * as ZDIFF_WITHSCORES from '../commands/ZDIFF_WITHSCORES'; import * as ZDIFF from '../commands/ZDIFF'; import * as ZDIFFSTORE from '../commands/ZDIFFSTORE'; import * as ZINCRBY from '../commands/ZINCRBY'; import * as ZINTER_WITHSCORES from '../commands/ZINTER_WITHSCORES'; import * as ZINTER from '../commands/ZINTER'; import * as ZINTERCARD from '../commands/ZINTERCARD'; import * as ZINTERSTORE from '../commands/ZINTERSTORE'; import * as ZLEXCOUNT from '../commands/ZLEXCOUNT'; import * as ZMPOP from '../commands/ZMPOP'; import * as ZMSCORE from '../commands/ZMSCORE'; import * as ZPOPMAX_COUNT from '../commands/ZPOPMAX_COUNT'; import * as ZPOPMAX from '../commands/ZPOPMAX'; import * as ZPOPMIN_COUNT from '../commands/ZPOPMIN_COUNT'; import * as ZPOPMIN from '../commands/ZPOPMIN'; import * as ZRANDMEMBER_COUNT_WITHSCORES from '../commands/ZRANDMEMBER_COUNT_WITHSCORES'; import * as ZRANDMEMBER_COUNT from '../commands/ZRANDMEMBER_COUNT'; import * as ZRANDMEMBER from '../commands/ZRANDMEMBER'; import * as ZRANGE_WITHSCORES from '../commands/ZRANGE_WITHSCORES'; import * as ZRANGE from '../commands/ZRANGE'; import * as ZRANGEBYLEX from '../commands/ZRANGEBYLEX'; import * as ZRANGEBYSCORE_WITHSCORES from '../commands/ZRANGEBYSCORE_WITHSCORES'; import * as ZRANGEBYSCORE from '../commands/ZRANGEBYSCORE'; import * as ZRANGESTORE from '../commands/ZRANGESTORE'; import * as ZRANK from '../commands/ZRANK'; import * as ZREM from '../commands/ZREM'; import * as ZREMRANGEBYLEX from '../commands/ZREMRANGEBYLEX'; import * as ZREMRANGEBYRANK from '../commands/ZREMRANGEBYRANK'; import * as ZREMRANGEBYSCORE from '../commands/ZREMRANGEBYSCORE'; import * as ZREVRANK from '../commands/ZREVRANK'; import * as ZSCAN from '../commands/ZSCAN'; import * as ZSCORE from '../commands/ZSCORE'; import * as ZUNION_WITHSCORES from '../commands/ZUNION_WITHSCORES'; import * as ZUNION from '../commands/ZUNION'; import * as ZUNIONSTORE from '../commands/ZUNIONSTORE'; export default { APPEND, append: APPEND, BITCOUNT, bitCount: BITCOUNT, BITFIELD_RO, bitFieldRo: BITFIELD_RO, BITFIELD, bitField: BITFIELD, BITOP, bitOp: BITOP, BITPOS, bitPos: BITPOS, BLMOVE, blMove: BLMOVE, BLMPOP, blmPop: BLMPOP, BLPOP, blPop: BLPOP, BRPOP, brPop: BRPOP, BRPOPLPUSH, brPopLPush: BRPOPLPUSH, BZMPOP, bzmPop: BZMPOP, BZPOPMAX, bzPopMax: BZPOPMAX, BZPOPMIN, bzPopMin: BZPOPMIN, COPY, copy: COPY, DECR, decr: DECR, DECRBY, decrBy: DECRBY, DEL, del: DEL, DUMP, dump: DUMP, EVAL_RO, evalRo: EVAL_RO, EVAL, eval: EVAL, EVALSHA, evalSha: EVALSHA, EVALSHA_RO, evalShaRo: EVALSHA_RO, EXISTS, exists: EXISTS, EXPIRE, expire: EXPIRE, EXPIREAT, expireAt: EXPIREAT, EXPIRETIME, expireTime: EXPIRETIME, FCALL_RO, fCallRo: FCALL_RO, FCALL, fCall: FCALL, GEOADD, geoAdd: GEOADD, GEODIST, geoDist: GEODIST, GEOHASH, geoHash: GEOHASH, GEOPOS, geoPos: GEOPOS, GEORADIUS_RO_WITH, geoRadiusRoWith: GEORADIUS_RO_WITH, GEORADIUS_RO, geoRadiusRo: GEORADIUS_RO, GEORADIUS_WITH, geoRadiusWith: GEORADIUS_WITH, GEORADIUS, geoRadius: GEORADIUS, GEORADIUSBYMEMBER_RO_WITH, geoRadiusByMemberRoWith: GEORADIUSBYMEMBER_RO_WITH, GEORADIUSBYMEMBER_RO, geoRadiusByMemberRo: GEORADIUSBYMEMBER_RO, GEORADIUSBYMEMBER_WITH, geoRadiusByMemberWith: GEORADIUSBYMEMBER_WITH, GEORADIUSBYMEMBER, geoRadiusByMember: GEORADIUSBYMEMBER, GEORADIUSBYMEMBERSTORE, geoRadiusByMemberStore: GEORADIUSBYMEMBERSTORE, GEORADIUSSTORE, geoRadiusStore: GEORADIUSSTORE, GEOSEARCH_WITH, geoSearchWith: GEOSEARCH_WITH, GEOSEARCH, geoSearch: GEOSEARCH, GEOSEARCHSTORE, geoSearchStore: GEOSEARCHSTORE, GET, get: GET, GETBIT, getBit: GETBIT, GETDEL, getDel: GETDEL, GETEX, getEx: GETEX, GETRANGE, getRange: GETRANGE, GETSET, getSet: GETSET, HDEL, hDel: HDEL, HEXISTS, hExists: HEXISTS, HGET, hGet: HGET, HGETALL, hGetAll: HGETALL, HINCRBY, hIncrBy: HINCRBY, HINCRBYFLOAT, hIncrByFloat: HINCRBYFLOAT, HKEYS, hKeys: HKEYS, HLEN, hLen: HLEN, HMGET, hmGet: HMGET, HRANDFIELD_COUNT_WITHVALUES, hRandFieldCountWithValues: HRANDFIELD_COUNT_WITHVALUES, HRANDFIELD_COUNT, hRandFieldCount: HRANDFIELD_COUNT, HRANDFIELD, hRandField: HRANDFIELD, HSCAN, hScan: HSCAN, HSET, hSet: HSET, HSETNX, hSetNX: HSETNX, HSTRLEN, hStrLen: HSTRLEN, HVALS, hVals: HVALS, INCR, incr: INCR, INCRBY, incrBy: INCRBY, INCRBYFLOAT, incrByFloat: INCRBYFLOAT, LCS_IDX_WITHMATCHLEN, lcsIdxWithMatchLen: LCS_IDX_WITHMATCHLEN, LCS_IDX, lcsIdx: LCS_IDX, LCS_LEN, lcsLen: LCS_LEN, LCS, lcs: LCS, LINDEX, lIndex: LINDEX, LINSERT, lInsert: LINSERT, LLEN, lLen: LLEN, LMOVE, lMove: LMOVE, LMPOP, lmPop: LMPOP, LPOP_COUNT, lPopCount: LPOP_COUNT, LPOP, lPop: LPOP, LPOS_COUNT, lPosCount: LPOS_COUNT, LPOS, lPos: LPOS, LPUSH, lPush: LPUSH, LPUSHX, lPushX: LPUSHX, LRANGE, lRange: LRANGE, LREM, lRem: LREM, LSET, lSet: LSET, LTRIM, lTrim: LTRIM, MGET, mGet: MGET, MIGRATE, migrate: MIGRATE, MSET, mSet: MSET, MSETNX, mSetNX: MSETNX, OBJECT_ENCODING, objectEncoding: OBJECT_ENCODING, OBJECT_FREQ, objectFreq: OBJECT_FREQ, OBJECT_IDLETIME, objectIdleTime: OBJECT_IDLETIME, OBJECT_REFCOUNT, objectRefCount: OBJECT_REFCOUNT, PERSIST, persist: PERSIST, PEXPIRE, pExpire: PEXPIRE, PEXPIREAT, pExpireAt: PEXPIREAT, PEXPIRETIME, pExpireTime: PEXPIRETIME, PFADD, pfAdd: PFADD, PFCOUNT, pfCount: PFCOUNT, PFMERGE, pfMerge: PFMERGE, PSETEX, pSetEx: PSETEX, PTTL, pTTL: PTTL, PUBLISH, publish: PUBLISH, RENAME, rename: RENAME, RENAMENX, renameNX: RENAMENX, RPOP_COUNT, rPopCount: RPOP_COUNT, RPOP, rPop: RPOP, RPOPLPUSH, rPopLPush: RPOPLPUSH, RPUSH, rPush: RPUSH, RPUSHX, rPushX: RPUSHX, SADD, sAdd: SADD, SCARD, sCard: SCARD, SDIFF, sDiff: SDIFF, SDIFFSTORE, sDiffStore: SDIFFSTORE, SINTER, sInter: SINTER, SINTERCARD, sInterCard: SINTERCARD, SINTERSTORE, sInterStore: SINTERSTORE, SET, set: SET, SETBIT, setBit: SETBIT, SETEX, setEx: SETEX, SETNX, setNX: SETNX, SETRANGE, setRange: SETRANGE, SISMEMBER, sIsMember: SISMEMBER, SMEMBERS, sMembers: SMEMBERS, SMISMEMBER, smIsMember: SMISMEMBER, SMOVE, sMove: SMOVE, SORT_RO, sortRo: SORT_RO, SORT_STORE, sortStore: SORT_STORE, SORT, sort: SORT, SPOP, sPop: SPOP, SRANDMEMBER_COUNT, sRandMemberCount: SRANDMEMBER_COUNT, SRANDMEMBER, sRandMember: SRANDMEMBER, SREM, sRem: SREM, SSCAN, sScan: SSCAN, STRLEN, strLen: STRLEN, SUNION, sUnion: SUNION, SUNIONSTORE, sUnionStore: SUNIONSTORE, TOUCH, touch: TOUCH, TTL, ttl: TTL, TYPE, type: TYPE, UNLINK, unlink: UNLINK, WATCH, watch: WATCH, XACK, xAck: XACK, XADD, xAdd: XADD, XAUTOCLAIM_JUSTID, xAutoClaimJustId: XAUTOCLAIM_JUSTID, XAUTOCLAIM, xAutoClaim: XAUTOCLAIM, XCLAIM, xClaim: XCLAIM, XCLAIM_JUSTID, xClaimJustId: XCLAIM_JUSTID, XDEL, xDel: XDEL, XGROUP_CREATE, xGroupCreate: XGROUP_CREATE, XGROUP_CREATECONSUMER, xGroupCreateConsumer: XGROUP_CREATECONSUMER, XGROUP_DELCONSUMER, xGroupDelConsumer: XGROUP_DELCONSUMER, XGROUP_DESTROY, xGroupDestroy: XGROUP_DESTROY, XGROUP_SETID, xGroupSetId: XGROUP_SETID, XINFO_CONSUMERS, xInfoConsumers: XINFO_CONSUMERS, XINFO_GROUPS, xInfoGroups: XINFO_GROUPS, XINFO_STREAM, xInfoStream: XINFO_STREAM, XLEN, xLen: XLEN, XPENDING_RANGE, xPendingRange: XPENDING_RANGE, XPENDING, xPending: XPENDING, XRANGE, xRange: XRANGE, XREAD, xRead: XREAD, XREADGROUP, xReadGroup: XREADGROUP, XREVRANGE, xRevRange: XREVRANGE, XSETID, xSetId: XSETID, XTRIM, xTrim: XTRIM, ZADD, zAdd: ZADD, ZCARD, zCard: ZCARD, ZCOUNT, zCount: ZCOUNT, ZDIFF_WITHSCORES, zDiffWithScores: ZDIFF_WITHSCORES, ZDIFF, zDiff: ZDIFF, ZDIFFSTORE, zDiffStore: ZDIFFSTORE, ZINCRBY, zIncrBy: ZINCRBY, ZINTER_WITHSCORES, zInterWithScores: ZINTER_WITHSCORES, ZINTER, zInter: ZINTER, ZINTERCARD, zInterCard: ZINTERCARD, ZINTERSTORE, zInterStore: ZINTERSTORE, ZLEXCOUNT, zLexCount: ZLEXCOUNT, ZMPOP, zmPop: ZMPOP, ZMSCORE, zmScore: ZMSCORE, ZPOPMAX_COUNT, zPopMaxCount: ZPOPMAX_COUNT, ZPOPMAX, zPopMax: ZPOPMAX, ZPOPMIN_COUNT, zPopMinCount: ZPOPMIN_COUNT, ZPOPMIN, zPopMin: ZPOPMIN, ZRANDMEMBER_COUNT_WITHSCORES, zRandMemberCountWithScores: ZRANDMEMBER_COUNT_WITHSCORES, ZRANDMEMBER_COUNT, zRandMemberCount: ZRANDMEMBER_COUNT, ZRANDMEMBER, zRandMember: ZRANDMEMBER, ZRANGE_WITHSCORES, zRangeWithScores: ZRANGE_WITHSCORES, ZRANGE, zRange: ZRANGE, ZRANGEBYLEX, zRangeByLex: ZRANGEBYLEX, ZRANGEBYSCORE_WITHSCORES, zRangeByScoreWithScores: ZRANGEBYSCORE_WITHSCORES, ZRANGEBYSCORE, zRangeByScore: ZRANGEBYSCORE, ZRANGESTORE, zRangeStore: ZRANGESTORE, ZRANK, zRank: ZRANK, ZREM, zRem: ZREM, ZREMRANGEBYLEX, zRemRangeByLex: ZREMRANGEBYLEX, ZREMRANGEBYRANK, zRemRangeByRank: ZREMRANGEBYRANK, ZREMRANGEBYSCORE, zRemRangeByScore: ZREMRANGEBYSCORE, ZREVRANK, zRevRank: ZREVRANK, ZSCAN, zScan: ZSCAN, ZSCORE, zScore: ZSCORE, ZUNION_WITHSCORES, zUnionWithScores: ZUNION_WITHSCORES, ZUNION, zUnion: ZUNION, ZUNIONSTORE, zUnionStore: ZUNIONSTORE }; node-redis-redis-4.5.1/packages/client/lib/cluster/index.spec.ts000066400000000000000000000067271433774114400245750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import RedisCluster from '.'; import { ClusterSlotStates } from '../commands/CLUSTER_SETSLOT'; import { SQUARE_SCRIPT } from '../client/index.spec'; import { RootNodesUnavailableError } from '../errors'; // We need to use 'require', because it's not possible with Typescript to import // function that are exported as 'module.exports = function`, without esModuleInterop // set to true. const calculateSlot = require('cluster-key-slot'); describe('Cluster', () => { testUtils.testWithCluster('sendCommand', async cluster => { await cluster.publish('channel', 'message'); await cluster.set('a', 'b'); await cluster.set('a{a}', 'bb'); await cluster.set('aa', 'bb'); await cluster.get('aa'); await cluster.get('aa'); await cluster.get('aa'); await cluster.get('aa'); }, GLOBAL.CLUSTERS.OPEN); testUtils.testWithCluster('multi', async cluster => { const key = 'key'; assert.deepEqual( await cluster.multi() .set(key, 'value') .get(key) .exec(), ['OK', 'value'] ); }, GLOBAL.CLUSTERS.OPEN); testUtils.testWithCluster('scripts', async cluster => { assert.equal( await cluster.square(2), 4 ); }, { ...GLOBAL.CLUSTERS.OPEN, clusterConfiguration: { scripts: { square: SQUARE_SCRIPT } } }); it('should throw RootNodesUnavailableError', async () => { const cluster = RedisCluster.create({ rootNodes: [] }); try { await assert.rejects( cluster.connect(), RootNodesUnavailableError ); } catch (err) { await cluster.disconnect(); throw err; } }); testUtils.testWithCluster('should handle live resharding', async cluster => { const key = 'key', value = 'value'; await cluster.set(key, value); const slot = calculateSlot(key), source = cluster.getSlotMaster(slot), destination = cluster.getMasters().find(node => node.id !== source.id)!; await Promise.all([ source.client.clusterSetSlot(slot, ClusterSlotStates.MIGRATING, destination.id), destination.client.clusterSetSlot(slot, ClusterSlotStates.IMPORTING, destination.id) ]); // should be able to get the key from the source node using "ASKING" assert.equal( await cluster.get(key), value ); await Promise.all([ source.client.migrate( '127.0.0.1', (destination.client.options).socket.port, key, 0, 10 ) ]); // should be able to get the key from the destination node using the "ASKING" command assert.equal( await cluster.get(key), value ); await Promise.all( cluster.getMasters().map(({ client }) => { return client.clusterSetSlot(slot, ClusterSlotStates.NODE, destination.id); }) ); // should handle "MOVED" errors assert.equal( await cluster.get(key), value ); }, { serverArguments: [], numberOfNodes: 2 }); }); node-redis-redis-4.5.1/packages/client/lib/cluster/index.ts000066400000000000000000000220041433774114400236260ustar00rootroot00000000000000import COMMANDS from './commands'; import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisFunctions, RedisModules, RedisExtensions, RedisScript, RedisScripts, RedisCommandSignature, RedisFunction } from '../commands'; import { ClientCommandOptions, RedisClientOptions, RedisClientType, WithFunctions, WithModules, WithScripts } from '../client'; import RedisClusterSlots, { ClusterNode, NodeAddressMap } from './cluster-slots'; import { attachExtensions, transformCommandReply, attachCommands, transformCommandArguments } from '../commander'; import { EventEmitter } from 'events'; import RedisClusterMultiCommand, { InstantiableRedisClusterMultiCommandType, RedisClusterMultiCommandType } from './multi-command'; import { RedisMultiQueuedCommand } from '../multi-command'; export type RedisClusterClientOptions = Omit< RedisClientOptions, 'modules' | 'functions' | 'scripts' | 'database' >; export interface RedisClusterOptions< M extends RedisModules = Record, F extends RedisFunctions = Record, S extends RedisScripts = Record > extends RedisExtensions { rootNodes: Array; defaults?: Partial; useReplicas?: boolean; maxCommandRedirections?: number; nodeAddressMap?: NodeAddressMap; } type WithCommands = { [P in keyof typeof COMMANDS]: RedisCommandSignature<(typeof COMMANDS)[P]>; }; export type RedisClusterType< M extends RedisModules = Record, F extends RedisFunctions = Record, S extends RedisScripts = Record > = RedisCluster & WithCommands & WithModules & WithFunctions & WithScripts; export default class RedisCluster< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > extends EventEmitter { static extractFirstKey( command: RedisCommand, originalArgs: Array, redisArgs: RedisCommandArguments ): RedisCommandArgument | undefined { if (command.FIRST_KEY_INDEX === undefined) { return undefined; } else if (typeof command.FIRST_KEY_INDEX === 'number') { return redisArgs[command.FIRST_KEY_INDEX]; } return command.FIRST_KEY_INDEX(...originalArgs); } static create< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(options?: RedisClusterOptions): RedisClusterType { return new (attachExtensions({ BaseClass: RedisCluster, modulesExecutor: RedisCluster.prototype.commandsExecutor, modules: options?.modules, functionsExecutor: RedisCluster.prototype.functionsExecutor, functions: options?.functions, scriptsExecutor: RedisCluster.prototype.scriptsExecutor, scripts: options?.scripts }))(options); } readonly #options: RedisClusterOptions; readonly #slots: RedisClusterSlots; readonly #Multi: InstantiableRedisClusterMultiCommandType; constructor(options: RedisClusterOptions) { super(); this.#options = options; this.#slots = new RedisClusterSlots(options, err => this.emit('error', err)); this.#Multi = RedisClusterMultiCommand.extend(options); } duplicate(overrides?: Partial>): RedisClusterType { return new (Object.getPrototypeOf(this).constructor)({ ...this.#options, ...overrides }); } async connect(): Promise { return this.#slots.connect(); } async commandsExecutor( command: C, args: Array ): Promise> { const { args: redisArgs, options } = transformCommandArguments(command, args); return transformCommandReply( command, await this.sendCommand( RedisCluster.extractFirstKey(command, args, redisArgs), command.IS_READ_ONLY, redisArgs, options ), redisArgs.preserve ); } async sendCommand( firstKey: RedisCommandArgument | undefined, isReadonly: boolean | undefined, args: RedisCommandArguments, options?: ClientCommandOptions ): Promise { return this.#execute( firstKey, isReadonly, client => client.sendCommand(args, options) ); } async functionsExecutor( fn: F, args: Array, name: string, ): Promise> { const { args: redisArgs, options } = transformCommandArguments(fn, args); return transformCommandReply( fn, await this.executeFunction( name, fn, args, redisArgs, options ), redisArgs.preserve ); } async executeFunction( name: string, fn: RedisFunction, originalArgs: Array, redisArgs: RedisCommandArguments, options?: ClientCommandOptions ): Promise { return this.#execute( RedisCluster.extractFirstKey(fn, originalArgs, redisArgs), fn.IS_READ_ONLY, client => client.executeFunction(name, fn, redisArgs, options) ); } async scriptsExecutor(script: S, args: Array): Promise> { const { args: redisArgs, options } = transformCommandArguments(script, args); return transformCommandReply( script, await this.executeScript( script, args, redisArgs, options ), redisArgs.preserve ); } async executeScript( script: RedisScript, originalArgs: Array, redisArgs: RedisCommandArguments, options?: ClientCommandOptions ): Promise { return this.#execute( RedisCluster.extractFirstKey(script, originalArgs, redisArgs), script.IS_READ_ONLY, client => client.executeScript(script, redisArgs, options) ); } async #execute( firstKey: RedisCommandArgument | undefined, isReadonly: boolean | undefined, executor: (client: RedisClientType) => Promise ): Promise { const maxCommandRedirections = this.#options.maxCommandRedirections ?? 16; let client = this.#slots.getClient(firstKey, isReadonly); for (let i = 0;; i++) { try { return await executor(client); } catch (err) { if (++i > maxCommandRedirections || !(err instanceof Error)) { throw err; } if (err.message.startsWith('ASK')) { const address = err.message.substring(err.message.lastIndexOf(' ') + 1); if (this.#slots.getNodeByAddress(address)?.client === client) { await client.asking(); continue; } await this.#slots.rediscover(client); const redirectTo = this.#slots.getNodeByAddress(address); if (!redirectTo) { throw new Error(`Cannot find node ${address}`); } await redirectTo.client.asking(); client = redirectTo.client; continue; } else if (err.message.startsWith('MOVED')) { await this.#slots.rediscover(client); client = this.#slots.getClient(firstKey, isReadonly); continue; } throw err; } } } MULTI(routing?: RedisCommandArgument): RedisClusterMultiCommandType { return new this.#Multi( (commands: Array, firstKey?: RedisCommandArgument, chainId?: symbol) => { return this.#execute( firstKey, false, client => client.multiExecutor(commands, undefined, chainId) ); }, routing ); } multi = this.MULTI; getMasters(): Array> { return this.#slots.getMasters(); } getSlotMaster(slot: number): ClusterNode { return this.#slots.getSlotMaster(slot); } quit(): Promise { return this.#slots.quit(); } disconnect(): Promise { return this.#slots.disconnect(); } } attachCommands({ BaseClass: RedisCluster, commands: COMMANDS, executor: RedisCluster.prototype.commandsExecutor }); node-redis-redis-4.5.1/packages/client/lib/cluster/multi-command.ts000066400000000000000000000123411433774114400252700ustar00rootroot00000000000000import COMMANDS from './commands'; import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply, RedisFunctions, RedisModules, RedisExtensions, RedisScript, RedisScripts, ExcludeMappedString, RedisFunction } from '../commands'; import RedisMultiCommand, { RedisMultiQueuedCommand } from '../multi-command'; import { attachCommands, attachExtensions } from '../commander'; import RedisCluster from '.'; type RedisClusterMultiCommandSignature< C extends RedisCommand, M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = (...args: Parameters) => RedisClusterMultiCommandType; type WithCommands< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof typeof COMMANDS]: RedisClusterMultiCommandSignature<(typeof COMMANDS)[P], M, F, S>; }; type WithModules< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof M as ExcludeMappedString

]: { [C in keyof M[P] as ExcludeMappedString]: RedisClusterMultiCommandSignature; }; }; type WithFunctions< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof F as ExcludeMappedString

]: { [FF in keyof F[P] as ExcludeMappedString]: RedisClusterMultiCommandSignature; }; }; type WithScripts< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = { [P in keyof S as ExcludeMappedString

]: RedisClusterMultiCommandSignature; }; export type RedisClusterMultiCommandType< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = RedisClusterMultiCommand & WithCommands & WithModules & WithFunctions & WithScripts; export type InstantiableRedisClusterMultiCommandType< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > = new (...args: ConstructorParameters) => RedisClusterMultiCommandType; export type RedisClusterMultiExecutor = (queue: Array, firstKey?: RedisCommandArgument, chainId?: symbol) => Promise>; export default class RedisClusterMultiCommand { readonly #multi = new RedisMultiCommand(); readonly #executor: RedisClusterMultiExecutor; #firstKey: RedisCommandArgument | undefined; static extend< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(extensions?: RedisExtensions): InstantiableRedisClusterMultiCommandType { return attachExtensions({ BaseClass: RedisClusterMultiCommand, modulesExecutor: RedisClusterMultiCommand.prototype.commandsExecutor, modules: extensions?.modules, functionsExecutor: RedisClusterMultiCommand.prototype.functionsExecutor, functions: extensions?.functions, scriptsExecutor: RedisClusterMultiCommand.prototype.scriptsExecutor, scripts: extensions?.scripts }); } constructor(executor: RedisClusterMultiExecutor, firstKey?: RedisCommandArgument) { this.#executor = executor; this.#firstKey = firstKey; } commandsExecutor(command: RedisCommand, args: Array): this { const transformedArguments = command.transformArguments(...args); this.#firstKey ??= RedisCluster.extractFirstKey(command, args, transformedArguments); return this.addCommand(undefined, transformedArguments, command.transformReply); } addCommand( firstKey: RedisCommandArgument | undefined, args: RedisCommandArguments, transformReply?: RedisCommand['transformReply'] ): this { this.#firstKey ??= firstKey; this.#multi.addCommand(args, transformReply); return this; } functionsExecutor(fn: RedisFunction, args: Array, name: string): this { const transformedArguments = this.#multi.addFunction(name, fn, args); this.#firstKey ??= RedisCluster.extractFirstKey(fn, args, transformedArguments); return this; } scriptsExecutor(script: RedisScript, args: Array): this { const transformedArguments = this.#multi.addScript(script, args); this.#firstKey ??= RedisCluster.extractFirstKey(script, args, transformedArguments); return this; } async exec(execAsPipeline = false): Promise> { if (execAsPipeline) { return this.execAsPipeline(); } const commands = this.#multi.exec(); if (!commands) return []; return this.#multi.handleExecReplies( await this.#executor(commands, this.#firstKey, RedisMultiCommand.generateChainId()) ); } EXEC = this.exec; async execAsPipeline(): Promise> { return this.#multi.transformReplies( await this.#executor(this.#multi.queue, this.#firstKey) ); } } attachCommands({ BaseClass: RedisClusterMultiCommand, commands: COMMANDS, executor: RedisClusterMultiCommand.prototype.commandsExecutor }); node-redis-redis-4.5.1/packages/client/lib/command-options.ts000066400000000000000000000006011433774114400241440ustar00rootroot00000000000000const symbol = Symbol('Command Options'); export type CommandOptions = T & { readonly [symbol]: true; }; export function commandOptions(options: T): CommandOptions { (options as any)[symbol] = true; return options as CommandOptions; } export function isCommandOptions(options: any): options is CommandOptions { return options?.[symbol] === true; } node-redis-redis-4.5.1/packages/client/lib/commander.ts000066400000000000000000000110651433774114400230100ustar00rootroot00000000000000 import { ClientCommandOptions } from './client'; import { CommandOptions, isCommandOptions } from './command-options'; import { RedisCommand, RedisCommandArgument, RedisCommandArguments, RedisCommandReply, RedisFunction, RedisFunctions, RedisModules, RedisScript, RedisScripts } from './commands'; type Instantiable = new (...args: Array) => T; type CommandsExecutor = (command: C, args: Array, name: string) => unknown; interface AttachCommandsConfig { BaseClass: Instantiable; commands: Record; executor: CommandsExecutor; } export function attachCommands({ BaseClass, commands, executor }: AttachCommandsConfig): void { for (const [name, command] of Object.entries(commands)) { BaseClass.prototype[name] = function (...args: Array): unknown { return executor.call(this, command, args, name); }; } } interface AttachExtensionsConfig { BaseClass: T; modulesExecutor: CommandsExecutor; modules?: RedisModules; functionsExecutor: CommandsExecutor; functions?: RedisFunctions; scriptsExecutor: CommandsExecutor; scripts?: RedisScripts; } export function attachExtensions(config: AttachExtensionsConfig): any { let Commander; if (config.modules) { Commander = attachWithNamespaces({ BaseClass: config.BaseClass, namespaces: config.modules, executor: config.modulesExecutor }); } if (config.functions) { Commander = attachWithNamespaces({ BaseClass: Commander ?? config.BaseClass, namespaces: config.functions, executor: config.functionsExecutor }); } if (config.scripts) { Commander ??= class extends config.BaseClass {}; attachCommands({ BaseClass: Commander, commands: config.scripts, executor: config.scriptsExecutor }); } return Commander ?? config.BaseClass; } interface AttachWithNamespacesConfig { BaseClass: Instantiable; namespaces: Record>; executor: CommandsExecutor; } function attachWithNamespaces({ BaseClass, namespaces, executor }: AttachWithNamespacesConfig): any { const Commander = class extends BaseClass { constructor(...args: Array) { super(...args); for (const namespace of Object.keys(namespaces)) { this[namespace] = Object.create(this[namespace], { self: { value: this } }); } } }; for (const [namespace, commands] of Object.entries(namespaces)) { Commander.prototype[namespace] = {}; for (const [name, command] of Object.entries(commands)) { Commander.prototype[namespace][name] = function (...args: Array): unknown { return executor.call(this.self, command, args, name); }; } } return Commander; } export function transformCommandArguments( command: RedisCommand, args: Array ): { args: RedisCommandArguments; options: CommandOptions | undefined; } { let options; if (isCommandOptions(args[0])) { options = args[0]; args = args.slice(1); } return { args: command.transformArguments(...args), options }; } export function transformLegacyCommandArguments(args: Array): Array { return args.flat().map(arg => { return typeof arg === 'number' || arg instanceof Date ? arg.toString() : arg; }); } export function transformCommandReply( command: C, rawReply: unknown, preserved: unknown ): RedisCommandReply { if (!command.transformReply) { return rawReply as RedisCommandReply; } return command.transformReply(rawReply, preserved); } export function fCallArguments( name: RedisCommandArgument, fn: RedisFunction, args: RedisCommandArguments ): RedisCommandArguments { const actualArgs: RedisCommandArguments = [ fn.IS_READ_ONLY ? 'FCALL_RO' : 'FCALL', name ]; if (fn.NUMBER_OF_KEYS !== undefined) { actualArgs.push(fn.NUMBER_OF_KEYS.toString()); } actualArgs.push(...args); return actualArgs; } node-redis-redis-4.5.1/packages/client/lib/commands/000077500000000000000000000000001433774114400222715ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/commands/ACL_CAT.spec.ts000066400000000000000000000011361433774114400246610ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_CAT'; describe('ACL CAT', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['ACL', 'CAT'] ); }); it('with categoryName', () => { assert.deepEqual( transformArguments('dangerous'), ['ACL', 'CAT', 'dangerous'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_CAT.ts000066400000000000000000000005671433774114400237370ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(categoryName?: RedisCommandArgument): RedisCommandArguments { const args: RedisCommandArguments = ['ACL', 'CAT']; if (categoryName) { args.push(categoryName); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_DELUSER.spec.ts000066400000000000000000000015071433774114400253570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ACL_DELUSER'; describe('ACL DELUSER', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('username'), ['ACL', 'DELUSER', 'username'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['ACL', 'DELUSER', '1', '2'] ); }); }); testUtils.testWithClient('client.aclDelUser', async client => { assert.equal( await client.aclDelUser('dosenotexists'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_DELUSER.ts000066400000000000000000000005651433774114400244310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export function transformArguments( username: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['ACL', 'DELUSER'], username); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_DRYRUN.spec.ts000066400000000000000000000011711433774114400252740ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ACL_DRYRUN'; describe('ACL DRYRUN', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('default', ['GET', 'key']), ['ACL', 'DRYRUN', 'default', 'GET', 'key'] ); }); testUtils.testWithClient('client.aclDryRun', async client => { assert.equal( await client.aclDryRun('default', ['GET', 'key']), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_DRYRUN.ts000066400000000000000000000006171433774114400243470ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments( username: RedisCommandArgument, command: Array ): RedisCommandArguments { return [ 'ACL', 'DRYRUN', username, ...command ]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_GENPASS.spec.ts000066400000000000000000000011301433774114400253440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_GENPASS'; describe('ACL GENPASS', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['ACL', 'GENPASS'] ); }); it('with bits', () => { assert.deepEqual( transformArguments(128), ['ACL', 'GENPASS', '128'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_GENPASS.ts000066400000000000000000000005021433774114400244150ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(bits?: number): RedisCommandArguments { const args = ['ACL', 'GENPASS']; if (bits) { args.push(bits.toString()); } return args; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_GETUSER.spec.ts000066400000000000000000000026271433774114400253760ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ACL_GETUSER'; describe('ACL GETUSER', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments('username'), ['ACL', 'GETUSER', 'username'] ); }); testUtils.testWithClient('client.aclGetUser', async client => { const expectedReply: any = { passwords: [], commands: '+@all', }; if (testUtils.isVersionGreaterThan([7])) { expectedReply.flags = ['on', 'nopass']; expectedReply.keys = '~*'; expectedReply.channels = '&*'; expectedReply.selectors = []; } else { expectedReply.keys = ['*']; expectedReply.selectors = undefined; if (testUtils.isVersionGreaterThan([6, 2])) { expectedReply.flags = ['on', 'allkeys', 'allchannels', 'allcommands', 'nopass']; expectedReply.channels = ['*']; } else { expectedReply.flags = ['on', 'allkeys', 'allcommands', 'nopass']; expectedReply.channels = undefined; } } assert.deepEqual( await client.aclGetUser('default'), expectedReply ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_GETUSER.ts000066400000000000000000000021651433774114400244420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(username: RedisCommandArgument): RedisCommandArguments { return ['ACL', 'GETUSER', username]; } type AclGetUserRawReply = [ 'flags', Array, 'passwords', Array, 'commands', RedisCommandArgument, 'keys', Array | RedisCommandArgument, 'channels', Array | RedisCommandArgument, 'selectors' | undefined, Array> | undefined ]; interface AclUser { flags: Array; passwords: Array; commands: RedisCommandArgument; keys: Array | RedisCommandArgument; channels: Array | RedisCommandArgument; selectors?: Array>; } export function transformReply(reply: AclGetUserRawReply): AclUser { return { flags: reply[1], passwords: reply[3], commands: reply[5], keys: reply[7], channels: reply[9], selectors: reply[11] }; } node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LIST.spec.ts000066400000000000000000000005431433774114400250260ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_LIST'; describe('ACL LIST', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ACL', 'LIST'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LIST.ts000066400000000000000000000003461433774114400240760ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['ACL', 'LIST']; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LOAD.spec.ts000066400000000000000000000005431433774114400247720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_SAVE'; describe('ACL SAVE', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ACL', 'SAVE'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LOAD.ts000066400000000000000000000003371433774114400240420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['ACL', 'LOAD']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LOG.spec.ts000066400000000000000000000031771433774114400247020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments, transformReply } from './ACL_LOG'; describe('ACL LOG', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['ACL', 'LOG'] ); }); it('with count', () => { assert.deepEqual( transformArguments(10), ['ACL', 'LOG', '10'] ); }); }); it('transformReply', () => { assert.deepEqual( transformReply([[ 'count', 1, 'reason', 'auth', 'context', 'toplevel', 'object', 'AUTH', 'username', 'someuser', 'age-seconds', '4.096', 'client-info', 'id=6 addr=127.0.0.1:63026 fd=8 name= age=9 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=auth user=default' ]]), [{ count: 1, reason: 'auth', context: 'toplevel', object: 'AUTH', username: 'someuser', ageSeconds: 4.096, clientInfo: 'id=6 addr=127.0.0.1:63026 fd=8 name= age=9 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=auth user=default' }] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LOG.ts000066400000000000000000000023661433774114400237500ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(count?: number): RedisCommandArguments { const args = ['ACL', 'LOG']; if (count) { args.push(count.toString()); } return args; } type AclLogRawReply = [ _: RedisCommandArgument, count: number, _: RedisCommandArgument, reason: RedisCommandArgument, _: RedisCommandArgument, context: RedisCommandArgument, _: RedisCommandArgument, object: RedisCommandArgument, _: RedisCommandArgument, username: RedisCommandArgument, _: RedisCommandArgument, ageSeconds: RedisCommandArgument, _: RedisCommandArgument, clientInfo: RedisCommandArgument ]; interface AclLog { count: number; reason: RedisCommandArgument; context: RedisCommandArgument; object: RedisCommandArgument; username: RedisCommandArgument; ageSeconds: number; clientInfo: RedisCommandArgument; } export function transformReply(reply: Array): Array { return reply.map(log => ({ count: log[1], reason: log[3], context: log[5], object: log[7], username: log[9], ageSeconds: Number(log[11]), clientInfo: log[13] })); } node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LOG_RESET.spec.ts000066400000000000000000000005651433774114400256420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_LOG_RESET'; describe('ACL LOG RESET', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ACL', 'LOG', 'RESET'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_LOG_RESET.ts000066400000000000000000000003471433774114400247070ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['ACL', 'LOG', 'RESET']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_SAVE.spec.ts000066400000000000000000000005431433774114400250110ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_LOAD'; describe('ACL LOAD', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ACL', 'LOAD'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_SAVE.ts000066400000000000000000000003371433774114400240610ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['ACL', 'SAVE']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_SETUSER.spec.ts000066400000000000000000000013021433774114400253770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_SETUSER'; describe('ACL SETUSER', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('username', 'allkeys'), ['ACL', 'SETUSER', 'username', 'allkeys'] ); }); it('array', () => { assert.deepEqual( transformArguments('username', ['allkeys', 'allchannels']), ['ACL', 'SETUSER', 'username', 'allkeys', 'allchannels'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_SETUSER.ts000066400000000000000000000006511433774114400244540ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export function transformArguments( username: RedisCommandArgument, rule: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['ACL', 'SETUSER', username], rule); } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_USERS.spec.ts000066400000000000000000000005461433774114400251570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_USERS'; describe('ACL USERS', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ACL', 'USERS'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_USERS.ts000066400000000000000000000003471433774114400242250ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['ACL', 'USERS']; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ACL_WHOAMI.spec.ts000066400000000000000000000005511433774114400252360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './ACL_WHOAMI'; describe('ACL WHOAMI', () => { testUtils.isVersionGreaterThanHook([6]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ACL', 'WHOAMI'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ACL_WHOAMI.ts000066400000000000000000000003411433774114400243020ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['ACL', 'WHOAMI']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/APPEND.spec.ts000066400000000000000000000004431433774114400245420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './APPEND'; describe('APPEND', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'value'), ['APPEND', 'key', 'value'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/APPEND.ts000066400000000000000000000004731433774114400236140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, value: RedisCommandArgument ): RedisCommandArguments { return ['APPEND', key, value]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ASKING.spec.ts000066400000000000000000000004051433774114400245450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './ASKING'; describe('ASKING', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ASKING'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ASKING.ts000066400000000000000000000003321433774114400236130ustar00rootroot00000000000000import { RedisCommandArguments, RedisCommandArgument } from '.'; export function transformArguments(): RedisCommandArguments { return ['ASKING']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/AUTH.spec.ts000066400000000000000000000012561433774114400243370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './AUTH'; describe('AUTH', () => { describe('transformArguments', () => { it('password only', () => { assert.deepEqual( transformArguments({ password: 'password' }), ['AUTH', 'password'] ); }); it('username & password', () => { assert.deepEqual( transformArguments({ username: 'username', password: 'password' }), ['AUTH', 'username', 'password'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/AUTH.ts000066400000000000000000000006711433774114400234060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export interface AuthOptions { username?: RedisCommandArgument; password: RedisCommandArgument; } export function transformArguments({ username, password }: AuthOptions): RedisCommandArguments { if (!username) { return ['AUTH', password]; } return ['AUTH', username, password]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/BGREWRITEAOF.spec.ts000066400000000000000000000004271433774114400254550ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './BGREWRITEAOF'; describe('BGREWRITEAOF', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['BGREWRITEAOF'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/BGREWRITEAOF.ts000066400000000000000000000003401433774114400245160ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['BGREWRITEAOF']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/BGSAVE.spec.ts000066400000000000000000000011071433774114400245400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { describe } from 'mocha'; import { transformArguments } from './BGSAVE'; describe('BGSAVE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['BGSAVE'] ); }); it('with SCHEDULE', () => { assert.deepEqual( transformArguments({ SCHEDULE: true }), ['BGSAVE', 'SCHEDULE'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/BGSAVE.ts000066400000000000000000000005761433774114400236200ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; interface BgSaveOptions { SCHEDULE?: true; } export function transformArguments(options?: BgSaveOptions): RedisCommandArguments { const args = ['BGSAVE']; if (options?.SCHEDULE) { args.push('SCHEDULE'); } return args; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/BITCOUNT.spec.ts000066400000000000000000000023501433774114400250210ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BITCOUNT'; describe('BITCOUNT', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key'), ['BITCOUNT', 'key'] ); }); describe('with range', () => { it('simple', () => { assert.deepEqual( transformArguments('key', { start: 0, end: 1 }), ['BITCOUNT', 'key', '0', '1'] ); }); it('with mode', () => { assert.deepEqual( transformArguments('key', { start: 0, end: 1, mode: 'BIT' }), ['BITCOUNT', 'key', '0', '1', 'BIT'] ); }); }); }); testUtils.testWithClient('client.bitCount', async client => { assert.equal( await client.bitCount('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BITCOUNT.ts000066400000000000000000000012121433774114400240640ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface BitCountRange { start: number; end: number; mode?: 'BYTE' | 'BIT'; } export function transformArguments( key: RedisCommandArgument, range?: BitCountRange ): RedisCommandArguments { const args = ['BITCOUNT', key]; if (range) { args.push( range.start.toString(), range.end.toString() ); if (range.mode) { args.push(range.mode); } } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/BITFIELD.spec.ts000066400000000000000000000026101433774114400247530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BITFIELD'; describe('BITFIELD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', [{ operation: 'OVERFLOW', behavior: 'WRAP' }, { operation: 'GET', encoding: 'i8', offset: 0 }, { operation: 'OVERFLOW', behavior: 'SAT' }, { operation: 'SET', encoding: 'i16', offset: 1, value: 0 }, { operation: 'OVERFLOW', behavior: 'FAIL' }, { operation: 'INCRBY', encoding: 'i32', offset: 2, increment: 1 }]), ['BITFIELD', 'key', 'OVERFLOW', 'WRAP', 'GET', 'i8', '0', 'OVERFLOW', 'SAT', 'SET', 'i16', '1', '0', 'OVERFLOW', 'FAIL', 'INCRBY', 'i32', '2', '1'] ); }); testUtils.testWithClient('client.bitField', async client => { assert.deepEqual( await client.bitField('key', [{ operation: 'GET', encoding: 'i8', offset: 0 }]), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BITFIELD.ts000066400000000000000000000040151433774114400240230ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export type BitFieldEncoding = `${'i' | 'u'}${number}`; export interface BitFieldOperation { operation: S; } export interface BitFieldGetOperation extends BitFieldOperation<'GET'> { encoding: BitFieldEncoding; offset: number | string; } interface BitFieldSetOperation extends BitFieldOperation<'SET'> { encoding: BitFieldEncoding; offset: number | string; value: number; } interface BitFieldIncrByOperation extends BitFieldOperation<'INCRBY'> { encoding: BitFieldEncoding; offset: number | string; increment: number; } interface BitFieldOverflowOperation extends BitFieldOperation<'OVERFLOW'> { behavior: string; } type BitFieldOperations = Array< BitFieldGetOperation | BitFieldSetOperation | BitFieldIncrByOperation | BitFieldOverflowOperation >; export function transformArguments(key: string, operations: BitFieldOperations): Array { const args = ['BITFIELD', key]; for (const options of operations) { switch (options.operation) { case 'GET': args.push( 'GET', options.encoding, options.offset.toString() ); break; case 'SET': args.push( 'SET', options.encoding, options.offset.toString(), options.value.toString() ); break; case 'INCRBY': args.push( 'INCRBY', options.encoding, options.offset.toString(), options.increment.toString() ); break; case 'OVERFLOW': args.push( 'OVERFLOW', options.behavior ); break; } } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/BITFIELD_RO.spec.ts000066400000000000000000000013631433774114400253570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BITFIELD_RO'; describe('BITFIELD RO', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', [{ encoding: 'i8', offset: 0 }]), ['BITFIELD_RO', 'key', 'GET', 'i8', '0'] ); }); testUtils.testWithClient('client.bitFieldRo', async client => { assert.deepEqual( await client.bitFieldRo('key', [{ encoding: 'i8', offset: 0 }]), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BITFIELD_RO.ts000066400000000000000000000012151433774114400244220ustar00rootroot00000000000000import { BitFieldGetOperation } from './BITFIELD'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; type BitFieldRoOperations = Array< Omit & Partial> >; export function transformArguments(key: string, operations: BitFieldRoOperations): Array { const args = ['BITFIELD_RO', key]; for (const operation of operations) { args.push( 'GET', operation.encoding, operation.offset.toString() ); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/BITOP.spec.ts000066400000000000000000000020271433774114400244500ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BITOP'; describe('BITOP', () => { describe('transformArguments', () => { it('single key', () => { assert.deepEqual( transformArguments('AND', 'destKey', 'key'), ['BITOP', 'AND', 'destKey', 'key'] ); }); it('multiple keys', () => { assert.deepEqual( transformArguments('AND', 'destKey', ['1', '2']), ['BITOP', 'AND', 'destKey', '1', '2'] ); }); }); testUtils.testWithClient('client.bitOp', async client => { assert.equal( await client.bitOp('AND', 'destKey', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.bitOp', async cluster => { assert.equal( await cluster.bitOp('AND', '{tag}destKey', '{tag}key'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BITOP.ts000066400000000000000000000010161433774114400235140ustar00rootroot00000000000000import { 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: RedisCommandArgument, key: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['BITOP', operation, destKey], key); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/BITPOS.spec.ts000066400000000000000000000025501433774114400245740ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BITPOS'; describe('BITPOS', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 1), ['BITPOS', 'key', '1'] ); }); it('with start', () => { assert.deepEqual( transformArguments('key', 1, 1), ['BITPOS', 'key', '1', '1'] ); }); it('with start and end', () => { assert.deepEqual( transformArguments('key', 1, 1, -1), ['BITPOS', 'key', '1', '1', '-1'] ); }); it('with start, end and mode', () => { assert.deepEqual( transformArguments('key', 1, 1, -1, 'BIT'), ['BITPOS', 'key', '1', '1', '-1', 'BIT'] ); }); }); testUtils.testWithClient('client.bitPos', async client => { assert.equal( await client.bitPos('key', 1, 1), -1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.bitPos', async cluster => { assert.equal( await cluster.bitPos('key', 1, 1), -1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BITPOS.ts000066400000000000000000000012631433774114400236430ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { BitValue } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, bit: BitValue, start?: number, end?: number, mode?: 'BYTE' | 'BIT' ): RedisCommandArguments { const args = ['BITPOS', key, bit.toString()]; if (typeof start === 'number') { args.push(start.toString()); } if (typeof end === 'number') { args.push(end.toString()); } if (mode) { args.push(mode); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/BLMOVE.spec.ts000066400000000000000000000025141433774114400245600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BLMOVE'; import { commandOptions } from '../../index'; describe('BLMOVE', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('source', 'destination', 'LEFT', 'RIGHT', 0), ['BLMOVE', 'source', 'destination', 'LEFT', 'RIGHT', '0'] ); }); testUtils.testWithClient('client.blMove', async client => { const [blMoveReply] = await Promise.all([ client.blMove(commandOptions({ isolated: true }), 'source', 'destination', 'LEFT', 'RIGHT', 0), client.lPush('source', 'element') ]); assert.equal( blMoveReply, 'element' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.blMove', async cluster => { const [blMoveReply] = await Promise.all([ cluster.blMove(commandOptions({ isolated: true }), '{tag}source', '{tag}destination', 'LEFT', 'RIGHT', 0), cluster.lPush('{tag}source', 'element') ]); assert.equal( blMoveReply, 'element' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BLMOVE.ts000066400000000000000000000011361433774114400236260ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ListSide } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( source: RedisCommandArgument, destination: RedisCommandArgument, sourceDirection: ListSide, destinationDirection: ListSide, timeout: number ): RedisCommandArguments { return [ 'BLMOVE', source, destination, sourceDirection, destinationDirection, timeout.toString() ]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/BLMPOP.spec.ts000066400000000000000000000016331433774114400245660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BLMPOP'; describe('BLMPOP', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(0, 'key', 'LEFT'), ['BLMPOP', '0', '1', 'key', 'LEFT'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments(0, 'key', 'LEFT', { COUNT: 2 }), ['BLMPOP', '0', '1', 'key', 'LEFT', 'COUNT', '2'] ); }); }); testUtils.testWithClient('client.blmPop', async client => { assert.deepEqual( await client.blmPop(1, 'key', 'RIGHT'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BLMPOP.ts000066400000000000000000000010541433774114400236320ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformLMPopArguments, LMPopOptions, ListSide } from './generic-transformers'; export const FIRST_KEY_INDEX = 3; export function transformArguments( timeout: number, keys: RedisCommandArgument | Array, side: ListSide, options?: LMPopOptions ): RedisCommandArguments { return transformLMPopArguments( ['BLMPOP', timeout.toString()], keys, side, options ); } export { transformReply } from './LMPOP'; node-redis-redis-4.5.1/packages/client/lib/commands/BLPOP.spec.ts000066400000000000000000000040131433774114400244440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './BLPOP'; import { commandOptions } from '../../index'; describe('BLPOP', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments('key', 0), ['BLPOP', 'key', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments(['key1', 'key2'], 0), ['BLPOP', 'key1', 'key2', '0'] ); }); }); describe('transformReply', () => { it('null', () => { assert.equal( transformReply(null), null ); }); it('member', () => { assert.deepEqual( transformReply(['key', 'element']), { key: 'key', element: 'element' } ); }); }); testUtils.testWithClient('client.blPop', async client => { const [ blPopReply ] = await Promise.all([ client.blPop( commandOptions({ isolated: true }), 'key', 1 ), client.lPush('key', 'element'), ]); assert.deepEqual( blPopReply, { key: 'key', element: 'element' } ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.blPop', async cluster => { const [ blPopReply ] = await Promise.all([ cluster.blPop( commandOptions({ isolated: true }), 'key', 1 ), cluster.lPush('key', 'element') ]); assert.deepEqual( blPopReply, { key: 'key', element: 'element' } ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BLPOP.ts000066400000000000000000000014021433774114400235120ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( keys: RedisCommandArgument | Array, timeout: number ): RedisCommandArguments { const args = pushVerdictArguments(['BLPOP'], keys); args.push(timeout.toString()); return args; } type BLPopRawReply = null | [RedisCommandArgument, RedisCommandArgument]; type BLPopReply = null | { key: RedisCommandArgument; element: RedisCommandArgument; }; export function transformReply(reply: BLPopRawReply): BLPopReply { if (reply === null) return null; return { key: reply[0], element: reply[1] }; } node-redis-redis-4.5.1/packages/client/lib/commands/BRPOP.spec.ts000066400000000000000000000040141433774114400244530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './BRPOP'; import { commandOptions } from '../../index'; describe('BRPOP', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments('key', 0), ['BRPOP', 'key', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments(['key1', 'key2'], 0), ['BRPOP', 'key1', 'key2', '0'] ); }); }); describe('transformReply', () => { it('null', () => { assert.equal( transformReply(null), null ); }); it('member', () => { assert.deepEqual( transformReply(['key', 'element']), { key: 'key', element: 'element' } ); }); }); testUtils.testWithClient('client.brPop', async client => { const [ brPopReply ] = await Promise.all([ client.brPop( commandOptions({ isolated: true }), 'key', 1 ), client.lPush('key', 'element'), ]); assert.deepEqual( brPopReply, { key: 'key', element: 'element' } ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.brPop', async cluster => { const [ brPopReply ] = await Promise.all([ cluster.brPop( commandOptions({ isolated: true }), 'key', 1 ), cluster.lPush('key', 'element'), ]); assert.deepEqual( brPopReply, { key: 'key', element: 'element' } ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BRPOP.ts000066400000000000000000000007161433774114400235270ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument | Array, timeout: number ): RedisCommandArguments { const args = pushVerdictArguments(['BRPOP'], key); args.push(timeout.toString()); return args; } export { transformReply } from './BLPOP'; node-redis-redis-4.5.1/packages/client/lib/commands/BRPOPLPUSH.spec.ts000066400000000000000000000025171433774114400252750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BRPOPLPUSH'; import { commandOptions } from '../../index'; describe('BRPOPLPUSH', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('source', 'destination', 0), ['BRPOPLPUSH', 'source', 'destination', '0'] ); }); testUtils.testWithClient('client.brPopLPush', async client => { const [ popReply ] = await Promise.all([ client.brPopLPush( commandOptions({ isolated: true }), 'source', 'destination', 0 ), client.lPush('source', 'element') ]); assert.equal( popReply, 'element' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.brPopLPush', async cluster => { const [ popReply ] = await Promise.all([ cluster.brPopLPush( commandOptions({ isolated: true }), '{tag}source', '{tag}destination', 0 ), cluster.lPush('{tag}source', 'element') ]); assert.equal( popReply, 'element' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BRPOPLPUSH.ts000066400000000000000000000006171433774114400243430ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( source: RedisCommandArgument, destination: RedisCommandArgument, timeout: number ): RedisCommandArguments { return ['BRPOPLPUSH', source, destination, timeout.toString()]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/BZMPOP.spec.ts000066400000000000000000000016251433774114400246050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './BZMPOP'; describe('BZMPOP', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(0, 'key', 'MIN'), ['BZMPOP', '0', '1', 'key', 'MIN'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments(0, 'key', 'MIN', { COUNT: 2 }), ['BZMPOP', '0', '1', 'key', 'MIN', 'COUNT', '2'] ); }); }); testUtils.testWithClient('client.bzmPop', async client => { assert.deepEqual( await client.bzmPop(1, 'key', 'MAX'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BZMPOP.ts000066400000000000000000000010661433774114400236530ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { SortedSetSide, transformZMPopArguments, ZMPopOptions } from './generic-transformers'; export const FIRST_KEY_INDEX = 3; export function transformArguments( timeout: number, keys: RedisCommandArgument | Array, side: SortedSetSide, options?: ZMPopOptions ): RedisCommandArguments { return transformZMPopArguments( ['BZMPOP', timeout.toString()], keys, side, options ); } export { transformReply } from './ZMPOP'; node-redis-redis-4.5.1/packages/client/lib/commands/BZPOPMAX.spec.ts000066400000000000000000000032251433774114400250340ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './BZPOPMAX'; import { commandOptions } from '../../index'; describe('BZPOPMAX', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments('key', 0), ['BZPOPMAX', 'key', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments(['1', '2'], 0), ['BZPOPMAX', '1', '2', '0'] ); }); }); describe('transformReply', () => { it('null', () => { assert.equal( transformReply(null), null ); }); it('member', () => { assert.deepEqual( transformReply(['key', 'value', '1']), { key: 'key', value: 'value', score: 1 } ); }); }); testUtils.testWithClient('client.bzPopMax', async client => { const [ bzPopMaxReply ] = await Promise.all([ client.bzPopMax( commandOptions({ isolated: true }), 'key', 1 ), client.zAdd('key', [{ value: '1', score: 1 }]) ]); assert.deepEqual( bzPopMaxReply, { key: 'key', value: '1', score: 1 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BZPOPMAX.ts000066400000000000000000000015651433774114400241100ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments, transformNumberInfinityReply, ZMember } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument | Array, timeout: number ): RedisCommandArguments { const args = pushVerdictArguments(['BZPOPMAX'], key); args.push(timeout.toString()); return args; } type ZMemberRawReply = [key: RedisCommandArgument, value: RedisCommandArgument, score: RedisCommandArgument] | null; type BZPopMaxReply = (ZMember & { key: RedisCommandArgument }) | null; export function transformReply(reply: ZMemberRawReply): BZPopMaxReply | null { if (!reply) return null; return { key: reply[0], value: reply[1], score: transformNumberInfinityReply(reply[2]) }; } node-redis-redis-4.5.1/packages/client/lib/commands/BZPOPMIN.spec.ts000066400000000000000000000032251433774114400250320ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './BZPOPMIN'; import { commandOptions } from '../../index'; describe('BZPOPMIN', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments('key', 0), ['BZPOPMIN', 'key', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments(['1', '2'], 0), ['BZPOPMIN', '1', '2', '0'] ); }); }); describe('transformReply', () => { it('null', () => { assert.equal( transformReply(null), null ); }); it('member', () => { assert.deepEqual( transformReply(['key', 'value', '1']), { key: 'key', value: 'value', score: 1 } ); }); }); testUtils.testWithClient('client.bzPopMin', async client => { const [ bzPopMinReply ] = await Promise.all([ client.bzPopMin( commandOptions({ isolated: true }), 'key', 1 ), client.zAdd('key', [{ value: '1', score: 1 }]) ]); assert.deepEqual( bzPopMinReply, { key: 'key', value: '1', score: 1 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/BZPOPMIN.ts000066400000000000000000000007241433774114400241020ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument | Array, timeout: number ): RedisCommandArguments { const args = pushVerdictArguments(['BZPOPMIN'], key); args.push(timeout.toString()); return args; } export { transformReply } from './BZPOPMAX'; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_CACHING.spec.ts000066400000000000000000000010251433774114400256620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLIENT_CACHING'; describe('CLIENT CACHING', () => { describe('transformArguments', () => { it('true', () => { assert.deepEqual( transformArguments(true), ['CLIENT', 'CACHING', 'YES'] ); }); it('false', () => { assert.deepEqual( transformArguments(false), ['CLIENT', 'CACHING', 'NO'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_CACHING.ts000066400000000000000000000004121433774114400247300ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(value: boolean): RedisCommandArguments { return [ 'CLIENT', 'CACHING', value ? 'YES' : 'NO' ]; } export declare function transformReply(): 'OK' | Buffer; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_GETNAME.spec.ts000066400000000000000000000004401433774114400257060ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLIENT_GETNAME'; describe('CLIENT GETNAME', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLIENT', 'GETNAME'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_GETNAME.ts000066400000000000000000000003101433774114400247510ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['CLIENT', 'GETNAME']; } export declare function transformReply(): string | null; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_GETREDIR.spec.ts000066400000000000000000000004431433774114400260360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLIENT_GETREDIR'; describe('CLIENT GETREDIR', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLIENT', 'GETREDIR'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_GETREDIR.ts000066400000000000000000000003021433774114400250770ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['CLIENT', 'GETREDIR']; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_ID.spec.ts000066400000000000000000000010101433774114400251140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLIENT_ID'; describe('CLIENT ID', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLIENT', 'ID'] ); }); testUtils.testWithClient('client.clientId', async client => { assert.equal( typeof (await client.clientId()), 'number' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_ID.ts000066400000000000000000000002531433774114400241730ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(): Array { return ['CLIENT', 'ID']; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_INFO.spec.ts000066400000000000000000000024371433774114400253710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments, transformReply } from './CLIENT_INFO'; describe('CLIENT INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLIENT', 'INFO'] ); }); it('transformReply', () => { assert.deepEqual( transformReply('id=526512 addr=127.0.0.1:36244 laddr=127.0.0.1:6379 fd=8 name= age=11213 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=40928 argv-mem=10 obl=0 oll=0 omem=0 tot-mem=61466 events=r cmd=client user=default redir=-1\n'), { id: 526512, addr: '127.0.0.1:36244', laddr: '127.0.0.1:6379', fd: 8, name: '', age: 11213, idle: 0, flags: 'N', db: 0, sub: 0, psub: 0, multi: -1, qbuf: 26, qbufFree: 40928, argvMem: 10, obl: 0, oll: 0, omem: 0, totMem: 61466, events: 'r', cmd: 'client', user: 'default', redir: -1 } ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_INFO.ts000066400000000000000000000032051433774114400244320ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLIENT', 'INFO']; } interface ClientInfoReply { id: number; addr: string; laddr: string; fd: number; name: string; age: number; idle: number; flags: string; db: number; sub: number; psub: number; multi: number; qbuf: number; qbufFree: number; argvMem: number; obl: number; oll: number; omem: number; totMem: number; events: string; cmd: string; user: string; redir: number; } const REGEX = /=([^\s]*)/g; export function transformReply(reply: string): ClientInfoReply { const [ [, id], [, addr], [, laddr], [, fd], [, name], [, age], [, idle], [, flags], [, db], [, sub], [, psub], [, multi], [, qbuf], [, qbufFree], [, argvMem], [, obl], [, oll], [, omem], [, totMem], [, events], [, cmd], [, user], [, redir] ] = [...reply.matchAll(REGEX)]; return { id: Number(id), addr, laddr, fd: Number(fd), name, age: Number(age), idle: Number(idle), flags, db: Number(db), sub: Number(sub), psub: Number(psub), multi: Number(multi), qbuf: Number(qbuf), qbufFree: Number(qbufFree), argvMem: Number(argvMem), obl: Number(obl), oll: Number(oll), omem: Number(omem), totMem: Number(totMem), events, cmd, user, redir: Number(redir) }; } node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_KILL.spec.ts000066400000000000000000000064161433774114400253720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { ClientKillFilters, transformArguments } from './CLIENT_KILL'; describe('CLIENT KILL', () => { describe('transformArguments', () => { it('ADDRESS', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.ADDRESS, address: 'ip:6379' }), ['CLIENT', 'KILL', 'ADDR', 'ip:6379'] ); }); it('LOCAL_ADDRESS', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.LOCAL_ADDRESS, localAddress: 'ip:6379' }), ['CLIENT', 'KILL', 'LADDR', 'ip:6379'] ); }); describe('ID', () => { it('string', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.ID, id: '1' }), ['CLIENT', 'KILL', 'ID', '1'] ); }); it('number', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.ID, id: 1 }), ['CLIENT', 'KILL', 'ID', '1'] ); }); }); it('TYPE', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.TYPE, type: 'master' }), ['CLIENT', 'KILL', 'TYPE', 'master'] ); }); it('USER', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.USER, username: 'username' }), ['CLIENT', 'KILL', 'USER', 'username'] ); }); describe('SKIP_ME', () => { it('undefined', () => { assert.deepEqual( transformArguments(ClientKillFilters.SKIP_ME), ['CLIENT', 'KILL', 'SKIPME'] ); }); it('true', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.SKIP_ME, skipMe: true }), ['CLIENT', 'KILL', 'SKIPME', 'yes'] ); }); it('false', () => { assert.deepEqual( transformArguments({ filter: ClientKillFilters.SKIP_ME, skipMe: false }), ['CLIENT', 'KILL', 'SKIPME', 'no'] ); }); }); it('TYPE & SKIP_ME', () => { assert.deepEqual( transformArguments([ { filter: ClientKillFilters.TYPE, type: 'master' }, ClientKillFilters.SKIP_ME ]), ['CLIENT', 'KILL', 'TYPE', 'master', 'SKIPME'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_KILL.ts000066400000000000000000000045271433774114400244420ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export enum ClientKillFilters { ADDRESS = 'ADDR', LOCAL_ADDRESS = 'LADDR', ID = 'ID', TYPE = 'TYPE', USER = 'USER', SKIP_ME = 'SKIPME' } interface KillFilter { filter: T; } interface KillAddress extends KillFilter { address: `${string}:${number}`; } interface KillLocalAddress extends KillFilter { localAddress: `${string}:${number}`; } interface KillId extends KillFilter { id: number | `${number}`; } interface KillType extends KillFilter { type: 'normal' | 'master' | 'replica' | 'pubsub'; } interface KillUser extends KillFilter { username: string; } type KillSkipMe = ClientKillFilters.SKIP_ME | (KillFilter & { skipMe: boolean; }); type KillFilters = KillAddress | KillLocalAddress | KillId | KillType | KillUser | KillSkipMe; export function transformArguments(filters: KillFilters | Array): RedisCommandArguments { const args = ['CLIENT', 'KILL']; if (Array.isArray(filters)) { for (const filter of filters) { pushFilter(args, filter); } } else { pushFilter(args, filters); } return args; } function pushFilter(args: RedisCommandArguments, filter: KillFilters): void { if (filter === ClientKillFilters.SKIP_ME) { args.push('SKIPME'); return; } args.push(filter.filter); switch(filter.filter) { case ClientKillFilters.ADDRESS: args.push(filter.address); break; case ClientKillFilters.LOCAL_ADDRESS: args.push(filter.localAddress); break; case ClientKillFilters.ID: args.push( typeof filter.id === 'number' ? filter.id.toString() : filter.id ); break; case ClientKillFilters.TYPE: args.push(filter.type); break; case ClientKillFilters.USER: args.push(filter.username); break; case ClientKillFilters.SKIP_ME: args.push(filter.skipMe ? 'yes' : 'no'); break; } } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_NO-EVICT.spec.ts000066400000000000000000000014771433774114400260250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLIENT_NO-EVICT'; describe('CLIENT NO-EVICT', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('true', () => { assert.deepEqual( transformArguments(true), ['CLIENT', 'NO-EVICT', 'ON'] ); }); it('false', () => { assert.deepEqual( transformArguments(false), ['CLIENT', 'NO-EVICT', 'OFF'] ); }); }); testUtils.testWithClient('client.clientNoEvict', async client => { assert.equal( await client.clientNoEvict(true), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_NO-EVICT.ts000066400000000000000000000004131433774114400250610ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(value: boolean): RedisCommandArguments { return [ 'CLIENT', 'NO-EVICT', value ? 'ON' : 'OFF' ]; } export declare function transformReply(): 'OK' | Buffer; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_PAUSE.spec.ts000066400000000000000000000014101433774114400255010ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLIENT_PAUSE'; describe('CLIENT PAUSE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(0), ['CLIENT', 'PAUSE', '0'] ); }); it('with mode', () => { assert.deepEqual( transformArguments(0, 'ALL'), ['CLIENT', 'PAUSE', '0', 'ALL'] ); }); }); testUtils.testWithClient('client.clientPause', async client => { assert.equal( await client.clientPause(0), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_PAUSE.ts000066400000000000000000000005611433774114400245560ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments( timeout: number, mode?: 'WRITE' | 'ALL' ): RedisCommandArguments { const args = [ 'CLIENT', 'PAUSE', timeout.toString() ]; if (mode) { args.push(mode); } return args; } export declare function transformReply(): 'OK' | Buffer; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_SETNAME.spec.ts000066400000000000000000000004561433774114400257310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLIENT_SETNAME'; describe('CLIENT SETNAME', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('name'), ['CLIENT', 'SETNAME', 'name'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_SETNAME.ts000066400000000000000000000004051433774114400247720ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(name: RedisCommandArgument): RedisCommandArguments { return ['CLIENT', 'SETNAME', name]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_TRACKING.spec.ts000066400000000000000000000062641433774114400260420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLIENT_TRACKING'; describe('CLIENT TRACKING', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { describe('true', () => { it('simple', () => { assert.deepEqual( transformArguments(true), ['CLIENT', 'TRACKING', 'ON'] ); }); it('with REDIRECT', () => { assert.deepEqual( transformArguments(true, { REDIRECT: 1 }), ['CLIENT', 'TRACKING', 'ON', 'REDIRECT', '1'] ); }); describe('with BCAST', () => { it('simple', () => { assert.deepEqual( transformArguments(true, { BCAST: true }), ['CLIENT', 'TRACKING', 'ON', 'BCAST'] ); }); describe('with PREFIX', () => { it('string', () => { assert.deepEqual( transformArguments(true, { BCAST: true, PREFIX: 'prefix' }), ['CLIENT', 'TRACKING', 'ON', 'BCAST', 'PREFIX', 'prefix'] ); }); it('array', () => { assert.deepEqual( transformArguments(true, { BCAST: true, PREFIX: ['1', '2'] }), ['CLIENT', 'TRACKING', 'ON', 'BCAST', 'PREFIX', '1', 'PREFIX', '2'] ); }); }); }); it('with OPTIN', () => { assert.deepEqual( transformArguments(true, { OPTIN: true }), ['CLIENT', 'TRACKING', 'ON', 'OPTIN'] ); }); it('with OPTOUT', () => { assert.deepEqual( transformArguments(true, { OPTOUT: true }), ['CLIENT', 'TRACKING', 'ON', 'OPTOUT'] ); }); it('with NOLOOP', () => { assert.deepEqual( transformArguments(true, { NOLOOP: true }), ['CLIENT', 'TRACKING', 'ON', 'NOLOOP'] ); }); }); it('false', () => { assert.deepEqual( transformArguments(false), ['CLIENT', 'TRACKING', 'OFF'] ); }); }); testUtils.testWithClient('client.clientTracking', async client => { assert.equal( await client.clientTracking(false), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_TRACKING.ts000066400000000000000000000040031433774114400250760ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; interface CommonOptions { REDIRECT?: number; NOLOOP?: boolean; } interface BroadcastOptions { BCAST?: boolean; PREFIX?: RedisCommandArgument | Array; } interface OptInOptions { OPTIN?: boolean; } interface OptOutOptions { OPTOUT?: boolean; } type ClientTrackingOptions = CommonOptions & ( BroadcastOptions | OptInOptions | OptOutOptions ); export function transformArguments( mode: M, options?: M extends true ? ClientTrackingOptions : undefined ): RedisCommandArguments { const args: RedisCommandArguments = [ 'CLIENT', 'TRACKING', mode ? 'ON' : 'OFF' ]; if (mode) { if (options?.REDIRECT) { args.push( 'REDIRECT', options.REDIRECT.toString() ); } if (isBroadcast(options)) { args.push('BCAST'); if (options?.PREFIX) { if (Array.isArray(options.PREFIX)) { for (const prefix of options.PREFIX) { args.push('PREFIX', prefix); } } else { args.push('PREFIX', options.PREFIX); } } } else if (isOptIn(options)) { args.push('OPTIN'); } else if (isOptOut(options)) { args.push('OPTOUT'); } if (options?.NOLOOP) { args.push('NOLOOP'); } } return args; } function isBroadcast(options?: ClientTrackingOptions): options is BroadcastOptions { return (options as BroadcastOptions)?.BCAST === true; } function isOptIn(options?: ClientTrackingOptions): options is OptInOptions { return (options as OptInOptions)?.OPTIN === true; } function isOptOut(options?: ClientTrackingOptions): options is OptOutOptions { return (options as OptOutOptions)?.OPTOUT === true; } export declare function transformReply(): 'OK' | Buffer; node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_TRACKINGINFO.spec.ts000066400000000000000000000013211433774114400265030ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLIENT_TRACKINGINFO'; describe('CLIENT TRACKINGINFO', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLIENT', 'TRACKINGINFO'] ); }); testUtils.testWithClient('client.clientTrackingInfo', async client => { assert.deepEqual( await client.clientTrackingInfo(), { flags: new Set(['off']), redirect: -1, prefixes: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_TRACKINGINFO.ts000066400000000000000000000010201433774114400255460ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['CLIENT', 'TRACKINGINFO']; } type RawReply = [ 'flags', Array, 'redirect', number, 'prefixes', Array ]; interface Reply { flags: Set; redirect: number; prefixes: Array; } export function transformReply(reply: RawReply): Reply { return { flags: new Set(reply[1]), redirect: reply[3], prefixes: reply[5] }; } node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_UNPAUSE.spec.ts000066400000000000000000000010771433774114400257550ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLIENT_UNPAUSE'; describe('CLIENT UNPAUSE', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLIENT', 'UNPAUSE'] ); }); testUtils.testWithClient('client.unpause', async client => { assert.equal( await client.clientUnpause(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLIENT_UNPAUSE.ts000066400000000000000000000003101433774114400250110ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['CLIENT', 'UNPAUSE']; } export declare function transformReply(): 'OK' | Buffer; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_ADDSLOTS.spec.ts000066400000000000000000000010421433774114400262050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_ADDSLOTS'; describe('CLUSTER ADDSLOTS', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments(0), ['CLUSTER', 'ADDSLOTS', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments([0, 1]), ['CLUSTER', 'ADDSLOTS', '0', '1'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_ADDSLOTS.ts000066400000000000000000000005361433774114400252630ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushVerdictNumberArguments } from './generic-transformers'; export function transformArguments(slots: number | Array): RedisCommandArguments { return pushVerdictNumberArguments( ['CLUSTER', 'ADDSLOTS'], slots ); } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_ADDSLOTSRANGE.spec.ts000066400000000000000000000014461433774114400267720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_ADDSLOTSRANGE'; describe('CLUSTER ADDSLOTSRANGE', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments({ start: 0, end: 1 }), ['CLUSTER', 'ADDSLOTSRANGE', '0', '1'] ); }); it('multiple', () => { assert.deepEqual( transformArguments([{ start: 0, end: 1 }, { start: 2, end: 3 }]), ['CLUSTER', 'ADDSLOTSRANGE', '0', '1', '2', '3'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_ADDSLOTSRANGE.ts000066400000000000000000000005641433774114400260410ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushSlotRangesArguments, SlotRange } from './generic-transformers'; export function transformArguments( ranges: SlotRange | Array ): RedisCommandArguments { return pushSlotRangesArguments( ['CLUSTER', 'ADDSLOTSRANGE'], ranges ); } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_BUMPEPOCH.spec.ts000066400000000000000000000011161433774114400263140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_BUMPEPOCH'; describe('CLUSTER BUMPEPOCH', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'BUMPEPOCH'] ); }); testUtils.testWithCluster('clusterNode.clusterBumpEpoch', async cluster => { assert.equal( typeof await cluster.getSlotMaster(0).client.clusterBumpEpoch(), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_BUMPEPOCH.ts000066400000000000000000000002341433774114400253630ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'BUMPEPOCH']; } export declare function transformReply(): 'BUMPED' | 'STILL'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_COUNT-FAILURE-REPORTS.spec.ts000066400000000000000000000013431433774114400301050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_COUNT-FAILURE-REPORTS'; describe('CLUSTER COUNT-FAILURE-REPORTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('0'), ['CLUSTER', 'COUNT-FAILURE-REPORTS', '0'] ); }); testUtils.testWithCluster('clusterNode.clusterCountFailureReports', async cluster => { const { client } = cluster.getSlotMaster(0); assert.equal( typeof await client.clusterCountFailureReports( await client.clusterMyId() ), 'number' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_COUNT-FAILURE-REPORTS.ts000066400000000000000000000002621433774114400271530ustar00rootroot00000000000000export function transformArguments(nodeId: string): Array { return ['CLUSTER', 'COUNT-FAILURE-REPORTS', nodeId]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_COUNTKEYSINSLOT.spec.ts000066400000000000000000000011641433774114400273120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_COUNTKEYSINSLOT'; describe('CLUSTER COUNTKEYSINSLOT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(0), ['CLUSTER', 'COUNTKEYSINSLOT', '0'] ); }); testUtils.testWithCluster('clusterNode.clusterCountKeysInSlot', async cluster => { assert.equal( typeof await cluster.getSlotMaster(0).client.clusterCountKeysInSlot(0), 'number' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_COUNTKEYSINSLOT.ts000066400000000000000000000002631433774114400263600ustar00rootroot00000000000000export function transformArguments(slot: number): Array { return ['CLUSTER', 'COUNTKEYSINSLOT', slot.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_DELSLOTS.spec.ts000066400000000000000000000010421433774114400262210ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_DELSLOTS'; describe('CLUSTER DELSLOTS', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments(0), ['CLUSTER', 'DELSLOTS', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments([0, 1]), ['CLUSTER', 'DELSLOTS', '0', '1'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_DELSLOTS.ts000066400000000000000000000005341433774114400252750ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushVerdictNumberArguments } from './generic-transformers'; export function transformArguments(slots: number | Array): RedisCommandArguments { return pushVerdictNumberArguments( ['CLUSTER', 'DELSLOTS'], slots ); } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_DELSLOTSRANGE.spec.ts000066400000000000000000000014461433774114400270060ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_DELSLOTSRANGE'; describe('CLUSTER DELSLOTSRANGE', () => { describe('transformArguments', () => { it('single', () => { assert.deepEqual( transformArguments({ start: 0, end: 1 }), ['CLUSTER', 'DELSLOTSRANGE', '0', '1'] ); }); it('multiple', () => { assert.deepEqual( transformArguments([{ start: 0, end: 1 }, { start: 2, end: 3 }]), ['CLUSTER', 'DELSLOTSRANGE', '0', '1', '2', '3'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_DELSLOTSRANGE.ts000066400000000000000000000005641433774114400260550ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushSlotRangesArguments, SlotRange } from './generic-transformers'; export function transformArguments( ranges: SlotRange | Array ): RedisCommandArguments { return pushSlotRangesArguments( ['CLUSTER', 'DELSLOTSRANGE'], ranges ); } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_FAILOVER.spec.ts000066400000000000000000000011001433774114400261720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { FailoverModes, transformArguments } from './CLUSTER_FAILOVER'; describe('CLUSTER FAILOVER', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'FAILOVER'] ); }); it('with mode', () => { assert.deepEqual( transformArguments(FailoverModes.FORCE), ['CLUSTER', 'FAILOVER', 'FORCE'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_FAILOVER.ts000066400000000000000000000004671433774114400252600ustar00rootroot00000000000000export enum FailoverModes { FORCE = 'FORCE', TAKEOVER = 'TAKEOVER' } export function transformArguments(mode?: FailoverModes): Array { const args = ['CLUSTER', 'FAILOVER']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_FLUSHSLOTS.spec.ts000066400000000000000000000004541433774114400265040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_FLUSHSLOTS'; describe('CLUSTER FLUSHSLOTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'FLUSHSLOTS'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_FLUSHSLOTS.ts000066400000000000000000000002171433774114400255500ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'FLUSHSLOTS']; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_FORGET.spec.ts000066400000000000000000000004501433774114400257600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_FORGET'; describe('CLUSTER FORGET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('0'), ['CLUSTER', 'FORGET', '0'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_FORGET.ts000066400000000000000000000002421433774114400250260ustar00rootroot00000000000000export function transformArguments(nodeId: string): Array { return ['CLUSTER', 'FORGET', nodeId]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_GETKEYSINSLOT.spec.ts000066400000000000000000000013141433774114400270360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_GETKEYSINSLOT'; describe('CLUSTER GETKEYSINSLOT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(0, 10), ['CLUSTER', 'GETKEYSINSLOT', '0', '10'] ); }); testUtils.testWithCluster('clusterNode.clusterGetKeysInSlot', async cluster => { const reply = await cluster.getSlotMaster(0).client.clusterGetKeysInSlot(0, 1); assert.ok(Array.isArray(reply)); for (const item of reply) { assert.equal(typeof item, 'string'); } }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_GETKEYSINSLOT.ts000066400000000000000000000003311433774114400261030ustar00rootroot00000000000000export function transformArguments(slot: number, count: number): Array { return ['CLUSTER', 'GETKEYSINSLOT', slot.toString(), count.toString()]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_INFO.spec.ts000066400000000000000000000031771433774114400255360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './CLUSTER_INFO'; describe('CLUSTER INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'INFO'] ); }); it('transformReply', () => { assert.deepEqual( transformReply([ 'cluster_state:ok', 'cluster_slots_assigned:16384', 'cluster_slots_ok:16384', 'cluster_slots_pfail:0', 'cluster_slots_fail:0', 'cluster_known_nodes:6', 'cluster_size:3', 'cluster_current_epoch:6', 'cluster_my_epoch:2', 'cluster_stats_messages_sent:1483972', 'cluster_stats_messages_received:1483968' ].join('\r\n')), { state: 'ok', slots: { assigned: 16384, ok: 16384, pfail: 0, fail: 0 }, knownNodes: 6, size: 3, currentEpoch: 6, myEpoch: 2, stats: { messagesSent: 1483972, messagesReceived: 1483968 } } ); }); testUtils.testWithCluster('clusterNode.clusterInfo', async cluster => { assert.notEqual( await cluster.getSlotMaster(0).client.clusterInfo(), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_INFO.ts000066400000000000000000000024531433774114400246010ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'INFO']; } interface ClusterInfoReply { state: string; slots: { assigned: number; ok: number; pfail: number; fail: number; }; knownNodes: number; size: number; currentEpoch: number; myEpoch: number; stats: { messagesSent: number; messagesReceived: number; }; } export function transformReply(reply: string): ClusterInfoReply { const lines = reply.split('\r\n'); return { state: extractLineValue(lines[0]), slots: { assigned: Number(extractLineValue(lines[1])), ok: Number(extractLineValue(lines[2])), pfail: Number(extractLineValue(lines[3])), fail: Number(extractLineValue(lines[4])) }, knownNodes: Number(extractLineValue(lines[5])), size: Number(extractLineValue(lines[6])), currentEpoch: Number(extractLineValue(lines[7])), myEpoch: Number(extractLineValue(lines[8])), stats: { messagesSent: Number(extractLineValue(lines[9])), messagesReceived: Number(extractLineValue(lines[10])) } }; } export function extractLineValue(line: string): string { return line.substring(line.indexOf(':') + 1); } node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_KEYSLOT.spec.ts000066400000000000000000000011261433774114400261250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_KEYSLOT'; describe('CLUSTER KEYSLOT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['CLUSTER', 'KEYSLOT', 'key'] ); }); testUtils.testWithCluster('clusterNode.clusterKeySlot', async cluster => { assert.equal( typeof await cluster.getSlotMaster(0).client.clusterKeySlot('key'), 'number' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_KEYSLOT.ts000066400000000000000000000002361433774114400251750ustar00rootroot00000000000000export function transformArguments(key: string): Array { return ['CLUSTER', 'KEYSLOT', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_LINKS.spec.ts000066400000000000000000000017671433774114400256660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_LINKS'; describe('CLUSTER LINKS', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'LINKS'] ); }); testUtils.testWithCluster('clusterNode.clusterLinks', async cluster => { const links = await cluster.getSlotMaster(0).client.clusterLinks(); assert.ok(Array.isArray(links)); for (const link of links) { assert.equal(typeof link.direction, 'string'); assert.equal(typeof link.node, 'string'); assert.equal(typeof link.createTime, 'number'); assert.equal(typeof link.events, 'string'); assert.equal(typeof link.sendBufferAllocated, 'number'); assert.equal(typeof link.sendBufferUsed, 'number'); } }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_LINKS.ts000066400000000000000000000015241433774114400247240ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'LINKS']; } type ClusterLinksRawReply = Array<[ 'direction', string, 'node', string, 'createTime', number, 'events', string, 'send-buffer-allocated', number, 'send-buffer-used', number ]>; type ClusterLinksReply = Array<{ direction: string; node: string; createTime: number; events: string; sendBufferAllocated: number; sendBufferUsed: number; }>; export function transformReply(reply: ClusterLinksRawReply): ClusterLinksReply { return reply.map(peerLink => ({ direction: peerLink[1], node: peerLink[3], createTime: Number(peerLink[5]), events: peerLink[7], sendBufferAllocated: Number(peerLink[9]), sendBufferUsed: Number(peerLink[11]) })); } node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_MEET.spec.ts000066400000000000000000000005001433774114400255200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_MEET'; describe('CLUSTER MEET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379), ['CLUSTER', 'MEET', '127.0.0.1', '6379'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_MEET.ts000066400000000000000000000002661433774114400246000ustar00rootroot00000000000000export function transformArguments(ip: string, port: number): Array { return ['CLUSTER', 'MEET', ip, port.toString()]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_MYID.spec.ts000066400000000000000000000010661433774114400255400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_MYID'; describe('CLUSTER MYID', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'MYID'] ); }); testUtils.testWithCluster('clusterNode.clusterMyId', async cluster => { assert.equal( typeof await cluster.getSlotMaster(0).client.clusterMyId(), 'string' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_MYID.ts000066400000000000000000000002141433774114400246010ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'MYID']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_NODES.spec.ts000066400000000000000000000116441433774114400256510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { RedisClusterNodeLinkStates, transformArguments, transformReply } from './CLUSTER_NODES'; describe('CLUSTER NODES', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'NODES'] ); }); describe('transformReply', () => { it('simple', () => { assert.deepEqual( transformReply([ 'master 127.0.0.1:30001@31001 myself,master - 0 0 1 connected 0-16384', 'slave 127.0.0.1:30002@31002 slave master 0 0 1 connected', '' ].join('\n')), [{ id: 'master', address: '127.0.0.1:30001@31001', host: '127.0.0.1', port: 30001, cport: 31001, flags: ['myself', 'master'], pingSent: 0, pongRecv: 0, configEpoch: 1, linkState: RedisClusterNodeLinkStates.CONNECTED, slots: [{ from: 0, to: 16384 }], replicas: [{ id: 'slave', address: '127.0.0.1:30002@31002', host: '127.0.0.1', port: 30002, cport: 31002, flags: ['slave'], pingSent: 0, pongRecv: 0, configEpoch: 1, linkState: RedisClusterNodeLinkStates.CONNECTED }] }] ); }); it('should support addresses without cport', () => { assert.deepEqual( transformReply( 'id 127.0.0.1:30001 master - 0 0 0 connected 0-16384\n' ), [{ id: 'id', address: '127.0.0.1:30001', host: '127.0.0.1', port: 30001, cport: null, flags: ['master'], pingSent: 0, pongRecv: 0, configEpoch: 0, linkState: RedisClusterNodeLinkStates.CONNECTED, slots: [{ from: 0, to: 16384 }], replicas: [] }] ); }); it('should support ipv6 addresses', () => { assert.deepEqual( transformReply( 'id 2a02:6b8:c21:330d:0:1589:ebbe:b1a0:6379@16379 master - 0 0 0 connected 0-549\n' ), [{ id: 'id', address: '2a02:6b8:c21:330d:0:1589:ebbe:b1a0:6379@16379', host: '2a02:6b8:c21:330d:0:1589:ebbe:b1a0', port: 6379, cport: 16379, flags: ['master'], pingSent: 0, pongRecv: 0, configEpoch: 0, linkState: RedisClusterNodeLinkStates.CONNECTED, slots: [{ from: 0, to: 549 }], replicas: [] }] ); }); it.skip('with importing slots', () => { assert.deepEqual( transformReply( 'id 127.0.0.1:30001@31001 master - 0 0 0 connected 0-<-16384\n' ), [{ id: 'id', address: '127.0.0.1:30001@31001', host: '127.0.0.1', port: 30001, cport: 31001, flags: ['master'], pingSent: 0, pongRecv: 0, configEpoch: 0, linkState: RedisClusterNodeLinkStates.CONNECTED, slots: [], // TODO replicas: [] }] ); }); it.skip('with migrating slots', () => { assert.deepEqual( transformReply( 'id 127.0.0.1:30001@31001 master - 0 0 0 connected 0->-16384\n' ), [{ id: 'id', address: '127.0.0.1:30001@31001', host: '127.0.0.1', port: 30001, cport: 31001, flags: ['master'], pingSent: 0, pongRecv: 0, configEpoch: 0, linkState: RedisClusterNodeLinkStates.CONNECTED, slots: [], // TODO replicas: [] }] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_NODES.ts000066400000000000000000000061731433774114400247210ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'NODES']; } export enum RedisClusterNodeLinkStates { CONNECTED = 'connected', DISCONNECTED = 'disconnected' } interface RedisClusterNodeAddress { host: string; port: number; cport: number | null; } export interface RedisClusterReplicaNode extends RedisClusterNodeAddress { id: string; address: string; flags: Array; pingSent: number; pongRecv: number; configEpoch: number; linkState: RedisClusterNodeLinkStates; } export interface RedisClusterMasterNode extends RedisClusterReplicaNode { slots: Array<{ from: number; to: number; }>; replicas: Array; } export function transformReply(reply: string): Array { const lines = reply.split('\n'); lines.pop(); // last line is empty const mastersMap = new Map(), replicasMap = new Map>(); for (const line of lines) { const [id, address, flags, masterId, pingSent, pongRecv, configEpoch, linkState, ...slots] = line.split(' '), node = { id, address, ...transformNodeAddress(address), flags: flags.split(','), pingSent: Number(pingSent), pongRecv: Number(pongRecv), configEpoch: Number(configEpoch), linkState: (linkState as RedisClusterNodeLinkStates) }; if (masterId === '-') { let replicas = replicasMap.get(id); if (!replicas) { replicas = []; replicasMap.set(id, replicas); } mastersMap.set(id, { ...node, slots: slots.map(slot => { // TODO: importing & exporting (https://redis.io/commands/cluster-nodes#special-slot-entries) const [fromString, toString] = slot.split('-', 2), from = Number(fromString); return { from, to: toString ? Number(toString) : from }; }), replicas }); } else { const replicas = replicasMap.get(masterId); if (!replicas) { replicasMap.set(masterId, [node]); } else { replicas.push(node); } } } return [...mastersMap.values()]; } function transformNodeAddress(address: string): RedisClusterNodeAddress { const indexOfColon = address.lastIndexOf(':'), indexOfAt = address.indexOf('@', indexOfColon), host = address.substring(0, indexOfColon); if (indexOfAt === -1) { return { host, port: Number(address.substring(indexOfColon + 1)), cport: null }; } return { host: address.substring(0, indexOfColon), port: Number(address.substring(indexOfColon + 1, indexOfAt)), cport: Number(address.substring(indexOfAt + 1)) }; } node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_REPLICAS.spec.ts000066400000000000000000000004561433774114400262020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_REPLICAS'; describe('CLUSTER REPLICAS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('0'), ['CLUSTER', 'REPLICAS', '0'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_REPLICAS.ts000066400000000000000000000002451433774114400252450ustar00rootroot00000000000000export function transformArguments(nodeId: string): Array { return ['CLUSTER', 'REPLICAS', nodeId]; } export { transformReply } from './CLUSTER_NODES'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_REPLICATE.spec.ts000066400000000000000000000004611433774114400263040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_REPLICATE'; describe('CLUSTER REPLICATE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('0'), ['CLUSTER', 'REPLICATE', '0'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_REPLICATE.ts000066400000000000000000000002441433774114400253520ustar00rootroot00000000000000export function transformArguments(nodeId: string): Array { return ['CLUSTER', 'REPLICATE', nodeId]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_RESET.spec.ts000066400000000000000000000010171433774114400256540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_RESET'; describe('CLUSTER RESET', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'RESET'] ); }); it('with mode', () => { assert.deepEqual( transformArguments('HARD'), ['CLUSTER', 'RESET', 'HARD'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_RESET.ts000066400000000000000000000003521433774114400247240ustar00rootroot00000000000000export function transformArguments(mode?: 'HARD' | 'SOFT'): Array { const args = ['CLUSTER', 'RESET']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SAVECONFIG.spec.ts000066400000000000000000000011111433774114400264110ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CLUSTER_SAVECONFIG'; describe('CLUSTER SAVECONFIG', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'SAVECONFIG'] ); }); testUtils.testWithCluster('clusterNode.clusterSaveConfig', async cluster => { assert.equal( await cluster.getSlotMaster(0).client.clusterSaveConfig(), 'OK' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SAVECONFIG.ts000066400000000000000000000002201433774114400254600ustar00rootroot00000000000000export function transformArguments(): Array { return ['CLUSTER', 'SAVECONFIG']; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SET-CONFIG-EPOCH.spec.ts000066400000000000000000000005041433774114400272240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CLUSTER_SET-CONFIG-EPOCH'; describe('CLUSTER SET-CONFIG-EPOCH', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(0), ['CLUSTER', 'SET-CONFIG-EPOCH', '0'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SET-CONFIG-EPOCH.ts000066400000000000000000000003011433774114400262660ustar00rootroot00000000000000export function transformArguments(configEpoch: number): Array { return ['CLUSTER', 'SET-CONFIG-EPOCH', configEpoch.toString()]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SETSLOT.spec.ts000066400000000000000000000012221433774114400261250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { ClusterSlotStates, transformArguments } from './CLUSTER_SETSLOT'; describe('CLUSTER SETSLOT', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(0, ClusterSlotStates.IMPORTING), ['CLUSTER', 'SETSLOT', '0', 'IMPORTING'] ); }); it('with nodeId', () => { assert.deepEqual( transformArguments(0, ClusterSlotStates.IMPORTING, 'nodeId'), ['CLUSTER', 'SETSLOT', '0', 'IMPORTING', 'nodeId'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SETSLOT.ts000066400000000000000000000006731433774114400252050ustar00rootroot00000000000000export enum ClusterSlotStates { IMPORTING = 'IMPORTING', MIGRATING = 'MIGRATING', STABLE = 'STABLE', NODE = 'NODE' } export function transformArguments( slot: number, state: ClusterSlotStates, nodeId?: string ): Array { const args = ['CLUSTER', 'SETSLOT', slot.toString(), state]; if (nodeId) { args.push(nodeId); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SLOTS.spec.ts000066400000000000000000000047431433774114400257070ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments, transformReply } from './CLUSTER_SLOTS'; describe('CLUSTER SLOTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CLUSTER', 'SLOTS'] ); }); it('transformReply', () => { assert.deepEqual( transformReply([ [ 0, 5460, ['127.0.0.1', 30001, '09dbe9720cda62f7865eabc5fd8857c5d2678366'], ['127.0.0.1', 30004, '821d8ca00d7ccf931ed3ffc7e3db0599d2271abf'] ], [ 5461, 10922, ['127.0.0.1', 30002, 'c9d93d9f2c0c524ff34cc11838c2003d8c29e013'], ['127.0.0.1', 30005, 'faadb3eb99009de4ab72ad6b6ed87634c7ee410f'] ], [ 10923, 16383, ['127.0.0.1', 30003, '044ec91f325b7595e76dbcb18cc688b6a5b434a1'], ['127.0.0.1', 30006, '58e6e48d41228013e5d9c1c37c5060693925e97e'] ] ]), [{ from: 0, to: 5460, master: { ip: '127.0.0.1', port: 30001, id: '09dbe9720cda62f7865eabc5fd8857c5d2678366' }, replicas: [{ ip: '127.0.0.1', port: 30004, id: '821d8ca00d7ccf931ed3ffc7e3db0599d2271abf' }] }, { from: 5461, to: 10922, master: { ip: '127.0.0.1', port: 30002, id: 'c9d93d9f2c0c524ff34cc11838c2003d8c29e013' }, replicas: [{ ip: '127.0.0.1', port: 30005, id: 'faadb3eb99009de4ab72ad6b6ed87634c7ee410f' }] }, { from: 10923, to: 16383, master: { ip: '127.0.0.1', port: 30003, id: '044ec91f325b7595e76dbcb18cc688b6a5b434a1' }, replicas: [{ ip: '127.0.0.1', port: 30006, id: '58e6e48d41228013e5d9c1c37c5060693925e97e' }] }] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CLUSTER_SLOTS.ts000066400000000000000000000020141433774114400247430ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['CLUSTER', 'SLOTS']; } type ClusterSlotsRawNode = [ip: string, port: number, id: string]; type ClusterSlotsRawReply = Array<[ from: number, to: number, master: ClusterSlotsRawNode, ...replicas: Array ]>; type ClusterSlotsNode = { ip: string; port: number; id: string; }; export type ClusterSlotsReply = Array<{ from: number; to: number; master: ClusterSlotsNode; replicas: Array; }>; export function transformReply(reply: ClusterSlotsRawReply): ClusterSlotsReply { return reply.map(([from, to, master, ...replicas]) => { return { from, to, master: transformNode(master), replicas: replicas.map(transformNode) }; }); } function transformNode([ip, port, id]: ClusterSlotsRawNode): ClusterSlotsNode { return { ip, port, id }; } node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND.spec.ts000066400000000000000000000010611433774114400246460ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './COMMAND'; import { assertPingCommand } from './COMMAND_INFO.spec'; describe('COMMAND', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['COMMAND'] ); }); testUtils.testWithClient('client.command', async client => { assertPingCommand((await client.command()).find(command => command.name === 'ping')); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND.ts000066400000000000000000000006131433774114400237170ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { CommandRawReply, CommandReply, transformCommandReply } from './generic-transformers'; export const IS_READ_ONLY = true; export function transformArguments(): RedisCommandArguments { return ['COMMAND']; } export function transformReply(reply: Array): Array { return reply.map(transformCommandReply); } node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_COUNT.spec.ts000066400000000000000000000010321433774114400256140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './COMMAND_COUNT'; describe('COMMAND COUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['COMMAND', 'COUNT'] ); }); testUtils.testWithClient('client.commandCount', async client => { assert.equal( typeof await client.commandCount(), 'number' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_COUNT.ts000066400000000000000000000003431433774114400246670ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments(): RedisCommandArguments { return ['COMMAND', 'COUNT']; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_GETKEYS.spec.ts000066400000000000000000000011121433774114400260360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './COMMAND_GETKEYS'; describe('COMMAND GETKEYS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(['GET', 'key']), ['COMMAND', 'GETKEYS', 'GET', 'key'] ); }); testUtils.testWithClient('client.commandGetKeys', async client => { assert.deepEqual( await client.commandGetKeys(['GET', 'key']), ['key'] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_GETKEYS.ts000066400000000000000000000004721433774114400251150ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments(args: Array): RedisCommandArguments { return ['COMMAND', 'GETKEYS', ...args]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_GETKEYSANDFLAGS.spec.ts000066400000000000000000000013561433774114400271500ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './COMMAND_GETKEYSANDFLAGS'; describe('COMMAND GETKEYSANDFLAGS', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments(['GET', 'key']), ['COMMAND', 'GETKEYSANDFLAGS', 'GET', 'key'] ); }); testUtils.testWithClient('client.commandGetKeysAndFlags', async client => { assert.deepEqual( await client.commandGetKeysAndFlags(['GET', 'key']), [{ key: 'key', flags: ['RO', 'access'] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_GETKEYSANDFLAGS.ts000066400000000000000000000011401433774114400262060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments(args: Array): RedisCommandArguments { return ['COMMAND', 'GETKEYSANDFLAGS', ...args]; } type KeysAndFlagsRawReply = Array<[ RedisCommandArgument, RedisCommandArguments ]>; type KeysAndFlagsReply = Array<{ key: RedisCommandArgument; flags: RedisCommandArguments; }>; export function transformReply(reply: KeysAndFlagsRawReply): KeysAndFlagsReply { return reply.map(([key, flags]) => ({ key, flags })); } node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_INFO.spec.ts000066400000000000000000000030521433774114400254630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './COMMAND_INFO'; import { CommandCategories, CommandFlags, CommandReply } from './generic-transformers'; export function assertPingCommand(commandInfo: CommandReply | null | undefined): void { assert.deepEqual( commandInfo, { name: 'ping', arity: -1, flags: new Set( testUtils.isVersionGreaterThan([7]) ? [CommandFlags.FAST] : [CommandFlags.STALE, CommandFlags.FAST] ), firstKeyIndex: 0, lastKeyIndex: 0, step: 0, categories: new Set( testUtils.isVersionGreaterThan([6]) ? [CommandCategories.FAST, CommandCategories.CONNECTION] : [] ) } ); } describe('COMMAND INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(['PING']), ['COMMAND', 'INFO', 'PING'] ); }); describe('client.commandInfo', () => { testUtils.testWithClient('PING', async client => { assertPingCommand((await client.commandInfo(['PING']))[0]); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('DOSE_NOT_EXISTS', async client => { assert.deepEqual( await client.commandInfo(['DOSE_NOT_EXISTS']), [null] ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_INFO.ts000066400000000000000000000007521433774114400245360ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { CommandRawReply, CommandReply, transformCommandReply } from './generic-transformers'; export const IS_READ_ONLY = true; export function transformArguments(commands: Array): RedisCommandArguments { return ['COMMAND', 'INFO', ...commands]; } export function transformReply(reply: Array): Array { return reply.map(command => command ? transformCommandReply(command) : null); } node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_LIST.spec.ts000066400000000000000000000034051433774114400255050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, FilterBy } from './COMMAND_LIST'; describe('COMMAND LIST', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['COMMAND', 'LIST'] ); }); describe('with FILTERBY', () => { it('MODULE', () => { assert.deepEqual( transformArguments({ filterBy: FilterBy.MODULE, value: 'json' }), ['COMMAND', 'LIST', 'FILTERBY', 'MODULE', 'json'] ); }); it('ACLCAT', () => { assert.deepEqual( transformArguments({ filterBy: FilterBy.ACLCAT, value: 'admin' }), ['COMMAND', 'LIST', 'FILTERBY', 'ACLCAT', 'admin'] ); }); it('PATTERN', () => { assert.deepEqual( transformArguments({ filterBy: FilterBy.PATTERN, value: 'a*' }), ['COMMAND', 'LIST', 'FILTERBY', 'PATTERN', 'a*'] ); }); }); }); testUtils.testWithClient('client.commandList', async client => { const commandList = await client.commandList(); assert.ok(Array.isArray(commandList)); for (const command of commandList) { assert.ok(typeof command === 'string'); } }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/COMMAND_LIST.ts000066400000000000000000000010671433774114400245560ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export enum FilterBy { MODULE = 'MODULE', ACLCAT = 'ACLCAT', PATTERN = 'PATTERN' } interface Filter { filterBy: FilterBy; value: string; } export function transformArguments(filter?: Filter): RedisCommandArguments { const args = ['COMMAND', 'LIST']; if (filter) { args.push( 'FILTERBY', filter.filterBy, filter.value ); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_GET.spec.ts000066400000000000000000000004341433774114400252370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CONFIG_GET'; describe('CONFIG GET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('*'), ['CONFIG', 'GET', '*'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_GET.ts000066400000000000000000000003041433774114400243020ustar00rootroot00000000000000export function transformArguments(parameter: string): Array { return ['CONFIG', 'GET', parameter]; } export { transformTuplesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_RESETSTAT.spec.ts000066400000000000000000000004461433774114400262010ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CONFIG_RESETSTAT'; describe('CONFIG RESETSTAT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CONFIG', 'RESETSTAT'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_RESETSTAT.ts000066400000000000000000000002171433774114400252440ustar00rootroot00000000000000export function transformArguments(): Array { return ['CONFIG', 'RESETSTAT']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_REWRITE.spec.ts000066400000000000000000000004401433774114400257360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CONFIG_REWRITE'; describe('CONFIG REWRITE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['CONFIG', 'REWRITE'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_REWRITE.ts000066400000000000000000000002151433774114400250050ustar00rootroot00000000000000export function transformArguments(): Array { return ['CONFIG', 'REWRITE']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_SET.spec.ts000066400000000000000000000013131433774114400252500ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './CONFIG_SET'; describe('CONFIG SET', () => { describe('transformArguments', () => { it('set one parameter (old version)', () => { assert.deepEqual( transformArguments('parameter', 'value'), ['CONFIG', 'SET', 'parameter', 'value'] ); }); it('set muiltiple parameters', () => { assert.deepEqual( transformArguments({ 1: 'a', 2: 'b', 3: 'c' }), ['CONFIG', 'SET', '1', 'a', '2', 'b', '3', 'c'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/CONFIG_SET.ts000066400000000000000000000013261433774114400243230ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; type SingleParameter = [parameter: RedisCommandArgument, value: RedisCommandArgument]; type MultipleParameters = [config: Record]; export function transformArguments( ...[parameterOrConfig, value]: SingleParameter | MultipleParameters ): RedisCommandArguments { const args: RedisCommandArguments = ['CONFIG', 'SET']; if (typeof parameterOrConfig === 'string') { args.push(parameterOrConfig, value!); } else { for (const [key, value] of Object.entries(parameterOrConfig)) { args.push(key, value); } } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/COPY.spec.ts000066400000000000000000000035271433774114400243530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './COPY'; describe('COPY', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('source', 'destination'), ['COPY', 'source', 'destination'] ); }); it('with destination DB flag', () => { assert.deepEqual( transformArguments('source', 'destination', { destinationDb: 1 }), ['COPY', 'source', 'destination', 'DB', '1'] ); }); it('with replace flag', () => { assert.deepEqual( transformArguments('source', 'destination', { replace: true }), ['COPY', 'source', 'destination', 'REPLACE'] ); }); it('with both flags', () => { assert.deepEqual( transformArguments('source', 'destination', { destinationDb: 1, replace: true }), ['COPY', 'source', 'destination', 'DB', '1', 'REPLACE'] ); }); }); describe('transformReply', () => { it('0', () => { assert.equal( transformReply(0), false ); }); it('1', () => { assert.equal( transformReply(1), true ); }); }); testUtils.testWithClient('client.copy', async client => { assert.equal( await client.copy('source', 'destination'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/COPY.ts000066400000000000000000000012371433774114400234160ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; interface CopyCommandOptions { destinationDb?: number; replace?: boolean; } export const FIRST_KEY_INDEX = 1; export function transformArguments( source: RedisCommandArgument, destination: RedisCommandArgument, options?: CopyCommandOptions ): RedisCommandArguments { const args = ['COPY', source, destination]; if (options?.destinationDb) { args.push('DB', options.destinationDb.toString()); } if (options?.replace) { args.push('REPLACE'); } return args; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/DBSIZE.spec.ts000066400000000000000000000007501433774114400245540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DBSIZE'; describe('DBSIZE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['DBSIZE'] ); }); testUtils.testWithClient('client.dbSize', async client => { assert.equal( await client.dbSize(), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/DBSIZE.ts000066400000000000000000000002451433774114400236220ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(): Array { return ['DBSIZE']; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/DECR.spec.ts000066400000000000000000000007601433774114400243120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DECR'; describe('DECR', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['DECR', 'key'] ); }); testUtils.testWithClient('client.decr', async client => { assert.equal( await client.decr('key'), -1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/DECR.ts000066400000000000000000000004131433774114400233540ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['DECR', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/DECRBY.spec.ts000066400000000000000000000010051433774114400245360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DECRBY'; describe('DECRBY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 2), ['DECRBY', 'key', '2'] ); }); testUtils.testWithClient('client.decrBy', async client => { assert.equal( await client.decrBy('key', 2), -2 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/DECRBY.ts000066400000000000000000000005001433774114400236040ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, decrement: number ): RedisCommandArguments { return ['DECRBY', key, decrement.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/DEL.spec.ts000066400000000000000000000013351433774114400242000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DEL'; describe('DEL', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['DEL', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['key1', 'key2']), ['DEL', 'key1', 'key2'] ); }); }); testUtils.testWithClient('client.del', async client => { assert.equal( await client.del('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/DEL.ts000066400000000000000000000006051433774114400232460ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['DEL'], keys); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/DISCARD.spec.ts000066400000000000000000000004101433774114400246360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './DISCARD'; describe('DISCARD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['DISCARD'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/DISCARD.ts000066400000000000000000000002741433774114400237150ustar00rootroot00000000000000import { RedisCommandArgument } from '.'; export function transformArguments(): Array { return ['DISCARD']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/DUMP.spec.ts000066400000000000000000000004571433774114400243450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; describe('DUMP', () => { testUtils.testWithClient('client.dump', async client => { assert.equal( await client.dump('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/DUMP.ts000066400000000000000000000004311433774114400234040ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['DUMP', key]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/ECHO.spec.ts000066400000000000000000000010031433774114400243020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ECHO'; describe('ECHO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('message'), ['ECHO', 'message'] ); }); testUtils.testWithClient('client.echo', async client => { assert.equal( await client.echo('message'), 'message' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ECHO.ts000066400000000000000000000004411433774114400233560ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments(message: RedisCommandArgument): RedisCommandArguments { return ['ECHO', message]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/EVAL.spec.ts000066400000000000000000000015111433774114400243170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EVAL'; describe('EVAL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('return KEYS[1] + ARGV[1]', { keys: ['key'], arguments: ['argument'] }), ['EVAL', 'return KEYS[1] + ARGV[1]', '1', 'key', 'argument'] ); }); testUtils.testWithClient('client.eval', async client => { assert.equal( await client.eval('return 1'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.eval', async cluster => { assert.equal( await cluster.eval('return 1'), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/EVAL.ts000066400000000000000000000004461433774114400233740ustar00rootroot00000000000000import { evalFirstKeyIndex, EvalOptions, pushEvalArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = evalFirstKeyIndex; export function transformArguments(script: string, options?: EvalOptions): Array { return pushEvalArguments(['EVAL', script], options); } node-redis-redis-4.5.1/packages/client/lib/commands/EVALSHA.spec.ts000066400000000000000000000006061433774114400246570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './EVALSHA'; describe('EVALSHA', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('sha1', { keys: ['key'], arguments: ['argument'] }), ['EVALSHA', 'sha1', '1', 'key', 'argument'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/EVALSHA.ts000066400000000000000000000004451433774114400237270ustar00rootroot00000000000000import { evalFirstKeyIndex, EvalOptions, pushEvalArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = evalFirstKeyIndex; export function transformArguments(sha1: string, options?: EvalOptions): Array { return pushEvalArguments(['EVALSHA', sha1], options); } node-redis-redis-4.5.1/packages/client/lib/commands/EVALSHA_RO.spec.ts000066400000000000000000000007441433774114400252620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './EVALSHA_RO'; describe('EVALSHA_RO', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('sha1', { keys: ['key'], arguments: ['argument'] }), ['EVALSHA_RO', 'sha1', '1', 'key', 'argument'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/EVALSHA_RO.ts000066400000000000000000000005131433774114400243230ustar00rootroot00000000000000import { evalFirstKeyIndex, EvalOptions, pushEvalArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = evalFirstKeyIndex; export const IS_READ_ONLY = true; export function transformArguments(sha1: string, options?: EvalOptions): Array { return pushEvalArguments(['EVALSHA_RO', sha1], options); } node-redis-redis-4.5.1/packages/client/lib/commands/EVAL_RO.spec.ts000066400000000000000000000016101433774114400247170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EVAL_RO'; describe('EVAL_RO', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('return KEYS[1] + ARGV[1]', { keys: ['key'], arguments: ['argument'] }), ['EVAL_RO', 'return KEYS[1] + ARGV[1]', '1', 'key', 'argument'] ); }); testUtils.testWithClient('client.evalRo', async client => { assert.equal( await client.evalRo('return 1'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.evalRo', async cluster => { assert.equal( await cluster.evalRo('return 1'), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/EVAL_RO.ts000066400000000000000000000005141433774114400237700ustar00rootroot00000000000000import { evalFirstKeyIndex, EvalOptions, pushEvalArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = evalFirstKeyIndex; export const IS_READ_ONLY = true; export function transformArguments(script: string, options?: EvalOptions): Array { return pushEvalArguments(['EVAL_RO', script], options); } node-redis-redis-4.5.1/packages/client/lib/commands/EXISTS.spec.ts000066400000000000000000000013431433774114400246120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EXISTS'; describe('EXISTS', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['EXISTS', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['EXISTS', '1', '2'] ); }); }); testUtils.testWithClient('client.exists', async client => { assert.equal( await client.exists('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/EXISTS.ts000066400000000000000000000006531433774114400236640ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['EXISTS'], keys); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/EXPIRE.spec.ts000066400000000000000000000014101433774114400245620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EXPIRE'; describe('EXPIRE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 1), ['EXPIRE', 'key', '1'] ); }); it('with set option', () => { assert.deepEqual( transformArguments('key', 1, 'NX'), ['EXPIRE', 'key', '1', 'NX'] ); }); }); testUtils.testWithClient('client.expire', async client => { assert.equal( await client.expire('key', 0), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/EXPIRE.ts000066400000000000000000000007121433774114400236350ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, seconds: number, mode?: 'NX' | 'XX' | 'GT' | 'LT' ): RedisCommandArguments { const args = ['EXPIRE', key, seconds.toString()]; if (mode) { args.push(mode); } return args; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/EXPIREAT.spec.ts000066400000000000000000000020201433774114400250050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EXPIREAT'; describe('EXPIREAT', () => { describe('transformArguments', () => { it('number', () => { assert.deepEqual( transformArguments('key', 1), ['EXPIREAT', 'key', '1'] ); }); it('date', () => { const d = new Date(); assert.deepEqual( transformArguments('key', d), ['EXPIREAT', 'key', Math.floor(d.getTime() / 1000).toString()] ); }); it('with set option', () => { assert.deepEqual( transformArguments('key', 1, 'GT'), ['EXPIREAT', 'key', '1', 'GT'] ); }); }); testUtils.testWithClient('client.expireAt', async client => { assert.equal( await client.expireAt('key', 1), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/EXPIREAT.ts000066400000000000000000000010611433774114400240600ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformEXAT } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, timestamp: number | Date, mode?: 'NX' | 'XX' | 'GT' | 'LT' ): RedisCommandArguments { const args = [ 'EXPIREAT', key, transformEXAT(timestamp) ]; if (mode) { args.push(mode); } return args; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/EXPIRETIME.spec.ts000066400000000000000000000010741433774114400252470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EXPIRETIME'; describe('EXPIRETIME', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['EXPIRETIME', 'key'] ); }); testUtils.testWithClient('client.expireTime', async client => { assert.equal( await client.expireTime('key'), -2 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/EXPIRETIME.ts000066400000000000000000000004211433774114400243110ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['EXPIRETIME', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/FAILOVER.spec.ts000066400000000000000000000037431433774114400250100ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './FAILOVER'; describe('FAILOVER', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['FAILOVER'] ); }); describe('with TO', () => { it('simple', () => { assert.deepEqual( transformArguments({ TO: { host: 'host', port: 6379 } }), ['FAILOVER', 'TO', 'host', '6379'] ); }); it('with FORCE', () => { assert.deepEqual( transformArguments({ TO: { host: 'host', port: 6379, FORCE: true } }), ['FAILOVER', 'TO', 'host', '6379', 'FORCE'] ); }); }); it('with ABORT', () => { assert.deepEqual( transformArguments({ ABORT: true }), ['FAILOVER', 'ABORT'] ); }); it('with TIMEOUT', () => { assert.deepEqual( transformArguments({ TIMEOUT: 1 }), ['FAILOVER', 'TIMEOUT', '1'] ); }); it('with TO, ABORT, TIMEOUT', () => { assert.deepEqual( transformArguments({ TO: { host: 'host', port: 6379 }, ABORT: true, TIMEOUT: 1 }), ['FAILOVER', 'TO', 'host', '6379', 'ABORT', 'TIMEOUT', '1'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/FAILOVER.ts000066400000000000000000000012311433774114400240450ustar00rootroot00000000000000interface FailoverOptions { TO?: { host: string; port: number; FORCE?: true; }; ABORT?: true; TIMEOUT?: number; } export function transformArguments(options?: FailoverOptions): Array { const args = ['FAILOVER']; if (options?.TO) { args.push('TO', options.TO.host, options.TO.port.toString()); if (options.TO.FORCE) { args.push('FORCE'); } } if (options?.ABORT) { args.push('ABORT'); } if (options?.TIMEOUT) { args.push('TIMEOUT', options.TIMEOUT.toString()); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/FCALL.spec.ts000066400000000000000000000015331433774114400244150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec'; import { transformArguments } from './FCALL'; describe('FCALL', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('function', { keys: ['key'], arguments: ['argument'] }), ['FCALL', 'function', '1', 'key', 'argument'] ); }); testUtils.testWithClient('client.fCall', async client => { await loadMathFunction(client); assert.equal( await client.fCall(MATH_FUNCTION.library.square.NAME, { arguments: ['2'] }), 4 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FCALL.ts000066400000000000000000000004371433774114400234660ustar00rootroot00000000000000import { evalFirstKeyIndex, EvalOptions, pushEvalArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = evalFirstKeyIndex; export function transformArguments(fn: string, options?: EvalOptions): Array { return pushEvalArguments(['FCALL', fn], options); } node-redis-redis-4.5.1/packages/client/lib/commands/FCALL_RO.spec.ts000066400000000000000000000015501433774114400250140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec'; import { transformArguments } from './FCALL_RO'; describe('FCALL_RO', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('function', { keys: ['key'], arguments: ['argument'] }), ['FCALL_RO', 'function', '1', 'key', 'argument'] ); }); testUtils.testWithClient('client.fCallRo', async client => { await loadMathFunction(client); assert.equal( await client.fCallRo(MATH_FUNCTION.library.square.NAME, { arguments: ['2'] }), 4 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FCALL_RO.ts000066400000000000000000000005051433774114400240620ustar00rootroot00000000000000import { evalFirstKeyIndex, EvalOptions, pushEvalArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = evalFirstKeyIndex; export const IS_READ_ONLY = true; export function transformArguments(fn: string, options?: EvalOptions): Array { return pushEvalArguments(['FCALL_RO', fn], options); } node-redis-redis-4.5.1/packages/client/lib/commands/FLUSHALL.spec.ts000066400000000000000000000016611433774114400250100ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisFlushModes, transformArguments } from './FLUSHALL'; describe('FLUSHALL', () => { describe('transformArguments', () => { it('default', () => { assert.deepEqual( transformArguments(), ['FLUSHALL'] ); }); it('ASYNC', () => { assert.deepEqual( transformArguments(RedisFlushModes.ASYNC), ['FLUSHALL', 'ASYNC'] ); }); it('SYNC', () => { assert.deepEqual( transformArguments(RedisFlushModes.SYNC), ['FLUSHALL', 'SYNC'] ); }); }); testUtils.testWithClient('client.flushAll', async client => { assert.equal( await client.flushAll(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FLUSHALL.ts000066400000000000000000000004521433774114400240540ustar00rootroot00000000000000export enum RedisFlushModes { ASYNC = 'ASYNC', SYNC = 'SYNC' } export function transformArguments(mode?: RedisFlushModes): Array { const args = ['FLUSHALL']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/FLUSHDB.spec.ts000066400000000000000000000017071433774114400246660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisFlushModes } from './FLUSHALL'; import { transformArguments } from './FLUSHDB'; describe('FLUSHDB', () => { describe('transformArguments', () => { it('default', () => { assert.deepEqual( transformArguments(), ['FLUSHDB'] ); }); it('ASYNC', () => { assert.deepEqual( transformArguments(RedisFlushModes.ASYNC), ['FLUSHDB', 'ASYNC'] ); }); it('SYNC', () => { assert.deepEqual( transformArguments(RedisFlushModes.SYNC), ['FLUSHDB', 'SYNC'] ); }); }); testUtils.testWithClient('client.flushDb', async client => { assert.equal( await client.flushDb(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FLUSHDB.ts000066400000000000000000000004201433774114400237240ustar00rootroot00000000000000import { RedisFlushModes } from './FLUSHALL'; export function transformArguments(mode?: RedisFlushModes): Array { const args = ['FLUSHDB']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_DELETE.spec.ts000066400000000000000000000013361433774114400260440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './FUNCTION_DELETE'; describe('FUNCTION DELETE', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('library'), ['FUNCTION', 'DELETE', 'library'] ); }); testUtils.testWithClient('client.functionDelete', async client => { await loadMathFunction(client); assert.equal( await client.functionDelete(MATH_FUNCTION.name), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_DELETE.ts000066400000000000000000000003301433774114400251040ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(library: string): RedisCommandArguments { return ['FUNCTION', 'DELETE', library]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_DUMP.spec.ts000066400000000000000000000011101433774114400256350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './FUNCTION_DUMP'; describe('FUNCTION DUMP', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['FUNCTION', 'DUMP'] ); }); testUtils.testWithClient('client.functionDump', async client => { assert.equal( typeof await client.functionDump(), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_DUMP.ts000066400000000000000000000003441433774114400247140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['FUNCTION', 'DUMP']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_FLUSH.spec.ts000066400000000000000000000014651433774114400257660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './FUNCTION_FLUSH'; describe('FUNCTION FLUSH', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['FUNCTION', 'FLUSH'] ); }); it('with mode', () => { assert.deepEqual( transformArguments('SYNC'), ['FUNCTION', 'FLUSH', 'SYNC'] ); }); }); testUtils.testWithClient('client.functionFlush', async client => { assert.equal( await client.functionFlush(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_FLUSH.ts000066400000000000000000000004361433774114400250320ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(mode?: 'ASYNC' | 'SYNC'): RedisCommandArguments { const args = ['FUNCTION', 'FLUSH']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_KILL.spec.ts000066400000000000000000000005621433774114400256350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils from '../test-utils'; import { transformArguments } from './FUNCTION_KILL'; describe('FUNCTION KILL', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['FUNCTION', 'KILL'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_KILL.ts000066400000000000000000000002761433774114400247060ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['FUNCTION', 'KILL']; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_LIST.spec.ts000066400000000000000000000023271433774114400256560ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec'; import { transformArguments } from './FUNCTION_LIST'; describe('FUNCTION LIST', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['FUNCTION', 'LIST'] ); }); it('with pattern', () => { assert.deepEqual( transformArguments('patter*'), ['FUNCTION', 'LIST', 'patter*'] ); }); }); testUtils.testWithClient('client.functionList', async client => { await loadMathFunction(client); assert.deepEqual( await client.functionList(), [{ libraryName: MATH_FUNCTION.name, engine: MATH_FUNCTION.engine, functions: [{ name: MATH_FUNCTION.library.square.NAME, description: null, flags: ['no-writes'] }] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_LIST.ts000066400000000000000000000010051433774114400247150ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { FunctionListItemReply, FunctionListRawItemReply, transformFunctionListItemReply } from './generic-transformers'; export function transformArguments(pattern?: string): RedisCommandArguments { const args = ['FUNCTION', 'LIST']; if (pattern) { args.push(pattern); } return args; } export function transformReply(reply: Array): Array { return reply.map(transformFunctionListItemReply); } node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_LIST_WITHCODE.spec.ts000066400000000000000000000025021433774114400271370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec'; import { transformArguments } from './FUNCTION_LIST_WITHCODE'; describe('FUNCTION LIST WITHCODE', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['FUNCTION', 'LIST', 'WITHCODE'] ); }); it('with pattern', () => { assert.deepEqual( transformArguments('patter*'), ['FUNCTION', 'LIST', 'patter*', 'WITHCODE'] ); }); }); testUtils.testWithClient('client.functionListWithCode', async client => { await loadMathFunction(client); assert.deepEqual( await client.functionListWithCode(), [{ libraryName: MATH_FUNCTION.name, engine: MATH_FUNCTION.engine, functions: [{ name: MATH_FUNCTION.library.square.NAME, description: null, flags: ['no-writes'] }], libraryCode: MATH_FUNCTION.code }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_LIST_WITHCODE.ts000066400000000000000000000016471433774114400262170ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { transformArguments as transformFunctionListArguments } from './FUNCTION_LIST'; import { FunctionListItemReply, FunctionListRawItemReply, transformFunctionListItemReply } from './generic-transformers'; export function transformArguments(pattern?: string): RedisCommandArguments { const args = transformFunctionListArguments(pattern); args.push('WITHCODE'); return args; } type FunctionListWithCodeRawItemReply = [ ...FunctionListRawItemReply, 'library_code', string ]; interface FunctionListWithCodeItemReply extends FunctionListItemReply { libraryCode: string; } export function transformReply(reply: Array): Array { return reply.map(library => ({ ...transformFunctionListItemReply(library as unknown as FunctionListRawItemReply), libraryCode: library[7] })); } node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_LOAD.spec.ts000066400000000000000000000020321433774114400256130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { MATH_FUNCTION } from '../client/index.spec'; import { transformArguments } from './FUNCTION_LOAD'; describe('FUNCTION LOAD', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments( 'code'), ['FUNCTION', 'LOAD', 'code'] ); }); it('with REPLACE', () => { assert.deepEqual( transformArguments('code', { REPLACE: true }), ['FUNCTION', 'LOAD', 'REPLACE', 'code'] ); }); }); testUtils.testWithClient('client.functionLoad', async client => { assert.equal( await client.functionLoad( MATH_FUNCTION.code, { REPLACE: true } ), MATH_FUNCTION.name ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_LOAD.ts000066400000000000000000000006361433774114400246720ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; interface FunctionLoadOptions { REPLACE?: boolean; } export function transformArguments( code: string, options?: FunctionLoadOptions ): RedisCommandArguments { const args = ['FUNCTION', 'LOAD']; if (options?.REPLACE) { args.push('REPLACE'); } args.push(code); return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_RESTORE.spec.ts000066400000000000000000000020651433774114400262250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './FUNCTION_RESTORE'; describe('FUNCTION RESTORE', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('dump'), ['FUNCTION', 'RESTORE', 'dump'] ); }); it('with mode', () => { assert.deepEqual( transformArguments('dump', 'APPEND'), ['FUNCTION', 'RESTORE', 'dump', 'APPEND'] ); }); }); testUtils.testWithClient('client.functionRestore', async client => { assert.equal( await client.functionRestore( await client.functionDump( client.commandOptions({ returnBuffers: true }) ), 'FLUSH' ), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_RESTORE.ts000066400000000000000000000005601433774114400252720ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments( dump: RedisCommandArgument, mode?: 'FLUSH' | 'APPEND' | 'REPLACE' ): RedisCommandArguments { const args = ['FUNCTION', 'RESTORE', dump]; if (mode) { args.push(mode); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_STATS.spec.ts000066400000000000000000000016301433774114400257750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './FUNCTION_STATS'; describe('FUNCTION STATS', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments(), ['FUNCTION', 'STATS'] ); }); testUtils.testWithClient('client.functionStats', async client => { const stats = await client.functionStats(); assert.equal(stats.runningScript, null); assert.equal(typeof stats.engines, 'object'); for (const [engine, { librariesCount, functionsCount }] of Object.entries(stats.engines)) { assert.equal(typeof engine, 'string'); assert.equal(typeof librariesCount, 'number'); assert.equal(typeof functionsCount, 'number'); } }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/FUNCTION_STATS.ts000066400000000000000000000024131433774114400250440ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; export function transformArguments(): RedisCommandArguments { return ['FUNCTION', 'STATS']; } type FunctionStatsRawReply = [ 'running_script', null | [ 'name', string, 'command', string, 'duration_ms', number ], 'engines', Array // "flat tuples" (there is no way to type that) // ...[string, [ // 'libraries_count', // number, // 'functions_count', // number // ]] ]; interface FunctionStatsReply { runningScript: null | { name: string; command: string; durationMs: number; }; engines: Record; } export function transformReply(reply: FunctionStatsRawReply): FunctionStatsReply { const engines = Object.create(null); for (let i = 0; i < reply[3].length; i++) { engines[reply[3][i]] = { librariesCount: reply[3][++i][1], functionsCount: reply[3][i][3] }; } return { runningScript: reply[1] === null ? null : { name: reply[1][1], command: reply[1][3], durationMs: reply[1][5] }, engines }; } node-redis-redis-4.5.1/packages/client/lib/commands/GEOADD.spec.ts000066400000000000000000000052231433774114400245170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEOADD'; describe('GEOADD', () => { describe('transformArguments', () => { it('one member', () => { assert.deepEqual( transformArguments('key', { member: 'member', longitude: 1, latitude: 2 }), ['GEOADD', 'key', '1', '2', 'member'] ); }); it('multiple members', () => { assert.deepEqual( transformArguments('key', [{ longitude: 1, latitude: 2, member: '3', }, { longitude: 4, latitude: 5, member: '6', }]), ['GEOADD', 'key', '1', '2', '3', '4', '5', '6'] ); }); it('with NX', () => { assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2, member: 'member' }, { NX: true }), ['GEOADD', 'key', 'NX', '1', '2', 'member'] ); }); it('with CH', () => { assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2, member: 'member' }, { CH: true }), ['GEOADD', 'key', 'CH', '1', '2', 'member'] ); }); it('with XX, CH', () => { assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2, member: 'member' }, { XX: true, CH: true }), ['GEOADD', 'key', 'XX', 'CH', '1', '2', 'member'] ); }); }); testUtils.testWithClient('client.geoAdd', async client => { assert.equal( await client.geoAdd('key', { member: 'member', longitude: 1, latitude: 2 }), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoAdd', async cluster => { assert.equal( await cluster.geoAdd('key', { member: 'member', longitude: 1, latitude: 2 }), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEOADD.ts000066400000000000000000000021141433774114400235620ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoCoordinates } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; interface GeoMember extends GeoCoordinates { member: RedisCommandArgument; } interface NX { NX?: true; } interface XX { XX?: true; } type SetGuards = NX | XX; interface GeoAddCommonOptions { CH?: true; } type GeoAddOptions = SetGuards & GeoAddCommonOptions; export function transformArguments( key: RedisCommandArgument, toAdd: GeoMember | Array, options?: GeoAddOptions ): RedisCommandArguments { const args = ['GEOADD', key]; if ((options as NX)?.NX) { args.push('NX'); } else if ((options as XX)?.XX) { args.push('XX'); } if (options?.CH) { args.push('CH'); } for (const { longitude, latitude, member } of (Array.isArray(toAdd) ? toAdd : [toAdd])) { args.push( longitude.toString(), latitude.toString(), member ); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/GEODIST.spec.ts000066400000000000000000000031621433774114400246720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEODIST'; describe('GEODIST', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', '1', '2'), ['GEODIST', 'key', '1', '2'] ); }); it('with unit', () => { assert.deepEqual( transformArguments('key', '1', '2', 'm'), ['GEODIST', 'key', '1', '2', 'm'] ); }); }); describe('client.geoDist', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.geoDist('key', '1', '2'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with value', async client => { const [, dist] = await Promise.all([ client.geoAdd('key', [{ member: '1', longitude: 1, latitude: 1 }, { member: '2', longitude: 2, latitude: 2 }]), client.geoDist('key', '1', '2') ]); assert.equal( dist, 157270.0561 ); }, GLOBAL.SERVERS.OPEN); }); testUtils.testWithCluster('cluster.geoDist', async cluster => { assert.equal( await cluster.geoDist('key', '1', '2'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEODIST.ts000066400000000000000000000011651433774114400237420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoUnits } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member1: RedisCommandArgument, member2: RedisCommandArgument, unit?: GeoUnits ): RedisCommandArguments { const args = ['GEODIST', key, member1, member2]; if (unit) { args.push(unit); } return args; } export function transformReply(reply: RedisCommandArgument | null): number | null { return reply === null ? null : Number(reply); } node-redis-redis-4.5.1/packages/client/lib/commands/GEOHASH.spec.ts000066400000000000000000000017771433774114400246640ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEOHASH'; describe('GEOHASH', () => { describe('transformArguments', () => { it('single member', () => { assert.deepEqual( transformArguments('key', 'member'), ['GEOHASH', 'key', 'member'] ); }); it('multiple members', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['GEOHASH', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.geoHash', async client => { assert.deepEqual( await client.geoHash('key', 'member'), [null] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoHash', async cluster => { assert.deepEqual( await cluster.geoHash('key', 'member'), [null] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEOHASH.ts000066400000000000000000000007511433774114400237220ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['GEOHASH', key], member); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/GEOPOS.spec.ts000066400000000000000000000037651433774114400246010ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './GEOPOS'; describe('GEOPOS', () => { describe('transformArguments', () => { it('single member', () => { assert.deepEqual( transformArguments('key', 'member'), ['GEOPOS', 'key', 'member'] ); }); it('multiple members', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['GEOPOS', 'key', '1', '2'] ); }); }); describe('transformReply', () => { it('null', () => { assert.deepEqual( transformReply([null]), [null] ); }); it('with member', () => { assert.deepEqual( transformReply([['1', '2']]), [{ longitude: '1', latitude: '2' }] ); }); }); describe('client.geoPos', () => { testUtils.testWithClient('null', async client => { assert.deepEqual( await client.geoPos('key', 'member'), [null] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with member', async client => { const coordinates = { longitude: '-122.06429868936538696', latitude: '37.37749628831998194' }; await client.geoAdd('key', { member: 'member', ...coordinates }); assert.deepEqual( await client.geoPos('key', 'member'), [coordinates] ); }, GLOBAL.SERVERS.OPEN); }); testUtils.testWithCluster('cluster.geoPos', async cluster => { assert.deepEqual( await cluster.geoPos('key', 'member'), [null] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEOPOS.ts000066400000000000000000000015231433774114400236360ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['GEOPOS', key], member); } type GeoCoordinatesRawReply = Array<[RedisCommandArgument, RedisCommandArgument] | null>; interface GeoCoordinates { longitude: RedisCommandArgument; latitude: RedisCommandArgument; } export function transformReply(reply: GeoCoordinatesRawReply): Array { return reply.map(coordinates => coordinates === null ? null : { longitude: coordinates[0], latitude: coordinates[1] }); } node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS.spec.ts000066400000000000000000000017421433774114400251200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEORADIUS'; describe('GEORADIUS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2 }, 3 , 'm'), ['GEORADIUS', 'key', '1', '2', '3', 'm'] ); }); testUtils.testWithClient('client.geoRadius', async client => { assert.deepEqual( await client.geoRadius('key', { longitude: 1, latitude: 2 }, 3 , 'm'), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadius', async cluster => { assert.deepEqual( await cluster.geoRadius('key', { longitude: 1, latitude: 2 }, 3 , 'm'), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS.ts000066400000000000000000000012261433774114400241640ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchOptions, GeoCoordinates, pushGeoRadiusArguments, GeoUnits } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, coordinates: GeoCoordinates, radius: number, unit: GeoUnits, options?: GeoSearchOptions ): RedisCommandArguments { return pushGeoRadiusArguments( ['GEORADIUS'], key, coordinates, radius, unit, options ); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER.spec.ts000066400000000000000000000015301433774114400262360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEORADIUSBYMEMBER'; describe('GEORADIUSBYMEMBER', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member', 3 , 'm'), ['GEORADIUSBYMEMBER', 'key', 'member', '3', 'm'] ); }); testUtils.testWithClient('client.geoRadiusByMember', async client => { assert.deepEqual( await client.geoRadiusByMember('key', 'member', 3 , 'm'), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusByMember', async cluster => { assert.deepEqual( await cluster.geoRadiusByMember('key', 'member', 3 , 'm'), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER.ts000066400000000000000000000011741433774114400253110ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchOptions, pushGeoRadiusArguments, GeoUnits } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: string, radius: number, unit: GeoUnits, options?: GeoSearchOptions ): RedisCommandArguments { return pushGeoRadiusArguments( ['GEORADIUSBYMEMBER'], key, member, radius, unit, options ); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBERSTORE.spec.ts000066400000000000000000000033341433774114400270570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './GEORADIUSBYMEMBERSTORE'; describe('GEORADIUSBYMEMBERSTORE', () => { describe('transformArguments', () => { it('STORE', () => { assert.deepEqual( transformArguments('key', 'member', 3 , 'm', 'dest', { SORT: 'ASC', COUNT: { value: 1, ANY: true } }), ['GEORADIUSBYMEMBER', 'key', 'member', '3', 'm', 'ASC', 'COUNT', '1', 'ANY', 'STORE', 'dest'] ); }); it('STOREDIST', () => { assert.deepEqual( transformArguments('key', 'member', 3 , 'm', 'dest', { STOREDIST: true }), ['GEORADIUSBYMEMBER', 'key', 'member', '3', 'm', 'STOREDIST', 'dest'] ); }); }); testUtils.testWithClient('client.geoRadiusByMemberStore', async client => { await client.geoAdd('source', { longitude: 1, latitude: 1, member: 'member' }); assert.equal( await client.geoRadiusByMemberStore('source', 'member', 3 , 'm', 'dest'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusByMemberStore', async cluster => { await cluster.geoAdd('{tag}source', { longitude: 1, latitude: 1, member: 'member' }); assert.equal( await cluster.geoRadiusByMemberStore('{tag}source', 'member', 3 , 'm','{tag}destination'), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBERSTORE.ts000066400000000000000000000012671433774114400261310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoUnits, GeoRadiusStoreOptions, pushGeoRadiusStoreArguments } from './generic-transformers'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEORADIUSBYMEMBER'; export function transformArguments( key: RedisCommandArgument, member: string, radius: number, unit: GeoUnits, destination: RedisCommandArgument, options?: GeoRadiusStoreOptions, ): RedisCommandArguments { return pushGeoRadiusStoreArguments( ['GEORADIUSBYMEMBER'], key, member, radius, unit, destination, options ); } export declare function transformReply(): number node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER_RO.spec.ts000066400000000000000000000015511433774114400266410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEORADIUSBYMEMBER_RO'; describe('GEORADIUSBYMEMBER_RO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member', 3 , 'm'), ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm'] ); }); testUtils.testWithClient('client.geoRadiusByMemberRo', async client => { assert.deepEqual( await client.geoRadiusByMemberRo('key', 'member', 3 , 'm'), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusByMemberRo', async cluster => { assert.deepEqual( await cluster.geoRadiusByMemberRo('key', 'member', 3 , 'm'), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER_RO.ts000066400000000000000000000011771433774114400257140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchOptions, pushGeoRadiusArguments, GeoUnits } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: string, radius: number, unit: GeoUnits, options?: GeoSearchOptions ): RedisCommandArguments { return pushGeoRadiusArguments( ['GEORADIUSBYMEMBER_RO'], key, member, radius, unit, options ); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.spec.ts000066400000000000000000000022571433774114400275000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisCommandArguments } from '.'; import { GeoReplyWith } from './generic-transformers'; import { transformArguments } from './GEORADIUSBYMEMBER_RO_WITH'; describe('GEORADIUSBYMEMBER_RO WITH', () => { it('transformArguments', () => { const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm', 'WITHDIST']; expectedReply.preserve = ['WITHDIST']; assert.deepEqual( transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), expectedReply ); }); testUtils.testWithClient('client.geoRadiusByMemberRoWith', async client => { assert.deepEqual( await client.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusByMemberRoWith', async cluster => { assert.deepEqual( await cluster.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.ts000066400000000000000000000015321433774114400265420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoReplyWith, GeoSearchOptions, GeoUnits } from './generic-transformers'; import { transformArguments as geoRadiusTransformArguments } from './GEORADIUSBYMEMBER_RO'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEORADIUSBYMEMBER_RO'; export function transformArguments( key: RedisCommandArgument, member: string, radius: number, unit: GeoUnits, replyWith: Array, options?: GeoSearchOptions ): RedisCommandArguments { const args: RedisCommandArguments = geoRadiusTransformArguments( key, member, radius, unit, options ); args.push(...replyWith); args.preserve = replyWith; return args; } export { transformGeoMembersWithReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER_WITH.spec.ts000066400000000000000000000022361433774114400270750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisCommandArguments } from '.'; import { GeoReplyWith } from './generic-transformers'; import { transformArguments } from './GEORADIUSBYMEMBER_WITH'; describe('GEORADIUSBYMEMBER WITH', () => { it('transformArguments', () => { const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER', 'key', 'member', '3', 'm', 'WITHDIST']; expectedReply.preserve = ['WITHDIST']; assert.deepEqual( transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), expectedReply ); }); testUtils.testWithClient('client.geoRadiusByMemberWith', async client => { assert.deepEqual( await client.geoRadiusByMemberWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusByMemberWith', async cluster => { assert.deepEqual( await cluster.geoRadiusByMemberWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSBYMEMBER_WITH.ts000066400000000000000000000015241433774114400261430ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoReplyWith, GeoSearchOptions, GeoUnits } from './generic-transformers'; import { transformArguments as transformGeoRadiusArguments } from './GEORADIUSBYMEMBER'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEORADIUSBYMEMBER'; export function transformArguments( key: RedisCommandArgument, member: string, radius: number, unit: GeoUnits, replyWith: Array, options?: GeoSearchOptions ): RedisCommandArguments { const args: RedisCommandArguments = transformGeoRadiusArguments( key, member, radius, unit, options ); args.push(...replyWith); args.preserve = replyWith; return args; } export { transformGeoMembersWithReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSSTORE.spec.ts000066400000000000000000000033511433774114400257330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './GEORADIUSSTORE'; describe('GEORADIUSSTORE', () => { describe('transformArguments', () => { it('STORE', () => { assert.deepEqual( transformArguments('key', {longitude: 1, latitude: 2}, 3 , 'm', 'dest', { SORT: 'ASC', COUNT: { value: 1, ANY: true } }), ['GEORADIUS', 'key', '1', '2', '3', 'm', 'ASC', 'COUNT', '1', 'ANY', 'STORE', 'dest'] ); }); it('STOREDIST', () => { assert.deepEqual( transformArguments('key', {longitude: 1, latitude: 2}, 3 , 'm', 'dest', { STOREDIST: true }), ['GEORADIUS', 'key', '1', '2', '3', 'm', 'STOREDIST', 'dest'] ); }); }); testUtils.testWithClient('client.geoRadiusStore', async client => { await client.geoAdd('source', { longitude: 1, latitude: 1, member: 'member' }); assert.equal( await client.geoRadiusStore('source', {longitude: 1, latitude: 1}, 3 , 'm', 'dest'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusStore', async cluster => { await cluster.geoAdd('{tag}source', { longitude: 1, latitude: 1, member: 'member' }); assert.equal( await cluster.geoRadiusStore('{tag}source', {longitude: 1, latitude: 1}, 3 , 'm', '{tag}destination'), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUSSTORE.ts000066400000000000000000000013121433774114400247750ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoCoordinates, GeoUnits, GeoRadiusStoreOptions, pushGeoRadiusStoreArguments } from './generic-transformers'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEORADIUS'; export function transformArguments( key: RedisCommandArgument, coordinates: GeoCoordinates, radius: number, unit: GeoUnits, destination: RedisCommandArgument, options?: GeoRadiusStoreOptions, ): RedisCommandArguments { return pushGeoRadiusStoreArguments( ['GEORADIUS'], key, coordinates, radius, unit, destination, options ); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS_RO.spec.ts000066400000000000000000000017641433774114400255240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEORADIUS_RO'; describe('GEORADIUS_RO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2 }, 3 , 'm'), ['GEORADIUS_RO', 'key', '1', '2', '3', 'm'] ); }); testUtils.testWithClient('client.geoRadiusRo', async client => { assert.deepEqual( await client.geoRadiusRo('key', { longitude: 1, latitude: 2 }, 3 , 'm'), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusRo', async cluster => { assert.deepEqual( await cluster.geoRadiusRo('key', { longitude: 1, latitude: 2 }, 3 , 'm'), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS_RO.ts000066400000000000000000000012311433774114400245600ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchOptions, GeoCoordinates, pushGeoRadiusArguments, GeoUnits } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, coordinates: GeoCoordinates, radius: number, unit: GeoUnits, options?: GeoSearchOptions ): RedisCommandArguments { return pushGeoRadiusArguments( ['GEORADIUS_RO'], key, coordinates, radius, unit, options ); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS_RO_WITH.spec.ts000066400000000000000000000025001433774114400263440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisCommandArguments } from '.'; import { GeoReplyWith } from './generic-transformers'; import { transformArguments } from './GEORADIUS_RO_WITH'; describe('GEORADIUS_RO WITH', () => { it('transformArguments', () => { const expectedReply: RedisCommandArguments = ['GEORADIUS_RO', 'key', '1', '2', '3', 'm', 'WITHDIST']; expectedReply.preserve = ['WITHDIST']; assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2 }, 3 , 'm', [GeoReplyWith.DISTANCE]), expectedReply ); }); testUtils.testWithClient('client.geoRadiusRoWith', async client => { assert.deepEqual( await client.geoRadiusRoWith('key', { longitude: 1, latitude: 2 }, 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusReadOnlyWith', async cluster => { assert.deepEqual( await cluster.geoRadiusRoWith('key', { longitude: 1, latitude: 2 }, 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS_RO_WITH.ts000066400000000000000000000015601433774114400254200ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoReplyWith, GeoSearchOptions, GeoCoordinates, GeoUnits } from './generic-transformers'; import { transformArguments as transformGeoRadiusRoArguments } from './GEORADIUS_RO'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEORADIUS_RO'; export function transformArguments( key: RedisCommandArgument, coordinates: GeoCoordinates, radius: number, unit: GeoUnits, replyWith: Array, options?: GeoSearchOptions ): RedisCommandArguments { const args: RedisCommandArguments = transformGeoRadiusRoArguments( key, coordinates, radius, unit, options ); args.push(...replyWith); args.preserve = replyWith; return args; } export { transformGeoMembersWithReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS_WITH.spec.ts000066400000000000000000000024511433774114400257510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisCommandArguments } from '.'; import { GeoReplyWith } from './generic-transformers'; import { transformArguments } from './GEORADIUS_WITH'; describe('GEORADIUS WITH', () => { it('transformArguments', () => { const expectedReply: RedisCommandArguments = ['GEORADIUS', 'key', '1', '2', '3', 'm', 'WITHDIST']; expectedReply.preserve = ['WITHDIST']; assert.deepEqual( transformArguments('key', { longitude: 1, latitude: 2 }, 3 , 'm', [GeoReplyWith.DISTANCE]), expectedReply ); }); testUtils.testWithClient('client.geoRadiusWith', async client => { assert.deepEqual( await client.geoRadiusWith('key', { longitude: 1, latitude: 2 }, 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoRadiusWith', async cluster => { assert.deepEqual( await cluster.geoRadiusWith('key', { longitude: 1, latitude: 2 }, 3 , 'm', [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEORADIUS_WITH.ts000066400000000000000000000015461433774114400250240ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoReplyWith, GeoSearchOptions, GeoCoordinates, GeoUnits } from './generic-transformers'; import { transformArguments as transformGeoRadiusArguments } from './GEORADIUS'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEORADIUS'; export function transformArguments( key: RedisCommandArgument, coordinates: GeoCoordinates, radius: number, unit: GeoUnits, replyWith: Array, options?: GeoSearchOptions ): RedisCommandArguments { const args: RedisCommandArguments = transformGeoRadiusArguments( key, coordinates, radius, unit, options ); args.push(...replyWith); args.preserve = replyWith; return args; } export { transformGeoMembersWithReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/GEOSEARCH.spec.ts000066400000000000000000000020411433774114400250670ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GEOSEARCH'; describe('GEOSEARCH', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member', { radius: 1, unit: 'm' }), ['GEOSEARCH', 'key', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm'] ); }); testUtils.testWithClient('client.geoSearch', async client => { assert.deepEqual( await client.geoSearch('key', 'member', { radius: 1, unit: 'm' }), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoSearch', async cluster => { assert.deepEqual( await cluster.geoSearch('key', 'member', { radius: 1, unit: 'm' }), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEOSEARCH.ts000066400000000000000000000010661433774114400241440ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchOptions ): RedisCommandArguments { return pushGeoSearchArguments(['GEOSEARCH'], key, from, by, options); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/GEOSEARCHSTORE.spec.ts000066400000000000000000000047541433774114400257210ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './GEOSEARCHSTORE'; describe('GEOSEARCHSTORE', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('destination', 'source', 'member', { radius: 1, unit: 'm' }, { SORT: 'ASC', COUNT: { value: 1, ANY: true } }), ['GEOSEARCHSTORE', 'destination', 'source', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm', 'ASC', 'COUNT', '1', 'ANY'] ); }); it('with STOREDIST', () => { assert.deepEqual( transformArguments('destination', 'source', 'member', { radius: 1, unit: 'm' }, { SORT: 'ASC', COUNT: { value: 1, ANY: true }, STOREDIST: true }), ['GEOSEARCHSTORE', 'destination', 'source', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm', 'ASC', 'COUNT', '1', 'ANY', 'STOREDIST'] ); }); }); it('transformReply with empty array (https://github.com/redis/redis/issues/9261)', () => { assert.throws( () => (transformReply as any)([]), TypeError ); }); testUtils.testWithClient('client.geoSearchStore', async client => { await client.geoAdd('source', { longitude: 1, latitude: 1, member: 'member' }); assert.equal( await client.geoSearchStore('destination', 'source', 'member', { radius: 1, unit: 'm' }), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoSearchStore', async cluster => { await cluster.geoAdd('{tag}source', { longitude: 1, latitude: 1, member: 'member' }); assert.equal( await cluster.geoSearchStore('{tag}destination', '{tag}source', 'member', { radius: 1, unit: 'm' }), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEOSEARCHSTORE.ts000066400000000000000000000017151433774114400247620ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions, pushGeoSearchArguments } from './generic-transformers'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEOSEARCH'; interface GeoSearchStoreOptions extends GeoSearchOptions { STOREDIST?: true; } export function transformArguments( destination: RedisCommandArgument, source: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchStoreOptions ): RedisCommandArguments { const args = pushGeoSearchArguments( ['GEOSEARCHSTORE', destination], source, from, by, options ); if (options?.STOREDIST) { args.push('STOREDIST'); } return args; } export function transformReply(reply: number): number { if (typeof reply !== 'number') { throw new TypeError(`https://github.com/redis/redis/issues/9261`); } return reply; } node-redis-redis-4.5.1/packages/client/lib/commands/GEOSEARCH_WITH.spec.ts000066400000000000000000000025501433774114400257270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { RedisCommandArguments } from '.'; import { GeoReplyWith } from './generic-transformers'; import { transformArguments } from './GEOSEARCH_WITH'; describe('GEOSEARCH WITH', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { const expectedReply: RedisCommandArguments = ['GEOSEARCH', 'key', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm', 'WITHDIST']; expectedReply.preserve = ['WITHDIST']; assert.deepEqual( transformArguments('key', 'member', { radius: 1, unit: 'm' }, [GeoReplyWith.DISTANCE]), expectedReply ); }); testUtils.testWithClient('client.geoSearchWith', async client => { assert.deepEqual( await client.geoSearchWith('key', 'member', { radius: 1, unit: 'm' }, [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.geoSearchWith', async cluster => { assert.deepEqual( await cluster.geoSearchWith('key', 'member', { radius: 1, unit: 'm' }, [GeoReplyWith.DISTANCE]), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GEOSEARCH_WITH.ts000066400000000000000000000014161433774114400247760ustar00rootroot00000000000000import { 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: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, replyWith: Array, options?: GeoSearchOptions ): RedisCommandArguments { const args: RedisCommandArguments = geoSearchTransformArguments(key, from, by, options); args.push(...replyWith); args.preserve = replyWith; return args; } export { transformGeoMembersWithReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/GET.spec.ts000066400000000000000000000014151433774114400242120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import RedisClient from '../client'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GET'; describe('GET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['GET', 'key'] ); }); testUtils.testWithClient('client.get', async client => { const a = await client.get( 'key' ); assert.equal( await client.get('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.get', async cluster => { assert.equal( await cluster.get('key'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GET.ts000066400000000000000000000005021433774114400232550ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['GET', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/GETBIT.spec.ts000066400000000000000000000013011433774114400245430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GETBIT'; describe('GETBIT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0), ['GETBIT', 'key', '0'] ); }); testUtils.testWithClient('client.getBit', async client => { assert.equal( await client.getBit('key', 0), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.getBit', async cluster => { assert.equal( await cluster.getBit('key', 0), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GETBIT.ts000066400000000000000000000006221433774114400236170ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { BitValue } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, offset: number ): RedisCommandArguments { return ['GETBIT', key, offset.toString()]; } export declare function transformReply(): BitValue; node-redis-redis-4.5.1/packages/client/lib/commands/GETDEL.spec.ts000066400000000000000000000013521433774114400245370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GETDEL'; describe('GETDEL', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['GETDEL', 'key'] ); }); testUtils.testWithClient('client.getDel', async client => { assert.equal( await client.getDel('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.getDel', async cluster => { assert.equal( await cluster.getDel('key'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GETDEL.ts000066400000000000000000000004421433774114400236050ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['GETDEL', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/GETEX.spec.ts000066400000000000000000000051241433774114400244500ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GETEX'; describe('GETEX', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('EX', () => { assert.deepEqual( transformArguments('key', { EX: 1 }), ['GETEX', 'key', 'EX', '1'] ); }); it('PX', () => { assert.deepEqual( transformArguments('key', { PX: 1 }), ['GETEX', 'key', 'PX', '1'] ); }); describe('EXAT', () => { it('number', () => { assert.deepEqual( transformArguments('key', { EXAT: 1 }), ['GETEX', 'key', 'EXAT', '1'] ); }); it('date', () => { const d = new Date(); assert.deepEqual( transformArguments('key', { EXAT: d }), ['GETEX', 'key', 'EXAT', Math.floor(d.getTime() / 1000).toString()] ); }); }); describe('PXAT', () => { it('number', () => { assert.deepEqual( transformArguments('key', { PXAT: 1 }), ['GETEX', 'key', 'PXAT', '1'] ); }); it('date', () => { const d = new Date(); assert.deepEqual( transformArguments('key', { PXAT: d }), ['GETEX', 'key', 'PXAT', d.getTime().toString()] ); }); }); it('PERSIST', () => { assert.deepEqual( transformArguments('key', { PERSIST: true }), ['GETEX', 'key', 'PERSIST'] ); }); }); testUtils.testWithClient('client.getEx', async client => { assert.equal( await client.getEx('key', { PERSIST: true }), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.getEx', async cluster => { assert.equal( await cluster.getEx('key', { PERSIST: true }), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GETEX.ts000066400000000000000000000016531433774114400235220ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformEXAT, transformPXAT } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; type GetExModes = { EX: number; } | { PX: number; } | { EXAT: number | Date; } | { PXAT: number | Date; } | { PERSIST: true; }; export function transformArguments( key: RedisCommandArgument, mode: GetExModes ): RedisCommandArguments { const args = ['GETEX', key]; if ('EX' in mode) { args.push('EX', mode.EX.toString()); } else if ('PX' in mode) { args.push('PX', mode.PX.toString()); } else if ('EXAT' in mode) { args.push('EXAT', transformEXAT(mode.EXAT)); } else if ('PXAT' in mode) { args.push('PXAT', transformPXAT(mode.PXAT)); } else { // PERSIST args.push('PERSIST'); } return args; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/GETRANGE.spec.ts000066400000000000000000000013401433774114400247640ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GETRANGE'; describe('GETRANGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, -1), ['GETRANGE', 'key', '0', '-1'] ); }); testUtils.testWithClient('client.getRange', async client => { assert.equal( await client.getRange('key', 0, -1), '' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lTrim', async cluster => { assert.equal( await cluster.getRange('key', 0, -1), '' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GETRANGE.ts000066400000000000000000000006141433774114400240360ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, start: number, end: number ): RedisCommandArguments { return ['GETRANGE', key, start.toString(), end.toString()]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/GETSET.spec.ts000066400000000000000000000013351433774114400245670ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GETSET'; describe('GETSET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'value'), ['GETSET', 'key', 'value'] ); }); testUtils.testWithClient('client.getSet', async client => { assert.equal( await client.getSet('key', 'value'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.getSet', async cluster => { assert.equal( await cluster.getSet('key', 'value'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/GETSET.ts000066400000000000000000000005201433774114400236310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, value: RedisCommandArgument ): RedisCommandArguments { return ['GETSET', key, value]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/HDEL.spec.ts000066400000000000000000000014001433774114400243010ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HDEL'; describe('HDEL', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'field'), ['HDEL', 'key', 'field'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['HDEL', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.hDel', async client => { assert.equal( await client.hDel('key', 'field'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HDEL.ts000066400000000000000000000006541433774114400233620ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['HDEL', key], field); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/HELLO.spec.ts000066400000000000000000000044151433774114400244410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HELLO'; describe('HELLO', () => { testUtils.isVersionGreaterThanHook([6]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['HELLO'] ); }); it('with protover', () => { assert.deepEqual( transformArguments({ protover: 3 }), ['HELLO', '3'] ); }); it('with protover, auth', () => { assert.deepEqual( transformArguments({ protover: 3, auth: { username: 'username', password: 'password' } }), ['HELLO', '3', 'AUTH', 'username', 'password'] ); }); it('with protover, clientName', () => { assert.deepEqual( transformArguments({ protover: 3, clientName: 'clientName' }), ['HELLO', '3', 'SETNAME', 'clientName'] ); }); it('with protover, auth, clientName', () => { assert.deepEqual( transformArguments({ protover: 3, auth: { username: 'username', password: 'password' }, clientName: 'clientName' }), ['HELLO', '3', 'AUTH', 'username', 'password', 'SETNAME', 'clientName'] ); }); }); testUtils.testWithClient('client.hello', async client => { const reply = await client.hello(); assert.equal(reply.server, 'redis'); assert.equal(typeof reply.version, 'string'); assert.equal(reply.proto, 2); assert.equal(typeof reply.id, 'number'); assert.equal(reply.mode, 'standalone'); assert.equal(reply.role, 'master'); assert.deepEqual(reply.modules, []); }, { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [6, 2] }); }); node-redis-redis-4.5.1/packages/client/lib/commands/HELLO.ts000066400000000000000000000027531433774114400235130ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { AuthOptions } from './AUTH'; interface HelloOptions { protover: number; auth?: Required; clientName?: string; } export function transformArguments(options?: HelloOptions): RedisCommandArguments { const args: RedisCommandArguments = ['HELLO']; if (options) { args.push(options.protover.toString()); if (options.auth) { args.push('AUTH', options.auth.username, options.auth.password); } if (options.clientName) { args.push('SETNAME', options.clientName); } } return args; } type HelloRawReply = [ _: never, server: RedisCommandArgument, _: never, version: RedisCommandArgument, _: never, proto: number, _: never, id: number, _: never, mode: RedisCommandArgument, _: never, role: RedisCommandArgument, _: never, modules: Array ]; interface HelloTransformedReply { server: RedisCommandArgument; version: RedisCommandArgument; proto: number; id: number; mode: RedisCommandArgument; role: RedisCommandArgument; modules: Array; } export function transformReply(reply: HelloRawReply): HelloTransformedReply { return { server: reply[1], version: reply[3], proto: reply[5], id: reply[7], mode: reply[9], role: reply[11], modules: reply[13] }; } node-redis-redis-4.5.1/packages/client/lib/commands/HEXISTS.spec.ts000066400000000000000000000010351433774114400247200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HEXISTS'; describe('HEXISTS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'field'), ['HEXISTS', 'key', 'field'] ); }); testUtils.testWithClient('client.hExists', async client => { assert.equal( await client.hExists('key', 'field'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HEXISTS.ts000066400000000000000000000005341433774114400237720ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument ): RedisCommandArguments { return ['HEXISTS', key, field]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/HGET.spec.ts000066400000000000000000000010151433774114400243160ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HGET'; describe('HGET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'field'), ['HGET', 'key', 'field'] ); }); testUtils.testWithClient('client.hGet', async client => { assert.equal( await client.hGet('key', 'field'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HGET.ts000066400000000000000000000005661433774114400233770ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument ): RedisCommandArguments { return ['HGET', key, field]; } export declare function transformReply(): RedisCommandArgument | undefined; node-redis-redis-4.5.1/packages/client/lib/commands/HGETALL.spec.ts000066400000000000000000000023201433774114400246470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformReply } from './HGETALL'; describe('HGETALL', () => { describe('transformReply', () => { it('empty', () => { assert.deepEqual( transformReply([]), Object.create(null) ); }); it('with values', () => { assert.deepEqual( transformReply(['key1', 'value1', 'key2', 'value2']), Object.create(null, { key1: { value: 'value1', configurable: true, enumerable: true, writable: true }, key2: { value: 'value2', configurable: true, enumerable: true, writable: true } }) ); }); }); testUtils.testWithClient('client.hGetAll', async client => { assert.deepEqual( await client.hGetAll('key'), Object.create(null) ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HGETALL.ts000066400000000000000000000005201433774114400237160ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HGETALL', key]; } export { transformTuplesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/HINCRBY.spec.ts000066400000000000000000000010441433774114400246670ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HINCRBY'; describe('HINCRBY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'field', 1), ['HINCRBY', 'key', 'field', '1'] ); }); testUtils.testWithClient('client.hIncrBy', async client => { assert.equal( await client.hIncrBy('key', 'field', 1), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HINCRBY.ts000066400000000000000000000005511433774114400237400ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument, increment: number ): RedisCommandArguments { return ['HINCRBY', key, field, increment.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/HINCRBYFLOAT.spec.ts000066400000000000000000000011071433774114400254550ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HINCRBYFLOAT'; describe('HINCRBYFLOAT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'field', 1.5), ['HINCRBYFLOAT', 'key', 'field', '1.5'] ); }); testUtils.testWithClient('client.hIncrByFloat', async client => { assert.equal( await client.hIncrByFloat('key', 'field', 1.5), '1.5' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HINCRBYFLOAT.ts000066400000000000000000000005561433774114400245330ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument, increment: number ): RedisCommandArguments { return ['HINCRBYFLOAT', key, field, increment.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/HKEYS.spec.ts000066400000000000000000000007711433774114400244620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HKEYS'; describe('HKEYS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['HKEYS', 'key'] ); }); testUtils.testWithClient('client.hKeys', async client => { assert.deepEqual( await client.hKeys('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HKEYS.ts000066400000000000000000000004411433774114400235230ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HKEYS', key]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/HLEN.spec.ts000066400000000000000000000007571433774114400243310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HLEN'; describe('HLEN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['HLEN', 'key'] ); }); testUtils.testWithClient('client.hLen', async client => { assert.equal( await client.hLen('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HLEN.ts000066400000000000000000000004131433774114400233650ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HLEN', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/HMGET.spec.ts000066400000000000000000000014431433774114400244400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HMGET'; describe('HMGET', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'field'), ['HMGET', 'key', 'field'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['field1', 'field2']), ['HMGET', 'key', 'field1', 'field2'] ); }); }); testUtils.testWithClient('client.hmGet', async client => { assert.deepEqual( await client.hmGet('key', 'field'), [null] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HMGET.ts000066400000000000000000000007471433774114400235150ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, fields: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['HMGET', key], fields); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/HRANDFIELD.spec.ts000066400000000000000000000011011433774114400251630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HRANDFIELD'; describe('HRANDFIELD', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['HRANDFIELD', 'key'] ); }); testUtils.testWithClient('client.hRandField', async client => { assert.equal( await client.hRandField('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HRANDFIELD.ts000066400000000000000000000005111433774114400242360ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HRANDFIELD', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/HRANDFIELD_COUNT.spec.ts000066400000000000000000000011471433774114400261450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HRANDFIELD_COUNT'; describe('HRANDFIELD COUNT', () => { testUtils.isVersionGreaterThanHook([6, 2, 5]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['HRANDFIELD', 'key', '1'] ); }); testUtils.testWithClient('client.hRandFieldCount', async client => { assert.deepEqual( await client.hRandFieldCount('key', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HRANDFIELD_COUNT.ts000066400000000000000000000007511433774114400252140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformHRandFieldArguments } from './HRANDFIELD'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './HRANDFIELD'; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return [ ...transformHRandFieldArguments(key), count.toString() ]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES.spec.ts000066400000000000000000000012601433774114400277140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HRANDFIELD_COUNT_WITHVALUES'; describe('HRANDFIELD COUNT WITHVALUES', () => { testUtils.isVersionGreaterThanHook([6, 2, 5]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['HRANDFIELD', 'key', '1', 'WITHVALUES'] ); }); testUtils.testWithClient('client.hRandFieldCountWithValues', async client => { assert.deepEqual( await client.hRandFieldCountWithValues('key', 1), Object.create(null) ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HRANDFIELD_COUNT_WITHVALUES.ts000066400000000000000000000010141433774114400267600ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformHRandFieldCountArguments } from './HRANDFIELD_COUNT'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './HRANDFIELD_COUNT'; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return [ ...transformHRandFieldCountArguments(key, count), 'WITHVALUES' ]; } export { transformTuplesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/HSCAN.spec.ts000066400000000000000000000040621433774114400244300ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './HSCAN'; describe('HSCAN', () => { describe('transformArguments', () => { it('cusror only', () => { assert.deepEqual( transformArguments('key', 0), ['HSCAN', 'key', '0'] ); }); it('with MATCH', () => { assert.deepEqual( transformArguments('key', 0, { MATCH: 'pattern' }), ['HSCAN', 'key', '0', 'MATCH', 'pattern'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', 0, { COUNT: 1 }), ['HSCAN', 'key', '0', 'COUNT', '1'] ); }); it('with MATCH & COUNT', () => { assert.deepEqual( transformArguments('key', 0, { MATCH: 'pattern', COUNT: 1 }), ['HSCAN', 'key', '0', 'MATCH', 'pattern', 'COUNT', '1'] ); }); }); describe('transformReply', () => { it('without tuples', () => { assert.deepEqual( transformReply(['0', []]), { cursor: 0, tuples: [] } ); }); it('with tuples', () => { assert.deepEqual( transformReply(['0', ['field', 'value']]), { cursor: 0, tuples: [{ field: 'field', value: 'value' }] } ); }); }); testUtils.testWithClient('client.hScan', async client => { assert.deepEqual( await client.hScan('key', 0), { cursor: 0, tuples: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HSCAN.ts000066400000000000000000000020311433774114400234710ustar00rootroot00000000000000import { 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: RedisCommandArgument, cursor: number, options?: ScanOptions ): RedisCommandArguments { return pushScanArguments([ 'HSCAN', key ], cursor, options); } type HScanRawReply = [RedisCommandArgument, Array]; export interface HScanTuple { field: RedisCommandArgument; value: RedisCommandArgument; } interface HScanReply { cursor: number; tuples: Array; } export function transformReply([cursor, rawTuples]: HScanRawReply): HScanReply { const parsedTuples = []; for (let i = 0; i < rawTuples.length; i += 2) { parsedTuples.push({ field: rawTuples[i], value: rawTuples[i + 1] }); } return { cursor: Number(cursor), tuples: parsedTuples }; } node-redis-redis-4.5.1/packages/client/lib/commands/HSET.spec.ts000066400000000000000000000044371433774114400243450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './HSET'; import testUtils, { GLOBAL } from '../test-utils'; describe('HSET', () => { describe('transformArguments', () => { describe('field, value', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'field', 'value'), ['HSET', 'key', 'field', 'value'] ); }); it('number', () => { assert.deepEqual( transformArguments('key', 1, 2), ['HSET', 'key', '1', '2'] ); }); it('Buffer', () => { assert.deepEqual( transformArguments(Buffer.from('key'), Buffer.from('field'), Buffer.from('value')), ['HSET', Buffer.from('key'), Buffer.from('field'), Buffer.from('value')] ); }); }); it('Map', () => { assert.deepEqual( transformArguments('key', new Map([['field', 'value']])), ['HSET', 'key', 'field', 'value'] ); }); it('Array', () => { assert.deepEqual( transformArguments('key', [['field', 'value']]), ['HSET', 'key', 'field', 'value'] ); }); describe('Object', () => { it('string', () => { assert.deepEqual( transformArguments('key', { field: 'value' }), ['HSET', 'key', 'field', 'value'] ); }); it('Buffer', () => { assert.deepEqual( transformArguments('key', { field: Buffer.from('value') }), ['HSET', 'key', 'field', Buffer.from('value')] ); }); }); }); testUtils.testWithClient('client.hSet', async client => { assert.equal( await client.hSet('key', 'field', 'value'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.hSet', async cluster => { assert.equal( await cluster.hSet('key', { field: 'value' }), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HSET.ts000066400000000000000000000040001433774114400233760ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; type Types = RedisCommandArgument | number; type HSETObject = Record; type HSETMap = Map; type HSETTuples = Array<[Types, Types]> | Array; type GenericArguments = [key: RedisCommandArgument]; type SingleFieldArguments = [...generic: GenericArguments, field: Types, value: Types]; type MultipleFieldsArguments = [...generic: GenericArguments, value: HSETObject | HSETMap | HSETTuples]; export function transformArguments(...[ key, value, fieldValue ]: SingleFieldArguments | MultipleFieldsArguments): RedisCommandArguments { const args: RedisCommandArguments = ['HSET', key]; if (typeof value === 'string' || typeof value === 'number' || Buffer.isBuffer(value)) { args.push( convertValue(value), convertValue(fieldValue!) ); } else if (value instanceof Map) { pushMap(args, value); } else if (Array.isArray(value)) { pushTuples(args, value); } else { pushObject(args, value); } return args; } function pushMap(args: RedisCommandArguments, map: HSETMap): void { for (const [key, value] of map.entries()) { args.push( convertValue(key), convertValue(value) ); } } function pushTuples(args: RedisCommandArguments, tuples: HSETTuples): void { for (const tuple of tuples) { if (Array.isArray(tuple)) { pushTuples(args, tuple); continue; } args.push(convertValue(tuple)); } } function pushObject(args: RedisCommandArguments, object: HSETObject): void { for (const key of Object.keys(object)) { args.push( convertValue(key), convertValue(object[key]) ); } } function convertValue(value: Types): RedisCommandArgument { return typeof value === 'number' ? value.toString() : value; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/HSETNX.spec.ts000066400000000000000000000010621433774114400246020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HSETNX'; describe('HSETNX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'field', 'value'), ['HSETNX', 'key', 'field', 'value'] ); }); testUtils.testWithClient('client.hSetNX', async client => { assert.equal( await client.hSetNX('key', 'field', 'value'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HSETNX.ts000066400000000000000000000006031433774114400236510ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument, value: RedisCommandArgument ): RedisCommandArguments { return ['HSETNX', key, field, value]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/HSTRLEN.spec.ts000066400000000000000000000010311433774114400247040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HSTRLEN'; describe('HSTRLEN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'field'), ['HSTRLEN', 'key', 'field'] ); }); testUtils.testWithClient('client.hStrLen', async client => { assert.equal( await client.hStrLen('key', 'field'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HSTRLEN.ts000066400000000000000000000004741433774114400237650ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, field: RedisCommandArgument ): RedisCommandArguments { return ['HSTRLEN', key, field]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/HVALS.spec.ts000066400000000000000000000007711433774114400244540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './HVALS'; describe('HVALS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['HVALS', 'key'] ); }); testUtils.testWithClient('client.hVals', async client => { assert.deepEqual( await client.hVals('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/HVALS.ts000066400000000000000000000004411433774114400235150ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['HVALS', key]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/INCR.spec.ts000066400000000000000000000007571433774114400243360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './INCR'; describe('INCR', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['INCR', 'key'] ); }); testUtils.testWithClient('client.incr', async client => { assert.equal( await client.incr('key'), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/INCR.ts000066400000000000000000000004131433774114400233720ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['INCR', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/INCRBY.spec.ts000066400000000000000000000010021433774114400245510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './INCRBY'; describe('INCR', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['INCRBY', 'key', '1'] ); }); testUtils.testWithClient('client.incrBy', async client => { assert.equal( await client.incrBy('key', 1), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/INCRBY.ts000066400000000000000000000005001433774114400236220ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, increment: number ): RedisCommandArguments { return ['INCRBY', key, increment.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/INCRBYFLOAT.spec.ts000066400000000000000000000010471433774114400253500ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './INCRBYFLOAT'; describe('INCRBYFLOAT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1.5), ['INCRBYFLOAT', 'key', '1.5'] ); }); testUtils.testWithClient('client.incrByFloat', async client => { assert.equal( await client.incrByFloat('key', 1.5), '1.5' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/INCRBYFLOAT.ts000066400000000000000000000005231433774114400244150ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, increment: number ): RedisCommandArguments { return ['INCRBYFLOAT', key, increment.toString()]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/INFO.spec.ts000066400000000000000000000007561433774114400243350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './INFO'; describe('INFO', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['INFO'] ); }); it('server section', () => { assert.deepEqual( transformArguments('server'), ['INFO', 'server'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/INFO.ts000066400000000000000000000004011433774114400233670ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(section?: string): Array { const args = ['INFO']; if (section) { args.push(section); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/KEYS.spec.ts000066400000000000000000000004651433774114400243520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; describe('KEYS', () => { testUtils.testWithClient('client.keys', async client => { assert.deepEqual( await client.keys('pattern'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/KEYS.ts000066400000000000000000000004051433774114400234130ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments(pattern: RedisCommandArgument): RedisCommandArguments { return ['KEYS', pattern]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/LASTSAVE.spec.ts000066400000000000000000000007341433774114400250200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LASTSAVE'; describe('LASTSAVE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['LASTSAVE'] ); }); testUtils.testWithClient('client.lastSave', async client => { assert.ok((await client.lastSave()) instanceof Date); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LASTSAVE.ts000066400000000000000000000003111433774114400240560ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(): Array { return ['LASTSAVE']; } export function transformReply(reply: number): Date { return new Date(reply); } node-redis-redis-4.5.1/packages/client/lib/commands/LATENCY_DOCTOR.spec.ts000066400000000000000000000010351433774114400257420ustar00rootroot00000000000000import {strict as assert} from 'assert'; import testUtils, {GLOBAL} from '../test-utils'; import { transformArguments } from './LATENCY_DOCTOR'; describe('LATENCY DOCTOR', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['LATENCY', 'DOCTOR'] ); }); testUtils.testWithClient('client.latencyDoctor', async client => { assert.equal( typeof (await client.latencyDoctor()), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LATENCY_DOCTOR.ts000066400000000000000000000002151433774114400250100ustar00rootroot00000000000000export function transformArguments(): Array { return ['LATENCY', 'DOCTOR']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/LCS.spec.ts000066400000000000000000000013441433774114400242150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LCS'; describe('LCS', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('1', '2'), ['LCS', '1', '2'] ); }); testUtils.testWithClient('client.lcs', async client => { assert.equal( await client.lcs('1', '2'), '' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lcs', async cluster => { assert.equal( await cluster.lcs('{tag}1', '{tag}2'), '' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LCS.ts000066400000000000000000000006021433774114400232600ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key1: RedisCommandArgument, key2: RedisCommandArgument ): RedisCommandArguments { return [ 'LCS', key1, key2 ]; } export declare function transformReply(): string | Buffer; node-redis-redis-4.5.1/packages/client/lib/commands/LCS_IDX.spec.ts000066400000000000000000000020401433774114400247130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LCS_IDX'; describe('LCS_IDX', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('1', '2'), ['LCS', '1', '2', 'IDX'] ); }); testUtils.testWithClient('client.lcsIdx', async client => { const [, reply] = await Promise.all([ client.mSet({ '1': 'abc', '2': 'bc' }), client.lcsIdx('1', '2') ]); assert.deepEqual( reply, { matches: [{ key1: { start: 1, end: 2 }, key2: { start: 0, end: 1 } }], length: 2 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LCS_IDX.ts000066400000000000000000000017671433774114400240010ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RangeReply, RawRangeReply, transformRangeReply } from './generic-transformers'; import { transformArguments as transformLcsArguments } from './LCS'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './LCS'; export function transformArguments( key1: RedisCommandArgument, key2: RedisCommandArgument ): RedisCommandArguments { const args = transformLcsArguments(key1, key2); args.push('IDX'); return args; } type RawReply = [ 'matches', Array<[ key1: RawRangeReply, key2: RawRangeReply ]>, 'len', number ]; interface Reply { matches: Array<{ key1: RangeReply; key2: RangeReply; }>; length: number; } export function transformReply(reply: RawReply): Reply { return { matches: reply[1].map(([key1, key2]) => ({ key1: transformRangeReply(key1), key2: transformRangeReply(key2) })), length: reply[3] }; } node-redis-redis-4.5.1/packages/client/lib/commands/LCS_IDX_WITHMATCHLEN.spec.ts000066400000000000000000000022011433774114400266610ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LCS_IDX_WITHMATCHLEN'; describe('LCS_IDX_WITHMATCHLEN', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('1', '2'), ['LCS', '1', '2', 'IDX', 'WITHMATCHLEN'] ); }); testUtils.testWithClient('client.lcsIdxWithMatchLen', async client => { const [, reply] = await Promise.all([ client.mSet({ '1': 'abc', '2': 'bc' }), client.lcsIdxWithMatchLen('1', '2') ]); assert.deepEqual( reply, { matches: [{ key1: { start: 1, end: 2 }, key2: { start: 0, end: 1 }, length: 2 }], length: 2 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LCS_IDX_WITHMATCHLEN.ts000066400000000000000000000021231433774114400257330ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RangeReply, RawRangeReply, transformRangeReply } from './generic-transformers'; import { transformArguments as transformLcsArguments } from './LCS'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './LCS'; export function transformArguments( key1: RedisCommandArgument, key2: RedisCommandArgument ): RedisCommandArguments { const args = transformLcsArguments(key1, key2); args.push('IDX', 'WITHMATCHLEN'); return args; } type RawReply = [ 'matches', Array<[ key1: RawRangeReply, key2: RawRangeReply, length: number ]>, 'len', number ]; interface Reply { matches: Array<{ key1: RangeReply; key2: RangeReply; length: number; }>; length: number; } export function transformReply(reply: RawReply): Reply { return { matches: reply[1].map(([key1, key2, length]) => ({ key1: transformRangeReply(key1), key2: transformRangeReply(key2), length })), length: reply[3] }; } node-redis-redis-4.5.1/packages/client/lib/commands/LCS_LEN.spec.ts000066400000000000000000000013751433774114400247170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LCS_LEN'; describe('LCS_LEN', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('1', '2'), ['LCS', '1', '2', 'LEN'] ); }); testUtils.testWithClient('client.lcsLen', async client => { assert.equal( await client.lcsLen('1', '2'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lcsLen', async cluster => { assert.equal( await cluster.lcsLen('{tag}1', '{tag}2'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LCS_LEN.ts000066400000000000000000000007151433774114400237630ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformLcsArguments } from './LCS'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './LCS'; export function transformArguments( key1: RedisCommandArgument, key2: RedisCommandArgument ): RedisCommandArguments { const args = transformLcsArguments(key1, key2); args.push('LEN'); return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/LINDEX.spec.ts000066400000000000000000000020701433774114400245540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LINDEX'; describe('LINDEX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0), ['LINDEX', 'key', '0'] ); }); describe('client.lIndex', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.lIndex('key', 0), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with value', async client => { const [, lIndexReply] = await Promise.all([ client.lPush('key', 'element'), client.lIndex('key', 0) ]); assert.equal(lIndexReply, 'element'); }, GLOBAL.SERVERS.OPEN); }); testUtils.testWithCluster('cluster.lIndex', async cluster => { assert.equal( await cluster.lIndex('key', 0), null ); }, GLOBAL.CLUSTERS.OPEN); });node-redis-redis-4.5.1/packages/client/lib/commands/LINDEX.ts000066400000000000000000000005601433774114400236250ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, index: number ): RedisCommandArguments { return ['LINDEX', key, index.toString()]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/LINSERT.spec.ts000066400000000000000000000014621433774114400247150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LINSERT'; describe('LINSERT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'BEFORE', 'pivot', 'element'), ['LINSERT', 'key', 'BEFORE', 'pivot', 'element'] ); }); testUtils.testWithClient('client.lInsert', async client => { assert.equal( await client.lInsert('key', 'BEFORE', 'pivot', 'element'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lInsert', async cluster => { assert.equal( await cluster.lInsert('key', 'BEFORE', 'pivot', 'element'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LINSERT.ts000066400000000000000000000007531433774114400237660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; type LInsertPosition = 'BEFORE' | 'AFTER'; export function transformArguments( key: RedisCommandArgument, position: LInsertPosition, pivot: RedisCommandArgument, element: RedisCommandArgument ): RedisCommandArguments { return [ 'LINSERT', key, position, pivot, element ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/LLEN.spec.ts000066400000000000000000000012451433774114400243260ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LLEN'; describe('LLEN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['LLEN', 'key'] ); }); testUtils.testWithClient('client.lLen', async client => { assert.equal( await client.lLen('key'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lLen', async cluster => { assert.equal( await cluster.lLen('key'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LLEN.ts000066400000000000000000000004561433774114400234000ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['LLEN', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/LMOVE.spec.ts000066400000000000000000000015711433774114400244600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LMOVE'; describe('LMOVE', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('source', 'destination', 'LEFT', 'RIGHT'), ['LMOVE', 'source', 'destination', 'LEFT', 'RIGHT'] ); }); testUtils.testWithClient('client.lMove', async client => { assert.equal( await client.lMove('source', 'destination', 'LEFT', 'RIGHT'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lMove', async cluster => { assert.equal( await cluster.lMove('{tag}source', '{tag}destination', 'LEFT', 'RIGHT'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LMOVE.ts000066400000000000000000000010311433774114400235160ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ListSide } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( source: RedisCommandArgument, destination: RedisCommandArgument, sourceSide: ListSide, destinationSide: ListSide ): RedisCommandArguments { return [ 'LMOVE', source, destination, sourceSide, destinationSide, ]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/LMPOP.spec.ts000066400000000000000000000016021433774114400244600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LMPOP'; describe('LMPOP', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'LEFT'), ['LMPOP', '1', 'key', 'LEFT'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', 'LEFT', { COUNT: 2 }), ['LMPOP', '1', 'key', 'LEFT', 'COUNT', '2'] ); }); }); testUtils.testWithClient('client.lmPop', async client => { assert.deepEqual( await client.lmPop('key', 'RIGHT'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LMPOP.ts000066400000000000000000000010731433774114400235310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformLMPopArguments, LMPopOptions, ListSide } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; export function transformArguments( keys: RedisCommandArgument | Array, side: ListSide, options?: LMPopOptions ): RedisCommandArguments { return transformLMPopArguments( ['LMPOP'], keys, side, options ); } export declare function transformReply(): null | [ key: string, elements: Array ]; node-redis-redis-4.5.1/packages/client/lib/commands/LOLWUT.spec.ts000066400000000000000000000017041433774114400246220ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LOLWUT'; describe('LOLWUT', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['LOLWUT'] ); }); it('with version', () => { assert.deepEqual( transformArguments(5), ['LOLWUT', 'VERSION', '5'] ); }); it('with version and optional arguments', () => { assert.deepEqual( transformArguments(5, 1, 2, 3), ['LOLWUT', 'VERSION', '5', '1', '2', '3'] ); }); }); testUtils.testWithClient('client.LOLWUT', async client => { assert.equal( typeof (await client.LOLWUT()), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LOLWUT.ts000066400000000000000000000007101433774114400236650ustar00rootroot00000000000000import { RedisCommandArgument } from '.'; export const IS_READ_ONLY = true; export function transformArguments(version?: number, ...optionalArguments: Array): Array { const args = ['LOLWUT']; if (version) { args.push( 'VERSION', version.toString(), ...optionalArguments.map(String), ); } return args; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/LPOP.spec.ts000066400000000000000000000012531433774114400243450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LPOP'; describe('LPOP', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['LPOP', 'key'] ); }); testUtils.testWithClient('client.lPop', async client => { assert.equal( await client.lPop('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lPop', async cluster => { assert.equal( await cluster.lPop('key'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LPOP.ts000066400000000000000000000004401433774114400234110ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['LPOP', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/LPOP_COUNT.spec.ts000066400000000000000000000014121433774114400253120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LPOP_COUNT'; describe('LPOP COUNT', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['LPOP', 'key', '1'] ); }); testUtils.testWithClient('client.lPopCount', async client => { assert.equal( await client.lPopCount('key', 1), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lPopCount', async cluster => { assert.equal( await cluster.lPopCount('key', 1), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LPOP_COUNT.ts000066400000000000000000000005221433774114400243620ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return ['LPOP', key, count.toString()]; } export declare function transformReply(): Array | null; node-redis-redis-4.5.1/packages/client/lib/commands/LPOS.spec.ts000066400000000000000000000031651433774114400243540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LPOS'; describe('LPOS', () => { testUtils.isVersionGreaterThanHook([6, 0, 6]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'element'), ['LPOS', 'key', 'element'] ); }); it('with RANK', () => { assert.deepEqual( transformArguments('key', 'element', { RANK: 0 }), ['LPOS', 'key', 'element', 'RANK', '0'] ); }); it('with MAXLEN', () => { assert.deepEqual( transformArguments('key', 'element', { MAXLEN: 10 }), ['LPOS', 'key', 'element', 'MAXLEN', '10'] ); }); it('with RANK, MAXLEN', () => { assert.deepEqual( transformArguments('key', 'element', { RANK: 0, MAXLEN: 10 }), ['LPOS', 'key', 'element', 'RANK', '0', 'MAXLEN', '10'] ); }); }); testUtils.testWithClient('client.lPos', async client => { assert.equal( await client.lPos('key', 'element'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lPos', async cluster => { assert.equal( await cluster.lPos('key', 'element'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LPOS.ts000066400000000000000000000012721433774114400234200ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export interface LPosOptions { RANK?: number; MAXLEN?: number; } export function transformArguments( key: RedisCommandArgument, element: RedisCommandArgument, options?: LPosOptions ): RedisCommandArguments { const args = ['LPOS', key, element]; if (typeof options?.RANK === 'number') { args.push('RANK', options.RANK.toString()); } if (typeof options?.MAXLEN === 'number') { args.push('MAXLEN', options.MAXLEN.toString()); } return args; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/LPOS_COUNT.spec.ts000066400000000000000000000033431433774114400253220ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LPOS_COUNT'; describe('LPOS COUNT', () => { testUtils.isVersionGreaterThanHook([6, 0, 6]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'element', 0), ['LPOS', 'key', 'element', 'COUNT', '0'] ); }); it('with RANK', () => { assert.deepEqual( transformArguments('key', 'element', 0, { RANK: 0 }), ['LPOS', 'key', 'element', 'RANK', '0', 'COUNT', '0'] ); }); it('with MAXLEN', () => { assert.deepEqual( transformArguments('key', 'element', 0, { MAXLEN: 10 }), ['LPOS', 'key', 'element', 'COUNT', '0', 'MAXLEN', '10'] ); }); it('with RANK, MAXLEN', () => { assert.deepEqual( transformArguments('key', 'element', 0, { RANK: 0, MAXLEN: 10 }), ['LPOS', 'key', 'element', 'RANK', '0', 'COUNT', '0', 'MAXLEN', '10'] ); }); }); testUtils.testWithClient('client.lPosCount', async client => { assert.deepEqual( await client.lPosCount('key', 'element', 0), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lPosCount', async cluster => { assert.deepEqual( await cluster.lPosCount('key', 'element', 0), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LPOS_COUNT.ts000066400000000000000000000013071433774114400243670ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { LPosOptions } from './LPOS'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './LPOS'; export function transformArguments( key: RedisCommandArgument, element: RedisCommandArgument, count: number, options?: LPosOptions ): RedisCommandArguments { const args = ['LPOS', key, element]; if (typeof options?.RANK === 'number') { args.push('RANK', options.RANK.toString()); } args.push('COUNT', count.toString()); if (typeof options?.MAXLEN === 'number') { args.push('MAXLEN', options.MAXLEN.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/LPUSH.spec.ts000066400000000000000000000017071433774114400244720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LPUSH'; describe('LPUSH', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'field'), ['LPUSH', 'key', 'field'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['LPUSH', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.lPush', async client => { assert.equal( await client.lPush('key', 'field'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lPush', async cluster => { assert.equal( await cluster.lPush('key', 'field'), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LPUSH.ts000066400000000000000000000006621433774114400235400ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, elements: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['LPUSH', key], elements);} export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/LPUSHX.spec.ts000066400000000000000000000017271433774114400246240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LPUSHX'; describe('LPUSHX', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'element'), ['LPUSHX', 'key', 'element'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['LPUSHX', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.lPushX', async client => { assert.equal( await client.lPushX('key', 'element'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lPushX', async cluster => { assert.equal( await cluster.lPushX('key', 'element'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LPUSHX.ts000066400000000000000000000006621433774114400236700ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, element: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['LPUSHX', key], element); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/LRANGE.spec.ts000066400000000000000000000013361433774114400245450ustar00rootroot00000000000000 import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LRANGE'; describe('LRANGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, -1), ['LRANGE', 'key', '0', '-1'] ); }); testUtils.testWithClient('client.lRange', async client => { assert.deepEqual( await client.lRange('key', 0, -1), [] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lRange', async cluster => { assert.deepEqual( await cluster.lRange('key', 0, -1), [] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LRANGE.ts000066400000000000000000000006711433774114400236150ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, start: number, stop: number ): RedisCommandArguments { return [ 'LRANGE', key, start.toString(), stop.toString() ]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/LREM.spec.ts000066400000000000000000000013401433774114400243270ustar00rootroot00000000000000 import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LREM'; describe('LREM', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 'element'), ['LREM', 'key', '0', 'element'] ); }); testUtils.testWithClient('client.lRem', async client => { assert.equal( await client.lRem('key', 0, 'element'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lRem', async cluster => { assert.equal( await cluster.lRem('key', 0, 'element'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LREM.ts000066400000000000000000000006101433774114400233750ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, count: number, element: RedisCommandArgument ): RedisCommandArguments { return [ 'LREM', key, count.toString(), element ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/LSET.spec.ts000066400000000000000000000015021433774114400243370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LSET'; describe('LSET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 'element'), ['LSET', 'key', '0', 'element'] ); }); testUtils.testWithClient('client.lSet', async client => { await client.lPush('key', 'element'); assert.equal( await client.lSet('key', 0, 'element'), 'OK' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lSet', async cluster => { await cluster.lPush('key', 'element'); assert.equal( await cluster.lSet('key', 0, 'element'), 'OK' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LSET.ts000066400000000000000000000006261433774114400234140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, index: number, element: RedisCommandArgument ): RedisCommandArguments { return [ 'LSET', key, index.toString(), element ]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/LTRIM.spec.ts000066400000000000000000000013221433774114400244570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LTRIM'; describe('LTRIM', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, -1), ['LTRIM', 'key', '0', '-1'] ); }); testUtils.testWithClient('client.lTrim', async client => { assert.equal( await client.lTrim('key', 0, -1), 'OK' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.lTrim', async cluster => { assert.equal( await cluster.lTrim('key', 0, -1), 'OK' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/LTRIM.ts000066400000000000000000000006161433774114400235330ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, start: number, stop: number ): RedisCommandArguments { return [ 'LTRIM', key, start.toString(), stop.toString() ]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_DOCTOR.spec.ts000066400000000000000000000010341433774114400256520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MEMORY_DOCTOR'; describe('MEMORY DOCTOR', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['MEMORY', 'DOCTOR'] ); }); testUtils.testWithClient('client.memoryDoctor', async client => { assert.equal( typeof (await client.memoryDoctor()), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_DOCTOR.ts000066400000000000000000000002141433774114400247200ustar00rootroot00000000000000export function transformArguments(): Array { return ['MEMORY', 'DOCTOR']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_MALLOC-STATS.spec.ts000066400000000000000000000010631433774114400265250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MEMORY_MALLOC-STATS'; describe('MEMORY MALLOC-STATS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['MEMORY', 'MALLOC-STATS'] ); }); testUtils.testWithClient('client.memoryMallocStats', async client => { assert.equal( typeof (await client.memoryDoctor()), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_MALLOC-STATS.ts000066400000000000000000000002221433774114400255700ustar00rootroot00000000000000export function transformArguments(): Array { return ['MEMORY', 'MALLOC-STATS']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_PURGE.spec.ts000066400000000000000000000010121433774114400255360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MEMORY_PURGE'; describe('MEMORY PURGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['MEMORY', 'PURGE'] ); }); testUtils.testWithClient('client.memoryPurge', async client => { assert.equal( await client.memoryPurge(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_PURGE.ts000066400000000000000000000002131433774114400246070ustar00rootroot00000000000000export function transformArguments(): Array { return ['MEMORY', 'PURGE']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_STATS.spec.ts000066400000000000000000000066551433774114400255740ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments, transformReply } from './MEMORY_STATS'; describe('MEMORY STATS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['MEMORY', 'STATS'] ); }); it('transformReply', () => { assert.deepEqual( transformReply([ 'peak.allocated', 952728, 'total.allocated', 892904, 'startup.allocated', 809952, 'replication.backlog', 0, 'clients.slaves', 0, 'clients.normal', 41000, 'aof.buffer', 0, 'lua.caches', 0, 'db.0', [ 'overhead.hashtable.main', 72, 'overhead.hashtable.expires', 0 ], 'overhead.total', 850952, 'keys.count', 0, 'keys.bytes-per-key', 0, 'dataset.bytes', 41952, 'dataset.percentage', '50.573825836181641', 'peak.percentage', '93.720771789550781', 'allocator.allocated', 937632, 'allocator.active', 1191936, 'allocator.resident', 4005888, 'allocator-fragmentation.ratio', '1.2712193727493286', 'allocator-fragmentation.bytes', 254304, 'allocator-rss.ratio', '3.3608248233795166', 'allocator-rss.bytes', 2813952, 'rss-overhead.ratio', '2.4488751888275146', 'rss-overhead.bytes', 5804032, 'fragmentation', '11.515504837036133', 'fragmentation.bytes', 8958032 ]), { peakAllocated: 952728, totalAllocated: 892904, startupAllocated: 809952, replicationBacklog: 0, clientsReplicas: 0, clientsNormal: 41000, aofBuffer: 0, luaCaches: 0, overheadTotal: 850952, keysCount: 0, keysBytesPerKey: 0, datasetBytes: 41952, datasetPercentage: 50.573825836181641, peakPercentage: 93.720771789550781, allocatorAllocated: 937632, allocatorActive: 1191936, allocatorResident: 4005888, allocatorFragmentationRatio: 1.2712193727493286, allocatorFragmentationBytes: 254304, allocatorRssRatio: 3.3608248233795166, allocatorRssBytes: 2813952, rssOverheadRatio: 2.4488751888275146, rssOverheadBytes: 5804032, fragmentation: 11.515504837036133, fragmentationBytes: 8958032, db: { 0: { overheadHashtableMain: 72, overheadHashtableExpires: 0 } } } ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_STATS.ts000066400000000000000000000061721433774114400246350ustar00rootroot00000000000000export function transformArguments(): Array { return ['MEMORY', 'STATS']; } interface MemoryStatsReply { peakAllocated: number; totalAllocated: number; startupAllocated: number; replicationBacklog: number; clientsReplicas: number; clientsNormal: number; aofBuffer: number; luaCaches: number; overheadTotal: number; keysCount: number; keysBytesPerKey: number; datasetBytes: number; datasetPercentage: number; peakPercentage: number; allocatorAllocated?: number, allocatorActive?: number; allocatorResident?: number; allocatorFragmentationRatio?: number; allocatorFragmentationBytes?: number; allocatorRssRatio?: number; allocatorRssBytes?: number; rssOverheadRatio?: number; rssOverheadBytes?: number; fragmentation?: number; fragmentationBytes: number; db: { [key: number]: { overheadHashtableMain: number; overheadHashtableExpires: number; }; }; } const FIELDS_MAPPING = { 'peak.allocated': 'peakAllocated', 'total.allocated': 'totalAllocated', 'startup.allocated': 'startupAllocated', 'replication.backlog': 'replicationBacklog', 'clients.slaves': 'clientsReplicas', 'clients.normal': 'clientsNormal', 'aof.buffer': 'aofBuffer', 'lua.caches': 'luaCaches', 'overhead.total': 'overheadTotal', 'keys.count': 'keysCount', 'keys.bytes-per-key': 'keysBytesPerKey', 'dataset.bytes': 'datasetBytes', 'dataset.percentage': 'datasetPercentage', 'peak.percentage': 'peakPercentage', 'allocator.allocated': 'allocatorAllocated', 'allocator.active': 'allocatorActive', 'allocator.resident': 'allocatorResident', 'allocator-fragmentation.ratio': 'allocatorFragmentationRatio', 'allocator-fragmentation.bytes': 'allocatorFragmentationBytes', 'allocator-rss.ratio': 'allocatorRssRatio', 'allocator-rss.bytes': 'allocatorRssBytes', 'rss-overhead.ratio': 'rssOverheadRatio', 'rss-overhead.bytes': 'rssOverheadBytes', 'fragmentation': 'fragmentation', 'fragmentation.bytes': 'fragmentationBytes' }, DB_FIELDS_MAPPING = { 'overhead.hashtable.main': 'overheadHashtableMain', 'overhead.hashtable.expires': 'overheadHashtableExpires' }; export function transformReply(rawReply: Array>): MemoryStatsReply { const reply: any = { db: {} }; for (let i = 0; i < rawReply.length; i += 2) { const key = rawReply[i] as string; if (key.startsWith('db.')) { const dbTuples = rawReply[i + 1] as Array, db: any = {}; for (let j = 0; j < dbTuples.length; j += 2) { db[DB_FIELDS_MAPPING[dbTuples[j] as keyof typeof DB_FIELDS_MAPPING]] = dbTuples[j + 1]; } reply.db[key.substring(3)] = db; continue; } reply[FIELDS_MAPPING[key as keyof typeof FIELDS_MAPPING]] = Number(rawReply[i + 1]); } return reply as MemoryStatsReply; } node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_USAGE.spec.ts000066400000000000000000000015211433774114400255250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MEMORY_USAGE'; describe('MEMORY USAGE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key'), ['MEMORY', 'USAGE', 'key'] ); }); it('with SAMPLES', () => { assert.deepEqual( transformArguments('key', { SAMPLES: 1 }), ['MEMORY', 'USAGE', 'key', 'SAMPLES', '1'] ); }); }); testUtils.testWithClient('client.memoryUsage', async client => { assert.equal( await client.memoryUsage('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MEMORY_USAGE.ts000066400000000000000000000006631433774114400246020ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface MemoryUsageOptions { SAMPLES?: number; } export function transformArguments(key: string, options?: MemoryUsageOptions): Array { const args = ['MEMORY', 'USAGE', key]; if (options?.SAMPLES) { args.push('SAMPLES', options.SAMPLES.toString()); } return args; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/MGET.spec.ts000066400000000000000000000013031433774114400243230ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MGET'; describe('MGET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(['1', '2']), ['MGET', '1', '2'] ); }); testUtils.testWithClient('client.mGet', async client => { assert.deepEqual( await client.mGet(['key']), [null] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.mGet', async cluster => { assert.deepEqual( await cluster.mGet(['key']), [null] ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MGET.ts000066400000000000000000000005341433774114400233770ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( keys: Array ): RedisCommandArguments { return ['MGET', ...keys]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/MIGRATE.spec.ts000066400000000000000000000051121433774114400246610ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './MIGRATE'; describe('MIGRATE', () => { describe('transformArguments', () => { it('single key', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, 'key', 0, 10), ['MIGRATE', '127.0.0.1', '6379', 'key', '0', '10'] ); }); it('multiple keys', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, ['1', '2'], 0, 10), ['MIGRATE', '127.0.0.1', '6379', '', '0', '10', 'KEYS', '1', '2'] ); }); it('with COPY', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, 'key', 0, 10, { COPY: true }), ['MIGRATE', '127.0.0.1', '6379', 'key', '0', '10', 'COPY'] ); }); it('with REPLACE', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, 'key', 0, 10, { REPLACE: true }), ['MIGRATE', '127.0.0.1', '6379', 'key', '0', '10', 'REPLACE'] ); }); describe('with AUTH', () => { it('password only', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, 'key', 0, 10, { AUTH: { password: 'password' } }), ['MIGRATE', '127.0.0.1', '6379', 'key', '0', '10', 'AUTH', 'password'] ); }); it('username & password', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, 'key', 0, 10, { AUTH: { username: 'username', password: 'password' } }), ['MIGRATE', '127.0.0.1', '6379', 'key', '0', '10', 'AUTH2', 'username', 'password'] ); }); }); it('with COPY, REPLACE, AUTH', () => { assert.deepEqual( transformArguments('127.0.0.1', 6379, 'key', 0, 10, { COPY: true, REPLACE: true, AUTH: { password: 'password' } }), ['MIGRATE', '127.0.0.1', '6379', 'key', '0', '10', 'COPY', 'REPLACE', 'AUTH', 'password'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/MIGRATE.ts000066400000000000000000000024761433774114400237420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { AuthOptions } from './AUTH'; interface MigrateOptions { COPY?: true; REPLACE?: true; AUTH?: AuthOptions; } export function transformArguments( host: RedisCommandArgument, port: number, key: RedisCommandArgument | Array, destinationDb: number, timeout: number, options?: MigrateOptions ): RedisCommandArguments { const args = ['MIGRATE', host, port.toString()], isKeyArray = Array.isArray(key); if (isKeyArray) { args.push(''); } else { args.push(key); } args.push( destinationDb.toString(), timeout.toString() ); if (options?.COPY) { args.push('COPY'); } if (options?.REPLACE) { args.push('REPLACE'); } if (options?.AUTH) { if (options.AUTH.username) { args.push( 'AUTH2', options.AUTH.username, options.AUTH.password ); } else { args.push( 'AUTH', options.AUTH.password ); } } if (isKeyArray) { args.push( 'KEYS', ...key ); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MODULE_LIST.spec.ts000066400000000000000000000004271433774114400254150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './MODULE_LIST'; describe('MODULE LIST', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['MODULE', 'LIST'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/MODULE_LIST.ts000066400000000000000000000002121433774114400244540ustar00rootroot00000000000000export function transformArguments(): Array { return ['MODULE', 'LIST']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MODULE_LOAD.spec.ts000066400000000000000000000010621433774114400253550ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './MODULE_LOAD'; describe('MODULE LOAD', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('path'), ['MODULE', 'LOAD', 'path'] ); }); it('with module args', () => { assert.deepEqual( transformArguments('path', ['1', '2']), ['MODULE', 'LOAD', 'path', '1', '2'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/MODULE_LOAD.ts000066400000000000000000000004171433774114400244270ustar00rootroot00000000000000export function transformArguments(path: string, moduleArgs?: Array): Array { const args = ['MODULE', 'LOAD', path]; if (moduleArgs) { args.push(...moduleArgs); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MODULE_UNLOAD.spec.ts000066400000000000000000000004531433774114400256230ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './MODULE_UNLOAD'; describe('MODULE UNLOAD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('name'), ['MODULE', 'UNLOAD', 'name'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/MODULE_UNLOAD.ts000066400000000000000000000002361433774114400246710ustar00rootroot00000000000000export function transformArguments(name: string): Array { return ['MODULE', 'UNLOAD', name]; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/MOVE.spec.ts000066400000000000000000000007761433774114400243520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MOVE'; describe('MOVE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['MOVE', 'key', '1'] ); }); testUtils.testWithClient('client.move', async client => { assert.equal( await client.move('key', 1), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MOVE.ts000066400000000000000000000003561433774114400234130ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, db: number): Array { return ['MOVE', key, db.toString()]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/MSET.spec.ts000066400000000000000000000026001433774114400243400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MSET'; describe('MSET', () => { describe('transformArguments', () => { it("['key1', 'value1', 'key2', 'value2']", () => { assert.deepEqual( transformArguments(['key1', 'value1', 'key2', 'value2']), ['MSET', 'key1', 'value1', 'key2', 'value2'] ); }); it("[['key1', 'value1'], ['key2', 'value2']]", () => { assert.deepEqual( transformArguments([['key1', 'value1'], ['key2', 'value2']]), ['MSET', 'key1', 'value1', 'key2', 'value2'] ); }); it("{key1: 'value1'. key2: 'value2'}", () => { assert.deepEqual( transformArguments({ key1: 'value1', key2: 'value2' }), ['MSET', 'key1', 'value1', 'key2', 'value2'] ); }); }); testUtils.testWithClient('client.mSet', async client => { assert.equal( await client.mSet(['key1', 'value1', 'key2', 'value2']), 'OK' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.mSet', async cluster => { assert.equal( await cluster.mSet(['{key}1', 'value1', '{key}2', 'value2']), 'OK' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MSET.ts000066400000000000000000000012331433774114400234100ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; 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()); } else { for (const key of Object.keys(toSet)) { args.push(key, toSet[key]); } } return args; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/MSETNX.spec.ts000066400000000000000000000026221433774114400246120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MSETNX'; describe('MSETNX', () => { describe('transformArguments', () => { it("['key1', 'value1', 'key2', 'value2']", () => { assert.deepEqual( transformArguments(['key1', 'value1', 'key2', 'value2']), ['MSETNX', 'key1', 'value1', 'key2', 'value2'] ); }); it("[['key1', 'value1'], ['key2', 'value2']]", () => { assert.deepEqual( transformArguments([['key1', 'value1'], ['key2', 'value2']]), ['MSETNX', 'key1', 'value1', 'key2', 'value2'] ); }); it("{key1: 'value1'. key2: 'value2'}", () => { assert.deepEqual( transformArguments({ key1: 'value1', key2: 'value2' }), ['MSETNX', 'key1', 'value1', 'key2', 'value2'] ); }); }); testUtils.testWithClient('client.mSetNX', async client => { assert.equal( await client.mSetNX(['key1', 'value1', 'key2', 'value2']), true ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.mSetNX', async cluster => { assert.equal( await cluster.mSetNX(['{key}1', 'value1', '{key}2', 'value2']), true ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/MSETNX.ts000066400000000000000000000010361433774114400236570ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { MSetArguments } from './MSET'; export const FIRST_KEY_INDEX = 1; export function transformArguments(toSet: MSetArguments): RedisCommandArguments { const args: RedisCommandArguments = ['MSETNX']; if (Array.isArray(toSet)) { args.push(...toSet.flat()); } else { for (const key of Object.keys(toSet)) { args.push(key, toSet[key]); } } return args; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_ENCODING.spec.ts000066400000000000000000000010521433774114400260040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './OBJECT_ENCODING'; describe('OBJECT ENCODING', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['OBJECT', 'ENCODING', 'key'] ); }); testUtils.testWithClient('client.objectEncoding', async client => { assert.equal( await client.objectEncoding('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_ENCODING.ts000066400000000000000000000005031433774114400250530ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['OBJECT', 'ENCODING', key]; } export declare function transformReply(): string | null; node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_FREQ.spec.ts000066400000000000000000000010261433774114400253540ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './OBJECT_FREQ'; describe('OBJECT FREQ', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['OBJECT', 'FREQ', 'key'] ); }); testUtils.testWithClient('client.objectFreq', async client => { assert.equal( await client.objectFreq('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_FREQ.ts000066400000000000000000000004771433774114400244340ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['OBJECT', 'FREQ', key]; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_IDLETIME.spec.ts000066400000000000000000000010521433774114400260120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './OBJECT_IDLETIME'; describe('OBJECT IDLETIME', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['OBJECT', 'IDLETIME', 'key'] ); }); testUtils.testWithClient('client.objectIdleTime', async client => { assert.equal( await client.objectIdleTime('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_IDLETIME.ts000066400000000000000000000005031433774114400250610ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['OBJECT', 'IDLETIME', key]; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_REFCOUNT.spec.ts000066400000000000000000000010521433774114400260430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './OBJECT_REFCOUNT'; describe('OBJECT REFCOUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['OBJECT', 'REFCOUNT', 'key'] ); }); testUtils.testWithClient('client.objectRefCount', async client => { assert.equal( await client.objectRefCount('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/OBJECT_REFCOUNT.ts000066400000000000000000000005031433774114400251120ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['OBJECT', 'REFCOUNT', key]; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/PERSIST.spec.ts000066400000000000000000000010021433774114400247140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PERSIST'; describe('PERSIST', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['PERSIST', 'key'] ); }); testUtils.testWithClient('client.persist', async client => { assert.equal( await client.persist('key'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PERSIST.ts000066400000000000000000000004561433774114400237770ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['PERSIST', key]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/PEXPIRE.spec.ts000066400000000000000000000014161433774114400247100ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PEXPIRE'; describe('PEXPIRE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 1), ['PEXPIRE', 'key', '1'] ); }); it('with set option', () => { assert.deepEqual( transformArguments('key', 1, 'GT'), ['PEXPIRE', 'key', '1', 'GT'] ); }); }); testUtils.testWithClient('client.pExpire', async client => { assert.equal( await client.pExpire('key', 1), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PEXPIRE.ts000066400000000000000000000007251433774114400237610ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, milliseconds: number, mode?: 'NX' | 'XX' | 'GT' | 'LT' ): RedisCommandArguments { const args = ['PEXPIRE', key, milliseconds.toString()]; if (mode) { args.push(mode); } return args; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/PEXPIREAT.spec.ts000066400000000000000000000017741433774114400251440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PEXPIREAT'; describe('PEXPIREAT', () => { describe('transformArguments', () => { it('number', () => { assert.deepEqual( transformArguments('key', 1), ['PEXPIREAT', 'key', '1'] ); }); it('date', () => { const d = new Date(); assert.deepEqual( transformArguments('key', d), ['PEXPIREAT', 'key', d.getTime().toString()] ); }); it('with set option', () => { assert.deepEqual( transformArguments('key', 1, 'XX'), ['PEXPIREAT', 'key', '1', 'XX'] ); }); }); testUtils.testWithClient('client.pExpireAt', async client => { assert.equal( await client.pExpireAt('key', 1), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PEXPIREAT.ts000066400000000000000000000011121433774114400241750ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformPXAT } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, millisecondsTimestamp: number | Date, mode?: 'NX' | 'XX' | 'GT' | 'LT' ): RedisCommandArguments { const args = [ 'PEXPIREAT', key, transformPXAT(millisecondsTimestamp) ]; if (mode) { args.push(mode); } return args; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/PEXPIRETIME.spec.ts000066400000000000000000000011011433774114400253560ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PEXPIRETIME'; describe('PEXPIRETIME', () => { testUtils.isVersionGreaterThanHook([7]); it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['PEXPIRETIME', 'key'] ); }); testUtils.testWithClient('client.pExpireTime', async client => { assert.equal( await client.pExpireTime('key'), -2 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PEXPIRETIME.ts000066400000000000000000000004221433774114400244320ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['PEXPIRETIME', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/PFADD.spec.ts000066400000000000000000000014111433774114400244050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PFADD'; describe('PFADD', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'element'), ['PFADD', 'key', 'element'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['PFADD', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.pfAdd', async client => { assert.equal( await client.pfAdd('key', '1'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PFADD.ts000066400000000000000000000007211433774114400234570ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, element: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['PFADD', key], element); } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/PFCOUNT.spec.ts000066400000000000000000000013511433774114400247100ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PFCOUNT'; describe('PFCOUNT', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['PFCOUNT', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['PFCOUNT', '1', '2'] ); }); }); testUtils.testWithClient('client.pfCount', async client => { assert.equal( await client.pfCount('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PFCOUNT.ts000066400000000000000000000006071433774114400237620ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['PFCOUNT'], key); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/PFMERGE.spec.ts000066400000000000000000000015001433774114400246530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PFMERGE'; describe('PFMERGE', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('destination', 'source'), ['PFMERGE', 'destination', 'source'] ); }); it('array', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['PFMERGE', 'destination', '1', '2'] ); }); }); testUtils.testWithClient('client.pfMerge', async client => { assert.equal( await client.pfMerge('destination', 'source'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PFMERGE.ts000066400000000000000000000005671433774114400237360ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments(destination: string, source: string | Array): RedisCommandArguments { return pushVerdictArguments(['PFMERGE', destination], source); } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/PING.spec.ts000066400000000000000000000012301433774114400243230ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import RedisClient from '../client'; describe('PING', () => { 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); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/PING.ts000066400000000000000000000002711433774114400233760ustar00rootroot00000000000000import { RedisCommandArgument } from '.'; export function transformArguments(): Array { return ['PING']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/PSETEX.spec.ts000066400000000000000000000014451433774114400246060ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PSETEX'; describe('PSETEX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1, 'value'), ['PSETEX', 'key', '1', 'value'] ); }); testUtils.testWithClient('client.pSetEx', async client => { const a = await client.pSetEx('key', 1, 'value'); assert.equal( await client.pSetEx('key', 1, 'value'), 'OK' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.pSetEx', async cluster => { assert.equal( await cluster.pSetEx('key', 1, 'value'), 'OK' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PSETEX.ts000066400000000000000000000006421433774114400236530ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, milliseconds: number, value: RedisCommandArgument ): RedisCommandArguments { return [ 'PSETEX', key, milliseconds.toString(), value ]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/PTTL.spec.ts000066400000000000000000000007601433774114400243600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PTTL'; describe('PTTL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['PTTL', 'key'] ); }); testUtils.testWithClient('client.pTTL', async client => { assert.equal( await client.pTTL('key'), -2 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PTTL.ts000066400000000000000000000004561433774114400234310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['PTTL', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/PUBLISH.spec.ts000066400000000000000000000010531433774114400246770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PUBLISH'; describe('PUBLISH', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('channel', 'message'), ['PUBLISH', 'channel', 'message'] ); }); testUtils.testWithClient('client.publish', async client => { assert.equal( await client.publish('channel', 'message'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PUBLISH.ts000066400000000000000000000004451433774114400237520ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformArguments( channel: RedisCommandArgument, message: RedisCommandArgument ): RedisCommandArguments { return ['PUBLISH', channel, message]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/PUBSUB_CHANNELS.spec.ts000066400000000000000000000014301433774114400260430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PUBSUB_CHANNELS'; describe('PUBSUB CHANNELS', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['PUBSUB', 'CHANNELS'] ); }); it('with pattern', () => { assert.deepEqual( transformArguments('patter*'), ['PUBSUB', 'CHANNELS', 'patter*'] ); }); }); testUtils.testWithClient('client.pubSubChannels', async client => { assert.deepEqual( await client.pubSubChannels(), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PUBSUB_CHANNELS.ts000066400000000000000000000004261433774114400251160ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(pattern?: string): Array { const args = ['PUBSUB', 'CHANNELS']; if (pattern) { args.push(pattern); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/PUBSUB_NUMPAT.spec.ts000066400000000000000000000010141433774114400256520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PUBSUB_NUMPAT'; describe('PUBSUB NUMPAT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['PUBSUB', 'NUMPAT'] ); }); testUtils.testWithClient('client.pubSubNumPat', async client => { assert.equal( await client.pubSubNumPat(), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PUBSUB_NUMPAT.ts000066400000000000000000000002571433774114400247310ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(): Array { return ['PUBSUB', 'NUMPAT']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/PUBSUB_NUMSUB.spec.ts000066400000000000000000000017141433774114400256660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PUBSUB_NUMSUB'; describe('PUBSUB NUMSUB', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['PUBSUB', 'NUMSUB'] ); }); it('string', () => { assert.deepEqual( transformArguments('channel'), ['PUBSUB', 'NUMSUB', 'channel'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['PUBSUB', 'NUMSUB', '1', '2'] ); }); }); testUtils.testWithClient('client.pubSubNumSub', async client => { assert.deepEqual( await client.pubSubNumSub(), Object.create(null) ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/PUBSUB_NUMSUB.ts000066400000000000000000000013001433774114400247240ustar00rootroot00000000000000import { pushVerdictArguments } from './generic-transformers'; import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments( channels?: Array | RedisCommandArgument ): RedisCommandArguments { const args = ['PUBSUB', 'NUMSUB']; if (channels) return pushVerdictArguments(args, channels); return args; } export function transformReply(rawReply: Array): Record { const transformedReply = Object.create(null); for (let i = 0; i < rawReply.length; i +=2) { transformedReply[rawReply[i]] = rawReply[i + 1]; } return transformedReply; } node-redis-redis-4.5.1/packages/client/lib/commands/RANDOMKEY.spec.ts000066400000000000000000000007721433774114400251310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RANDOMKEY'; describe('RANDOMKEY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['RANDOMKEY'] ); }); testUtils.testWithClient('client.randomKey', async client => { assert.equal( await client.randomKey(), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RANDOMKEY.ts000066400000000000000000000004071433774114400241730ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments(): RedisCommandArguments { return ['RANDOMKEY']; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/READONLY.spec.ts000066400000000000000000000004131433774114400250050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './READONLY'; describe('READONLY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['READONLY'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/READONLY.ts000066400000000000000000000002041433774114400240520ustar00rootroot00000000000000export function transformArguments(): Array { return ['READONLY']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/READWRITE.spec.ts000066400000000000000000000004161433774114400251210ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './READWRITE'; describe('READWRITE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['READWRITE'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/READWRITE.ts000066400000000000000000000002051433774114400241640ustar00rootroot00000000000000export function transformArguments(): Array { return ['READWRITE']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/RENAME.spec.ts000066400000000000000000000010751433774114400245440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RENAME'; describe('RENAME', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('from', 'to'), ['RENAME', 'from', 'to'] ); }); testUtils.testWithClient('client.rename', async client => { await client.set('from', 'value'); assert.equal( await client.rename('from', 'to'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RENAME.ts000066400000000000000000000005131433774114400236070ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, newKey: RedisCommandArgument ): RedisCommandArguments { return ['RENAME', key, newKey]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/RENAMENX.spec.ts000066400000000000000000000011071433774114400250060ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RENAMENX'; describe('RENAMENX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('from', 'to'), ['RENAMENX', 'from', 'to'] ); }); testUtils.testWithClient('client.renameNX', async client => { await client.set('from', 'value'); assert.equal( await client.renameNX('from', 'to'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RENAMENX.ts000066400000000000000000000005371433774114400240630ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, newKey: RedisCommandArgument ): RedisCommandArguments { return ['RENAMENX', key, newKey]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/REPLICAOF.spec.ts000066400000000000000000000004441433774114400251000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './REPLICAOF'; describe('REPLICAOF', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('host', 1), ['REPLICAOF', 'host', '1'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/REPLICAOF.ts000066400000000000000000000002661433774114400241510ustar00rootroot00000000000000export function transformArguments(host: string, port: number): Array { return ['REPLICAOF', host, port.toString()]; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/RESTORE-ASKING.spec.ts000066400000000000000000000004351433774114400256710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './RESTORE-ASKING'; describe('RESTORE-ASKING', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['RESTORE-ASKING'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/RESTORE-ASKING.ts000066400000000000000000000002121433774114400247310ustar00rootroot00000000000000export function transformArguments(): Array { return ['RESTORE-ASKING']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/ROLE.spec.ts000066400000000000000000000042021433774114400243310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './ROLE'; describe('ROLE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['ROLE'] ); }); describe('transformReply', () => { it('master', () => { assert.deepEqual( transformReply(['master', 3129659, [['127.0.0.1', '9001', '3129242'], ['127.0.0.1', '9002', '3129543']]]), { role: 'master', replicationOffest: 3129659, replicas: [{ ip: '127.0.0.1', port: 9001, replicationOffest: 3129242 }, { ip: '127.0.0.1', port: 9002, replicationOffest: 3129543 }] } ); }); it('replica', () => { assert.deepEqual( transformReply(['slave', '127.0.0.1', 9000, 'connected', 3167038]), { role: 'slave', master: { ip: '127.0.0.1', port: 9000 }, state: 'connected', dataReceived: 3167038 } ); }); it('sentinel', () => { assert.deepEqual( transformReply(['sentinel', ['resque-master', 'html-fragments-master', 'stats-master', 'metadata-master']]), { role: 'sentinel', masterNames: ['resque-master', 'html-fragments-master', 'stats-master', 'metadata-master'] } ); }); }); testUtils.testWithClient('client.role', async client => { assert.deepEqual( await client.role(), { role: 'master', replicationOffest: 0, replicas: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ROLE.ts000066400000000000000000000037161433774114400234110ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(): Array { return ['ROLE']; } interface RoleReplyInterface { role: T; } type RoleMasterRawReply = ['master', number, Array<[string, string, string]>]; interface RoleMasterReply extends RoleReplyInterface<'master'> { replicationOffest: number; replicas: Array<{ ip: string; port: number; replicationOffest: number; }>; } type RoleReplicaState = 'connect' | 'connecting' | 'sync' | 'connected'; type RoleReplicaRawReply = ['slave', string, number, RoleReplicaState, number]; interface RoleReplicaReply extends RoleReplyInterface<'slave'> { master: { ip: string; port: number; }; state: RoleReplicaState; dataReceived: number; } type RoleSentinelRawReply = ['sentinel', Array]; interface RoleSentinelReply extends RoleReplyInterface<'sentinel'> { masterNames: Array; } type RoleRawReply = RoleMasterRawReply | RoleReplicaRawReply | RoleSentinelRawReply; type RoleReply = RoleMasterReply | RoleReplicaReply | RoleSentinelReply; export function transformReply(reply: RoleRawReply): RoleReply { switch (reply[0]) { case 'master': return { role: 'master', replicationOffest: reply[1], replicas: reply[2].map(([ip, port, replicationOffest]) => ({ ip, port: Number(port), replicationOffest: Number(replicationOffest) })) }; case 'slave': return { role: 'slave', master: { ip: reply[1], port: reply[2] }, state: reply[3], dataReceived: reply[4] }; case 'sentinel': return { role: 'sentinel', masterNames: reply[1] }; } } node-redis-redis-4.5.1/packages/client/lib/commands/RPOP.spec.ts000066400000000000000000000012531433774114400243530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RPOP'; describe('RPOP', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['RPOP', 'key'] ); }); testUtils.testWithClient('client.rPop', async client => { assert.equal( await client.rPop('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.rPop', async cluster => { assert.equal( await cluster.rPop('key'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RPOP.ts000066400000000000000000000004401433774114400234170ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['RPOP', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/RPOPLPUSH.spec.ts000066400000000000000000000014401433774114400251650ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RPOPLPUSH'; describe('RPOPLPUSH', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('source', 'destination'), ['RPOPLPUSH', 'source', 'destination'] ); }); testUtils.testWithClient('client.rPopLPush', async client => { assert.equal( await client.rPopLPush('source', 'destination'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.rPopLPush', async cluster => { assert.equal( await cluster.rPopLPush('{tag}source', '{tag}destination'), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RPOPLPUSH.ts000066400000000000000000000005451433774114400242410ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( source: RedisCommandArgument, destination: RedisCommandArgument ): RedisCommandArguments { return ['RPOPLPUSH', source, destination]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/RPOP_COUNT.spec.ts000066400000000000000000000014121433774114400253200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RPOP_COUNT'; describe('RPOP COUNT', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['RPOP', 'key', '1'] ); }); testUtils.testWithClient('client.rPopCount', async client => { assert.equal( await client.rPopCount('key', 1), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.rPopCount', async cluster => { assert.equal( await cluster.rPopCount('key', 1), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RPOP_COUNT.ts000066400000000000000000000005221433774114400243700ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return ['RPOP', key, count.toString()]; } export declare function transformReply(): Array | null; node-redis-redis-4.5.1/packages/client/lib/commands/RPUSH.spec.ts000066400000000000000000000017171433774114400245010ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RPUSH'; describe('RPUSH', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'element'), ['RPUSH', 'key', 'element'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['RPUSH', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.rPush', async client => { assert.equal( await client.rPush('key', 'element'), 1 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.rPush', async cluster => { assert.equal( await cluster.rPush('key', 'element'), 1 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RPUSH.ts000066400000000000000000000006611433774114400235450ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, element: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['RPUSH', key], element); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/RPUSHX.spec.ts000066400000000000000000000017271433774114400246320ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RPUSHX'; describe('RPUSHX', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'element'), ['RPUSHX', 'key', 'element'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['RPUSHX', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.rPushX', async client => { assert.equal( await client.rPushX('key', 'element'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.rPushX', async cluster => { assert.equal( await cluster.rPushX('key', 'element'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/RPUSHX.ts000066400000000000000000000006621433774114400236760ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, element: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['RPUSHX', key], element); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SADD.spec.ts000066400000000000000000000014031433774114400243030ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SADD'; describe('SADD', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'member'), ['SADD', 'key', 'member'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['SADD', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.sAdd', async client => { assert.equal( await client.sAdd('key', 'member'), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SADD.ts000066400000000000000000000006601433774114400233560ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, members: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SADD', key], members); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SAVE.spec.ts000066400000000000000000000003771433774114400243370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './SAVE'; describe('SAVE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['SAVE'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/SAVE.ts000066400000000000000000000002711433774114400233770ustar00rootroot00000000000000import { RedisCommandArgument } from '.'; export function transformArguments(): Array { return ['SAVE']; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/SCAN.spec.ts000066400000000000000000000042331433774114400243200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './SCAN'; describe('SCAN', () => { describe('transformArguments', () => { it('cusror only', () => { assert.deepEqual( transformArguments(0), ['SCAN', '0'] ); }); it('with MATCH', () => { assert.deepEqual( transformArguments(0, { MATCH: 'pattern' }), ['SCAN', '0', 'MATCH', 'pattern'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments(0, { COUNT: 1 }), ['SCAN', '0', 'COUNT', '1'] ); }); it('with TYPE', () => { assert.deepEqual( transformArguments(0, { TYPE: 'stream' }), ['SCAN', '0', 'TYPE', 'stream'] ); }); it('with MATCH & COUNT & TYPE', () => { assert.deepEqual( transformArguments(0, { MATCH: 'pattern', COUNT: 1, TYPE: 'stream' }), ['SCAN', '0', 'MATCH', 'pattern', 'COUNT', '1', 'TYPE', 'stream'] ); }); }); describe('transformReply', () => { it('without keys', () => { assert.deepEqual( transformReply(['0', []]), { cursor: 0, keys: [] } ); }); it('with keys', () => { assert.deepEqual( transformReply(['0', ['key']]), { cursor: 0, keys: ['key'] } ); }); }); testUtils.testWithClient('client.scan', async client => { assert.deepEqual( await client.scan(0), { cursor: 0, keys: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCAN.ts000066400000000000000000000014621433774114400233700ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ScanOptions, pushScanArguments } from './generic-transformers'; export const IS_READ_ONLY = true; export interface ScanCommandOptions extends ScanOptions { TYPE?: RedisCommandArgument; } export function transformArguments( cursor: number, options?: ScanCommandOptions ): RedisCommandArguments { const args = pushScanArguments(['SCAN'], cursor, options); if (options?.TYPE) { args.push('TYPE', options.TYPE); } return args; } type ScanRawReply = [string, Array]; export interface ScanReply { cursor: number; keys: Array; } export function transformReply([cursor, keys]: ScanRawReply): ScanReply { return { cursor: Number(cursor), keys }; } node-redis-redis-4.5.1/packages/client/lib/commands/SCARD.spec.ts000066400000000000000000000007641433774114400244350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SCARD'; describe('SCARD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['SCARD', 'key'] ); }); testUtils.testWithClient('client.sCard', async client => { assert.equal( await client.sCard('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCARD.ts000066400000000000000000000002641433774114400234770ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string): Array { return ['SCARD', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_DEBUG.spec.ts000066400000000000000000000010301433774114400254760ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SCRIPT_DEBUG'; describe('SCRIPT DEBUG', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('NO'), ['SCRIPT', 'DEBUG', 'NO'] ); }); testUtils.testWithClient('client.scriptDebug', async client => { assert.equal( await client.scriptDebug('NO'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_DEBUG.ts000066400000000000000000000002541433774114400245540ustar00rootroot00000000000000export function transformArguments(mode: 'YES' | 'SYNC' | 'NO'): Array { return ['SCRIPT', 'DEBUG', mode]; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_EXISTS.spec.ts000066400000000000000000000014361433774114400257010ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SCRIPT_EXISTS'; describe('SCRIPT EXISTS', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('sha1'), ['SCRIPT', 'EXISTS', 'sha1'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['SCRIPT', 'EXISTS', '1', '2'] ); }); }); testUtils.testWithClient('client.scriptExists', async client => { assert.deepEqual( await client.scriptExists('sha1'), [false] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_EXISTS.ts000066400000000000000000000005341433774114400247460ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export function transformArguments(sha1: string | Array): RedisCommandArguments { return pushVerdictArguments(['SCRIPT', 'EXISTS'], sha1); } export { transformBooleanArrayReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_FLUSH.spec.ts000066400000000000000000000013731433774114400255430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SCRIPT_FLUSH'; describe('SCRIPT FLUSH', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['SCRIPT', 'FLUSH'] ); }); it('with mode', () => { assert.deepEqual( transformArguments('SYNC'), ['SCRIPT', 'FLUSH', 'SYNC'] ); }); }); testUtils.testWithClient('client.scriptFlush', async client => { assert.equal( await client.scriptFlush(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_FLUSH.ts000066400000000000000000000003521433774114400246060ustar00rootroot00000000000000export function transformArguments(mode?: 'ASYNC' | 'SYNC'): Array { const args = ['SCRIPT', 'FLUSH']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_KILL.spec.ts000066400000000000000000000004271433774114400254140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './SCRIPT_KILL'; describe('SCRIPT KILL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['SCRIPT', 'KILL'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_KILL.ts000066400000000000000000000002121433774114400244530ustar00rootroot00000000000000export function transformArguments(): Array { return ['SCRIPT', 'KILL']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_LOAD.spec.ts000066400000000000000000000012271433774114400253770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { scriptSha1 } from '../lua-script'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SCRIPT_LOAD'; describe('SCRIPT LOAD', () => { const SCRIPT = 'return 1;', SCRIPT_SHA1 = scriptSha1(SCRIPT); it('transformArguments', () => { assert.deepEqual( transformArguments(SCRIPT), ['SCRIPT', 'LOAD', SCRIPT] ); }); testUtils.testWithClient('client.scriptLoad', async client => { assert.equal( await client.scriptLoad(SCRIPT), SCRIPT_SHA1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SCRIPT_LOAD.ts000066400000000000000000000002401433774114400244400ustar00rootroot00000000000000export function transformArguments(script: string): Array { return ['SCRIPT', 'LOAD', script]; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/SDIFF.spec.ts000066400000000000000000000013421433774114400244250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SDIFF'; describe('SDIFF', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['SDIFF', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['SDIFF', '1', '2'] ); }); }); testUtils.testWithClient('client.sDiff', async client => { assert.deepEqual( await client.sDiff('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SDIFF.ts000066400000000000000000000006771433774114400235060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SDIFF'], keys); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SDIFFSTORE.spec.ts000066400000000000000000000015061433774114400252440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SDIFFSTORE'; describe('SDIFFSTORE', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('destination', 'key'), ['SDIFFSTORE', 'destination', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['SDIFFSTORE', 'destination', '1', '2'] ); }); }); testUtils.testWithClient('client.sDiffStore', async client => { assert.equal( await client.sDiffStore('destination', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SDIFFSTORE.ts000066400000000000000000000007001433774114400243060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( destination: RedisCommandArgument, keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SDIFFSTORE', destination], keys); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SET.spec.ts000066400000000000000000000072071433774114400242330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SET'; describe('SET', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'value'), ['SET', 'key', 'value'] ); }); it('number', () => { assert.deepEqual( transformArguments('key', 1), ['SET', 'key', '1'] ); }); describe('TTL', () => { it('with EX', () => { assert.deepEqual( transformArguments('key', 'value', { EX: 1 }), ['SET', 'key', 'value', 'EX', '1'] ); }); it('with PX', () => { assert.deepEqual( transformArguments('key', 'value', { PX: 1 }), ['SET', 'key', 'value', 'PX', '1'] ); }); it('with EXAT', () => { assert.deepEqual( transformArguments('key', 'value', { EXAT: 1 }), ['SET', 'key', 'value', 'EXAT', '1'] ); }); it('with PXAT', () => { assert.deepEqual( transformArguments('key', 'value', { PXAT: 1 }), ['SET', 'key', 'value', 'PXAT', '1'] ); }); it('with KEEPTTL', () => { assert.deepEqual( transformArguments('key', 'value', { KEEPTTL: true }), ['SET', 'key', 'value', 'KEEPTTL'] ); }); }); describe('Guards', () => { it('with NX', () => { assert.deepEqual( transformArguments('key', 'value', { NX: true }), ['SET', 'key', 'value', 'NX'] ); }); it('with XX', () => { assert.deepEqual( transformArguments('key', 'value', { XX: true }), ['SET', 'key', 'value', 'XX'] ); }); }); it('with GET', () => { assert.deepEqual( transformArguments('key', 'value', { GET: true }), ['SET', 'key', 'value', 'GET'] ); }); it('with EX, NX, GET', () => { assert.deepEqual( transformArguments('key', 'value', { EX: 1, NX: true, GET: true }), ['SET', 'key', 'value', 'EX', '1', 'NX', 'GET'] ); }); }); describe('client.set', () => { testUtils.testWithClient('simple', async client => { assert.equal( await client.set('key', 'value'), 'OK' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with GET on empty key', async client => { assert.equal( await client.set('key', 'value', { GET: true }), null ); }, { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [6, 2] }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/SET.ts000066400000000000000000000027041433774114400232770ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; type MaximumOneOf = K extends keyof T ? { [P in K]?: T[K] } & Partial, never>> : never; type SetTTL = MaximumOneOf<{ EX: number; PX: number; EXAT: number; PXAT: number; KEEPTTL: true; }>; type SetGuards = MaximumOneOf<{ NX: true; XX: true; }>; interface SetCommonOptions { GET?: true; } export type SetOptions = SetTTL & SetGuards & SetCommonOptions; export function transformArguments( key: RedisCommandArgument, value: RedisCommandArgument | number, options?: SetOptions ): RedisCommandArguments { const args = [ 'SET', key, typeof value === 'number' ? value.toString() : value ]; if (options?.EX) { args.push('EX', options.EX.toString()); } else if (options?.PX) { args.push('PX', options.PX.toString()); } else if (options?.EXAT) { args.push('EXAT', options.EXAT.toString()); } else if (options?.PXAT) { args.push('PXAT', options.PXAT.toString()); } else if (options?.KEEPTTL) { args.push('KEEPTTL'); } if (options?.NX) { args.push('NX'); } else if (options?.XX) { args.push('XX'); } if (options?.GET) { args.push('GET'); } return args; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/SETBIT.spec.ts000066400000000000000000000013171433774114400245660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SETBIT'; describe('SETBIT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 1), ['SETBIT', 'key', '0', '1'] ); }); testUtils.testWithClient('client.setBit', async client => { assert.equal( await client.setBit('key', 0, 1), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.setBit', async cluster => { assert.equal( await cluster.setBit('key', 0, 1), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SETBIT.ts000066400000000000000000000006261433774114400236370ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { BitValue } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, offset: number, value: BitValue ): RedisCommandArguments { return ['SETBIT', key, offset.toString(), value.toString()]; } export declare function transformReply(): BitValue; node-redis-redis-4.5.1/packages/client/lib/commands/SETEX.spec.ts000066400000000000000000000013441433774114400244640ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SETEX'; describe('SETEX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1, 'value'), ['SETEX', 'key', '1', 'value'] ); }); testUtils.testWithClient('client.setEx', async client => { assert.equal( await client.setEx('key', 1, 'value'), 'OK' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.setEx', async cluster => { assert.equal( await cluster.setEx('key', 1, 'value'), 'OK' ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SETEX.ts000066400000000000000000000006271433774114400235360ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, seconds: number, value: RedisCommandArgument ): RedisCommandArguments { return [ 'SETEX', key, seconds.toString(), value ]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/SETNX .spec.ts000066400000000000000000000013261433774114400245350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SETNX'; describe('SETNX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'value'), ['SETNX', 'key', 'value'] ); }); testUtils.testWithClient('client.setNX', async client => { assert.equal( await client.setNX('key', 'value'), true ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.setNX', async cluster => { assert.equal( await cluster.setNX('key', 'value'), true ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SETNX.ts000066400000000000000000000005321433774114400235420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, value: RedisCommandArgument ): RedisCommandArguments { return ['SETNX', key, value]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/SETRANGE.spec.ts000066400000000000000000000013631433774114400250050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SETRANGE'; describe('SETRANGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 'value'), ['SETRANGE', 'key', '0', 'value'] ); }); testUtils.testWithClient('client.setRange', async client => { assert.equal( await client.setRange('key', 0, 'value'), 5 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.setRange', async cluster => { assert.equal( await cluster.setRange('key', 0, 'value'), 5 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SETRANGE.ts000066400000000000000000000005441433774114400240540ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, offset: number, value: RedisCommandArgument ): RedisCommandArguments { return ['SETRANGE', key, offset.toString(), value]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SHUTDOWN.spec.ts000066400000000000000000000012351433774114400250460ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './SHUTDOWN'; describe('SHUTDOWN', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(), ['SHUTDOWN'] ); }); it('NOSAVE', () => { assert.deepEqual( transformArguments('NOSAVE'), ['SHUTDOWN', 'NOSAVE'] ); }); it('SAVE', () => { assert.deepEqual( transformArguments('SAVE'), ['SHUTDOWN', 'SAVE'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/SHUTDOWN.ts000066400000000000000000000003421433774114400241130ustar00rootroot00000000000000export function transformArguments(mode?: 'NOSAVE' | 'SAVE'): Array { const args = ['SHUTDOWN']; if (mode) { args.push(mode); } return args; } export declare function transformReply(): void; node-redis-redis-4.5.1/packages/client/lib/commands/SINTER.spec.ts000066400000000000000000000013501433774114400245750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SINTER'; describe('SINTER', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['SINTER', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['SINTER', '1', '2'] ); }); }); testUtils.testWithClient('client.sInter', async client => { assert.deepEqual( await client.sInter('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SINTER.ts000066400000000000000000000007001433774114400236420ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SINTER'], keys); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SINTERCARD.spec.ts000066400000000000000000000015251433774114400252330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SINTERCARD'; describe('SINTERCARD', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(['1', '2']), ['SINTERCARD', '2', '1', '2'] ); }); it('with limit', () => { assert.deepEqual( transformArguments(['1', '2'], 1), ['SINTERCARD', '2', '1', '2', 'LIMIT', '1'] ); }); }); testUtils.testWithClient('client.sInterCard', async client => { assert.deepEqual( await client.sInterCard('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SINTERCARD.ts000066400000000000000000000010371433774114400243000ustar00rootroot00000000000000import { 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 | RedisCommandArgument, limit?: number ): RedisCommandArguments { const args = pushVerdictArgument(['SINTERCARD'], keys); if (limit) { args.push('LIMIT', limit.toString()); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SINTERSTORE.spec.ts000066400000000000000000000015141433774114400254140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SINTERSTORE'; describe('SINTERSTORE', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('destination', 'key'), ['SINTERSTORE', 'destination', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['SINTERSTORE', 'destination', '1', '2'] ); }); }); testUtils.testWithClient('client.sInterStore', async client => { assert.equal( await client.sInterStore('destination', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SINTERSTORE.ts000066400000000000000000000007261433774114400244670ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( destination: RedisCommandArgument, keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SINTERSTORE', destination], keys); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SISMEMBER.spec.ts000066400000000000000000000010521433774114400251160ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SISMEMBER'; describe('SISMEMBER', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member'), ['SISMEMBER', 'key', 'member'] ); }); testUtils.testWithClient('client.sIsMember', async client => { assert.equal( await client.sIsMember('key', 'member'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SISMEMBER.ts000066400000000000000000000005401433774114400241660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument ): RedisCommandArguments { return ['SISMEMBER', key, member]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/SMEMBERS.spec.ts000066400000000000000000000010101433774114400247770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SMEMBERS'; describe('SMEMBERS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['SMEMBERS', 'key'] ); }); testUtils.testWithClient('client.sMembers', async client => { assert.deepEqual( await client.sMembers('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SMEMBERS.ts000066400000000000000000000004441433774114400240600ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['SMEMBERS', key]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SMISMEMBER.spec.ts000066400000000000000000000011611433774114400252340ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SMISMEMBER'; describe('SMISMEMBER', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['SMISMEMBER', 'key', '1', '2'] ); }); testUtils.testWithClient('client.smIsMember', async client => { assert.deepEqual( await client.smIsMember('key', ['1', '2']), [false, false] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SMISMEMBER.ts000066400000000000000000000005621433774114400243070ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, members: Array ): RedisCommandArguments { return ['SMISMEMBER', key, ...members]; } export { transformBooleanArrayReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/SMOVE.spec.ts000066400000000000000000000011141433774114400244600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SMOVE'; describe('SMOVE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('source', 'destination', 'member'), ['SMOVE', 'source', 'destination', 'member'] ); }); testUtils.testWithClient('client.sMove', async client => { assert.equal( await client.sMove('source', 'destination', 'member'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SMOVE.ts000066400000000000000000000006261433774114400235360ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( source: RedisCommandArgument, destination: RedisCommandArgument, member: RedisCommandArgument ): RedisCommandArguments { return ['SMOVE', source, destination, member]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/SORT.spec.ts000066400000000000000000000052421433774114400243640ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SORT'; describe('SORT', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key'), ['SORT', 'key'] ); }); it('with BY', () => { assert.deepEqual( transformArguments('key', { BY: 'pattern' }), ['SORT', 'key', 'BY', 'pattern'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('key', { LIMIT: { offset: 0, count: 1 } }), ['SORT', 'key', 'LIMIT', '0', '1'] ); }); describe('with GET', () => { it('string', () => { assert.deepEqual( transformArguments('key', { GET: 'pattern' }), ['SORT', 'key', 'GET', 'pattern'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', { GET: ['1', '2'] }), ['SORT', 'key', 'GET', '1', 'GET', '2'] ); }); }); it('with DIRECTION', () => { assert.deepEqual( transformArguments('key', { DIRECTION: 'ASC' }), ['SORT', 'key', 'ASC'] ); }); it('with ALPHA', () => { assert.deepEqual( transformArguments('key', { ALPHA: true }), ['SORT', 'key', 'ALPHA'] ); }); it('with BY, LIMIT, GET, DIRECTION, ALPHA', () => { assert.deepEqual( transformArguments('key', { BY: 'pattern', LIMIT: { offset: 0, count: 1 }, GET: 'pattern', DIRECTION: 'ASC', ALPHA: true }), ['SORT', 'key', 'BY', 'pattern', 'LIMIT', '0', '1', 'GET', 'pattern', 'ASC', 'ALPHA'] ); }); }); testUtils.testWithClient('client.sort', async client => { assert.deepEqual( await client.sort('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SORT.ts000066400000000000000000000005641433774114400234350ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushSortArguments, SortOptions } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: string, options?: SortOptions ): RedisCommandArguments { return pushSortArguments(['SORT', key], options); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SORT_RO.spec.ts000066400000000000000000000053631433774114400247700ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SORT_RO'; describe('SORT_RO', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key'), ['SORT_RO', 'key'] ); }); it('with BY', () => { assert.deepEqual( transformArguments('key', { BY: 'pattern' }), ['SORT_RO', 'key', 'BY', 'pattern'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('key', { LIMIT: { offset: 0, count: 1 } }), ['SORT_RO', 'key', 'LIMIT', '0', '1'] ); }); describe('with GET', () => { it('string', () => { assert.deepEqual( transformArguments('key', { GET: 'pattern' }), ['SORT_RO', 'key', 'GET', 'pattern'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', { GET: ['1', '2'] }), ['SORT_RO', 'key', 'GET', '1', 'GET', '2'] ); }); }); it('with DIRECTION', () => { assert.deepEqual( transformArguments('key', { DIRECTION: 'ASC' }), ['SORT_RO', 'key', 'ASC'] ); }); it('with ALPHA', () => { assert.deepEqual( transformArguments('key', { ALPHA: true }), ['SORT_RO', 'key', 'ALPHA'] ); }); it('with BY, LIMIT, GET, DIRECTION, ALPHA', () => { assert.deepEqual( transformArguments('key', { BY: 'pattern', LIMIT: { offset: 0, count: 1 }, GET: 'pattern', DIRECTION: 'ASC', ALPHA: true, }), ['SORT_RO', 'key', 'BY', 'pattern', 'LIMIT', '0', '1', 'GET', 'pattern', 'ASC', 'ALPHA'] ); }); }); testUtils.testWithClient('client.sortRo', async client => { assert.deepEqual( await client.sortRo('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SORT_RO.ts000066400000000000000000000006321433774114400240310ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushSortArguments, SortOptions } from "./generic-transformers"; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: string, options?: SortOptions ): RedisCommandArguments { return pushSortArguments(['SORT_RO', key], options); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SORT_STORE.spec.ts000066400000000000000000000060551433774114400253430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SORT_STORE'; describe('SORT STORE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('source', 'destination'), ['SORT', 'source', 'STORE', 'destination'] ); }); it('with BY', () => { assert.deepEqual( transformArguments('source', 'destination', { BY: 'pattern' }), ['SORT', 'source', 'BY', 'pattern', 'STORE', 'destination'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('source', 'destination', { LIMIT: { offset: 0, count: 1 } }), ['SORT', 'source', 'LIMIT', '0', '1', 'STORE', 'destination'] ); }); describe('with GET', () => { it('string', () => { assert.deepEqual( transformArguments('source', 'destination', { GET: 'pattern' }), ['SORT', 'source', 'GET', 'pattern', 'STORE', 'destination'] ); }); it('array', () => { assert.deepEqual( transformArguments('source', 'destination', { GET: ['1', '2'] }), ['SORT', 'source', 'GET', '1', 'GET', '2', 'STORE', 'destination'] ); }); }); it('with DIRECTION', () => { assert.deepEqual( transformArguments('source', 'destination', { DIRECTION: 'ASC' }), ['SORT', 'source', 'ASC', 'STORE', 'destination'] ); }); it('with ALPHA', () => { assert.deepEqual( transformArguments('source', 'destination', { ALPHA: true }), ['SORT', 'source', 'ALPHA', 'STORE', 'destination'] ); }); it('with BY, LIMIT, GET, DIRECTION, ALPHA', () => { assert.deepEqual( transformArguments('source', 'destination', { BY: 'pattern', LIMIT: { offset: 0, count: 1 }, GET: 'pattern', DIRECTION: 'ASC', ALPHA: true }), ['SORT', 'source', 'BY', 'pattern', 'LIMIT', '0', '1', 'GET', 'pattern', 'ASC', 'ALPHA', 'STORE', 'destination'] ); }); }); testUtils.testWithClient('client.sortStore', async client => { assert.equal( await client.sortStore('source', 'destination'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SORT_STORE.ts000066400000000000000000000007671433774114400244160ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { SortOptions } from './generic-transformers'; import { transformArguments as transformSortArguments } from './SORT'; export const FIRST_KEY_INDEX = 1; export function transformArguments( source: string, destination: string, options?: SortOptions ): RedisCommandArguments { const args = transformSortArguments(source, options); args.push('STORE', destination); return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SPOP.spec.ts000066400000000000000000000013371433774114400243570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SPOP'; describe('SPOP', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key'), ['SPOP', 'key'] ); }); it('with count', () => { assert.deepEqual( transformArguments('key', 2), ['SPOP', 'key', '2'] ); }); }); testUtils.testWithClient('client.sPop', async client => { assert.equal( await client.sPop('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SPOP.ts000066400000000000000000000006431433774114400234250ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, count?: number ): RedisCommandArguments { const args = ['SPOP', key]; if (typeof count === 'number') { args.push(count.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SRANDMEMBER.spec.ts000066400000000000000000000010251433774114400253270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SRANDMEMBER'; describe('SRANDMEMBER', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['SRANDMEMBER', 'key'] ); }); testUtils.testWithClient('client.sRandMember', async client => { assert.equal( await client.sRandMember('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SRANDMEMBER.ts000066400000000000000000000004471433774114400244050ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['SRANDMEMBER', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/SRANDMEMBER_COUNT.spec.ts000066400000000000000000000010701433774114400262770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SRANDMEMBER_COUNT'; describe('SRANDMEMBER COUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['SRANDMEMBER', 'key', '1'] ); }); testUtils.testWithClient('client.sRandMemberCount', async client => { assert.deepEqual( await client.sRandMemberCount('key', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SRANDMEMBER_COUNT.ts000066400000000000000000000007371433774114400253570ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformSRandMemberArguments } from './SRANDMEMBER'; export { FIRST_KEY_INDEX } from './SRANDMEMBER'; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return [ ...transformSRandMemberArguments(key), count.toString() ]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SREM.spec.ts000066400000000000000000000014031433774114400243360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SREM'; describe('SREM', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'member'), ['SREM', 'key', 'member'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['SREM', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.sRem', async client => { assert.equal( await client.sRem('key', 'member'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SREM.ts000066400000000000000000000006601433774114400234110ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, members: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SREM', key], members); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SSCAN.spec.ts000066400000000000000000000037211433774114400244440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './SSCAN'; describe('SSCAN', () => { describe('transformArguments', () => { it('cusror only', () => { assert.deepEqual( transformArguments('key', 0), ['SSCAN', 'key', '0'] ); }); it('with MATCH', () => { assert.deepEqual( transformArguments('key', 0, { MATCH: 'pattern' }), ['SSCAN', 'key', '0', 'MATCH', 'pattern'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', 0, { COUNT: 1 }), ['SSCAN', 'key', '0', 'COUNT', '1'] ); }); it('with MATCH & COUNT', () => { assert.deepEqual( transformArguments('key', 0, { MATCH: 'pattern', COUNT: 1 }), ['SSCAN', 'key', '0', 'MATCH', 'pattern', 'COUNT', '1'] ); }); }); describe('transformReply', () => { it('without members', () => { assert.deepEqual( transformReply(['0', []]), { cursor: 0, members: [] } ); }); it('with members', () => { assert.deepEqual( transformReply(['0', ['member']]), { cursor: 0, members: ['member'] } ); }); }); testUtils.testWithClient('client.sScan', async client => { assert.deepEqual( await client.sScan('key', 0), { cursor: 0, members: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SSCAN.ts000066400000000000000000000013401433774114400235060ustar00rootroot00000000000000import { 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: RedisCommandArgument, cursor: number, options?: ScanOptions ): RedisCommandArguments { return pushScanArguments([ 'SSCAN', key, ], cursor, options); } type SScanRawReply = [string, Array]; interface SScanReply { cursor: number; members: Array; } export function transformReply([cursor, members]: SScanRawReply): SScanReply { return { cursor: Number(cursor), members }; } node-redis-redis-4.5.1/packages/client/lib/commands/STRLEN.spec.ts000066400000000000000000000012631433774114400246030ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './STRLEN'; describe('STRLEN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['STRLEN', 'key'] ); }); testUtils.testWithClient('client.strLen', async client => { assert.equal( await client.strLen('key'), 0 ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.strLen', async cluster => { assert.equal( await cluster.strLen('key'), 0 ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/STRLEN.ts000066400000000000000000000004601433774114400236500ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['STRLEN', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SUNION.spec.ts000066400000000000000000000013501433774114400246040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUNION'; describe('SUNION', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['SUNION', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['SUNION', '1', '2'] ); }); }); testUtils.testWithClient('client.sUnion', async client => { assert.deepEqual( await client.sUnion('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SUNION.ts000066400000000000000000000007001433774114400236510ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SUNION'], keys); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/SUNIONSTORE.spec.ts000066400000000000000000000015141433774114400254230ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUNIONSTORE'; describe('SUNIONSTORE', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('destination', 'key'), ['SUNIONSTORE', 'destination', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['SUNIONSTORE', 'destination', '1', '2'] ); }); }); testUtils.testWithClient('client.sUnionStore', async client => { assert.equal( await client.sUnionStore('destination', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SUNIONSTORE.ts000066400000000000000000000007011433774114400244670ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( destination: RedisCommandArgument, keys: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['SUNIONSTORE', destination], keys); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/SWAPDB.spec.ts000066400000000000000000000007751433774114400245630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SWAPDB'; describe('SWAPDB', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(0, 1), ['SWAPDB', '0', '1'] ); }); testUtils.testWithClient('client.swapDb', async client => { assert.equal( await client.swapDb(0, 1), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/SWAPDB.ts000066400000000000000000000003061433774114400236200ustar00rootroot00000000000000export function transformArguments(index1: number, index2: number): Array { return ['SWAPDB', index1.toString(), index2.toString()]; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/TIME.spec.ts000066400000000000000000000010361433774114400243300ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './TIME'; describe('TIME', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['TIME'] ); }); testUtils.testWithClient('client.time', async client => { const reply = await client.time(); assert.ok(reply instanceof Date); assert.ok(typeof reply.microseconds === 'number'); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/TIME.ts000066400000000000000000000006621433774114400234030ustar00rootroot00000000000000export function transformArguments(): Array { return ['TIME']; } interface TimeReply extends Date { microseconds: number; } export function transformReply(reply: [string, string]): TimeReply { const seconds = Number(reply[0]), microseconds = Number(reply[1]), d: Partial = new Date(seconds * 1000 + microseconds / 1000); d.microseconds = microseconds; return d as TimeReply; } node-redis-redis-4.5.1/packages/client/lib/commands/TOUCH.spec.ts000066400000000000000000000013351433774114400244560ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './TOUCH'; describe('TOUCH', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['TOUCH', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['TOUCH', '1', '2'] ); }); }); testUtils.testWithClient('client.touch', async client => { assert.equal( await client.touch('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/TOUCH.ts000066400000000000000000000006051433774114400235240ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['TOUCH'], key); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/TTL.spec.ts000066400000000000000000000007531433774114400242420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './TTL'; describe('TTL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TTL', 'key'] ); }); testUtils.testWithClient('client.ttl', async client => { assert.equal( await client.ttl('key'), -2 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/TTL.ts000066400000000000000000000004551433774114400233100ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['TTL', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/TYPE.spec.ts000066400000000000000000000007641433774114400243620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './TYPE'; describe('TYPE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TYPE', 'key'] ); }); testUtils.testWithClient('client.type', async client => { assert.equal( await client.type('key'), 'none' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/TYPE.ts000066400000000000000000000004741433774114400234270ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['TYPE', key]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/UNLINK.spec.ts000066400000000000000000000013431433774114400245730ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './UNLINK'; describe('UNLINK', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['UNLINK', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['UNLINK', '1', '2'] ); }); }); testUtils.testWithClient('client.unlink', async client => { assert.equal( await client.unlink('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/UNLINK.ts000066400000000000000000000006061433774114400236430ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['UNLINK'], key); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/UNWATCH.spec.ts000066400000000000000000000007601433774114400247060ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './UNWATCH'; describe('UNWATCH', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['UNWATCH'] ); }); testUtils.testWithClient('client.unwatch', async client => { assert.equal( await client.unwatch(), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/UNWATCH.ts000066400000000000000000000002031433774114400237450ustar00rootroot00000000000000export function transformArguments(): Array { return ['UNWATCH']; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/WAIT.spec.ts000066400000000000000000000007601433774114400243410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './WAIT'; describe('WAIT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(0, 1), ['WAIT', '0', '1'] ); }); testUtils.testWithClient('client.wait', async client => { assert.equal( await client.wait(0, 1), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/WAIT.ts000066400000000000000000000003751433774114400234120ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(numberOfReplicas: number, timeout: number): Array { return ['WAIT', numberOfReplicas.toString(), timeout.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/WATCH.spec.ts000066400000000000000000000007671433774114400244520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './WATCH'; describe('WATCH', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['WATCH', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['WATCH', '1', '2'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/WATCH.ts000066400000000000000000000005151433774114400235100ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string | Array): RedisCommandArguments { return pushVerdictArguments(['WATCH'], key); } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/XACK.spec.ts000066400000000000000000000014571433774114400243270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XACK'; describe('XACK', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'group', '1-0'), ['XACK', 'key', 'group', '1-0'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', 'group', ['1-0', '2-0']), ['XACK', 'key', 'group', '1-0', '2-0'] ); }); }); testUtils.testWithClient('client.xAck', async client => { assert.equal( await client.xAck('key', 'group', '1-0'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XACK.ts000066400000000000000000000007161433774114400233730ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, id: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['XACK', key, group], id); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/XADD.spec.ts000066400000000000000000000067701433774114400243240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XADD'; describe('XADD', () => { describe('transformArguments', () => { it('single field', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }), ['XADD', 'key', '*', 'field', 'value'] ); }); it('multiple fields', () => { assert.deepEqual( transformArguments('key', '*', { '1': 'I', '2': 'II' }), ['XADD', 'key', '*', '1', 'I', '2', 'II'] ); }); it('with NOMKSTREAM', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }, { NOMKSTREAM: true }), ['XADD', 'key', 'NOMKSTREAM', '*', 'field', 'value'] ); }); it('with TRIM', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }, { TRIM: { threshold: 1000 } }), ['XADD', 'key', '1000', '*', 'field', 'value'] ); }); it('with TRIM.strategy', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }, { TRIM: { strategy: 'MAXLEN', threshold: 1000 } }), ['XADD', 'key', 'MAXLEN', '1000', '*','field', 'value'] ); }); it('with TRIM.strategyModifier', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }, { TRIM: { strategyModifier: '=', threshold: 1000 } }), ['XADD', 'key', '=', '1000', '*', 'field', 'value'] ); }); it('with TRIM.limit', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }, { TRIM: { threshold: 1000, limit: 1 } }), ['XADD', 'key', '1000', 'LIMIT', '1', '*', 'field', 'value'] ); }); it('with NOMKSTREAM, TRIM, TRIM.*', () => { assert.deepEqual( transformArguments('key', '*', { field: 'value' }, { NOMKSTREAM: true, TRIM: { strategy: 'MAXLEN', strategyModifier: '=', threshold: 1000, limit: 1 } }), ['XADD', 'key', 'NOMKSTREAM', 'MAXLEN', '=', '1000', 'LIMIT', '1', '*', 'field', 'value'] ); }); }); testUtils.testWithClient('client.xAdd', async client => { assert.equal( typeof await client.xAdd('key', '*', { field: 'value' }), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XADD.ts000066400000000000000000000022441433774114400233630ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; interface XAddOptions { NOMKSTREAM?: true; TRIM?: { strategy?: 'MAXLEN' | 'MINID'; strategyModifier?: '=' | '~'; threshold: number; limit?: number; }; } export function transformArguments( key: RedisCommandArgument, id: RedisCommandArgument, message: Record, options?: XAddOptions ): RedisCommandArguments { const args = ['XADD', key]; if (options?.NOMKSTREAM) { args.push('NOMKSTREAM'); } if (options?.TRIM) { if (options.TRIM.strategy) { args.push(options.TRIM.strategy); } if (options.TRIM.strategyModifier) { args.push(options.TRIM.strategyModifier); } args.push(options.TRIM.threshold.toString()); if (options.TRIM.limit) { args.push('LIMIT', options.TRIM.limit.toString()); } } args.push(id); for (const [key, value] of Object.entries(message)) { args.push(key, value); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/client/lib/commands/XAUTOCLAIM.spec.ts000066400000000000000000000024521433774114400252430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XAUTOCLAIM'; describe('XAUTOCLAIM', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0'), ['XAUTOCLAIM', 'key', 'group', 'consumer', '1', '0-0'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { COUNT: 1 }), ['XAUTOCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'COUNT', '1'] ); }); }); testUtils.testWithClient('client.xAutoClaim', async client => { await Promise.all([ client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), client.xGroupCreateConsumer('key', 'group', 'consumer'), ]); assert.deepEqual( await client.xAutoClaim('key', 'group', 'consumer', 1, '0-0'), { nextId: '0-0', messages: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XAUTOCLAIM.ts000066400000000000000000000020071433774114400243060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { StreamMessagesReply, transformStreamMessagesReply } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export interface XAutoClaimOptions { COUNT?: number; } export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, consumer: RedisCommandArgument, minIdleTime: number, start: string, options?: XAutoClaimOptions ): RedisCommandArguments { const args = ['XAUTOCLAIM', key, group, consumer, minIdleTime.toString(), start]; if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } return args; } type XAutoClaimRawReply = [RedisCommandArgument, Array]; interface XAutoClaimReply { nextId: RedisCommandArgument; messages: StreamMessagesReply; } export function transformReply(reply: XAutoClaimRawReply): XAutoClaimReply { return { nextId: reply[0], messages: transformStreamMessagesReply(reply[1]) }; } node-redis-redis-4.5.1/packages/client/lib/commands/XAUTOCLAIM_JUSTID.spec.ts000066400000000000000000000017431433774114400263270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XAUTOCLAIM_JUSTID'; describe('XAUTOCLAIM JUSTID', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0'), ['XAUTOCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'JUSTID'] ); }); testUtils.testWithClient('client.xAutoClaimJustId', async client => { await Promise.all([ client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), client.xGroupCreateConsumer('key', 'group', 'consumer'), ]); assert.deepEqual( await client.xAutoClaimJustId('key', 'group', 'consumer', 1, '0-0'), { nextId: '0-0', messages: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XAUTOCLAIM_JUSTID.ts000066400000000000000000000014021433774114400253660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformXAutoClaimArguments } from './XAUTOCLAIM'; export { FIRST_KEY_INDEX } from './XAUTOCLAIM'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformXAutoClaimArguments(...args), 'JUSTID' ]; } type XAutoClaimJustIdRawReply = [RedisCommandArgument, Array]; interface XAutoClaimJustIdReply { nextId: RedisCommandArgument; messages: Array; } export function transformReply(reply: XAutoClaimJustIdRawReply): XAutoClaimJustIdReply { return { nextId: reply[0], messages: reply[1] }; } node-redis-redis-4.5.1/packages/client/lib/commands/XCLAIM.spec.ts000066400000000000000000000057541433774114400245620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XCLAIM'; describe('XCLAIM', () => { describe('transformArguments', () => { it('single id (string)', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0'), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0'] ); }); it('multiple ids (array)', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, ['0-0', '1-0']), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', '1-0'] ); }); it('with IDLE', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { IDLE: 1 }), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'IDLE', '1'] ); }); it('with TIME (number)', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { TIME: 1 }), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'TIME', '1'] ); }); it('with TIME (date)', () => { const d = new Date(); assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { TIME: d }), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'TIME', d.getTime().toString()] ); }); it('with RETRYCOUNT', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { RETRYCOUNT: 1 }), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'RETRYCOUNT', '1'] ); }); it('with FORCE', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { FORCE: true }), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'FORCE'] ); }); it('with IDLE, TIME, RETRYCOUNT, FORCE, JUSTID', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0', { IDLE: 1, TIME: 1, RETRYCOUNT: 1, FORCE: true }), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'IDLE', '1', 'TIME', '1', 'RETRYCOUNT', '1', 'FORCE'] ); }); }); testUtils.testWithClient('client.xClaim', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xClaim('key', 'group', 'consumer', 1, '0-0'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XCLAIM.ts000066400000000000000000000023111433774114400236130ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export interface XClaimOptions { IDLE?: number; TIME?: number | Date; RETRYCOUNT?: number; FORCE?: true; } export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, consumer: RedisCommandArgument, minIdleTime: number, id: RedisCommandArgument | Array, options?: XClaimOptions ): RedisCommandArguments { const args = pushVerdictArguments( ['XCLAIM', key, group, consumer, minIdleTime.toString()], id ); if (options?.IDLE) { args.push('IDLE', options.IDLE.toString()); } if (options?.TIME) { args.push( 'TIME', (typeof options.TIME === 'number' ? options.TIME : options.TIME.getTime()).toString() ); } if (options?.RETRYCOUNT) { args.push('RETRYCOUNT', options.RETRYCOUNT.toString()); } if (options?.FORCE) { args.push('FORCE'); } return args; } export { transformStreamMessagesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XCLAIM_JUSTID.spec.ts000066400000000000000000000013421433774114400256310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XCLAIM_JUSTID'; describe('XCLAIM JUSTID', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer', 1, '0-0'), ['XCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'JUSTID'] ); }); testUtils.testWithClient('client.xClaimJustId', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xClaimJustId('key', 'group', 'consumer', 1, '0-0'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XCLAIM_JUSTID.ts000066400000000000000000000007111433774114400246770ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformXClaimArguments } from './XCLAIM'; export { FIRST_KEY_INDEX } from './XCLAIM'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformXClaimArguments(...args), 'JUSTID' ]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/XDEL.spec.ts000066400000000000000000000014021433774114400243230ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XDEL'; describe('XDEL', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', '0-0'), ['XDEL', 'key', '0-0'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['0-0', '1-0']), ['XDEL', 'key', '0-0', '1-0'] ); }); }); testUtils.testWithClient('client.xDel', async client => { assert.equal( await client.xDel('key', '0-0'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XDEL.ts000066400000000000000000000006461433774114400234030ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, id: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['XDEL', key], id); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_CREATE.spec.ts000066400000000000000000000017161433774114400256460ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XGROUP_CREATE'; describe('XGROUP CREATE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'group', '$'), ['XGROUP', 'CREATE', 'key', 'group', '$'] ); }); it('with MKSTREAM', () => { assert.deepEqual( transformArguments('key', 'group', '$', { MKSTREAM: true }), ['XGROUP', 'CREATE', 'key', 'group', '$', 'MKSTREAM'] ); }); }); testUtils.testWithClient('client.xGroupCreate', async client => { assert.equal( await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_CREATE.ts000066400000000000000000000010531433774114400247070ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; interface XGroupCreateOptions { MKSTREAM?: true; } export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, id: RedisCommandArgument, options?: XGroupCreateOptions ): RedisCommandArguments { const args = ['XGROUP', 'CREATE', key, group, id]; if (options?.MKSTREAM) { args.push('MKSTREAM'); } return args; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_CREATECONSUMER.spec.ts000066400000000000000000000014311433774114400270140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XGROUP_CREATECONSUMER'; describe('XGROUP CREATECONSUMER', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer'), ['XGROUP', 'CREATECONSUMER', 'key', 'group', 'consumer'] ); }); testUtils.testWithClient('client.xGroupCreateConsumer', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.equal( await client.xGroupCreateConsumer('key', 'group', 'consumer'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_CREATECONSUMER.ts000066400000000000000000000006331433774114400260660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, consumer: RedisCommandArgument ): RedisCommandArguments { return ['XGROUP', 'CREATECONSUMER', key, group, consumer]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_DELCONSUMER.spec.ts000066400000000000000000000013261433774114400264600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XGROUP_DELCONSUMER'; describe('XGROUP DELCONSUMER', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group', 'consumer'), ['XGROUP', 'DELCONSUMER', 'key', 'group', 'consumer'] ); }); testUtils.testWithClient('client.xGroupDelConsumer', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.equal( await client.xGroupDelConsumer('key', 'group', 'consumer'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_DELCONSUMER.ts000066400000000000000000000005701433774114400255270ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, consumer: RedisCommandArgument ): RedisCommandArguments { return ['XGROUP', 'DELCONSUMER', key, group, consumer]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_DESTROY.spec.ts000066400000000000000000000012411433774114400260250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XGROUP_DESTROY'; describe('XGROUP DESTROY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group'), ['XGROUP', 'DESTROY', 'key', 'group'] ); }); testUtils.testWithClient('client.xGroupDestroy', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.equal( await client.xGroupDestroy('key', 'group'), true ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_DESTROY.ts000066400000000000000000000005461433774114400251030ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument ): RedisCommandArguments { return ['XGROUP', 'DESTROY', key, group]; } export { transformBooleanReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_SETID.spec.ts000066400000000000000000000012461433774114400255510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XGROUP_SETID'; describe('XGROUP SETID', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group', '0'), ['XGROUP', 'SETID', 'key', 'group', '0'] ); }); testUtils.testWithClient('client.xGroupSetId', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.equal( await client.xGroupSetId('key', 'group', '0'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XGROUP_SETID.ts000066400000000000000000000005641433774114400246220ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, id: RedisCommandArgument ): RedisCommandArguments { return ['XGROUP', 'SETID', key, group, id]; } export declare function transformReply(): RedisCommandArgument; node-redis-redis-4.5.1/packages/client/lib/commands/XINFO_CONSUMERS.spec.ts000066400000000000000000000022261433774114400261150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './XINFO_CONSUMERS'; describe('XINFO CONSUMERS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group'), ['XINFO', 'CONSUMERS', 'key', 'group'] ); }); it('transformReply', () => { assert.deepEqual( transformReply([ ['name', 'Alice', 'pending', 1, 'idle', 9104628], ['name', 'Bob', 'pending', 1, 'idle', 83841983] ]), [{ name: 'Alice', pending: 1, idle: 9104628 }, { name: 'Bob', pending: 1, idle: 83841983 }] ); }); testUtils.testWithClient('client.xInfoConsumers', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xInfoConsumers('key', 'group'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XINFO_CONSUMERS.ts000066400000000000000000000011701433774114400251610ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument ): RedisCommandArguments { return ['XINFO', 'CONSUMERS', key, group]; } type XInfoConsumersReply = Array<{ name: RedisCommandArgument; pending: number; idle: number; }>; export function transformReply(rawReply: Array): XInfoConsumersReply { return rawReply.map(consumer => ({ name: consumer[1], pending: consumer[3], idle: consumer[5] })); } node-redis-redis-4.5.1/packages/client/lib/commands/XINFO_GROUPS.spec.ts000066400000000000000000000027131433774114400255570ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './XINFO_GROUPS'; describe('XINFO GROUPS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['XINFO', 'GROUPS', 'key'] ); }); it('transformReply', () => { assert.deepEqual( transformReply([ ['name', 'mygroup', 'consumers', 2, 'pending', 2, 'last-delivered-id', '1588152489012-0'], ['name', 'some-other-group', 'consumers', 1, 'pending', 0, 'last-delivered-id', '1588152498034-0'] ]), [{ name: 'mygroup', consumers: 2, pending: 2, lastDeliveredId: '1588152489012-0' }, { name: 'some-other-group', consumers: 1, pending: 0, lastDeliveredId: '1588152498034-0' }] ); }); testUtils.testWithClient('client.xInfoGroups', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xInfoGroups('key'), [{ name: 'group', consumers: 0, pending: 0, lastDeliveredId: '0-0' }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XINFO_GROUPS.ts000066400000000000000000000012151433774114400246220ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['XINFO', 'GROUPS', key]; } type XInfoGroupsReply = Array<{ name: RedisCommandArgument; consumers: number; pending: number; lastDeliveredId: RedisCommandArgument; }>; export function transformReply(rawReply: Array): XInfoGroupsReply { return rawReply.map(group => ({ name: group[1], consumers: group[3], pending: group[5], lastDeliveredId: group[7] })); } node-redis-redis-4.5.1/packages/client/lib/commands/XINFO_STREAM.spec.ts000066400000000000000000000043361433774114400255360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './XINFO_STREAM'; describe('XINFO STREAM', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['XINFO', 'STREAM', 'key'] ); }); it('transformReply', () => { assert.deepEqual( transformReply([ 'length', 2, 'radix-tree-keys', 1, 'radix-tree-nodes', 2, 'last-generated-id', '1538385846314-0', 'groups', 2, 'first-entry', ['1538385820729-0', ['foo', 'bar']], 'last-entry', ['1538385846314-0', ['field', 'value']] ]), { length: 2, radixTreeKeys: 1, radixTreeNodes: 2, groups: 2, lastGeneratedId: '1538385846314-0', firstEntry: { id: '1538385820729-0', message: Object.create(null, { foo: { value: 'bar', configurable: true, enumerable: true } }) }, lastEntry: { id: '1538385846314-0', message: Object.create(null, { field: { value: 'value', configurable: true, enumerable: true } }) } } ); }); testUtils.testWithClient('client.xInfoStream', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xInfoStream('key'), { length: 0, radixTreeKeys: 0, radixTreeNodes: 1, groups: 1, lastGeneratedId: '0-0', firstEntry: null, lastEntry: null } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XINFO_STREAM.ts000066400000000000000000000036541433774114400246070ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { StreamMessageReply, transformTuplesReply } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['XINFO', 'STREAM', key]; } interface XInfoStreamReply { length: number; radixTreeKeys: number; radixTreeNodes: number; groups: number; lastGeneratedId: RedisCommandArgument; firstEntry: StreamMessageReply | null; lastEntry: StreamMessageReply | null; } export function transformReply(rawReply: Array): XInfoStreamReply { const parsedReply: Partial = {}; for (let i = 0; i < rawReply.length; i+= 2) { switch (rawReply[i]) { case 'length': parsedReply.length = rawReply[i + 1]; break; case 'radix-tree-keys': parsedReply.radixTreeKeys = rawReply[i + 1]; break; case 'radix-tree-nodes': parsedReply.radixTreeNodes = rawReply[i + 1]; break; case 'groups': parsedReply.groups = rawReply[i + 1]; break; case 'last-generated-id': parsedReply.lastGeneratedId = rawReply[i + 1]; break; case 'first-entry': parsedReply.firstEntry = rawReply[i + 1] ? { id: rawReply[i + 1][0], message: transformTuplesReply(rawReply[i + 1][1]) } : null; break; case 'last-entry': parsedReply.lastEntry = rawReply[i + 1] ? { id: rawReply[i + 1][0], message: transformTuplesReply(rawReply[i + 1][1]) } : null; break; } } return parsedReply as XInfoStreamReply; } node-redis-redis-4.5.1/packages/client/lib/commands/XLEN.spec.ts000066400000000000000000000007571433774114400243510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XLEN'; describe('XLEN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['XLEN', 'key'] ); }); testUtils.testWithClient('client.xLen', async client => { assert.equal( await client.xLen('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XLEN.ts000066400000000000000000000004561433774114400234140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['XLEN', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/XPENDING.spec.ts000066400000000000000000000036321433774114400250120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XPENDING'; describe('XPENDING', () => { describe('transformArguments', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'group'), ['XPENDING', 'key', 'group'] ); }); }); describe('client.xPending', () => { testUtils.testWithClient('simple', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xPending('key', 'group'), { pending: 0, firstId: null, lastId: null, consumers: null } ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with consumers', async client => { const [,, id] = await Promise.all([ client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), client.xGroupCreateConsumer('key', 'group', 'consumer'), client.xAdd('key', '*', { field: 'value' }), client.xReadGroup('group', 'consumer', { key: 'key', id: '>' }) ]); assert.deepEqual( await client.xPending('key', 'group'), { pending: 1, firstId: id, lastId: id, consumers: [{ name: 'consumer', deliveriesCounter: 1 }] } ); }, { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [6, 2] }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/XPENDING.ts000066400000000000000000000022021433774114400240510ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument ): RedisCommandArguments { return ['XPENDING', key, group]; } type XPendingRawReply = [ pending: number, firstId: RedisCommandArgument | null, lastId: RedisCommandArgument | null, consumers: Array<[ name: RedisCommandArgument, deliveriesCounter: RedisCommandArgument ]> | null ]; interface XPendingReply { pending: number; firstId: RedisCommandArgument | null; lastId: RedisCommandArgument | null; consumers: Array<{ name: RedisCommandArgument; deliveriesCounter: number; }> | null; } export function transformReply(reply: XPendingRawReply): XPendingReply { return { pending: reply[0], firstId: reply[1], lastId: reply[2], consumers: reply[3] === null ? null : reply[3].map(([name, deliveriesCounter]) => ({ name, deliveriesCounter: Number(deliveriesCounter) })) }; } node-redis-redis-4.5.1/packages/client/lib/commands/XPENDING_RANGE.spec.ts000066400000000000000000000032221433774114400257210ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XPENDING_RANGE'; describe('XPENDING RANGE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'group', '-', '+', 1), ['XPENDING', 'key', 'group', '-', '+', '1'] ); }); it('with IDLE', () => { assert.deepEqual( transformArguments('key', 'group', '-', '+', 1, { IDLE: 1, }), ['XPENDING', 'key', 'group', 'IDLE', '1', '-', '+', '1'] ); }); it('with consumer', () => { assert.deepEqual( transformArguments('key', 'group', '-', '+', 1, { consumer: 'consumer' }), ['XPENDING', 'key', 'group', '-', '+', '1', 'consumer'] ); }); it('with IDLE, consumer', () => { assert.deepEqual( transformArguments('key', 'group', '-', '+', 1, { IDLE: 1, consumer: 'consumer' }), ['XPENDING', 'key', 'group', 'IDLE', '1', '-', '+', '1', 'consumer'] ); }); }); testUtils.testWithClient('client.xPendingRange', async client => { await client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }); assert.deepEqual( await client.xPendingRange('key', 'group', '-', '+', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XPENDING_RANGE.ts000066400000000000000000000025021433774114400247700ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface XPendingRangeOptions { IDLE?: number; consumer?: RedisCommandArgument; } export function transformArguments( key: RedisCommandArgument, group: RedisCommandArgument, start: string, end: string, count: number, options?: XPendingRangeOptions ): RedisCommandArguments { const args = ['XPENDING', key, group]; if (options?.IDLE) { args.push('IDLE', options.IDLE.toString()); } args.push(start, end, count.toString()); if (options?.consumer) { args.push(options.consumer); } return args; } type XPendingRangeRawReply = Array<[ id: RedisCommandArgument, consumer: RedisCommandArgument, millisecondsSinceLastDelivery: number, deliveriesCounter: number ]>; type XPendingRangeReply = Array<{ id: RedisCommandArgument; owner: RedisCommandArgument; millisecondsSinceLastDelivery: number; deliveriesCounter: number; }>; export function transformReply(reply: XPendingRangeRawReply): XPendingRangeReply { return reply.map(([id, owner, millisecondsSinceLastDelivery, deliveriesCounter]) => ({ id, owner, millisecondsSinceLastDelivery, deliveriesCounter })); } node-redis-redis-4.5.1/packages/client/lib/commands/XRANGE.spec.ts000066400000000000000000000015271433774114400245630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XRANGE'; describe('XRANGE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', '-', '+'), ['XRANGE', 'key', '-', '+'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', '-', '+', { COUNT: 1 }), ['XRANGE', 'key', '-', '+', 'COUNT', '1'] ); }); }); testUtils.testWithClient('client.xRange', async client => { assert.deepEqual( await client.xRange('key', '+', '-'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XRANGE.ts000066400000000000000000000011461433774114400236270ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface XRangeOptions { COUNT?: number; } export function transformArguments( key: RedisCommandArgument, start: RedisCommandArgument, end: RedisCommandArgument, options?: XRangeOptions ): RedisCommandArguments { const args = ['XRANGE', key, start, end]; if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } return args; } export { transformStreamMessagesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XREAD.spec.ts000066400000000000000000000053141433774114400244400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { FIRST_KEY_INDEX, transformArguments } from './XREAD'; describe('XREAD', () => { describe('FIRST_KEY_INDEX', () => { it('single stream', () => { assert.equal( FIRST_KEY_INDEX({ key: 'key', id: '' }), 'key' ); }); it('multiple streams', () => { assert.equal( FIRST_KEY_INDEX([{ key: '1', id: '' }, { key: '2', id: '' }]), '1' ); }); }); describe('transformArguments', () => { it('single stream', () => { assert.deepEqual( transformArguments({ key: 'key', id: '0' }), ['XREAD', 'STREAMS', 'key', '0'] ); }); it('multiple streams', () => { assert.deepEqual( transformArguments([{ key: '1', id: '0' }, { key: '2', id: '0' }]), ['XREAD', 'STREAMS', '1', '2', '0', '0'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments({ key: 'key', id: '0' }, { COUNT: 1 }), ['XREAD', 'COUNT', '1', 'STREAMS', 'key', '0'] ); }); it('with BLOCK', () => { assert.deepEqual( transformArguments({ key: 'key', id: '0' }, { BLOCK: 0 }), ['XREAD', 'BLOCK', '0', 'STREAMS', 'key', '0'] ); }); it('with COUNT, BLOCK', () => { assert.deepEqual( transformArguments({ key: 'key', id: '0' }, { COUNT: 1, BLOCK: 0 }), ['XREAD', 'COUNT', '1', 'BLOCK', '0', 'STREAMS', 'key', '0'] ); }); }); testUtils.testWithClient('client.xRead', async client => { assert.equal( await client.xRead({ key: 'key', id: '0' }), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithCluster('cluster.xRead', async cluster => { assert.equal( await cluster.xRead({ key: 'key', id: '0' }), null ); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XREAD.ts000066400000000000000000000023541433774114400235100ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = (streams: Array | XReadStream): RedisCommandArgument => { return Array.isArray(streams) ? streams[0].key : streams.key; }; export const IS_READ_ONLY = true; interface XReadStream { key: RedisCommandArgument; id: RedisCommandArgument; } interface XReadOptions { COUNT?: number; BLOCK?: number; } export function transformArguments( streams: Array | XReadStream, options?: XReadOptions ): RedisCommandArguments { const args: RedisCommandArguments = ['XREAD']; if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } if (typeof options?.BLOCK === 'number') { args.push('BLOCK', options.BLOCK.toString()); } args.push('STREAMS'); const streamsArray = Array.isArray(streams) ? streams : [streams], argsLength = args.length; for (let i = 0; i < streamsArray.length; i++) { const stream = streamsArray[i]; args[argsLength + i] = stream.key; args[argsLength + streamsArray.length + i] = stream.id; } return args; } export { transformStreamsMessagesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XREADGROUP.spec.ts000066400000000000000000000114261433774114400252560ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { FIRST_KEY_INDEX, transformArguments } from './XREADGROUP'; describe('XREADGROUP', () => { describe('FIRST_KEY_INDEX', () => { it('single stream', () => { assert.equal( FIRST_KEY_INDEX('', '', { key: 'key', id: '' }), 'key' ); }); it('multiple streams', () => { assert.equal( FIRST_KEY_INDEX('', '', [{ key: '1', id: '' }, { key: '2', id: '' }]), '1' ); }); }); describe('transformArguments', () => { it('single stream', () => { assert.deepEqual( transformArguments('group', 'consumer', { key: 'key', id: '0' }), ['XREADGROUP', 'GROUP', 'group', 'consumer', 'STREAMS', 'key', '0'] ); }); it('multiple streams', () => { assert.deepEqual( transformArguments('group', 'consumer', [{ key: '1', id: '0' }, { key: '2', id: '0' }]), ['XREADGROUP', 'GROUP', 'group', 'consumer', 'STREAMS', '1', '2', '0', '0'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('group', 'consumer', { key: 'key', id: '0' }, { COUNT: 1 }), ['XREADGROUP', 'GROUP', 'group', 'consumer', 'COUNT', '1', 'STREAMS', 'key', '0'] ); }); it('with BLOCK', () => { assert.deepEqual( transformArguments('group', 'consumer', { key: 'key', id: '0' }, { BLOCK: 0 }), ['XREADGROUP', 'GROUP', 'group', 'consumer', 'BLOCK', '0', 'STREAMS', 'key', '0'] ); }); it('with NOACK', () => { assert.deepEqual( transformArguments('group', 'consumer', { key: 'key', id: '0' }, { NOACK: true }), ['XREADGROUP', 'GROUP', 'group', 'consumer', 'NOACK', 'STREAMS', 'key', '0'] ); }); it('with COUNT, BLOCK, NOACK', () => { assert.deepEqual( transformArguments('group', 'consumer', { key: 'key', id: '0' }, { COUNT: 1, BLOCK: 0, NOACK: true }), ['XREADGROUP', 'GROUP', 'group', 'consumer', 'COUNT', '1', 'BLOCK', '0', 'NOACK', 'STREAMS', 'key', '0'] ); }); }); describe('client.xReadGroup', () => { testUtils.testWithClient('null', async client => { const [, readGroupReply] = await Promise.all([ client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), client.xReadGroup('group', 'consumer', { key: 'key', id: '>' }) ]); assert.equal(readGroupReply, null); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with a message', async client => { const [, id, readGroupReply] = await Promise.all([ client.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), client.xAdd('key', '*', { field: 'value' }), client.xReadGroup('group', 'consumer', { key: 'key', id: '>' }) ]); assert.deepEqual(readGroupReply, [{ name: 'key', messages: [{ id, message: Object.create(null, { field: { value: 'value', configurable: true, enumerable: true } }) }] }]); }, GLOBAL.SERVERS.OPEN); }); testUtils.testWithCluster('cluster.xReadGroup', async cluster => { const [, readGroupReply] = await Promise.all([ cluster.xGroupCreate('key', 'group', '$', { MKSTREAM: true }), cluster.xReadGroup('group', 'consumer', { key: 'key', id: '>' }) ]); assert.equal(readGroupReply, null); }, GLOBAL.CLUSTERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XREADGROUP.ts000066400000000000000000000030061433774114400243200ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export interface XReadGroupStream { key: RedisCommandArgument; id: RedisCommandArgument; } export interface XReadGroupOptions { COUNT?: number; BLOCK?: number; NOACK?: true; } export const FIRST_KEY_INDEX = ( _group: RedisCommandArgument, _consumer: RedisCommandArgument, streams: Array | XReadGroupStream ): RedisCommandArgument => { return Array.isArray(streams) ? streams[0].key : streams.key; }; export const IS_READ_ONLY = true; export function transformArguments( group: RedisCommandArgument, consumer: RedisCommandArgument, streams: Array | XReadGroupStream, options?: XReadGroupOptions ): RedisCommandArguments { const args = ['XREADGROUP', 'GROUP', group, consumer]; if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } if (typeof options?.BLOCK === 'number') { args.push('BLOCK', options.BLOCK.toString()); } if (options?.NOACK) { args.push('NOACK'); } args.push('STREAMS'); const streamsArray = Array.isArray(streams) ? streams : [streams], argsLength = args.length; for (let i = 0; i < streamsArray.length; i++) { const stream = streamsArray[i]; args[argsLength + i] = stream.key; args[argsLength + streamsArray.length + i] = stream.id; } return args; } export { transformStreamsMessagesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XREVRANGE.spec.ts000066400000000000000000000015511433774114400251350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XREVRANGE'; describe('XREVRANGE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', '-', '+'), ['XREVRANGE', 'key', '-', '+'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', '-', '+', { COUNT: 1 }), ['XREVRANGE', 'key', '-', '+', 'COUNT', '1'] ); }); }); testUtils.testWithClient('client.xRevRange', async client => { assert.deepEqual( await client.xRevRange('key', '+', '-'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XREVRANGE.ts000066400000000000000000000011571433774114400242060ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; 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) { args.push('COUNT', options.COUNT.toString()); } return args; } export { transformStreamMessagesReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/XSETID.spec.ts000066400000000000000000000000001433774114400245600ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/client/lib/commands/XSETID.ts000066400000000000000000000012361433774114400236430ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; interface XSetIdOptions { ENTRIESADDED?: number; MAXDELETEDID?: RedisCommandArgument; } export function transformArguments( key: RedisCommandArgument, lastId: RedisCommandArgument, options?: XSetIdOptions ): RedisCommandArguments { const args = ['XSETID', key, lastId]; if (options?.ENTRIESADDED) { args.push('ENTRIESADDED', options.ENTRIESADDED.toString()); } if (options?.MAXDELETEDID) { args.push('MAXDELETEDID', options.MAXDELETEDID); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/client/lib/commands/XTRIM.spec.ts000066400000000000000000000026661433774114400245070ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './XTRIM'; describe('XTRIM', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'MAXLEN', 1), ['XTRIM', 'key', 'MAXLEN', '1'] ); }); it('with strategyModifier', () => { assert.deepEqual( transformArguments('key', 'MAXLEN', 1, { strategyModifier: '=' }), ['XTRIM', 'key', 'MAXLEN', '=', '1'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('key', 'MAXLEN', 1, { LIMIT: 1 }), ['XTRIM', 'key', 'MAXLEN', '1', 'LIMIT', '1'] ); }); it('with strategyModifier, LIMIT', () => { assert.deepEqual( transformArguments('key', 'MAXLEN', 1, { strategyModifier: '=', LIMIT: 1 }), ['XTRIM', 'key', 'MAXLEN', '=', '1', 'LIMIT', '1'] ); }); }); testUtils.testWithClient('client.xTrim', async client => { assert.equal( await client.xTrim('key', 'MAXLEN', 1), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/XTRIM.ts000066400000000000000000000012611433774114400235440ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; interface XTrimOptions { strategyModifier?: '=' | '~'; LIMIT?: number; } export function transformArguments( key: RedisCommandArgument, strategy: 'MAXLEN' | 'MINID', threshold: number, options?: XTrimOptions ): RedisCommandArguments { const args = ['XTRIM', key, strategy]; if (options?.strategyModifier) { args.push(options.strategyModifier); } args.push(threshold.toString()); if (options?.LIMIT) { args.push('LIMIT', options.LIMIT.toString()); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZADD.spec.ts000066400000000000000000000065021433774114400243170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZADD'; describe('ZADD', () => { describe('transformArguments', () => { it('single member', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }), ['ZADD', 'key', '1', '1'] ); }); it('multiple members', () => { assert.deepEqual( transformArguments('key', [{ value: '1', score: 1 }, { value: '2', score: 2 }]), ['ZADD', 'key', '1', '1', '2', '2'] ); }); it('with NX', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { NX: true }), ['ZADD', 'key', 'NX', '1', '1'] ); }); it('with XX', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { XX: true }), ['ZADD', 'key', 'XX', '1', '1'] ); }); it('with GT', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { GT: true }), ['ZADD', 'key', 'GT', '1', '1'] ); }); it('with LT', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { LT: true }), ['ZADD', 'key', 'LT', '1', '1'] ); }); it('with CH', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { CH: true }), ['ZADD', 'key', 'CH', '1', '1'] ); }); it('with INCR', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { INCR: true }), ['ZADD', 'key', 'INCR', '1', '1'] ); }); it('with XX, GT, CH, INCR', () => { assert.deepEqual( transformArguments('key', { value: '1', score: 1 }, { XX: true, GT: true, CH: true, INCR: true }), ['ZADD', 'key', 'XX', 'GT', 'CH', 'INCR', '1', '1'] ); }); }); testUtils.testWithClient('client.zAdd', async client => { assert.equal( await client.zAdd('key', { value: '1', score: 1 }), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZADD.ts000066400000000000000000000025061433774114400233660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformNumberInfinityArgument, ZMember } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; interface NX { NX?: true; } interface XX { XX?: true; } interface LT { LT?: true; } interface GT { GT?: true; } interface CH { CH?: true; } interface INCR { INCR?: true; } type ZAddOptions = (NX | (XX & LT & GT)) & CH & INCR; export function transformArguments( key: RedisCommandArgument, members: ZMember | Array, options?: ZAddOptions ): RedisCommandArguments { const args = ['ZADD', key]; if ((options)?.NX) { args.push('NX'); } else { if ((options)?.XX) { args.push('XX'); } if ((options)?.GT) { args.push('GT'); } else if ((options)?.LT) { args.push('LT'); } } if ((options)?.CH) { args.push('CH'); } if ((options)?.INCR) { args.push('INCR'); } for (const { score, value } of (Array.isArray(members) ? members : [members])) { args.push( transformNumberInfinityArgument(score), value ); } return args; } export { transformNumberInfinityReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZCARD.spec.ts000066400000000000000000000007641433774114400244440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZCARD'; describe('ZCARD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['ZCARD', 'key'] ); }); testUtils.testWithClient('client.zCard', async client => { assert.equal( await client.zCard('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZCARD.ts000066400000000000000000000004571433774114400235120ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['ZCARD', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZCOUNT.spec.ts000066400000000000000000000010171433774114400246130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZCOUNT'; describe('ZCOUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 1), ['ZCOUNT', 'key', '0', '1'] ); }); testUtils.testWithClient('client.zCount', async client => { assert.equal( await client.zCount('key', 0, 1), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZCOUNT.ts000066400000000000000000000011241433774114400236610ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, min: RedisCommandArgument | number, max: RedisCommandArgument | number ): RedisCommandArguments { return [ 'ZCOUNT', key, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZDIFF.spec.ts000066400000000000000000000014351433774114400244370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZDIFF'; describe('ZDIFF', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['ZDIFF', '1', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZDIFF', '2', '1', '2'] ); }); }); testUtils.testWithClient('client.zDiff', async client => { assert.deepEqual( await client.zDiff('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZDIFF.ts000066400000000000000000000006751433774114400235130ustar00rootroot00000000000000import { 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 | RedisCommandArgument ): RedisCommandArguments { return pushVerdictArgument(['ZDIFF'], keys); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZDIFFSTORE.spec.ts000066400000000000000000000016011433774114400252470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZDIFFSTORE'; describe('ZDIFFSTORE', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('destination', 'key'), ['ZDIFFSTORE', 'destination', '1', 'key'] ); }); it('array', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['ZDIFFSTORE', 'destination', '2', '1', '2'] ); }); }); testUtils.testWithClient('client.zDiffStore', async client => { assert.equal( await client.zDiffStore('destination', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZDIFFSTORE.ts000066400000000000000000000006761433774114400243310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( destination: RedisCommandArgument, keys: Array | RedisCommandArgument ): RedisCommandArguments { return pushVerdictArgument(['ZDIFFSTORE', destination], keys); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZDIFF_WITHSCORES.spec.ts000066400000000000000000000015431433774114400262110ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZDIFF_WITHSCORES'; describe('ZDIFF WITHSCORES', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key'), ['ZDIFF', '1', 'key', 'WITHSCORES'] ); }); it('array', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZDIFF', '2', '1', '2', 'WITHSCORES'] ); }); }); testUtils.testWithClient('client.zDiffWithScores', async client => { assert.deepEqual( await client.zDiffWithScores('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZDIFF_WITHSCORES.ts000066400000000000000000000007271433774114400252630ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { transformArguments as transformZDiffArguments } from './ZDIFF'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZDIFF'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZDiffArguments(...args), 'WITHSCORES' ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZINCRBY.spec.ts000066400000000000000000000010571433774114400247150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZINCRBY'; describe('ZINCRBY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1, 'member'), ['ZINCRBY', 'key', '1', 'member'] ); }); testUtils.testWithClient('client.zIncrBy', async client => { assert.equal( await client.zIncrBy('destination', 1, 'member'), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZINCRBY.ts000066400000000000000000000010301433774114400237530ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, increment: number, member: RedisCommandArgument ): RedisCommandArguments { return [ 'ZINCRBY', key, transformNumberInfinityArgument(increment), member ]; } export { transformNumberInfinityReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZINTER.spec.ts000066400000000000000000000031361433774114400246100ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZINTER'; describe('ZINTER', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('key (string)', () => { assert.deepEqual( transformArguments('key'), ['ZINTER', '1', 'key'] ); }); it('keys (array)', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZINTER', '2', '1', '2'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('key', { WEIGHTS: [1] }), ['ZINTER', '1', 'key', 'WEIGHTS', '1'] ); }); it('with AGGREGATE', () => { assert.deepEqual( transformArguments('key', { AGGREGATE: 'SUM' }), ['ZINTER', '1', 'key', 'AGGREGATE', 'SUM'] ); }); it('with WEIGHTS, AGGREGATE', () => { assert.deepEqual( transformArguments('key', { WEIGHTS: [1], AGGREGATE: 'SUM' }), ['ZINTER', '1', 'key', 'WEIGHTS', '1', 'AGGREGATE', 'SUM'] ); }); }); testUtils.testWithClient('client.zInter', async client => { assert.deepEqual( await client.zInter('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZINTER.ts000066400000000000000000000015041433774114400236540ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; interface ZInterOptions { WEIGHTS?: Array; AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } export function transformArguments( keys: Array | RedisCommandArgument, options?: ZInterOptions ): RedisCommandArguments { const args = pushVerdictArgument(['ZINTER'], keys); if (options?.WEIGHTS) { args.push( 'WEIGHTS', ...options.WEIGHTS.map(weight => weight.toString()) ); } if (options?.AGGREGATE) { args.push('AGGREGATE', options.AGGREGATE); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZINTERCARD.spec.ts000066400000000000000000000015251433774114400252420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZINTERCARD'; describe('ZINTERCARD', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZINTERCARD', '2', '1', '2'] ); }); it('with limit', () => { assert.deepEqual( transformArguments(['1', '2'], 1), ['ZINTERCARD', '2', '1', '2', 'LIMIT', '1'] ); }); }); testUtils.testWithClient('client.zInterCard', async client => { assert.deepEqual( await client.zInterCard('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZINTERCARD.ts000066400000000000000000000010371433774114400243070ustar00rootroot00000000000000import { 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 | RedisCommandArgument, limit?: number ): RedisCommandArguments { const args = pushVerdictArgument(['ZINTERCARD'], keys); if (limit) { args.push('LIMIT', limit.toString()); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZINTERSTORE.spec.ts000066400000000000000000000033721433774114400254270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZINTERSTORE'; describe('ZINTERSTORE', () => { describe('transformArguments', () => { it('key (string)', () => { assert.deepEqual( transformArguments('destination', 'key'), ['ZINTERSTORE', 'destination', '1', 'key'] ); }); it('keys (array)', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['ZINTERSTORE', 'destination', '2', '1', '2'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('destination', 'key', { WEIGHTS: [1] }), ['ZINTERSTORE', 'destination', '1', 'key', 'WEIGHTS', '1'] ); }); it('with AGGREGATE', () => { assert.deepEqual( transformArguments('destination', 'key', { AGGREGATE: 'SUM' }), ['ZINTERSTORE', 'destination', '1', 'key', 'AGGREGATE', 'SUM'] ); }); it('with WEIGHTS, AGGREGATE', () => { assert.deepEqual( transformArguments('destination', 'key', { WEIGHTS: [1], AGGREGATE: 'SUM' }), ['ZINTERSTORE', 'destination', '1', 'key', 'WEIGHTS', '1', 'AGGREGATE', 'SUM'] ); }); }); testUtils.testWithClient('client.zInterStore', async client => { assert.equal( await client.zInterStore('destination', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZINTERSTORE.ts000066400000000000000000000015171433774114400244750ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; interface ZInterStoreOptions { WEIGHTS?: Array; AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } export function transformArguments( destination: RedisCommandArgument, keys: Array | RedisCommandArgument, options?: ZInterStoreOptions ): RedisCommandArguments { const args = pushVerdictArgument(['ZINTERSTORE', destination], keys); if (options?.WEIGHTS) { args.push( 'WEIGHTS', ...options.WEIGHTS.map(weight => weight.toString()) ); } if (options?.AGGREGATE) { args.push('AGGREGATE', options.AGGREGATE); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZINTER_WITHSCORES.spec.ts000066400000000000000000000033161433774114400263620ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZINTER_WITHSCORES'; describe('ZINTER WITHSCORES', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('key (string)', () => { assert.deepEqual( transformArguments('key'), ['ZINTER', '1', 'key', 'WITHSCORES'] ); }); it('keys (array)', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZINTER', '2', '1', '2', 'WITHSCORES'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('key', { WEIGHTS: [1] }), ['ZINTER', '1', 'key', 'WEIGHTS', '1', 'WITHSCORES'] ); }); it('with AGGREGATE', () => { assert.deepEqual( transformArguments('key', { AGGREGATE: 'SUM' }), ['ZINTER', '1', 'key', 'AGGREGATE', 'SUM', 'WITHSCORES'] ); }); it('with WEIGHTS, AGGREGATE', () => { assert.deepEqual( transformArguments('key', { WEIGHTS: [1], AGGREGATE: 'SUM' }), ['ZINTER', '1', 'key', 'WEIGHTS', '1', 'AGGREGATE', 'SUM', 'WITHSCORES'] ); }); }); testUtils.testWithClient('client.zInterWithScores', async client => { assert.deepEqual( await client.zInterWithScores('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZINTER_WITHSCORES.ts000066400000000000000000000007341433774114400254320ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { transformArguments as transformZInterArguments } from './ZINTER'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZINTER'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZInterArguments(...args), 'WITHSCORES' ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZLEXCOUNT.spec.ts000066400000000000000000000010541433774114400251650ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZLEXCOUNT'; describe('ZLEXCOUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '[a', '[b'), ['ZLEXCOUNT', 'key', '[a', '[b'] ); }); testUtils.testWithClient('client.zLexCount', async client => { assert.equal( await client.zLexCount('key', '[a', '[b'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZLEXCOUNT.ts000066400000000000000000000006471433774114400242430ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, min: RedisCommandArgument, max: RedisCommandArgument ): RedisCommandArguments { return [ 'ZLEXCOUNT', key, min, max ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZMPOP.spec.ts000066400000000000000000000016061433774114400245020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZMPOP'; describe('ZMPOP', () => { testUtils.isVersionGreaterThanHook([7]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', 'MIN'), ['ZMPOP', '1', 'key', 'MIN'] ); }); it('with score and count', () => { assert.deepEqual( transformArguments('key', 'MIN', { COUNT: 2 }), ['ZMPOP', '1', 'key', 'MIN', 'COUNT', '2'] ); }); }); testUtils.testWithClient('client.zmPop', async client => { assert.deepEqual( await client.zmPop('key', 'MIN'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZMPOP.ts000066400000000000000000000016221433774114400235470ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { SortedSetSide, transformSortedSetMemberReply, transformZMPopArguments, ZMember, ZMPopOptions } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; export function transformArguments( keys: RedisCommandArgument | Array, side: SortedSetSide, options?: ZMPopOptions ): RedisCommandArguments { return transformZMPopArguments( ['ZMPOP'], keys, side, options ); } type ZMPopRawReply = null | [ key: string, elements: Array<[RedisCommandArgument, RedisCommandArgument]> ]; type ZMPopReply = null | { key: string, elements: Array }; export function transformReply(reply: ZMPopRawReply): ZMPopReply { return reply === null ? null : { key: reply[0], elements: reply[1].map(transformSortedSetMemberReply) }; } node-redis-redis-4.5.1/packages/client/lib/commands/ZMSCORE.spec.ts000066400000000000000000000015171433774114400247200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZMSCORE'; describe('ZMSCORE', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'member'), ['ZMSCORE', 'key', 'member'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['ZMSCORE', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.zmScore', async client => { assert.deepEqual( await client.zmScore('key', 'member'), [null] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZMSCORE.ts000066400000000000000000000010041433774114400237560ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['ZMSCORE', key], member); } export { transformNumberInfinityNullArrayReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMAX.spec.ts000066400000000000000000000022201433774114400247240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './ZPOPMAX'; describe('ZPOPMAX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['ZPOPMAX', 'key'] ); }); it('transformReply', () => { assert.deepEqual( transformReply(['value', '1']), { value: 'value', score: 1 } ); }); describe('client.zPopMax', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.zPopMax('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('member', async client => { const member = { score: 1, value: 'value' }, [, zPopMaxReply] = await Promise.all([ client.zAdd('key', member), client.zPopMax('key') ]); assert.deepEqual(zPopMaxReply, member); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMAX.ts000066400000000000000000000005201433774114400237740ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'ZPOPMAX', key ]; } export { transformSortedSetMemberNullReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMAX_COUNT.spec.ts000066400000000000000000000010441433774114400256770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZPOPMAX_COUNT'; describe('ZPOPMAX COUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['ZPOPMAX', 'key', '1'] ); }); testUtils.testWithClient('client.zPopMaxCount', async client => { assert.deepEqual( await client.zPopMaxCount('key', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMAX_COUNT.ts000066400000000000000000000007461433774114400247560ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformZPopMaxArguments } from './ZPOPMAX'; export { FIRST_KEY_INDEX } from './ZPOPMAX'; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return [ ...transformZPopMaxArguments(key), count.toString() ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMIN.spec.ts000066400000000000000000000022201433774114400247220ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './ZPOPMIN'; describe('ZPOPMIN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['ZPOPMIN', 'key'] ); }); it('transformReply', () => { assert.deepEqual( transformReply(['value', '1']), { value: 'value', score: 1 } ); }); describe('client.zPopMin', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.zPopMin('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('member', async client => { const member = { score: 1, value: 'value' }, [, zPopMinReply] = await Promise.all([ client.zAdd('key', member), client.zPopMin('key') ]); assert.deepEqual(zPopMinReply, member); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMIN.ts000066400000000000000000000005201433774114400237720ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return [ 'ZPOPMIN', key ]; } export { transformSortedSetMemberNullReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMIN_COUNT.spec.ts000066400000000000000000000010441433774114400256750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZPOPMIN_COUNT'; describe('ZPOPMIN COUNT', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['ZPOPMIN', 'key', '1'] ); }); testUtils.testWithClient('client.zPopMinCount', async client => { assert.deepEqual( await client.zPopMinCount('key', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZPOPMIN_COUNT.ts000066400000000000000000000007461433774114400247540ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformZPopMinArguments } from './ZPOPMIN'; export { FIRST_KEY_INDEX } from './ZPOPMIN'; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return [ ...transformZPopMinArguments(key), count.toString() ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANDMEMBER.spec.ts000066400000000000000000000011061433774114400253360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANDMEMBER'; describe('ZRANDMEMBER', () => { testUtils.isVersionGreaterThanHook([6, 2]); it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['ZRANDMEMBER', 'key'] ); }); testUtils.testWithClient('client.zRandMember', async client => { assert.equal( await client.zRandMember('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANDMEMBER.ts000066400000000000000000000005121433774114400244050ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { return ['ZRANDMEMBER', key]; } export declare function transformReply(): RedisCommandArgument | null; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANDMEMBER_COUNT.spec.ts000066400000000000000000000011541433774114400263110ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANDMEMBER_COUNT'; describe('ZRANDMEMBER COUNT', () => { testUtils.isVersionGreaterThanHook([6, 2, 5]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['ZRANDMEMBER', 'key', '1'] ); }); testUtils.testWithClient('client.zRandMemberCount', async client => { assert.deepEqual( await client.zRandMemberCount('key', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANDMEMBER_COUNT.ts000066400000000000000000000007551433774114400253660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformArguments as transformZRandMemberArguments } from './ZRANDMEMBER'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANDMEMBER'; export function transformArguments( key: RedisCommandArgument, count: number ): RedisCommandArguments { return [ ...transformZRandMemberArguments(key), count.toString() ]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANDMEMBER_COUNT_WITHSCORES.spec.ts000066400000000000000000000012441433774114400300630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANDMEMBER_COUNT_WITHSCORES'; describe('ZRANDMEMBER COUNT WITHSCORES', () => { testUtils.isVersionGreaterThanHook([6, 2, 5]); it('transformArguments', () => { assert.deepEqual( transformArguments('key', 1), ['ZRANDMEMBER', 'key', '1', 'WITHSCORES'] ); }); testUtils.testWithClient('client.zRandMemberCountWithScores', async client => { assert.deepEqual( await client.zRandMemberCountWithScores('key', 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANDMEMBER_COUNT_WITHSCORES.ts000066400000000000000000000010201433774114400271220ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { transformArguments as transformZRandMemberCountArguments } from './ZRANDMEMBER_COUNT'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANDMEMBER_COUNT'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZRandMemberCountArguments(...args), 'WITHSCORES' ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGE.spec.ts000066400000000000000000000040741433774114400245650ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANGE'; describe('ZRANGE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('src', 0, 1), ['ZRANGE', 'src', '0', '1'] ); }); it('with BYSCORE', () => { assert.deepEqual( transformArguments('src', 0, 1, { BY: 'SCORE' }), ['ZRANGE', 'src', '0', '1', 'BYSCORE'] ); }); it('with BYLEX', () => { assert.deepEqual( transformArguments('src', 0, 1, { BY: 'LEX' }), ['ZRANGE', 'src', '0', '1', 'BYLEX'] ); }); it('with REV', () => { assert.deepEqual( transformArguments('src', 0, 1, { REV: true }), ['ZRANGE', 'src', '0', '1', 'REV'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('src', 0, 1, { LIMIT: { offset: 0, count: 1 } }), ['ZRANGE', 'src', '0', '1', 'LIMIT', '0', '1'] ); }); it('with BY & REV & LIMIT', () => { assert.deepEqual( transformArguments('src', 0, 1, { BY: 'SCORE', REV: true, LIMIT: { offset: 0, count: 1 } }), ['ZRANGE', 'src', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1'] ); }); }); testUtils.testWithClient('client.zRange', async client => { assert.deepEqual( await client.zRange('src', 0, 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGE.ts000066400000000000000000000022251433774114400236300ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface ZRangeOptions { BY?: 'SCORE' | 'LEX'; REV?: true; LIMIT?: { offset: number; count: number; }; } export function transformArguments( key: RedisCommandArgument, min: RedisCommandArgument | number, max: RedisCommandArgument | number, options?: ZRangeOptions ): RedisCommandArguments { const args = [ 'ZRANGE', key, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; switch (options?.BY) { case 'SCORE': args.push('BYSCORE'); break; case 'LEX': args.push('BYLEX'); break; } if (options?.REV) { args.push('REV'); } if (options?.LIMIT) { args.push('LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGEBYLEX.spec.ts000066400000000000000000000017241433774114400253700ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANGEBYLEX'; describe('ZRANGEBYLEX', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('src', '-', '+'), ['ZRANGEBYLEX', 'src', '-', '+'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('src', '-', '+', { LIMIT: { offset: 0, count: 1 } }), ['ZRANGEBYLEX', 'src', '-', '+', 'LIMIT', '0', '1'] ); }); }); testUtils.testWithClient('client.zRangeByLex', async client => { assert.deepEqual( await client.zRangeByLex('src', '-', '+'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGEBYLEX.ts000066400000000000000000000016011433774114400244310ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export interface ZRangeByLexOptions { LIMIT?: { offset: number; count: number; }; } export function transformArguments( key: RedisCommandArgument, min: RedisCommandArgument, max: RedisCommandArgument, options?: ZRangeByLexOptions ): RedisCommandArguments { const args = [ 'ZRANGEBYLEX', key, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; if (options?.LIMIT) { args.push('LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGEBYSCORE.spec.ts000066400000000000000000000017241433774114400256130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANGEBYSCORE'; describe('ZRANGEBYSCORE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('src', 0, 1), ['ZRANGEBYSCORE', 'src', '0', '1'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('src', 0, 1, { LIMIT: { offset: 0, count: 1 } }), ['ZRANGEBYSCORE', 'src', '0', '1', 'LIMIT', '0', '1'] ); }); }); testUtils.testWithClient('client.zRangeByScore', async client => { assert.deepEqual( await client.zRangeByScore('src', 0, 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGEBYSCORE.ts000066400000000000000000000015751433774114400246660ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export interface ZRangeByScoreOptions { LIMIT?: { offset: number; count: number; }; } export function transformArguments( key: RedisCommandArgument, min: string | number, max: string | number, options?: ZRangeByScoreOptions ): RedisCommandArguments { const args = [ 'ZRANGEBYSCORE', key, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; if (options?.LIMIT) { args.push('LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString()); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGEBYSCORE_WITHSCORES.spec.ts000066400000000000000000000020321433774114400273560ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANGEBYSCORE_WITHSCORES'; describe('ZRANGEBYSCORE WITHSCORES', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('src', 0, 1), ['ZRANGEBYSCORE', 'src', '0', '1', 'WITHSCORES'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('src', 0, 1, { LIMIT: { offset: 0, count: 1 } }), ['ZRANGEBYSCORE', 'src', '0', '1', 'LIMIT', '0', '1', 'WITHSCORES'] ); }); }); testUtils.testWithClient('client.zRangeByScoreWithScores', async client => { assert.deepEqual( await client.zRangeByScoreWithScores('src', 0, 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGEBYSCORE_WITHSCORES.ts000066400000000000000000000011661433774114400264340ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { ZRangeByScoreOptions, transformArguments as transformZRangeByScoreArguments } from './ZRANGEBYSCORE'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANGEBYSCORE'; export function transformArguments( key: RedisCommandArgument, min: string | number, max: string | number, options?: ZRangeByScoreOptions ): RedisCommandArguments { return [ ...transformZRangeByScoreArguments(key, min, max, options), 'WITHSCORES' ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGESTORE.spec.ts000066400000000000000000000053461433774114400254050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './ZRANGESTORE'; describe('ZRANGESTORE', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('dst', 'src', 0, 1), ['ZRANGESTORE', 'dst', 'src', '0', '1'] ); }); it('with BYSCORE', () => { assert.deepEqual( transformArguments('dst', 'src', 0, 1, { BY: 'SCORE' }), ['ZRANGESTORE', 'dst', 'src', '0', '1', 'BYSCORE'] ); }); it('with BYLEX', () => { assert.deepEqual( transformArguments('dst', 'src', 0, 1, { BY: 'LEX' }), ['ZRANGESTORE', 'dst', 'src', '0', '1', 'BYLEX'] ); }); it('with REV', () => { assert.deepEqual( transformArguments('dst', 'src', 0, 1, { REV: true }), ['ZRANGESTORE', 'dst', 'src', '0', '1', 'REV'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('dst', 'src', 0, 1, { LIMIT: { offset: 0, count: 1 } }), ['ZRANGESTORE', 'dst', 'src', '0', '1', 'LIMIT', '0', '1'] ); }); it('with BY & REV & LIMIT', () => { assert.deepEqual( transformArguments('dst', 'src', 0, 1, { BY: 'SCORE', REV: true, LIMIT: { offset: 0, count: 1 }, WITHSCORES: true }), ['ZRANGESTORE', 'dst', 'src', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1', 'WITHSCORES'] ); }); }); describe('transformReply', () => { it('should throw TypeError when reply is not a number', () => { assert.throws( // eslint-disable-next-line @typescript-eslint/no-explicit-any () => (transformReply as any)([]), TypeError ); }); }); testUtils.testWithClient('client.zRangeStore', async client => { await client.zAdd('src', { score: 0.5, value: 'value' }); assert.equal( await client.zRangeStore('dst', 'src', 0, 1), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGESTORE.ts000066400000000000000000000026451433774114400244530ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; interface ZRangeStoreOptions { BY?: 'SCORE' | 'LEX'; REV?: true; LIMIT?: { offset: number; count: number; }; WITHSCORES?: true; } export function transformArguments( dst: RedisCommandArgument, src: RedisCommandArgument, min: RedisCommandArgument | number, max: RedisCommandArgument | number, options?: ZRangeStoreOptions ): RedisCommandArguments { const args = [ 'ZRANGESTORE', dst, src, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; switch (options?.BY) { case 'SCORE': args.push('BYSCORE'); break; case 'LEX': args.push('BYLEX'); break; } if (options?.REV) { args.push('REV'); } if (options?.LIMIT) { args.push('LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString()); } if (options?.WITHSCORES) { args.push('WITHSCORES'); } return args; } export function transformReply(reply: number): number { if (typeof reply !== 'number') { throw new TypeError(`Upgrade to Redis 6.2.5 and up (https://github.com/redis/redis/pull/9089)`); } return reply; } node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGE_WITHSCORES.spec.ts000066400000000000000000000036631433774114400263420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANGE_WITHSCORES'; describe('ZRANGE WITHSCORES', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('src', 0, 1), ['ZRANGE', 'src', '0', '1', 'WITHSCORES'] ); }); it('with BY', () => { assert.deepEqual( transformArguments('src', 0, 1, { BY: 'SCORE' }), ['ZRANGE', 'src', '0', '1', 'BYSCORE', 'WITHSCORES'] ); }); it('with REV', () => { assert.deepEqual( transformArguments('src', 0, 1, { REV: true }), ['ZRANGE', 'src', '0', '1', 'REV', 'WITHSCORES'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('src', 0, 1, { LIMIT: { offset: 0, count: 1 } }), ['ZRANGE', 'src', '0', '1', 'LIMIT', '0', '1', 'WITHSCORES'] ); }); it('with BY & REV & LIMIT', () => { assert.deepEqual( transformArguments('src', 0, 1, { BY: 'SCORE', REV: true, LIMIT: { offset: 0, count: 1 } }), ['ZRANGE', 'src', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1', 'WITHSCORES'] ); }); }); testUtils.testWithClient('client.zRangeWithScores', async client => { assert.deepEqual( await client.zRangeWithScores('src', 0, 1), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANGE_WITHSCORES.ts000066400000000000000000000007341433774114400254050ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { transformArguments as transformZRangeArguments } from './ZRANGE'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANGE'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZRangeArguments(...args), 'WITHSCORES' ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZRANK.spec.ts000066400000000000000000000010251433774114400244550ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZRANK'; describe('ZRANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member'), ['ZRANK', 'key', 'member'] ); }); testUtils.testWithClient('client.zRank', async client => { assert.equal( await client.zRank('key', 'member'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZRANK.ts000066400000000000000000000005461433774114400235330ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument ): RedisCommandArguments { return ['ZRANK', key, member]; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/ZREM.spec.ts000066400000000000000000000014031433774114400243450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZREM'; describe('ZREM', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('key', 'member'), ['ZREM', 'key', 'member'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', ['1', '2']), ['ZREM', 'key', '1', '2'] ); }); }); testUtils.testWithClient('client.zRem', async client => { assert.equal( await client.zRem('key', 'member'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZREM.ts000066400000000000000000000006561433774114400234250ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArguments } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument | Array ): RedisCommandArguments { return pushVerdictArguments(['ZREM', key], member); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZREMRANGEBYLEX.spec.ts000066400000000000000000000011051433774114400257250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZREMRANGEBYLEX'; describe('ZREMRANGEBYLEX', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '[a', '[b'), ['ZREMRANGEBYLEX', 'key', '[a', '[b'] ); }); testUtils.testWithClient('client.zRemRangeByLex', async client => { assert.equal( await client.zRemRangeByLex('key', '[a', '[b'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZREMRANGEBYLEX.ts000066400000000000000000000010711433774114400247760ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, min: RedisCommandArgument | number, max: RedisCommandArgument | number ): RedisCommandArguments { return [ 'ZREMRANGEBYLEX', key, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZREMRANGEBYRANK.spec.ts000066400000000000000000000010741433774114400260350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZREMRANGEBYRANK'; describe('ZREMRANGEBYRANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 1), ['ZREMRANGEBYRANK', 'key', '0', '1'] ); }); testUtils.testWithClient('client.zRemRangeByRank', async client => { assert.equal( await client.zRemRangeByRank('key', 0, 1), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZREMRANGEBYRANK.ts000066400000000000000000000005441433774114400251050ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, start: number, stop: number ): RedisCommandArguments { return ['ZREMRANGEBYRANK', key, start.toString(), stop.toString()]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZREMRANGEBYSCORE.spec.ts000066400000000000000000000011011433774114400261440ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZREMRANGEBYSCORE'; describe('ZREMRANGEBYSCORE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 0, 1), ['ZREMRANGEBYSCORE', 'key', '0', '1'] ); }); testUtils.testWithClient('client.zRemRangeByScore', async client => { assert.equal( await client.zRemRangeByScore('key', 0, 1), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZREMRANGEBYSCORE.ts000066400000000000000000000010741433774114400252240ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { transformStringNumberInfinityArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; export function transformArguments( key: RedisCommandArgument, min: RedisCommandArgument | number, max: RedisCommandArgument | number, ): RedisCommandArguments { return [ 'ZREMRANGEBYSCORE', key, transformStringNumberInfinityArgument(min), transformStringNumberInfinityArgument(max) ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZREVRANK.spec.ts000066400000000000000000000010441433774114400250330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZREVRANK'; describe('ZREVRANK', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member'), ['ZREVRANK', 'key', 'member'] ); }); testUtils.testWithClient('client.zRevRank', async client => { assert.equal( await client.zRevRank('key', 'member'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZREVRANK.ts000066400000000000000000000005511433774114400241040ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument ): RedisCommandArguments { return ['ZREVRANK', key, member]; } export declare function transformReply(): number | null; node-redis-redis-4.5.1/packages/client/lib/commands/ZSCAN.spec.ts000066400000000000000000000040721433774114400244530ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments, transformReply } from './ZSCAN'; describe('ZSCAN', () => { describe('transformArguments', () => { it('cusror only', () => { assert.deepEqual( transformArguments('key', 0), ['ZSCAN', 'key', '0'] ); }); it('with MATCH', () => { assert.deepEqual( transformArguments('key', 0, { MATCH: 'pattern' }), ['ZSCAN', 'key', '0', 'MATCH', 'pattern'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', 0, { COUNT: 1 }), ['ZSCAN', 'key', '0', 'COUNT', '1'] ); }); it('with MATCH & COUNT', () => { assert.deepEqual( transformArguments('key', 0, { MATCH: 'pattern', COUNT: 1 }), ['ZSCAN', 'key', '0', 'MATCH', 'pattern', 'COUNT', '1'] ); }); }); describe('transformReply', () => { it('without members', () => { assert.deepEqual( transformReply(['0', []]), { cursor: 0, members: [] } ); }); it('with members', () => { assert.deepEqual( transformReply(['0', ['member', '-inf']]), { cursor: 0, members: [{ value: 'member', score: -Infinity }] } ); }); }); testUtils.testWithClient('client.zScan', async client => { assert.deepEqual( await client.zScan('key', 0), { cursor: 0, members: [] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZSCAN.ts000066400000000000000000000020211433774114400235120ustar00rootroot00000000000000import { 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: RedisCommandArgument, cursor: number, options?: ScanOptions ): RedisCommandArguments { return pushScanArguments([ 'ZSCAN', key ], cursor, options); } type ZScanRawReply = [RedisCommandArgument, Array]; interface ZScanReply { cursor: number; members: 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: transformNumberInfinityReply(rawMembers[i + 1]) }); } return { cursor: Number(cursor), members: parsedMembers }; } node-redis-redis-4.5.1/packages/client/lib/commands/ZSCORE.spec.ts000066400000000000000000000010321433774114400245730ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZSCORE'; describe('ZSCORE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'member'), ['ZSCORE', 'key', 'member'] ); }); testUtils.testWithClient('client.zScore', async client => { assert.equal( await client.zScore('key', 'member'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZSCORE.ts000066400000000000000000000006131433774114400236460ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: RedisCommandArgument, member: RedisCommandArgument ): RedisCommandArguments { return ['ZSCORE', key, member]; } export { transformNumberInfinityNullReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/ZUNION.spec.ts000066400000000000000000000024441433774114400246200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZUNION'; describe('ZUNION', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('key (string)', () => { assert.deepEqual( transformArguments('key'), ['ZUNION', '1', 'key'] ); }); it('keys (array)', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZUNION', '2', '1', '2'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('key', { WEIGHTS: [1] }), ['ZUNION', '1', 'key', 'WEIGHTS', '1'] ); }); it('with AGGREGATE', () => { assert.deepEqual( transformArguments('key', { AGGREGATE: 'SUM' }), ['ZUNION', '1', 'key', 'AGGREGATE', 'SUM'] ); }); }); testUtils.testWithClient('client.zUnion', async client => { assert.deepEqual( await client.zUnion('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZUNION.ts000066400000000000000000000014421433774114400236640ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 2; export const IS_READ_ONLY = true; interface ZUnionOptions { WEIGHTS?: Array; AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } export function transformArguments( keys: Array | RedisCommandArgument, options?: ZUnionOptions ): RedisCommandArguments { const args = pushVerdictArgument(['ZUNION'], keys); if (options?.WEIGHTS) { args.push('WEIGHTS', ...options.WEIGHTS.map(weight => weight.toString())); } if (options?.AGGREGATE) { args.push('AGGREGATE', options.AGGREGATE); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/client/lib/commands/ZUNIONSTORE.spec.ts000066400000000000000000000033721433774114400254360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZUNIONSTORE'; describe('ZUNIONSTORE', () => { describe('transformArguments', () => { it('key (string)', () => { assert.deepEqual( transformArguments('destination', 'key'), ['ZUNIONSTORE', 'destination', '1', 'key'] ); }); it('keys (array)', () => { assert.deepEqual( transformArguments('destination', ['1', '2']), ['ZUNIONSTORE', 'destination', '2', '1', '2'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('destination', 'key', { WEIGHTS: [1] }), ['ZUNIONSTORE', 'destination', '1', 'key', 'WEIGHTS', '1'] ); }); it('with AGGREGATE', () => { assert.deepEqual( transformArguments('destination', 'key', { AGGREGATE: 'SUM' }), ['ZUNIONSTORE', 'destination', '1', 'key', 'AGGREGATE', 'SUM'] ); }); it('with WEIGHTS, AGGREGATE', () => { assert.deepEqual( transformArguments('destination', 'key', { WEIGHTS: [1], AGGREGATE: 'SUM' }), ['ZUNIONSTORE', 'destination', '1', 'key', 'WEIGHTS', '1', 'AGGREGATE', 'SUM'] ); }); }); testUtils.testWithClient('client.zUnionStore', async client => { assert.equal( await client.zUnionStore('destination', 'key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZUNIONSTORE.ts000066400000000000000000000014431433774114400245020ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; import { pushVerdictArgument } from './generic-transformers'; export const FIRST_KEY_INDEX = 1; interface ZUnionOptions { WEIGHTS?: Array; AGGREGATE?: 'SUM' | 'MIN' | 'MAX'; } export function transformArguments( destination: RedisCommandArgument, keys: Array | RedisCommandArgument, options?: ZUnionOptions ): RedisCommandArguments { const args = pushVerdictArgument(['ZUNIONSTORE', destination], keys); if (options?.WEIGHTS) { args.push('WEIGHTS', ...options.WEIGHTS.map(weight => weight.toString())); } if (options?.AGGREGATE) { args.push('AGGREGATE', options.AGGREGATE); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/client/lib/commands/ZUNION_WITHSCORES.spec.ts000066400000000000000000000026061433774114400263720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ZUNION_WITHSCORES'; describe('ZUNION WITHSCORES', () => { testUtils.isVersionGreaterThanHook([6, 2]); describe('transformArguments', () => { it('key (string)', () => { assert.deepEqual( transformArguments('key'), ['ZUNION', '1', 'key', 'WITHSCORES'] ); }); it('keys (array)', () => { assert.deepEqual( transformArguments(['1', '2']), ['ZUNION', '2', '1', '2', 'WITHSCORES'] ); }); it('with WEIGHTS', () => { assert.deepEqual( transformArguments('key', { WEIGHTS: [1] }), ['ZUNION', '1', 'key', 'WEIGHTS', '1', 'WITHSCORES'] ); }); it('with AGGREGATE', () => { assert.deepEqual( transformArguments('key', { AGGREGATE: 'SUM' }), ['ZUNION', '1', 'key', 'AGGREGATE', 'SUM', 'WITHSCORES'] ); }); }); testUtils.testWithClient('client.zUnionWithScores', async client => { assert.deepEqual( await client.zUnionWithScores('key'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/client/lib/commands/ZUNION_WITHSCORES.ts000066400000000000000000000007341433774114400254410ustar00rootroot00000000000000import { RedisCommandArguments } from '.'; import { transformArguments as transformZUnionArguments } from './ZUNION'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZUNION'; export function transformArguments(...args: Parameters): RedisCommandArguments { return [ ...transformZUnionArguments(...args), 'WITHSCORES' ]; } export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers'; node-redis-redis-4.5.1/packages/client/lib/commands/generic-transformers.spec.ts000066400000000000000000000445401433774114400277400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformBooleanReply, transformBooleanArrayReply, pushScanArguments, transformNumberInfinityReply, transformNumberInfinityNullReply, transformNumberInfinityArgument, transformStringNumberInfinityArgument, transformTuplesReply, transformStreamMessagesReply, transformStreamsMessagesReply, transformSortedSetWithScoresReply, pushGeoCountArgument, pushGeoSearchArguments, GeoReplyWith, transformGeoMembersWithReply, transformEXAT, transformPXAT, pushEvalArguments, pushVerdictArguments, pushVerdictNumberArguments, pushVerdictArgument, pushOptionalVerdictArgument, transformCommandReply, CommandFlags, CommandCategories, pushSlotRangesArguments } from './generic-transformers'; describe('Generic Transformers', () => { describe('transformBooleanReply', () => { it('0', () => { assert.equal( transformBooleanReply(0), false ); }); it('1', () => { assert.equal( transformBooleanReply(1), true ); }); }); describe('transformBooleanArrayReply', () => { it('empty array', () => { assert.deepEqual( transformBooleanArrayReply([]), [] ); }); it('0, 1', () => { assert.deepEqual( transformBooleanArrayReply([0, 1]), [false, true] ); }); }); describe('pushScanArguments', () => { it('cusror only', () => { assert.deepEqual( pushScanArguments([], 0), ['0'] ); }); it('with MATCH', () => { assert.deepEqual( pushScanArguments([], 0, { MATCH: 'pattern' }), ['0', 'MATCH', 'pattern'] ); }); it('with COUNT', () => { assert.deepEqual( pushScanArguments([], 0, { COUNT: 1 }), ['0', 'COUNT', '1'] ); }); it('with MATCH & COUNT', () => { assert.deepEqual( pushScanArguments([], 0, { MATCH: 'pattern', COUNT: 1 }), ['0', 'MATCH', 'pattern', 'COUNT', '1'] ); }); }); describe('transformNumberInfinityReply', () => { it('0.5', () => { assert.equal( transformNumberInfinityReply('0.5'), 0.5 ); }); it('+inf', () => { assert.equal( transformNumberInfinityReply('+inf'), Infinity ); }); it('-inf', () => { assert.equal( transformNumberInfinityReply('-inf'), -Infinity ); }); }); describe('transformNumberInfinityNullReply', () => { it('null', () => { assert.equal( transformNumberInfinityNullReply(null), null ); }); it('1', () => { assert.equal( transformNumberInfinityNullReply('1'), 1 ); }); }); describe('transformNumberInfinityArgument', () => { it('0.5', () => { assert.equal( transformNumberInfinityArgument(0.5), '0.5' ); }); it('Infinity', () => { assert.equal( transformNumberInfinityArgument(Infinity), '+inf' ); }); it('-Infinity', () => { assert.equal( transformNumberInfinityArgument(-Infinity), '-inf' ); }); }); describe('transformStringNumberInfinityArgument', () => { it("'0.5'", () => { assert.equal( transformStringNumberInfinityArgument('0.5'), '0.5' ); }); it('0.5', () => { assert.equal( transformStringNumberInfinityArgument(0.5), '0.5' ); }); }); it('transformTuplesReply', () => { assert.deepEqual( transformTuplesReply(['key1', 'value1', 'key2', 'value2']), Object.create(null, { key1: { value: 'value1', configurable: true, enumerable: true }, key2: { value: 'value2', configurable: true, enumerable: true } }) ); }); it('transformStreamMessagesReply', () => { assert.deepEqual( transformStreamMessagesReply([['0-0', ['0key', '0value']], ['1-0', ['1key', '1value']]]), [{ id: '0-0', message: Object.create(null, { '0key': { value: '0value', configurable: true, enumerable: true } }) }, { id: '1-0', message: Object.create(null, { '1key': { value: '1value', configurable: true, enumerable: true } }) }] ); }); describe('transformStreamsMessagesReply', () => { it('null', () => { assert.equal( transformStreamsMessagesReply(null), null ); }); it('with messages', () => { assert.deepEqual( transformStreamsMessagesReply([['stream1', [['0-1', ['11key', '11value']], ['1-1', ['12key', '12value']]]], ['stream2', [['0-2', ['2key1', '2value1', '2key2', '2value2']]]]]), [{ name: 'stream1', messages: [{ id: '0-1', message: Object.create(null, { '11key': { value: '11value', configurable: true, enumerable: true } }) }, { id: '1-1', message: Object.create(null, { '12key': { value: '12value', configurable: true, enumerable: true } }) }] }, { name: 'stream2', messages: [{ id: '0-2', message: Object.create(null, { '2key1': { value: '2value1', configurable: true, enumerable: true }, '2key2': { value: '2value2', configurable: true, enumerable: true } }) }] }] ); }); }); it('transformSortedSetWithScoresReply', () => { assert.deepEqual( transformSortedSetWithScoresReply(['member1', '0.5', 'member2', '+inf', 'member3', '-inf']), [{ value: 'member1', score: 0.5 }, { value: 'member2', score: Infinity }, { value: 'member3', score: -Infinity }] ); }); describe('pushGeoCountArgument', () => { it('undefined', () => { assert.deepEqual( pushGeoCountArgument([], undefined), [] ); }); it('number', () => { assert.deepEqual( pushGeoCountArgument([], 1), ['COUNT', '1'] ); }); describe('with COUNT', () => { it('number', () => { assert.deepEqual( pushGeoCountArgument([], 1), ['COUNT', '1'] ); }); describe('object', () => { it('value', () => { assert.deepEqual( pushGeoCountArgument([], { value: 1 }), ['COUNT', '1'] ); }); it('value, ANY', () => { assert.deepEqual( pushGeoCountArgument([], { value: 1, ANY: true }), ['COUNT', '1', 'ANY'] ); }); }); }); }); describe('pushGeoSearchArguments', () => { it('FROMMEMBER, BYRADIUS', () => { assert.deepEqual( pushGeoSearchArguments([], 'key', 'member', { radius: 1, unit: 'm' }), ['key', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm'] ); }); it('FROMLONLAT, BYBOX', () => { assert.deepEqual( pushGeoSearchArguments([], 'key', { longitude: 1, latitude: 2 }, { width: 1, height: 2, unit: 'm' }), ['key', 'FROMLONLAT', '1', '2', 'BYBOX', '1', '2', 'm'] ); }); it('with SORT', () => { assert.deepEqual( pushGeoSearchArguments([], 'key', 'member', { radius: 1, unit: 'm' }, { SORT: 'ASC' }), ['key', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm', 'ASC'] ); }); }); describe('transformGeoMembersWithReply', () => { it('DISTANCE', () => { assert.deepEqual( transformGeoMembersWithReply([ [ '1', '2' ], [ '3', '4' ] ], [GeoReplyWith.DISTANCE]), [{ member: '1', distance: '2' }, { member: '3', distance: '4' }] ); }); it('HASH', () => { assert.deepEqual( transformGeoMembersWithReply([ [ '1', 2 ], [ '3', 4 ] ], [GeoReplyWith.HASH]), [{ member: '1', hash: 2 }, { member: '3', hash: 4 }] ); }); it('COORDINATES', () => { assert.deepEqual( transformGeoMembersWithReply([ [ '1', [ '2', '3' ] ], [ '4', [ '5', '6' ] ] ], [GeoReplyWith.COORDINATES]), [{ member: '1', coordinates: { longitude: '2', latitude: '3' } }, { member: '4', coordinates: { longitude: '5', latitude: '6' } }] ); }); it('DISTANCE, HASH, COORDINATES', () => { assert.deepEqual( transformGeoMembersWithReply([ [ '1', '2', 3, [ '4', '5' ] ], [ '6', '7', 8, [ '9', '10' ] ] ], [GeoReplyWith.DISTANCE, GeoReplyWith.HASH, GeoReplyWith.COORDINATES]), [{ member: '1', distance: '2', hash: 3, coordinates: { longitude: '4', latitude: '5' } }, { member: '6', distance: '7', hash: 8, coordinates: { longitude: '9', latitude: '10' } }] ); }); }); describe('transformEXAT', () => { it('number', () => { assert.equal( transformEXAT(1), '1' ); }); it('date', () => { const d = new Date(); assert.equal( transformEXAT(d), Math.floor(d.getTime() / 1000).toString() ); }); }); describe('transformPXAT', () => { it('number', () => { assert.equal( transformPXAT(1), '1' ); }); it('date', () => { const d = new Date(); assert.equal( transformPXAT(d), d.getTime().toString() ); }); }); describe('pushEvalArguments', () => { it('empty', () => { assert.deepEqual( pushEvalArguments([]), ['0'] ); }); it('with keys', () => { assert.deepEqual( pushEvalArguments([], { keys: ['key'] }), ['1', 'key'] ); }); it('with arguments', () => { assert.deepEqual( pushEvalArguments([], { arguments: ['argument'] }), ['0', 'argument'] ); }); it('with keys and arguments', () => { assert.deepEqual( pushEvalArguments([], { keys: ['key'], arguments: ['argument'] }), ['1', 'key', 'argument'] ); }); }); describe('pushVerdictArguments', () => { it('string', () => { assert.deepEqual( pushVerdictArguments([], 'string'), ['string'] ); }); it('array', () => { assert.deepEqual( pushVerdictArguments([], ['1', '2']), ['1', '2'] ); }); }); describe('pushVerdictNumberArguments', () => { it('number', () => { assert.deepEqual( pushVerdictNumberArguments([], 0), ['0'] ); }); it('array', () => { assert.deepEqual( pushVerdictNumberArguments([], [0, 1]), ['0', '1'] ); }); }); describe('pushVerdictArgument', () => { it('string', () => { assert.deepEqual( pushVerdictArgument([], 'string'), ['1', 'string'] ); }); it('array', () => { assert.deepEqual( pushVerdictArgument([], ['1', '2']), ['2', '1', '2'] ); }); }); describe('pushOptionalVerdictArgument', () => { it('undefined', () => { assert.deepEqual( pushOptionalVerdictArgument([], 'name', undefined), [] ); }); it('string', () => { assert.deepEqual( pushOptionalVerdictArgument([], 'name', 'string'), ['name', '1', 'string'] ); }); it('array', () => { assert.deepEqual( pushOptionalVerdictArgument([], 'name', ['1', '2']), ['name', '2', '1', '2'] ); }); }); it('transformCommandReply', () => { assert.deepEqual( transformCommandReply([ 'ping', -1, [CommandFlags.STALE, CommandFlags.FAST], 0, 0, 0, [CommandCategories.FAST, CommandCategories.CONNECTION] ]), { name: 'ping', arity: -1, flags: new Set([CommandFlags.STALE, CommandFlags.FAST]), firstKeyIndex: 0, lastKeyIndex: 0, step: 0, categories: new Set([CommandCategories.FAST, CommandCategories.CONNECTION]) } ); }); describe('pushSlotRangesArguments', () => { it('single range', () => { assert.deepEqual( pushSlotRangesArguments([], { start: 0, end: 1 }), ['0', '1'] ); }); it('multiple ranges', () => { assert.deepEqual( pushSlotRangesArguments([], [{ start: 0, end: 1 }, { start: 2, end: 3 }]), ['0', '1', '2', '3'] ); }); }); }); node-redis-redis-4.5.1/packages/client/lib/commands/generic-transformers.ts000066400000000000000000000400321433774114400267770ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '.'; export function transformBooleanReply(reply: number): boolean { return reply === 1; } export function transformBooleanArrayReply(reply: Array): Array { return reply.map(transformBooleanReply); } export type BitValue = 0 | 1; export interface ScanOptions { MATCH?: string; COUNT?: number; } export function pushScanArguments( args: RedisCommandArguments, cursor: number, options?: ScanOptions ): RedisCommandArguments { args.push(cursor.toString()); if (options?.MATCH) { args.push('MATCH', options.MATCH); } if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } return args; } export function transformNumberInfinityReply(reply: RedisCommandArgument): number { switch (reply.toString()) { case '+inf': return Infinity; case '-inf': return -Infinity; default: return Number(reply); } } export function transformNumberInfinityNullReply(reply: RedisCommandArgument | null): number | null { if (reply === null) return null; return transformNumberInfinityReply(reply); } export function transformNumberInfinityNullArrayReply(reply: Array): Array { return reply.map(transformNumberInfinityNullReply); } export function transformNumberInfinityArgument(num: number): string { switch (num) { case Infinity: return '+inf'; case -Infinity: return '-inf'; default: return num.toString(); } } export function transformStringNumberInfinityArgument(num: RedisCommandArgument | number): RedisCommandArgument { if (typeof num !== 'number') return num; return transformNumberInfinityArgument(num); } export function transformTuplesReply( reply: Array ): Record { const message = Object.create(null); for (let i = 0; i < reply.length; i += 2) { message[reply[i].toString()] = reply[i + 1]; } return message; } export interface StreamMessageReply { id: RedisCommandArgument; message: Record; } export type StreamMessagesReply = Array; export function transformStreamMessagesReply(reply: Array): StreamMessagesReply { const messages = []; for (const [id, message] of reply) { messages.push({ id, message: transformTuplesReply(message) }); } return messages; } export type StreamsMessagesReply = Array<{ name: RedisCommandArgument; messages: StreamMessagesReply; }> | null; export function transformStreamsMessagesReply(reply: Array | null): StreamsMessagesReply | null { if (reply === null) return null; return reply.map(([name, rawMessages]) => ({ name, messages: transformStreamMessagesReply(rawMessages) })); } export interface ZMember { score: number; value: RedisCommandArgument; } export function transformSortedSetMemberNullReply( reply: [RedisCommandArgument, RedisCommandArgument] | [] ): ZMember | null { if (!reply.length) return null; return transformSortedSetMemberReply(reply); } export function transformSortedSetMemberReply( reply: [RedisCommandArgument, RedisCommandArgument] ): ZMember { 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: transformNumberInfinityReply(reply[i + 1]) }); } return members; } export type SortedSetSide = 'MIN' | 'MAX'; export interface ZMPopOptions { COUNT?: number; } export function transformZMPopArguments( args: RedisCommandArguments, keys: RedisCommandArgument | Array, side: SortedSetSide, options?: ZMPopOptions ): RedisCommandArguments { pushVerdictArgument(args, keys); args.push(side); if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } return args; } export type ListSide = 'LEFT' | 'RIGHT'; export interface LMPopOptions { COUNT?: number; } export function transformLMPopArguments( args: RedisCommandArguments, keys: RedisCommandArgument | Array, side: ListSide, options?: LMPopOptions ): RedisCommandArguments { pushVerdictArgument(args, keys); args.push(side); if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } return args; } type GeoCountArgument = number | { value: number; ANY?: true }; export function pushGeoCountArgument( args: RedisCommandArguments, count: GeoCountArgument | undefined ): RedisCommandArguments { if (typeof count === 'number') { args.push('COUNT', count.toString()); } else if (count) { args.push('COUNT', count.value.toString()); if (count.ANY) { args.push('ANY'); } } return args; } export type GeoUnits = 'm' | 'km' | 'mi' | 'ft'; export interface GeoCoordinates { longitude: string | number; latitude: string | number; } type GeoSearchFromMember = string; export type GeoSearchFrom = GeoSearchFromMember | GeoCoordinates; interface GeoSearchByRadius { radius: number; unit: GeoUnits; } interface GeoSearchByBox { width: number; height: number; unit: GeoUnits; } export type GeoSearchBy = GeoSearchByRadius | GeoSearchByBox; export interface GeoSearchOptions { SORT?: 'ASC' | 'DESC'; COUNT?: GeoCountArgument; } export function pushGeoSearchArguments( args: RedisCommandArguments, key: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchOptions ): RedisCommandArguments { args.push(key); if (typeof from === 'string') { args.push('FROMMEMBER', from); } else { args.push('FROMLONLAT', from.longitude.toString(), from.latitude.toString()); } if ('radius' in by) { args.push('BYRADIUS', by.radius.toString()); } else { args.push('BYBOX', by.width.toString(), by.height.toString()); } args.push(by.unit); if (options?.SORT) { args.push(options.SORT); } pushGeoCountArgument(args, options?.COUNT); return args; } export function pushGeoRadiusArguments( args: RedisCommandArguments, key: RedisCommandArgument, from: GeoSearchFrom, radius: number, unit: GeoUnits, options?: GeoSearchOptions ): RedisCommandArguments { args.push(key); if (typeof from === 'string') { args.push(from); } else { args.push( from.longitude.toString(), from.latitude.toString() ); } args.push( radius.toString(), unit ); if (options?.SORT) { args.push(options.SORT); } pushGeoCountArgument(args, options?.COUNT); return args; } export interface GeoRadiusStoreOptions extends GeoSearchOptions { STOREDIST?: boolean; } export function pushGeoRadiusStoreArguments( args: RedisCommandArguments, key: RedisCommandArgument, from: GeoSearchFrom, radius: number, unit: GeoUnits, destination: RedisCommandArgument, options?: GeoRadiusStoreOptions ): RedisCommandArguments { pushGeoRadiusArguments(args, key, from, radius, unit, options); if (options?.STOREDIST) { args.push('STOREDIST', destination); } else { args.push('STORE', destination); } return args; } export enum GeoReplyWith { DISTANCE = 'WITHDIST', HASH = 'WITHHASH', COORDINATES = 'WITHCOORD' } export interface GeoReplyWithMember { member: string; distance?: number; hash?: string; coordinates?: { longitude: string; latitude: string; }; } export function transformGeoMembersWithReply(reply: Array>, replyWith: Array): Array { const replyWithSet = new Set(replyWith); let index = 0; const distanceIndex = replyWithSet.has(GeoReplyWith.DISTANCE) && ++index, hashIndex = replyWithSet.has(GeoReplyWith.HASH) && ++index, coordinatesIndex = replyWithSet.has(GeoReplyWith.COORDINATES) && ++index; return reply.map(member => { const transformedMember: GeoReplyWithMember = { member: member[0] }; if (distanceIndex) { transformedMember.distance = member[distanceIndex]; } if (hashIndex) { transformedMember.hash = member[hashIndex]; } if (coordinatesIndex) { const [longitude, latitude] = member[coordinatesIndex]; transformedMember.coordinates = { longitude, latitude }; } return transformedMember; }); } export function transformEXAT(EXAT: number | Date): string { return (typeof EXAT === 'number' ? EXAT : Math.floor(EXAT.getTime() / 1000)).toString(); } export function transformPXAT(PXAT: number | Date): string { return (typeof PXAT === 'number' ? PXAT : PXAT.getTime()).toString(); } export interface EvalOptions { keys?: Array; arguments?: Array; } export function evalFirstKeyIndex(options?: EvalOptions): string | undefined { return options?.keys?.[0]; } export function pushEvalArguments(args: Array, options?: EvalOptions): Array { if (options?.keys) { args.push( options.keys.length.toString(), ...options.keys ); } else { args.push('0'); } if (options?.arguments) { args.push(...options.arguments); } return args; } export function pushVerdictArguments(args: RedisCommandArguments, value: RedisCommandArgument | Array): RedisCommandArguments { if (Array.isArray(value)) { // https://github.com/redis/node-redis/pull/2160 args = args.concat(value); } else { args.push(value); } return args; } export function pushVerdictNumberArguments( args: RedisCommandArguments, value: number | Array ): RedisCommandArguments { if (Array.isArray(value)) { for (const item of value) { args.push(item.toString()); } } else { args.push(value.toString()); } return args; } 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: RedisCommandArgument, value: undefined | RedisCommandArgument | Array ): RedisCommandArguments { if (value === undefined) return args; args.push(name); return pushVerdictArgument(args, value); } export enum CommandFlags { WRITE = 'write', // command may result in modifications READONLY = 'readonly', // command will never modify keys DENYOOM = 'denyoom', // reject command if currently out of memory ADMIN = 'admin', // server admin command PUBSUB = 'pubsub', // pubsub-related command NOSCRIPT = 'noscript', // deny this command from scripts RANDOM = 'random', // command has random results, dangerous for scripts SORT_FOR_SCRIPT = 'sort_for_script', // if called from script, sort output LOADING = 'loading', // allow command while database is loading STALE = 'stale', // allow command while replica has stale data SKIP_MONITOR = 'skip_monitor', // do not show this command in MONITOR ASKING = 'asking', // cluster related - accept even if importing FAST = 'fast', // command operates in constant or log(N) time. Used for latency monitoring. MOVABLEKEYS = 'movablekeys' // keys have no pre-determined position. You must discover keys yourself. } export enum CommandCategories { KEYSPACE = '@keyspace', READ = '@read', WRITE = '@write', SET = '@set', SORTEDSET = '@sortedset', LIST = '@list', HASH = '@hash', STRING = '@string', BITMAP = '@bitmap', HYPERLOGLOG = '@hyperloglog', GEO = '@geo', STREAM = '@stream', PUBSUB = '@pubsub', ADMIN = '@admin', FAST = '@fast', SLOW = '@slow', BLOCKING = '@blocking', DANGEROUS = '@dangerous', CONNECTION = '@connection', TRANSACTION = '@transaction', SCRIPTING = '@scripting' } export type CommandRawReply = [ name: string, arity: number, flags: Array, firstKeyIndex: number, lastKeyIndex: number, step: number, categories: Array ]; export type CommandReply = { name: string, arity: number, flags: Set, firstKeyIndex: number, lastKeyIndex: number, step: number, categories: Set }; export function transformCommandReply( this: void, [name, arity, flags, firstKeyIndex, lastKeyIndex, step, categories]: CommandRawReply ): CommandReply { return { name, arity, flags: new Set(flags), firstKeyIndex, lastKeyIndex, step, categories: new Set(categories) }; } export enum RedisFunctionFlags { NO_WRITES = 'no-writes', ALLOW_OOM = 'allow-oom', ALLOW_STALE = 'allow-stale', NO_CLUSTER = 'no-cluster' } export type FunctionListRawItemReply = [ 'library_name', string, 'engine', string, 'functions', Array<[ 'name', string, 'description', string | null, 'flags', Array ]> ]; export interface FunctionListItemReply { libraryName: string; engine: string; functions: Array<{ name: string; description: string | null; flags: Array; }>; } export function transformFunctionListItemReply(reply: FunctionListRawItemReply): FunctionListItemReply { return { libraryName: reply[1], engine: reply[3], functions: reply[5].map(fn => ({ name: fn[1], description: fn[3], flags: fn[5] })) }; } export interface SortOptions { BY?: string; LIMIT?: { offset: number; count: number; }, GET?: string | Array; DIRECTION?: 'ASC' | 'DESC'; ALPHA?: true; } export function pushSortArguments( args: RedisCommandArguments, options?: SortOptions ): RedisCommandArguments { if (options?.BY) { args.push('BY', options.BY); } if (options?.LIMIT) { args.push( 'LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString() ); } if (options?.GET) { for (const pattern of (typeof options.GET === 'string' ? [options.GET] : options.GET)) { args.push('GET', pattern); } } if (options?.DIRECTION) { args.push(options.DIRECTION); } if (options?.ALPHA) { args.push('ALPHA'); } return args; } export interface SlotRange { start: number; end: number; } function pushSlotRangeArguments( args: RedisCommandArguments, range: SlotRange ): void { args.push( range.start.toString(), range.end.toString() ); } export function pushSlotRangesArguments( args: RedisCommandArguments, ranges: SlotRange | Array ): RedisCommandArguments { if (Array.isArray(ranges)) { for (const range of ranges) { pushSlotRangeArguments(args, range); } } else { pushSlotRangeArguments(args, ranges); } return args; } export type RawRangeReply = [ start: number, end: number ]; export interface RangeReply { start: number; end: number; } export function transformRangeReply([start, end]: RawRangeReply): RangeReply { return { start, end }; } node-redis-redis-4.5.1/packages/client/lib/commands/index.ts000066400000000000000000000055361433774114400237610ustar00rootroot00000000000000import { ClientCommandOptions } from '../client'; import { CommandOptions } from '../command-options'; import { RedisScriptConfig, SHA1 } from '../lua-script'; export type RedisCommandRawReply = string | number | Buffer | null | undefined | Array; export type RedisCommandArgument = string | Buffer; export type RedisCommandArguments = Array & { preserve?: unknown }; export interface RedisCommand { FIRST_KEY_INDEX?: number | ((...args: Array) => RedisCommandArgument | undefined); IS_READ_ONLY?: boolean; transformArguments(this: void, ...args: Array): RedisCommandArguments; transformReply?(this: void, reply: any, preserved?: any): any; } export type RedisCommandReply = C['transformReply'] extends (...args: any) => infer T ? T : RedisCommandRawReply; export type ConvertArgumentType = Type extends RedisCommandArgument ? ( Type extends (string & ToType) ? Type : ToType ) : ( Type extends Set ? Set> : ( Type extends Map ? Map> : ( Type extends Array ? Array> : ( Type extends Date ? Type : ( Type extends Record ? { [Property in keyof Type]: ConvertArgumentType } : Type ) ) ) ) ); export type RedisCommandSignature< Command extends RedisCommand, Params extends Array = Parameters > = >( ...args: Params | [options: Options, ...rest: Params] ) => Promise< ConvertArgumentType< RedisCommandReply, Options['returnBuffers'] extends true ? Buffer : string > >; export interface RedisCommands { [command: string]: RedisCommand; } export interface RedisModule { [command: string]: RedisCommand; } export interface RedisModules { [module: string]: RedisModule; } export interface RedisFunction extends RedisCommand { NUMBER_OF_KEYS?: number; } export interface RedisFunctionLibrary { [fn: string]: RedisFunction; } export interface RedisFunctions { [library: string]: RedisFunctionLibrary; } export type RedisScript = RedisScriptConfig & SHA1; export interface RedisScripts { [script: string]: RedisScript; } export interface RedisExtensions< M extends RedisModules = RedisModules, F extends RedisFunctions = RedisFunctions, S extends RedisScripts = RedisScripts > { modules?: M; functions?: F; scripts?: S; } export type ExcludeMappedString = string extends S ? never : S; node-redis-redis-4.5.1/packages/client/lib/errors.ts000066400000000000000000000026201433774114400223540ustar00rootroot00000000000000export class AbortError extends Error { constructor() { super('The command was aborted'); } } export class WatchError extends Error { constructor() { super('One (or more) of the watched keys has been changed'); } } export class ConnectionTimeoutError extends Error { constructor() { super('Connection timeout'); } } export class ClientClosedError extends Error { constructor() { super('The client is closed'); } } export class ClientOfflineError extends Error { constructor() { super('The client is offline'); } } export class DisconnectsClientError extends Error { constructor() { super('Disconnects client'); } } export class SocketClosedUnexpectedlyError extends Error { constructor() { super('Socket closed unexpectedly'); } } export class RootNodesUnavailableError extends Error { constructor() { super('All the root nodes are unavailable'); } } export class ReconnectStrategyError extends Error { originalError: Error; socketError: unknown; constructor(originalError: Error, socketError: unknown) { super(originalError.message); this.originalError = originalError; this.socketError = socketError; } } export class ErrorReply extends Error { constructor(message: string) { super(message); this.stack = undefined; } } node-redis-redis-4.5.1/packages/client/lib/lua-script.ts000066400000000000000000000010021433774114400231140ustar00rootroot00000000000000import { createHash } from 'crypto'; import { RedisCommand } from './commands'; export interface RedisScriptConfig extends RedisCommand { SCRIPT: string; NUMBER_OF_KEYS?: number; } export interface SHA1 { SHA1: string; } export function defineScript(script: S): S & SHA1 { return { ...script, SHA1: scriptSha1(script.SCRIPT) }; } export function scriptSha1(script: string): string { return createHash('sha1').update(script).digest('hex'); } node-redis-redis-4.5.1/packages/client/lib/multi-command.spec.ts000066400000000000000000000050521433774114400245410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import RedisMultiCommand from './multi-command'; import { WatchError } from './errors'; import { SQUARE_SCRIPT } from './client/index.spec'; describe('Multi Command', () => { it('generateChainId', () => { assert.equal( typeof RedisMultiCommand.generateChainId(), 'symbol' ); }); it('addCommand', () => { const multi = new RedisMultiCommand(); multi.addCommand(['PING']); assert.deepEqual( multi.queue[0].args, ['PING'] ); }); it('addScript', () => { const multi = new RedisMultiCommand(); multi.addScript(SQUARE_SCRIPT, ['1']); assert.equal( multi.scriptsInUse.has(SQUARE_SCRIPT.SHA1), true ); assert.deepEqual( multi.queue[0].args, ['EVAL', SQUARE_SCRIPT.SCRIPT, '0', '1'] ); multi.addScript(SQUARE_SCRIPT, ['2']); assert.equal( multi.scriptsInUse.has(SQUARE_SCRIPT.SHA1), true ); assert.deepEqual( multi.queue[1].args, ['EVALSHA', SQUARE_SCRIPT.SHA1, '0', '2'] ); }); describe('exec', () => { it('undefined', () => { assert.equal( new RedisMultiCommand().exec(), undefined ); }); it('Array', () => { const multi = new RedisMultiCommand(); multi.addCommand(['PING']); assert.deepEqual( multi.exec(), [ { args: ['MULTI'] }, { args: ['PING'], transformReply: undefined }, { args: ['EXEC'] } ] ); }); }); describe('handleExecReplies', () => { it('WatchError', () => { assert.throws( () => new RedisMultiCommand().handleExecReplies([null]), WatchError ); }); it('with replies', () => { const multi = new RedisMultiCommand(); multi.addCommand(['PING']); assert.deepEqual( multi.handleExecReplies(['OK', 'QUEUED', ['PONG']]), ['PONG'] ); }); }); it('transformReplies', () => { const multi = new RedisMultiCommand(); multi.addCommand(['PING'], (reply: string) => reply.substring(0, 2)); assert.deepEqual( multi.transformReplies(['PONG']), ['PO'] ); }); }); node-redis-redis-4.5.1/packages/client/lib/multi-command.ts000066400000000000000000000060021433774114400236040ustar00rootroot00000000000000import { fCallArguments } from './commander'; import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisFunction, RedisScript } from './commands'; import { WatchError } from './errors'; export interface RedisMultiQueuedCommand { args: RedisCommandArguments; transformReply?: RedisCommand['transformReply']; } export default class RedisMultiCommand { static generateChainId(): symbol { return Symbol('RedisMultiCommand Chain Id'); } readonly queue: Array = []; readonly scriptsInUse = new Set(); addCommand(args: RedisCommandArguments, transformReply?: RedisCommand['transformReply']): void { this.queue.push({ args, transformReply }); } addFunction(name: string, fn: RedisFunction, args: Array): RedisCommandArguments { const transformedArguments = fCallArguments( name, fn, fn.transformArguments(...args) ); this.queue.push({ args: transformedArguments, transformReply: fn.transformReply }); return transformedArguments; } addScript(script: RedisScript, args: Array): RedisCommandArguments { const transformedArguments: RedisCommandArguments = []; if (this.scriptsInUse.has(script.SHA1)) { transformedArguments.push( 'EVALSHA', script.SHA1 ); } else { this.scriptsInUse.add(script.SHA1); transformedArguments.push( 'EVAL', script.SCRIPT ); } if (script.NUMBER_OF_KEYS !== undefined) { transformedArguments.push(script.NUMBER_OF_KEYS.toString()); } const scriptArguments = script.transformArguments(...args); transformedArguments.push(...scriptArguments); if (scriptArguments.preserve) { transformedArguments.preserve = scriptArguments.preserve; } this.addCommand( transformedArguments, script.transformReply ); return transformedArguments; } exec(): undefined | Array { if (!this.queue.length) { return; } return [ { args: ['MULTI'] }, ...this.queue, { args: ['EXEC'] } ]; } handleExecReplies(rawReplies: Array): Array { const execReply = rawReplies[rawReplies.length - 1] as (null | Array); if (execReply === null) { throw new WatchError(); } return this.transformReplies(execReply); } transformReplies(rawReplies: Array): Array { return rawReplies.map((reply, i) => { const { transformReply, args } = this.queue[i]; return transformReply ? transformReply(reply, args.preserve) : reply; }); } } node-redis-redis-4.5.1/packages/client/lib/test-utils.ts000066400000000000000000000023111433774114400231520ustar00rootroot00000000000000import TestUtils from '@redis/test-utils'; import { SinonSpy } from 'sinon'; import { promiseTimeout } from './utils'; export default new TestUtils({ defaultDockerVersion: '7.0.2', dockerImageName: 'redis', dockerImageVersionArgument: 'redis-version' }); export const GLOBAL = { SERVERS: { OPEN: { serverArguments: [] }, PASSWORD: { serverArguments: ['--requirepass', 'password'], clientOptions: { password: 'password' } } }, CLUSTERS: { OPEN: { serverArguments: [] }, PASSWORD: { serverArguments: ['--requirepass', 'password'], clusterConfiguration: { defaults: { password: 'password' } } } } }; export async function waitTillBeenCalled(spy: SinonSpy): Promise { const start = process.hrtime.bigint(), calls = spy.callCount; do { if (process.hrtime.bigint() - start > 1_000_000_000) { throw new Error('Waiting for more than 1 second'); } await promiseTimeout(50); } while (spy.callCount === calls); } node-redis-redis-4.5.1/packages/client/lib/utils.ts000066400000000000000000000001721433774114400222000ustar00rootroot00000000000000export function promiseTimeout(ms: number): Promise { return new Promise(resolve => setTimeout(resolve, ms)); } node-redis-redis-4.5.1/packages/client/package.json000066400000000000000000000024361433774114400222150ustar00rootroot00000000000000{ "name": "@redis/client", "version": "1.4.2", "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", "lint": "eslint ./*.ts ./lib/**/*.ts", "documentation": "typedoc" }, "dependencies": { "cluster-key-slot": "1.1.1", "generic-pool": "3.9.0", "yallist": "4.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "@types/sinon": "^10.0.13", "@types/yallist": "^4.0.1", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", "eslint": "^8.26.0", "nyc": "^15.1.0", "release-it": "^15.5.0", "sinon": "^14.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" }, "engines": { "node": ">=14" }, "repository": { "type": "git", "url": "git://github.com/redis/node-redis.git" }, "bugs": { "url": "https://github.com/redis/node-redis/issues" }, "homepage": "https://github.com/redis/node-redis/tree/master/packages/client" } node-redis-redis-4.5.1/packages/client/tsconfig.json000066400000000000000000000006641433774114400224370ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./index.ts", "./lib/**/*.ts" ], "exclude": [ "./lib/test-utils.ts", "./lib/**/*.spec.ts" ], "ts-node": { "transpileOnly": true }, "typedocOptions": { "entryPoints": [ "./index.ts", "./lib" ], "entryPointStrategy": "expand", "out": "../../documentation/client" } } node-redis-redis-4.5.1/packages/graph/000077500000000000000000000000001433774114400175455ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/graph/.nycrc.json000066400000000000000000000001511433774114400216310ustar00rootroot00000000000000{ "extends": "@istanbuljs/nyc-config-typescript", "exclude": ["**/*.spec.ts", "lib/test-utils.ts"] } node-redis-redis-4.5.1/packages/graph/.release-it.json000066400000000000000000000003051433774114400225460ustar00rootroot00000000000000{ "git": { "tagName": "graph@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" }, "npm": { "publishArgs": ["--access", "public"] } } node-redis-redis-4.5.1/packages/graph/README.md000066400000000000000000000012421433774114400210230ustar00rootroot00000000000000# @redis/graph Example usage: ```javascript import { createClient, Graph } from 'redis'; const client = createClient(); client.on('error', (err) => console.log('Redis Client Error', err)); await client.connect(); const graph = new Graph(client, 'graph'); await graph.query( 'CREATE (:Rider { name: $riderName })-[:rides]->(:Team { name: $teamName })', { params: { riderName: 'Buzz Aldrin', teamName: 'Apollo' } } ); const result = await graph.roQuery( 'MATCH (r:Rider)-[:rides]->(t:Team { name: $name }) RETURN r.name AS name', { params: { name: 'Apollo' } } ); console.log(result.data); // [{ name: 'Buzz Aldrin' }] ``` node-redis-redis-4.5.1/packages/graph/lib/000077500000000000000000000000001433774114400203135ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/graph/lib/commands/000077500000000000000000000000001433774114400221145ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/graph/lib/commands/CONFIG_GET.spec.ts000066400000000000000000000011531433774114400250610ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CONFIG_GET'; describe('CONFIG GET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('TIMEOUT'), ['GRAPH.CONFIG', 'GET', 'TIMEOUT'] ); }); testUtils.testWithClient('client.graph.configGet', async client => { assert.deepEqual( await client.graph.configGet('TIMEOUT'), [ 'TIMEOUT', 0 ] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/CONFIG_GET.ts000066400000000000000000000004471433774114400241350ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(configKey: string): Array { return ['GRAPH.CONFIG', 'GET', configKey]; } type ConfigItem = [ configKey: string, value: number ]; export declare function transformReply(): ConfigItem | Array; node-redis-redis-4.5.1/packages/graph/lib/commands/CONFIG_SET.spec.ts000066400000000000000000000010721433774114400250750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CONFIG_SET'; describe('CONFIG SET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('TIMEOUT', 0), ['GRAPH.CONFIG', 'SET', 'TIMEOUT', '0'] ); }); testUtils.testWithClient('client.graph.configSet', async client => { assert.equal( await client.graph.configSet('TIMEOUT', 0), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/CONFIG_SET.ts000066400000000000000000000003601433774114400241430ustar00rootroot00000000000000export function transformArguments(configKey: string, value: number): Array { return [ 'GRAPH.CONFIG', 'SET', configKey, value.toString() ]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/graph/lib/commands/DELETE.spec.ts000066400000000000000000000011111433774114400243510ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DELETE'; describe('', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['GRAPH.DELETE', 'key'] ); }); testUtils.testWithClient('client.graph.delete', async client => { await client.graph.query('key', 'RETURN 1'); assert.equal( typeof await client.graph.delete('key'), 'string' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/DELETE.ts000066400000000000000000000002731433774114400234300ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string): Array { return ['GRAPH.DELETE', key]; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/graph/lib/commands/EXPLAIN.spec.ts000066400000000000000000000011641433774114400245170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './EXPLAIN'; describe('EXPLAIN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'RETURN 0'), ['GRAPH.EXPLAIN', 'key', 'RETURN 0'] ); }); testUtils.testWithClient('client.graph.explain', async client => { const reply = await client.graph.explain('key', 'RETURN 0'); assert.ok(Array.isArray(reply)); assert.ok(!reply.find(x => typeof x !== 'string')); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/EXPLAIN.ts000066400000000000000000000003741433774114400235700ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, query: string): Array { return ['GRAPH.EXPLAIN', key, query]; } export declare function transfromReply(): Array; node-redis-redis-4.5.1/packages/graph/lib/commands/LIST.spec.ts000066400000000000000000000007651433774114400242000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './LIST'; describe('LIST', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['GRAPH.LIST'] ); }); testUtils.testWithClient('client.graph.list', async client => { assert.deepEqual( await client.graph.list(), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/LIST.ts000066400000000000000000000002601433774114400232350ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(): Array { return ['GRAPH.LIST']; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/graph/lib/commands/PROFILE.spec.ts000066400000000000000000000011641433774114400245170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './PROFILE'; describe('PROFILE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'RETURN 0'), ['GRAPH.PROFILE', 'key', 'RETURN 0'] ); }); testUtils.testWithClient('client.graph.profile', async client => { const reply = await client.graph.profile('key', 'RETURN 0'); assert.ok(Array.isArray(reply)); assert.ok(!reply.find(x => typeof x !== 'string')); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/PROFILE.ts000066400000000000000000000003741433774114400235700ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, query: string): Array { return ['GRAPH.PROFILE', key, query]; } export declare function transfromReply(): Array; node-redis-redis-4.5.1/packages/graph/lib/commands/QUERY.spec.ts000066400000000000000000000010511433774114400243170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './QUERY'; describe('QUERY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'query'), ['GRAPH.QUERY', 'key', 'query'] ); }); testUtils.testWithClient('client.graph.query', async client => { const { data } = await client.graph.query('key', 'RETURN 0'); assert.deepEqual(data, [[0]]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/QUERY.ts000066400000000000000000000022741433774114400233760ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands/index'; import { pushQueryArguments, QueryOptionsBackwardCompatible } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( graph: RedisCommandArgument, query: RedisCommandArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean ): RedisCommandArguments { return pushQueryArguments( ['GRAPH.QUERY'], graph, query, options, compact ); } type Headers = Array; type Data = Array; type Metadata = Array; type QueryRawReply = [ headers: Headers, data: Data, metadata: Metadata ] | [ metadata: Metadata ]; export type QueryReply = { headers: undefined; data: undefined; metadata: Metadata; } | { headers: Headers; data: Data; metadata: Metadata; }; export function transformReply(reply: QueryRawReply): QueryReply { return reply.length === 1 ? { headers: undefined, data: undefined, metadata: reply[0] } : { headers: reply[0], data: reply[1], metadata: reply[2] }; } node-redis-redis-4.5.1/packages/graph/lib/commands/RO_QUERY.spec.ts000066400000000000000000000010651433774114400247240ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RO_QUERY'; describe('RO_QUERY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'query'), ['GRAPH.RO_QUERY', 'key', 'query'] ); }); testUtils.testWithClient('client.graph.roQuery', async client => { const { data } = await client.graph.roQuery('key', 'RETURN 0'); assert.deepEqual(data, [[0]]); }, GLOBAL.SERVERS.OPEN); });node-redis-redis-4.5.1/packages/graph/lib/commands/RO_QUERY.ts000066400000000000000000000011521433774114400237700ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushQueryArguments, QueryOptionsBackwardCompatible } from '.'; export { FIRST_KEY_INDEX } from './QUERY'; export const IS_READ_ONLY = true; export function transformArguments( graph: RedisCommandArgument, query: RedisCommandArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean ): RedisCommandArguments { return pushQueryArguments( ['GRAPH.RO_QUERY'], graph, query, options, compact ); } export { transformReply } from './QUERY'; node-redis-redis-4.5.1/packages/graph/lib/commands/SLOWLOG.spec.ts000066400000000000000000000011011433774114400245340ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SLOWLOG'; describe('SLOWLOG', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['GRAPH.SLOWLOG', 'key'] ); }); testUtils.testWithClient('client.graph.slowLog', async client => { await client.graph.query('key', 'RETURN 1'); const reply = await client.graph.slowLog('key'); assert.equal(reply.length, 1); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/commands/SLOWLOG.ts000066400000000000000000000012031433774114400236060ustar00rootroot00000000000000export const IS_READ_ONLY = true; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string) { return ['GRAPH.SLOWLOG', key]; } type SlowLogRawReply = Array<[ timestamp: string, command: string, query: string, took: string ]>; type SlowLogReply = Array<{ timestamp: Date; command: string; query: string; took: number; }>; export function transformReply(logs: SlowLogRawReply): SlowLogReply { return logs.map(([timestamp, command, query, took]) => ({ timestamp: new Date(Number(timestamp) * 1000), command, query, took: Number(took) })); } node-redis-redis-4.5.1/packages/graph/lib/commands/index.spec.ts000066400000000000000000000030751433774114400245310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { pushQueryArguments } from '.'; describe('pushQueryArguments', () => { it('simple', () => { assert.deepEqual( pushQueryArguments(['GRAPH.QUERY'], 'graph', 'query'), ['GRAPH.QUERY', 'graph', 'query'] ); }); describe('params', () => { it('all types', () => { assert.deepEqual( pushQueryArguments(['GRAPH.QUERY'], 'graph', 'query', { params: { null: null, string: '"\\', number: 0, boolean: false, array: [0], object: {a: 0} } }), ['GRAPH.QUERY', 'graph', 'CYPHER null=null string="\\"\\\\" number=0 boolean=false array=[0] object={a:0} query'] ); }); it('TypeError', () => { assert.throws(() => { pushQueryArguments(['GRAPH.QUERY'], 'graph', 'query', { params: { a: undefined as any } }) }, TypeError); }); }); it('TIMEOUT backward compatible', () => { assert.deepEqual( pushQueryArguments(['GRAPH.QUERY'], 'graph', 'query', 1), ['GRAPH.QUERY', 'graph', 'query', 'TIMEOUT', '1'] ); }); it('TIMEOUT', () => { assert.deepEqual( pushQueryArguments(['GRAPH.QUERY'], 'graph', 'query', { TIMEOUT: 1 }), ['GRAPH.QUERY', 'graph', 'query', 'TIMEOUT', '1'] ); }); it('compact', () => { assert.deepEqual( pushQueryArguments(['GRAPH.QUERY'], 'graph', 'query', undefined, true), ['GRAPH.QUERY', 'graph', 'query', '--compact'] ); }); }); node-redis-redis-4.5.1/packages/graph/lib/commands/index.ts000066400000000000000000000055141433774114400236000ustar00rootroot00000000000000import * as CONFIG_GET from './CONFIG_GET'; import * as CONFIG_SET from './CONFIG_SET';; import * as DELETE from './DELETE'; import * as EXPLAIN from './EXPLAIN'; import * as LIST from './LIST'; import * as PROFILE from './PROFILE'; import * as QUERY from './QUERY'; import * as RO_QUERY from './RO_QUERY'; import * as SLOWLOG from './SLOWLOG'; import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export default { CONFIG_GET, configGet: CONFIG_GET, CONFIG_SET, configSet: CONFIG_SET, DELETE, delete: DELETE, EXPLAIN, explain: EXPLAIN, LIST, list: LIST, PROFILE, profile: PROFILE, QUERY, query: QUERY, RO_QUERY, roQuery: RO_QUERY, SLOWLOG, slowLog: SLOWLOG }; type QueryParam = null | string | number | boolean | QueryParams | Array; type QueryParams = { [key: string]: QueryParam; }; export interface QueryOptions { params?: QueryParams; TIMEOUT?: number; } export type QueryOptionsBackwardCompatible = QueryOptions | number; export function pushQueryArguments( args: RedisCommandArguments, graph: RedisCommandArgument, query: RedisCommandArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean ): RedisCommandArguments { args.push(graph); if (typeof options === 'number') { args.push(query); pushTimeout(args, options); } else { args.push( options?.params ? `CYPHER ${queryParamsToString(options.params)} ${query}` : query ); if (options?.TIMEOUT !== undefined) { pushTimeout(args, options.TIMEOUT); } } if (compact) { args.push('--compact'); } return args; } function pushTimeout(args: RedisCommandArguments, timeout: number): void { args.push('TIMEOUT', timeout.toString()); } function queryParamsToString(params: QueryParams): string { const parts = []; for (const [key, value] of Object.entries(params)) { parts.push(`${key}=${queryParamToString(value)}`); } return parts.join(' '); } function queryParamToString(param: QueryParam): string { if (param === null) { return 'null'; } switch (typeof param) { case 'string': return `"${param.replace(/["\\]/g, '\\$&')}"`; case 'number': case 'boolean': return param.toString(); } if (Array.isArray(param)) { return `[${param.map(queryParamToString).join(',')}]`; } else if (typeof param === 'object') { const body = []; for (const [key, value] of Object.entries(param)) { body.push(`${key}:${queryParamToString(value)}`); } return `{${body.join(',')}}`; } else { throw new TypeError(`Unexpected param type ${typeof param} ${param}`) } } node-redis-redis-4.5.1/packages/graph/lib/graph.spec.ts000066400000000000000000000120521433774114400227150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from './test-utils'; import Graph from './graph'; describe('Graph', () => { testUtils.testWithClient('null', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN null AS key'); assert.deepEqual( data, [{ key: null }] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('string', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN "string" AS key'); assert.deepEqual( data, [{ key: 'string' }] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('integer', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN 0 AS key'); assert.deepEqual( data, [{ key: 0 }] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('boolean', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN false AS key'); assert.deepEqual( data, [{ key: false }] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('double', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN 0.1 AS key'); assert.deepEqual( data, [{ key: 0.1 }] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('array', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN [null] AS key'); assert.deepEqual( data, [{ key: [null] }] ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('edge', async client => { const graph = new Graph(client as any, 'graph'); // check with and without metadata cache for (let i = 0; i < 2; i++) { const { data } = await graph.query('CREATE ()-[edge :edge]->() RETURN edge'); assert.ok(Array.isArray(data)); assert.equal(data.length, 1); assert.equal(typeof data[0].edge.id, 'number'); assert.equal(data[0].edge.relationshipType, 'edge'); assert.equal(typeof data[0].edge.sourceId, 'number'); assert.equal(typeof data[0].edge.destinationId, 'number'); assert.deepEqual(data[0].edge.properties, {}); } }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('node', async client => { const graph = new Graph(client as any, 'graph'); // check with and without metadata cache for (let i = 0; i < 2; i++) { const { data } = await graph.query('CREATE (node :node { p: 0 }) RETURN node'); assert.ok(Array.isArray(data)); assert.equal(data.length, 1); assert.equal(typeof data[0].node.id, 'number'); assert.deepEqual(data[0].node.labels, ['node']); assert.deepEqual(data[0].node.properties, { p: 0 }); } }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('path', async client => { const graph = new Graph(client as any, 'graph'), [, { data }] = await Promise.all([ await graph.query('CREATE ()-[:edge]->()'), await graph.roQuery('MATCH path = ()-[:edge]->() RETURN path') ]); assert.ok(Array.isArray(data)); assert.equal(data.length, 1); assert.ok(Array.isArray(data[0].path.nodes)); assert.equal(data[0].path.nodes.length, 2); for (const node of data[0].path.nodes) { assert.equal(typeof node.id, 'number'); assert.deepEqual(node.labels, []); assert.deepEqual(node.properties, {}); } assert.ok(Array.isArray(data[0].path.edges)); assert.equal(data[0].path.edges.length, 1); for (const edge of data[0].path.edges) { assert.equal(typeof edge.id, 'number'); assert.equal(edge.relationshipType, 'edge'); assert.equal(typeof edge.sourceId, 'number'); assert.equal(typeof edge.destinationId, 'number'); assert.deepEqual(edge.properties, {}); } }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('map', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN { key: "value" } AS map'); assert.deepEqual(data, [{ map: { key: 'value' } }]); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('point', async client => { const graph = new Graph(client as any, 'graph'), { data } = await graph.roQuery('RETURN point({ latitude: 1, longitude: 2 }) AS point'); assert.deepEqual(data, [{ point: { latitude: 1, longitude: 2 } }]); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/graph/lib/graph.ts000066400000000000000000000232741433774114400217740ustar00rootroot00000000000000import { RedisClientType } from '@redis/client/dist/lib/client/index'; import { RedisCommandArgument, RedisFunctions, RedisScripts } from '@redis/client/dist/lib/commands'; import { QueryOptions } from './commands'; import { QueryReply } from './commands/QUERY'; interface GraphMetadata { labels: Array; relationshipTypes: Array; propertyKeys: Array; } // https://github.com/RedisGraph/RedisGraph/blob/master/src/resultset/formatters/resultset_formatter.h#L20 enum GraphValueTypes { UNKNOWN = 0, NULL = 1, STRING = 2, INTEGER = 3, BOOLEAN = 4, DOUBLE = 5, ARRAY = 6, EDGE = 7, NODE = 8, PATH = 9, MAP = 10, POINT = 11 } type GraphEntityRawProperties = Array<[ id: number, ...value: GraphRawValue ]>; type GraphEdgeRawValue = [ GraphValueTypes.EDGE, [ id: number, relationshipTypeId: number, sourceId: number, destinationId: number, properties: GraphEntityRawProperties ] ]; type GraphNodeRawValue = [ GraphValueTypes.NODE, [ id: number, labelIds: Array, properties: GraphEntityRawProperties ] ]; type GraphPathRawValue = [ GraphValueTypes.PATH, [ nodes: [ GraphValueTypes.ARRAY, Array ], edges: [ GraphValueTypes.ARRAY, Array ] ] ]; type GraphMapRawValue = [ GraphValueTypes.MAP, Array ]; type GraphRawValue = [ GraphValueTypes.NULL, null ] | [ GraphValueTypes.STRING, string ] | [ GraphValueTypes.INTEGER, number ] | [ GraphValueTypes.BOOLEAN, string ] | [ GraphValueTypes.DOUBLE, string ] | [ GraphValueTypes.ARRAY, Array ] | GraphEdgeRawValue | GraphNodeRawValue | GraphPathRawValue | GraphMapRawValue | [ GraphValueTypes.POINT, [ latitude: string, longitude: string ] ]; type GraphEntityProperties = Record; interface GraphEdge { id: number; relationshipType: string; sourceId: number; destinationId: number; properties: GraphEntityProperties; } interface GraphNode { id: number; labels: Array; properties: GraphEntityProperties; } interface GraphPath { nodes: Array; edges: Array; } type GraphMap = { [key: string]: GraphValue; }; type GraphValue = null | string | number | boolean | Array | { } | GraphEdge | GraphNode | GraphPath | GraphMap | { latitude: string; longitude: string; }; type GraphReply = Omit & { data?: Array; }; type GraphClientType = RedisClientType<{ graph: { query: typeof import('./commands/QUERY'), roQuery: typeof import('./commands/RO_QUERY') } }, RedisFunctions, RedisScripts>; export default class Graph { #client: GraphClientType; #name: string; #metadata?: GraphMetadata; constructor( client: GraphClientType, name: string ) { this.#client = client; this.#name = name; } async query( query: RedisCommandArgument, options?: QueryOptions ) { return this.#parseReply( await this.#client.graph.query( this.#name, query, options, true ) ); } async roQuery( query: RedisCommandArgument, options?: QueryOptions ) { return this.#parseReply( await this.#client.graph.roQuery( this.#name, query, options, true ) ); } #setMetadataPromise?: Promise; #updateMetadata(): Promise { this.#setMetadataPromise ??= this.#setMetadata() .finally(() => this.#setMetadataPromise = undefined); return this.#setMetadataPromise; } // DO NOT use directly, use #updateMetadata instead async #setMetadata(): Promise { const [labels, relationshipTypes, propertyKeys] = await Promise.all([ this.#client.graph.roQuery(this.#name, 'CALL db.labels()'), this.#client.graph.roQuery(this.#name, 'CALL db.relationshipTypes()'), this.#client.graph.roQuery(this.#name, 'CALL db.propertyKeys()') ]); this.#metadata = { labels: this.#cleanMetadataArray(labels.data as Array<[string]>), relationshipTypes: this.#cleanMetadataArray(relationshipTypes.data as Array<[string]>), propertyKeys: this.#cleanMetadataArray(propertyKeys.data as Array<[string]>) }; return this.#metadata; } #cleanMetadataArray(arr: Array<[string]>): Array { return arr.map(([value]) => value); } #getMetadata( key: T, id: number ): GraphMetadata[T][number] | Promise { return this.#metadata?.[key][id] ?? this.#getMetadataAsync(key, id); } // DO NOT use directly, use #getMetadata instead async #getMetadataAsync( key: T, id: number ): Promise { const value = (await this.#updateMetadata())[key][id]; if (value === undefined) throw new Error(`Cannot find value from ${key}[${id}]`); return value; } async #parseReply(reply: QueryReply): Promise> { if (!reply.data) return reply; const promises: Array> = [], parsed = { metadata: reply.metadata, data: reply.data!.map((row: any) => { const data: Record = {}; for (let i = 0; i < row.length; i++) { data[reply.headers[i][1]] = this.#parseValue(row[i], promises); } return data as unknown as T; }) }; if (promises.length) await Promise.all(promises); return parsed; } #parseValue([valueType, value]: GraphRawValue, promises: Array>): GraphValue { switch (valueType) { case GraphValueTypes.NULL: return null; case GraphValueTypes.STRING: case GraphValueTypes.INTEGER: return value; case GraphValueTypes.BOOLEAN: return value === 'true'; case GraphValueTypes.DOUBLE: return parseFloat(value); case GraphValueTypes.ARRAY: return value.map(x => this.#parseValue(x, promises)); case GraphValueTypes.EDGE: return this.#parseEdge(value, promises); case GraphValueTypes.NODE: return this.#parseNode(value, promises); case GraphValueTypes.PATH: return { nodes: value[0][1].map(([, node]) => this.#parseNode(node, promises)), edges: value[1][1].map(([, edge]) => this.#parseEdge(edge, promises)) }; case GraphValueTypes.MAP: const map: GraphMap = {}; for (let i = 0; i < value.length; i++) { map[value[i++] as string] = this.#parseValue(value[i] as GraphRawValue, promises); } return map; case GraphValueTypes.POINT: return { latitude: parseFloat(value[0]), longitude: parseFloat(value[1]) }; default: throw new Error(`unknown scalar type: ${valueType}`); } } #parseEdge([ id, relationshipTypeId, sourceId, destinationId, properties ]: GraphEdgeRawValue[1], promises: Array>): GraphEdge { const edge = { id, sourceId, destinationId, properties: this.#parseProperties(properties, promises) } as GraphEdge; const relationshipType = this.#getMetadata('relationshipTypes', relationshipTypeId); if (relationshipType instanceof Promise) { promises.push( relationshipType.then(value => edge.relationshipType = value) ); } else { edge.relationshipType = relationshipType; } return edge; } #parseNode([ id, labelIds, properties ]: GraphNodeRawValue[1], promises: Array>): GraphNode { const labels = new Array(labelIds.length); for (let i = 0; i < labelIds.length; i++) { const value = this.#getMetadata('labels', labelIds[i]); if (value instanceof Promise) { promises.push(value.then(value => labels[i] = value)); } else { labels[i] = value; } } return { id, labels, properties: this.#parseProperties(properties, promises) }; } #parseProperties(raw: GraphEntityRawProperties, promises: Array>): GraphEntityProperties { const parsed: GraphEntityProperties = {}; for (const [id, type, value] of raw) { const parsedValue = this.#parseValue([type, value] as GraphRawValue, promises), key = this.#getMetadata('propertyKeys', id); if (key instanceof Promise) { promises.push(key.then(key => parsed[key] = parsedValue)); } else { parsed[key] = parsedValue; } } return parsed; } } node-redis-redis-4.5.1/packages/graph/lib/index.ts000066400000000000000000000001221433774114400217650ustar00rootroot00000000000000export { default } from './commands'; export { default as Graph } from './graph'; node-redis-redis-4.5.1/packages/graph/lib/test-utils.ts000066400000000000000000000010161433774114400227760ustar00rootroot00000000000000import TestUtils from '@redis/test-utils'; import RedisGraph from '.'; export default new TestUtils({ dockerImageName: 'redislabs/redisgraph', dockerImageVersionArgument: 'redisgraph-version', defaultDockerVersion: '2.8.15' }); export const GLOBAL = { SERVERS: { OPEN: { serverArguments: ['--loadmodule /usr/lib/redis/modules/redisgraph.so'], clientOptions: { modules: { graph: RedisGraph } } } } }; node-redis-redis-4.5.1/packages/graph/package.json000066400000000000000000000013211433774114400220300ustar00rootroot00000000000000{ "name": "@redis/graph", "version": "1.1.0", "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", "documentation": "typedoc" }, "peerDependencies": { "@redis/client": "^1.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } } node-redis-redis-4.5.1/packages/graph/tsconfig.json000066400000000000000000000005371433774114400222610ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./lib/**/*.ts" ], "exclude": [ "./lib/test-utils.ts", "./lib/**/*.spec.ts" ], "typedocOptions": { "entryPoints": [ "./lib" ], "entryPointStrategy": "expand", "out": "../../documentation/graph" } } node-redis-redis-4.5.1/packages/json/000077500000000000000000000000001433774114400174155ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/json/.npmignore000066400000000000000000000001071433774114400214120ustar00rootroot00000000000000.nyc_output/ coverage/ lib/ .nycrc.json .release-it.json tsconfig.json node-redis-redis-4.5.1/packages/json/.nycrc.json000066400000000000000000000001511433774114400215010ustar00rootroot00000000000000{ "extends": "@istanbuljs/nyc-config-typescript", "exclude": ["**/*.spec.ts", "lib/test-utils.ts"] } node-redis-redis-4.5.1/packages/json/.release-it.json000066400000000000000000000003041433774114400224150ustar00rootroot00000000000000{ "git": { "tagName": "json@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" }, "npm": { "publishArgs": ["--access", "public"] } } node-redis-redis-4.5.1/packages/json/README.md000066400000000000000000000046211433774114400206770ustar00rootroot00000000000000# @redis/json This package provides support for the [RedisJSON](https://redisjson.io) module, which adds JSON as a native data type to Redis. It extends the [Node Redis client](https://github.com/redis/node-redis) to include functions for each of the RedisJSON commands. To use these extra commands, your Redis server must have the RedisJSON module installed. ## Usage For a complete example, see [`managing-json.js`](https://github.com/redis/node-redis/blob/master/examples/managing-json.js) in the Node Redis examples folder. ### Storing JSON Documents in Redis The [`JSON.SET`](https://oss.redis.com/redisjson/commands/#jsonset) command stores a JSON value at a given JSON Path in a Redis key. Here, we'll store a JSON document in the root of the Redis key "`mydoc`": ```javascript import { createClient } from 'redis'; ... await client.json.set('noderedis:jsondata', '$', { name: 'Roberta McDonald', pets: [ { name: 'Rex', species: 'dog', age: 3, isMammal: true }, { name: 'Goldie', species: 'fish', age: 2, isMammal: false } ] }); ``` For more information about RedisJSON's path syntax, [check out the documentation](https://oss.redis.com/redisjson/path/). ### Retrieving JSON Documents from Redis With RedisJSON, we can retrieve all or part(s) of a JSON document using the [`JSON.GET`]() command and one or more JSON Paths. Let's get the name and age of one of the pets: ```javascript const results = await client.json.get('noderedis:jsondata', { path: [ '.pets[1].name', '.pets[1].age' ] }); ``` `results` will contain the following: ```javascript { '.pets[1].name': 'Goldie', '.pets[1].age': 2 } ``` ### Performing Atomic Updates on JSON Documents Stored in Redis RedisJSON includes commands that can atomically update values in a JSON document, in place in Redis without having to first retrieve the entire document. Using the [`JSON.NUMINCRBY`](https://oss.redis.com/redisjson/commands/#jsonnumincrby) command, we can update the age of one of the pets like this: ```javascript await client.json.numIncrBy('noderedis:jsondata', '.pets[1].age', 1); ``` And we can add a new object to the pets array with the [`JSON.ARRAPPEND`](https://oss.redis.com/redisjson/commands/#jsonarrappend) command: ```javascript await client.json.arrAppend('noderedis:jsondata', '.pets', { name: 'Robin', species: 'bird', age: 1, isMammal: false }); ``` node-redis-redis-4.5.1/packages/json/lib/000077500000000000000000000000001433774114400201635ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/json/lib/commands/000077500000000000000000000000001433774114400217645ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/json/lib/commands/ARRAPPEND.spec.ts000066400000000000000000000015711433774114400246050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ARRAPPEND'; describe('ARRAPPEND', () => { describe('transformArguments', () => { it('single JSON', () => { assert.deepEqual( transformArguments('key', '$', 1), ['JSON.ARRAPPEND', 'key', '$', '1'] ); }); it('multiple JSONs', () => { assert.deepEqual( transformArguments('key', '$', 1, 2), ['JSON.ARRAPPEND', 'key', '$', '1', '2'] ); }); }); testUtils.testWithClient('client.json.arrAppend', async client => { await client.json.set('key', '$', []); assert.deepEqual( await client.json.arrAppend('key', '$', 1), [1] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/ARRAPPEND.ts000066400000000000000000000006551433774114400236560ustar00rootroot00000000000000import { RedisJSON, transformRedisJsonArgument } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path: string, ...jsons: Array): Array { const args = ['JSON.ARRAPPEND', key, path]; for (const json of jsons) { args.push(transformRedisJsonArgument(json)); } return args; } export declare function transformReply(): number | Array; node-redis-redis-4.5.1/packages/json/lib/commands/ARRINDEX.spec.ts000066400000000000000000000021441433774114400245020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ARRINDEX'; describe('ARRINDEX', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('key', '$', 'json'), ['JSON.ARRINDEX', 'key', '$', '"json"'] ); }); it('with start', () => { assert.deepEqual( transformArguments('key', '$', 'json', 1), ['JSON.ARRINDEX', 'key', '$', '"json"', '1'] ); }); it('with start, end', () => { assert.deepEqual( transformArguments('key', '$', 'json', 1, 2), ['JSON.ARRINDEX', 'key', '$', '"json"', '1', '2'] ); }); }); testUtils.testWithClient('client.json.arrIndex', async client => { await client.json.set('key', '$', []); assert.deepEqual( await client.json.arrIndex('key', '$', 'json'), [-1] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/ARRINDEX.ts000066400000000000000000000011541433774114400235510ustar00rootroot00000000000000import { RedisJSON, transformRedisJsonArgument } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, path: string, json: RedisJSON, start?: number, stop?: number): Array { const args = ['JSON.ARRINDEX', key, path, transformRedisJsonArgument(json)]; if (start !== undefined && start !== null) { args.push(start.toString()); if (stop !== undefined && stop !== null) { args.push(stop.toString()); } } return args; } export declare function transformReply(): number | Array; node-redis-redis-4.5.1/packages/json/lib/commands/ARRINSERT.spec.ts000066400000000000000000000016431433774114400246420ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ARRINSERT'; describe('ARRINSERT', () => { describe('transformArguments', () => { it('single JSON', () => { assert.deepEqual( transformArguments('key', '$', 0, 'json'), ['JSON.ARRINSERT', 'key', '$', '0', '"json"'] ); }); it('multiple JSONs', () => { assert.deepEqual( transformArguments('key', '$', 0, '1', '2'), ['JSON.ARRINSERT', 'key', '$', '0', '"1"', '"2"'] ); }); }); testUtils.testWithClient('client.json.arrInsert', async client => { await client.json.set('key', '$', []); assert.deepEqual( await client.json.arrInsert('key', '$', 0, 'json'), [1] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/ARRINSERT.ts000066400000000000000000000007161433774114400237110ustar00rootroot00000000000000import { RedisJSON, transformRedisJsonArgument } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path: string, index: number, ...jsons: Array): Array { const args = ['JSON.ARRINSERT', key, path, index.toString()]; for (const json of jsons) { args.push(transformRedisJsonArgument(json)); } return args; } export declare function transformReply(): number | Array; node-redis-redis-4.5.1/packages/json/lib/commands/ARRLEN.spec.ts000066400000000000000000000014761433774114400242600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ARRLEN'; describe('ARRLEN', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.ARRLEN', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.ARRLEN', 'key', '$'] ); }); }); testUtils.testWithClient('client.json.arrLen', async client => { await client.json.set('key', '$', []); assert.deepEqual( await client.json.arrLen('key', '$'), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/ARRLEN.ts000066400000000000000000000005041433774114400233160ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.ARRLEN', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): number | Array; node-redis-redis-4.5.1/packages/json/lib/commands/ARRPOP.spec.ts000066400000000000000000000031431433774114400242710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ARRPOP'; describe('ARRPOP', () => { describe('transformArguments', () => { it('key', () => { assert.deepEqual( transformArguments('key'), ['JSON.ARRPOP', 'key'] ); }); it('key, path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.ARRPOP', 'key', '$'] ); }); it('key, path, index', () => { assert.deepEqual( transformArguments('key', '$', 0), ['JSON.ARRPOP', 'key', '$', '0'] ); }); }); describe('client.json.arrPop', () => { testUtils.testWithClient('null', async client => { await client.json.set('key', '.', []); assert.equal( await client.json.arrPop('key', '.'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with value', async client => { await client.json.set('key', '.', ['value']); assert.equal( await client.json.arrPop('key', '.'), 'value' ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('array', async client => { await client.json.set('key', '$', ['value']); assert.deepEqual( await client.json.arrPop('key', '$'), ['value'] ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/json/lib/commands/ARRPOP.ts000066400000000000000000000012751433774114400233440ustar00rootroot00000000000000import { RedisJSON, transformRedisJsonNullReply } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string, index?: number): Array { const args = ['JSON.ARRPOP', key]; if (path) { args.push(path); if (index !== undefined && index !== null) { args.push(index.toString()); } } return args; } export function transformReply(reply: null | string | Array): null | RedisJSON | Array { if (reply === null) return null; if (Array.isArray(reply)) { return reply.map(transformRedisJsonNullReply); } return transformRedisJsonNullReply(reply); } node-redis-redis-4.5.1/packages/json/lib/commands/ARRTRIM.spec.ts000066400000000000000000000011501433774114400244020ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ARRTRIM'; describe('ARRTRIM', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '$', 0, 1), ['JSON.ARRTRIM', 'key', '$', '0', '1'] ); }); testUtils.testWithClient('client.json.arrTrim', async client => { await client.json.set('key', '$', []); assert.deepEqual( await client.json.arrTrim('key', '$', 0, 1), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/ARRTRIM.ts000066400000000000000000000004371433774114400234600ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path: string, start: number, stop: number): Array { return ['JSON.ARRTRIM', key, path, start.toString(), stop.toString()]; } export declare function transformReply(): number | Array; node-redis-redis-4.5.1/packages/json/lib/commands/DEBUG_MEMORY.spec.ts000066400000000000000000000014611433774114400252050ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DEBUG_MEMORY'; describe('DEBUG MEMORY', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.DEBUG', 'MEMORY', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.DEBUG', 'MEMORY', 'key', '$'] ); }); }); testUtils.testWithClient('client.json.arrTrim', async client => { assert.deepEqual( await client.json.debugMemory('key', '$'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/DEBUG_MEMORY.ts000066400000000000000000000004321433774114400242510ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 2; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.DEBUG', 'MEMORY', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/json/lib/commands/DEL.spec.ts000066400000000000000000000013661433774114400236770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DEL'; describe('DEL', () => { describe('transformArguments', () => { it('key', () => { assert.deepEqual( transformArguments('key'), ['JSON.DEL', 'key'] ); }); it('key, path', () => { assert.deepEqual( transformArguments('key', '$.path'), ['JSON.DEL', 'key', '$.path'] ); }); }); testUtils.testWithClient('client.json.del', async client => { assert.deepEqual( await client.json.del('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/DEL.ts000066400000000000000000000004161433774114400227410ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.DEL', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/json/lib/commands/FORGET.spec.ts000066400000000000000000000014101433774114400242470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './FORGET'; describe('FORGET', () => { describe('transformArguments', () => { it('key', () => { assert.deepEqual( transformArguments('key'), ['JSON.FORGET', 'key'] ); }); it('key, path', () => { assert.deepEqual( transformArguments('key', '$.path'), ['JSON.FORGET', 'key', '$.path'] ); }); }); testUtils.testWithClient('client.json.forget', async client => { assert.deepEqual( await client.json.forget('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/FORGET.ts000066400000000000000000000004211433774114400233170ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.FORGET', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/json/lib/commands/GET.spec.ts000066400000000000000000000044721433774114400237130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GET'; describe('GET', () => { describe('transformArguments', () => { describe('path', () => { it('string', () => { assert.deepEqual( transformArguments('key', { path: '$' }), ['JSON.GET', 'key', '$'] ); }); it('array', () => { assert.deepEqual( transformArguments('key', { path: ['$.1', '$.2'] }), ['JSON.GET', 'key', '$.1', '$.2'] ); }); }); it('key', () => { assert.deepEqual( transformArguments('key'), ['JSON.GET', 'key'] ); }); it('INDENT', () => { assert.deepEqual( transformArguments('key', { INDENT: 'indent' }), ['JSON.GET', 'key', 'INDENT', 'indent'] ); }); it('NEWLINE', () => { assert.deepEqual( transformArguments('key', { NEWLINE: 'newline' }), ['JSON.GET', 'key', 'NEWLINE', 'newline'] ); }); it('SPACE', () => { assert.deepEqual( transformArguments('key', { SPACE: 'space' }), ['JSON.GET', 'key', 'SPACE', 'space'] ); }); it('NOESCAPE', () => { assert.deepEqual( transformArguments('key', { NOESCAPE: true }), ['JSON.GET', 'key', 'NOESCAPE'] ); }); it('INDENT, NEWLINE, SPACE, NOESCAPE, path', () => { assert.deepEqual( transformArguments('key', { path: '$.path', INDENT: 'indent', NEWLINE: 'newline', SPACE: 'space', NOESCAPE: true }), ['JSON.GET', 'key', '$.path', 'INDENT', 'indent', 'NEWLINE', 'newline', 'SPACE', 'space', 'NOESCAPE'] ); }); }); testUtils.testWithClient('client.json.get', async client => { assert.equal( await client.json.get('key'), null ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/GET.ts000066400000000000000000000017671433774114400227660ustar00rootroot00000000000000import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface GetOptions { path?: string | Array; INDENT?: string; NEWLINE?: string; SPACE?: string; NOESCAPE?: true; } export function transformArguments(key: string, options?: GetOptions): RedisCommandArguments { let args: RedisCommandArguments = ['JSON.GET', key]; if (options?.path) { args = pushVerdictArguments(args, options.path); } if (options?.INDENT) { args.push('INDENT', options.INDENT); } if (options?.NEWLINE) { args.push('NEWLINE', options.NEWLINE); } if (options?.SPACE) { args.push('SPACE', options.SPACE); } if (options?.NOESCAPE) { args.push('NOESCAPE'); } return args; } export { transformRedisJsonNullReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/json/lib/commands/MGET.spec.ts000066400000000000000000000010511433774114400240160ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MGET'; describe('MGET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(['1', '2'], '$'), ['JSON.MGET', '1', '2', '$'] ); }); testUtils.testWithClient('client.json.mGet', async client => { assert.deepEqual( await client.json.mGet(['1', '2'], '$'), [null, null] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/MGET.ts000066400000000000000000000006151433774114400230720ustar00rootroot00000000000000import { RedisJSON, transformRedisJsonNullReply } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(keys: Array, path: string): Array { return [ 'JSON.MGET', ...keys, path ]; } export function transformReply(reply: Array): Array { return reply.map(transformRedisJsonNullReply); } node-redis-redis-4.5.1/packages/json/lib/commands/NUMINCRBY.spec.ts000066400000000000000000000011461433774114400246350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './NUMINCRBY'; describe('NUMINCRBY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '$', 1), ['JSON.NUMINCRBY', 'key', '$', '1'] ); }); testUtils.testWithClient('client.json.numIncrBy', async client => { await client.json.set('key', '$', 0); assert.deepEqual( await client.json.numIncrBy('key', '$', 1), [1] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/NUMINCRBY.ts000066400000000000000000000003671433774114400237100ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path: string, by: number): Array { return ['JSON.NUMINCRBY', key, path, by.toString()]; } export { transformNumbersReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/json/lib/commands/NUMMULTBY.spec.ts000066400000000000000000000011461433774114400246630ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './NUMMULTBY'; describe('NUMMULTBY', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '$', 2), ['JSON.NUMMULTBY', 'key', '$', '2'] ); }); testUtils.testWithClient('client.json.numMultBy', async client => { await client.json.set('key', '$', 1); assert.deepEqual( await client.json.numMultBy('key', '$', 2), [2] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/NUMMULTBY.ts000066400000000000000000000003671433774114400237360ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path: string, by: number): Array { return ['JSON.NUMMULTBY', key, path, by.toString()]; } export { transformNumbersReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/json/lib/commands/OBJKEYS.spec.ts000066400000000000000000000014511433774114400243740ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './OBJKEYS'; describe('OBJKEYS', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.OBJKEYS', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.OBJKEYS', 'key', '$'] ); }); }); // testUtils.testWithClient('client.json.objKeys', async client => { // assert.deepEqual( // await client.json.objKeys('key', '$'), // [null] // ); // }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/OBJKEYS.ts000066400000000000000000000004761433774114400234510ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.OBJKEYS', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): Array | null | Array | null>; node-redis-redis-4.5.1/packages/json/lib/commands/OBJLEN.spec.ts000066400000000000000000000014371433774114400242430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './OBJLEN'; describe('OBJLEN', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.OBJLEN', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.OBJLEN', 'key', '$'] ); }); }); // testUtils.testWithClient('client.json.objLen', async client => { // assert.equal( // await client.json.objLen('key', '$'), // [null] // ); // }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/OBJLEN.ts000066400000000000000000000004571433774114400233130ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.OBJLEN', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): number | null | Array; node-redis-redis-4.5.1/packages/json/lib/commands/RESP.spec.ts000066400000000000000000000014231433774114400240360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RESP'; describe('RESP', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.RESP', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.RESP', 'key', '$'] ); }); }); // testUtils.testWithClient('client.json.resp', async client => { // assert.deepEqual( // await client.json.resp('key', '$'), // [null] // ); // }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/RESP.ts000066400000000000000000000005101433774114400231010ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.RESP', key]; if (path) { args.push(path); } return args; } type RESPReply = Array; export declare function transformReply(): RESPReply; node-redis-redis-4.5.1/packages/json/lib/commands/SET.spec.ts000066400000000000000000000020251433774114400237170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SET'; describe('SET', () => { describe('transformArguments', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '$', 'json'), ['JSON.SET', 'key', '$', '"json"'] ); }); it('NX', () => { assert.deepEqual( transformArguments('key', '$', 'json', { NX: true }), ['JSON.SET', 'key', '$', '"json"', 'NX'] ); }); it('XX', () => { assert.deepEqual( transformArguments('key', '$', 'json', { XX: true }), ['JSON.SET', 'key', '$', '"json"', 'XX'] ); }); }); testUtils.testWithClient('client.json.mGet', async client => { assert.equal( await client.json.set('key', '$', 'json'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/SET.ts000066400000000000000000000010441433774114400227660ustar00rootroot00000000000000import { RedisJSON, transformRedisJsonArgument } from '.'; export const FIRST_KEY_INDEX = 1; interface NX { NX: true; } interface XX { XX: true; } export function transformArguments(key: string, path: string, json: RedisJSON, options?: NX | XX): Array { const args = ['JSON.SET', key, path, transformRedisJsonArgument(json)]; if ((options)?.NX) { args.push('NX'); } else if ((options)?.XX) { args.push('XX'); } return args; } export declare function transformReply(): 'OK' | null; node-redis-redis-4.5.1/packages/json/lib/commands/STRAPPEND.spec.ts000066400000000000000000000016061433774114400246300ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './STRAPPEND'; describe('STRAPPEND', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key', 'append'), ['JSON.STRAPPEND', 'key', '"append"'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$', 'append'), ['JSON.STRAPPEND', 'key', '$', '"append"'] ); }); }); testUtils.testWithClient('client.json.strAppend', async client => { await client.json.set('key', '$', ''); assert.deepEqual( await client.json.strAppend('key', '$', 'append'), [6] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/STRAPPEND.ts000066400000000000000000000012411433774114400236720ustar00rootroot00000000000000import { transformRedisJsonArgument } from '.'; export const FIRST_KEY_INDEX = 1; type AppendArguments = [key: string, append: string]; type AppendWithPathArguments = [key: string, path: string, append: string]; export function transformArguments(...[key, pathOrAppend, append]: AppendArguments | AppendWithPathArguments): Array { const args = ['JSON.STRAPPEND', key]; if (append !== undefined && append !== null) { args.push(pathOrAppend, transformRedisJsonArgument(append)); } else { args.push(transformRedisJsonArgument(pathOrAppend)); } return args; } export declare function transformReply(): number | Array; node-redis-redis-4.5.1/packages/json/lib/commands/STRLEN.spec.ts000066400000000000000000000014761433774114400243040ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './STRLEN'; describe('STRLEN', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.STRLEN', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.STRLEN', 'key', '$'] ); }); }); testUtils.testWithClient('client.json.strLen', async client => { await client.json.set('key', '$', ''); assert.deepEqual( await client.json.strLen('key', '$'), [0] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/STRLEN.ts000066400000000000000000000004641433774114400233470ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.STRLEN', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/json/lib/commands/TYPE.spec.ts000066400000000000000000000014271433774114400240520ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './TYPE'; describe('TYPE', () => { describe('transformArguments', () => { it('without path', () => { assert.deepEqual( transformArguments('key'), ['JSON.TYPE', 'key'] ); }); it('with path', () => { assert.deepEqual( transformArguments('key', '$'), ['JSON.TYPE', 'key', '$'] ); }); }); // testUtils.testWithClient('client.json.type', async client => { // assert.deepEqual( // await client.json.type('key', '$'), // [null] // ); // }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/json/lib/commands/TYPE.ts000066400000000000000000000004551433774114400231210ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, path?: string): Array { const args = ['JSON.TYPE', key]; if (path) { args.push(path); } return args; } export declare function transformReply(): string | null | Array; node-redis-redis-4.5.1/packages/json/lib/commands/index.ts000066400000000000000000000043751433774114400234540ustar00rootroot00000000000000import * as ARRAPPEND from './ARRAPPEND'; import * as ARRINDEX from './ARRINDEX'; import * as ARRINSERT from './ARRINSERT'; import * as ARRLEN from './ARRLEN'; import * as ARRPOP from './ARRPOP'; import * as ARRTRIM from './ARRTRIM'; import * as DEBUG_MEMORY from './DEBUG_MEMORY'; import * as DEL from './DEL'; import * as FORGET from './FORGET'; import * as GET from './GET'; import * as MGET from './MGET'; import * as NUMINCRBY from './NUMINCRBY'; import * as NUMMULTBY from './NUMMULTBY'; import * as OBJKEYS from './OBJKEYS'; import * as OBJLEN from './OBJLEN'; import * as RESP from './RESP'; import * as SET from './SET'; import * as STRAPPEND from './STRAPPEND'; import * as STRLEN from './STRLEN'; import * as TYPE from './TYPE'; export default { ARRAPPEND, arrAppend: ARRAPPEND, ARRINDEX, arrIndex: ARRINDEX, ARRINSERT, arrInsert: ARRINSERT, ARRLEN, arrLen: ARRLEN, ARRPOP, arrPop: ARRPOP, ARRTRIM, arrTrim: ARRTRIM, DEBUG_MEMORY, debugMemory: DEBUG_MEMORY, DEL, del: DEL, FORGET, forget: FORGET, GET, get: GET, MGET, mGet: MGET, NUMINCRBY, numIncrBy: NUMINCRBY, NUMMULTBY, numMultBy: NUMMULTBY, OBJKEYS, objKeys: OBJKEYS, OBJLEN, objLen: OBJLEN, RESP, resp: RESP, SET, set: SET, STRAPPEND, strAppend: STRAPPEND, STRLEN, strLen: STRLEN, TYPE, type: TYPE }; // 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); } export function transformRedisJsonReply(json: string): RedisJSON { return JSON.parse(json); } export function transformRedisJsonNullReply(json: string | null): RedisJSON | null { if (json === null) return null; return transformRedisJsonReply(json); } export function transformNumbersReply(reply: string): number | Array { return JSON.parse(reply); } node-redis-redis-4.5.1/packages/json/lib/index.ts000066400000000000000000000000461433774114400216420ustar00rootroot00000000000000export { default } from './commands'; node-redis-redis-4.5.1/packages/json/lib/test-utils.ts000066400000000000000000000007761433774114400226620ustar00rootroot00000000000000import TestUtils from '@redis/test-utils'; import RedisJSON from '.'; export default new TestUtils({ dockerImageName: 'redislabs/rejson', dockerImageVersionArgument: 'rejson-version', defaultDockerVersion: '2.0.9' }); export const GLOBAL = { SERVERS: { OPEN: { serverArguments: ['--loadmodule /usr/lib/redis/modules/rejson.so'], clientOptions: { modules: { json: RedisJSON } } } } }; node-redis-redis-4.5.1/packages/json/package.json000066400000000000000000000013201433774114400216770ustar00rootroot00000000000000{ "name": "@redis/json", "version": "1.0.4", "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", "documentation": "typedoc" }, "peerDependencies": { "@redis/client": "^1.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } } node-redis-redis-4.5.1/packages/json/tsconfig.json000066400000000000000000000005361433774114400221300ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./lib/**/*.ts" ], "exclude": [ "./lib/test-utils.ts", "./lib/**/*.spec.ts" ], "typedocOptions": { "entryPoints": [ "./lib" ], "entryPointStrategy": "expand", "out": "../../documentation/json" } } node-redis-redis-4.5.1/packages/search/000077500000000000000000000000001433774114400177115ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/search/.npmignore000066400000000000000000000001071433774114400217060ustar00rootroot00000000000000.nyc_output/ coverage/ lib/ .nycrc.json .release-it.json tsconfig.json node-redis-redis-4.5.1/packages/search/.nycrc.json000066400000000000000000000001511433774114400217750ustar00rootroot00000000000000{ "extends": "@istanbuljs/nyc-config-typescript", "exclude": ["**/*.spec.ts", "lib/test-utils.ts"] } node-redis-redis-4.5.1/packages/search/.release-it.json000066400000000000000000000003061433774114400227130ustar00rootroot00000000000000{ "git": { "tagName": "search@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" }, "npm": { "publishArgs": ["--access", "public"] } } node-redis-redis-4.5.1/packages/search/README.md000066400000000000000000000107171433774114400211760ustar00rootroot00000000000000# @redis/search This package provides support for the [RediSearch](https://redisearch.io) module, which adds indexing and querying support for data stored in Redis Hashes or as JSON documents with the RedisJSON module. It extends the [Node Redis client](https://github.com/redis/node-redis) to include functions for each of the RediSearch commands. To use these extra commands, your Redis server must have the RediSearch module installed. To index and query JSON documents, you'll also need to add the RedisJSON module. ## Usage For complete examples, see [`search-hashes.js`](https://github.com/redis/node-redis/blob/master/examples/search-hashes.js) and [`search-json.js`](https://github.com/redis/node-redis/blob/master/examples/search-json.js) in the Node Redis examples folder. ### Indexing and Querying Data in Redis Hashes #### Creating an Index Before we can perform any searches, we need to tell RediSearch how to index our data, and which Redis keys to find that data in. The [FT.CREATE](https://oss.redis.com/redisearch/Commands/#ftcreate) command creates a RediSearch index. Here's how to use it to create an index we'll call `idx:animals` where we want to index hashes containing `name`, `species` and `age` fields, and whose key names in Redis begin with the prefix `noderedis:animals`: ```javascript await client.ft.create('idx:animals', { name: { type: SchemaFieldTypes.TEXT, sortable: true }, species: SchemaFieldTypes.TAG, age: SchemaFieldTypes.NUMERIC }, { ON: 'HASH', PREFIX: 'noderedis:animals' } ); ``` See the [`FT.CREATE` documentation](https://oss.redis.com/redisearch/Commands/#ftcreate) for information about the different field types and additional options. #### Querying the Index Once we've created an index, and added some data to Redis hashes whose keys begin with the prefix `noderedis:animals`, we can start writing some search queries. RediSearch supports a rich query syntax for full-text search, faceted search, aggregation and more. Check out the [`FT.SEARCH` documentation](https://oss.redis.com/redisearch/Commands/#ftsearch) and the [query syntax reference](https://oss.redis.com/redisearch/Query_Syntax/) for more information. Let's write a query to find all the animals where the `species` field has the value `dog`: ```javascript const results = await client.ft.search('idx:animals', '@species:{dog}'); ``` `results` looks like this: ```javascript { total: 2, documents: [ { id: 'noderedis:animals:4', value: { name: 'Fido', species: 'dog', age: '7' } }, { id: 'noderedis:animals:3', value: { name: 'Rover', species: 'dog', age: '9' } } ] } ``` ### Indexing and Querying Data with RedisJSON RediSearch can also index and query JSON documents stored in Redis using the RedisJSON module. The approach is similar to that for indexing and searching data in hashes, but we can now use JSON Path like syntax and the data no longer has to be flat name/value pairs - it can contain nested objects and arrays. #### Creating an Index As before, we create an index with the `FT.CREATE` command, this time specifying we want to index JSON documents that look like this: ```javascript { name: 'Alice', age: 32, coins: 100 } ``` Each document represents a user in some system, and users have name, age and coins properties. One way we might choose to index these documents is as follows: ```javascript await client.ft.create('idx:users', { '$.name': { type: SchemaFieldTypes.TEXT, SORTABLE: 'UNF' }, '$.age': { type: SchemaFieldTypes.NUMERIC, AS: 'age' }, '$.coins': { type: SchemaFieldTypes.NUMERIC, AS: 'coins' } }, { ON: 'JSON', PREFIX: 'noderedis:users' }); ``` Note that we're using JSON Path to specify where the fields to index are in our JSON documents, and the `AS` clause to define a name/alias for each field. We'll use these when writing queries. #### Querying the Index Now we have an index and some data stored as JSON documents in Redis (see the [JSON package documentation](https://github.com/redis/node-redis/tree/master/packages/json) for examples of how to store JSON), we can write some queries... We'll use the [RediSearch query language](https://oss.redis.com/redisearch/Query_Syntax/) and [`FT.SEARCH`](https://oss.redis.com/redisearch/Commands/#ftsearch) command. Here's a query to find users under the age of 30: ```javascript await client.ft.search('idx:users', '@age:[0 30]'); ``` node-redis-redis-4.5.1/packages/search/lib/000077500000000000000000000000001433774114400204575ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/search/lib/commands/000077500000000000000000000000001433774114400222605ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/search/lib/commands/AGGREGATE.spec.ts000066400000000000000000000513561433774114400250610ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { AggregateGroupByReducers, AggregateSteps, transformArguments } from './AGGREGATE'; import { SchemaFieldTypes } from '.'; describe('AGGREGATE', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index', '*'), ['FT.AGGREGATE', 'index', '*'] ); }); it('with VERBATIM', () => { assert.deepEqual( transformArguments('index', '*', { VERBATIM: true }), ['FT.AGGREGATE', 'index', '*', 'VERBATIM'] ); }); describe('with LOAD', () => { describe('single', () => { describe('without alias', () => { it('string', () => { assert.deepEqual( transformArguments('index', '*', { LOAD: '@property' }), ['FT.AGGREGATE', 'index', '*', 'LOAD', '1', '@property'] ); }); it('{ identifier: string }', () => { assert.deepEqual( transformArguments('index', '*', { LOAD: { identifier: '@property' } }), ['FT.AGGREGATE', 'index', '*', 'LOAD', '1', '@property'] ); }); }); it('with alias', () => { assert.deepEqual( transformArguments('index', '*', { LOAD: { identifier: '@property', AS: 'alias' } }), ['FT.AGGREGATE', 'index', '*', 'LOAD', '3', '@property', 'AS', 'alias'] ); }); }); it('multiple', () => { assert.deepEqual( transformArguments('index', '*', { LOAD: ['@1', '@2'] }), ['FT.AGGREGATE', 'index', '*', 'LOAD', '2', '@1', '@2'] ); }); }); describe('with STEPS', () => { describe('GROUPBY', () => { describe('COUNT', () => { describe('without properties', () => { it('without alias', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.COUNT } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'COUNT', '0'] ); }); it('with alias', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.COUNT, AS: 'count' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'COUNT', '0', 'AS', 'count'] ); }); }); describe('with properties', () => { it('single', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, properties: '@property', REDUCE: { type: AggregateGroupByReducers.COUNT } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '1', '@property', 'REDUCE', 'COUNT', '0'] ); }); it('multiple', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, properties: ['@1', '@2'], REDUCE: { type: AggregateGroupByReducers.COUNT } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '2', '@1', '@2', 'REDUCE', 'COUNT', '0'] ); }); }); }); it('COUNT_DISTINCT', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.COUNT_DISTINCT, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'COUNT_DISTINCT', '1', '@property'] ); }); it('COUNT_DISTINCTISH', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.COUNT_DISTINCTISH, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'COUNT_DISTINCTISH', '1', '@property'] ); }); it('SUM', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.SUM, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'SUM', '1', '@property'] ); }); it('MIN', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.MIN, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'MIN', '1', '@property'] ); }); it('MAX', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.MAX, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'MAX', '1', '@property'] ); }); it('AVG', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.AVG, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'AVG', '1', '@property'] ); }); it('STDDEV', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.STDDEV, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'STDDEV', '1', '@property'] ); }); it('QUANTILE', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.QUANTILE, property: '@property', quantile: 0.5 } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'QUANTILE', '2', '@property', '0.5'] ); }); it('TO_LIST', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.TO_LIST, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'TOLIST', '1', '@property'] ); }); describe('FIRST_VALUE', () => { it('simple', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.FIRST_VALUE, property: '@property' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'FIRST_VALUE', '1', '@property'] ); }); describe('with BY', () => { describe('without direction', () => { it('string', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.FIRST_VALUE, property: '@property', BY: '@by' } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'FIRST_VALUE', '3', '@property', 'BY', '@by'] ); }); it('{ property: string }', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.FIRST_VALUE, property: '@property', BY: { property: '@by' } } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'FIRST_VALUE', '3', '@property', 'BY', '@by'] ); }); }); it('with direction', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.FIRST_VALUE, property: '@property', BY: { property: '@by', direction: 'ASC' } } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'FIRST_VALUE', '4', '@property', 'BY', '@by', 'ASC'] ); }); }); }); it('RANDOM_SAMPLE', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: { type: AggregateGroupByReducers.RANDOM_SAMPLE, property: '@property', sampleSize: 1 } }] }), ['FT.AGGREGATE', 'index', '*', 'GROUPBY', '0', 'REDUCE', 'RANDOM_SAMPLE', '2', '@property', '1'] ); }); }); describe('SORTBY', () => { it('string', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.SORTBY, BY: '@by' }] }), ['FT.AGGREGATE', 'index', '*', 'SORTBY', '1', '@by'] ); }); it('Array', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.SORTBY, BY: ['@1', '@2'] }] }), ['FT.AGGREGATE', 'index', '*', 'SORTBY', '2', '@1', '@2'] ); }); it('with MAX', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.SORTBY, BY: '@by', MAX: 1 }] }), ['FT.AGGREGATE', 'index', '*', 'SORTBY', '1', '@by', 'MAX', '1'] ); }); }); describe('APPLY', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.APPLY, expression: '@field + 1', AS: 'as' }] }), ['FT.AGGREGATE', 'index', '*', 'APPLY', '@field + 1', 'AS', 'as'] ); }); describe('LIMIT', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.LIMIT, from: 0, size: 1 }] }), ['FT.AGGREGATE', 'index', '*', 'LIMIT', '0', '1'] ); }); describe('FILTER', () => { assert.deepEqual( transformArguments('index', '*', { STEPS: [{ type: AggregateSteps.FILTER, expression: '@field != ""' }] }), ['FT.AGGREGATE', 'index', '*', 'FILTER', '@field != ""'] ); }); }); it('with PARAMS', () => { assert.deepEqual( transformArguments('index', '*', { PARAMS: { param: 'value' } }), ['FT.AGGREGATE', 'index', '*', 'PARAMS', '2', 'param', 'value'] ); }); it('with DIALECT', () => { assert.deepEqual( transformArguments('index', '*', { DIALECT: 1 }), ['FT.AGGREGATE', 'index', '*', 'DIALECT', '1'] ); }); }); testUtils.testWithClient('client.ft.aggregate', async client => { await Promise.all([ client.ft.create('index', { field: SchemaFieldTypes.NUMERIC }), client.hSet('1', 'field', '1'), client.hSet('2', 'field', '2') ]); assert.deepEqual( await client.ft.aggregate('index', '*', { STEPS: [{ type: AggregateSteps.GROUPBY, REDUCE: [{ type: AggregateGroupByReducers.SUM, property: '@field', AS: 'sum' }, { type: AggregateGroupByReducers.AVG, property: '@field', AS: 'avg' }] }] }), { total: 1, results: [ Object.create(null, { sum: { value: '3', configurable: true, enumerable: true }, avg: { value: '1.5', configurable: true, enumerable: true } }) ] } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/AGGREGATE.ts000066400000000000000000000210411433774114400241140ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArgument, transformTuplesReply } from '@redis/client/dist/lib/commands/generic-transformers'; import { Params, PropertyName, pushArgumentsWithLength, pushParamsArgs, pushSortByArguments, SortByProperty } from '.'; export enum AggregateSteps { GROUPBY = 'GROUPBY', SORTBY = 'SORTBY', APPLY = 'APPLY', LIMIT = 'LIMIT', FILTER = 'FILTER' } interface AggregateStep { type: T; } export enum AggregateGroupByReducers { COUNT = 'COUNT', COUNT_DISTINCT = 'COUNT_DISTINCT', COUNT_DISTINCTISH = 'COUNT_DISTINCTISH', SUM = 'SUM', MIN = 'MIN', MAX = 'MAX', AVG = 'AVG', STDDEV = 'STDDEV', QUANTILE = 'QUANTILE', TOLIST = 'TOLIST', TO_LIST = 'TOLIST', FIRST_VALUE = 'FIRST_VALUE', RANDOM_SAMPLE = 'RANDOM_SAMPLE' } interface GroupByReducer { type: T; AS?: string; } type CountReducer = GroupByReducer; interface CountDistinctReducer extends GroupByReducer { property: PropertyName; } interface CountDistinctishReducer extends GroupByReducer { property: PropertyName; } interface SumReducer extends GroupByReducer { property: PropertyName; } interface MinReducer extends GroupByReducer { property: PropertyName; } interface MaxReducer extends GroupByReducer { property: PropertyName; } interface AvgReducer extends GroupByReducer { property: PropertyName; } interface StdDevReducer extends GroupByReducer { property: PropertyName; } interface QuantileReducer extends GroupByReducer { property: PropertyName; quantile: number; } interface ToListReducer extends GroupByReducer { property: PropertyName; } interface FirstValueReducer extends GroupByReducer { property: PropertyName; BY?: PropertyName | { property: PropertyName; direction?: 'ASC' | 'DESC'; }; } interface RandomSampleReducer extends GroupByReducer { property: PropertyName; sampleSize: number; } type GroupByReducers = CountReducer | CountDistinctReducer | CountDistinctishReducer | SumReducer | MinReducer | MaxReducer | AvgReducer | StdDevReducer | QuantileReducer | ToListReducer | FirstValueReducer | RandomSampleReducer; interface GroupByStep extends AggregateStep { properties?: PropertyName | Array; REDUCE: GroupByReducers | Array; } interface SortStep extends AggregateStep { BY: SortByProperty | Array; MAX?: number; } interface ApplyStep extends AggregateStep { expression: string; AS: string; } interface LimitStep extends AggregateStep { from: number; size: number; } interface FilterStep extends AggregateStep { expression: string; } type LoadField = PropertyName | { identifier: PropertyName; AS?: string; } export interface AggregateOptions { VERBATIM?: true; LOAD?: LoadField | Array; STEPS?: Array; PARAMS?: Params; DIALECT?: number; } export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( index: string, query: string, options?: AggregateOptions ): RedisCommandArguments { return pushAggregatehOptions( ['FT.AGGREGATE', index, query], options ); } export function pushAggregatehOptions( args: RedisCommandArguments, options?: AggregateOptions ): RedisCommandArguments { if (options?.VERBATIM) { args.push('VERBATIM'); } if (options?.LOAD) { args.push('LOAD'); pushArgumentsWithLength(args, () => { if (Array.isArray(options.LOAD)) { for (const load of options.LOAD) { pushLoadField(args, load); } } else { pushLoadField(args, options.LOAD!); } }); } if (options?.STEPS) { for (const step of options.STEPS) { switch (step.type) { case AggregateSteps.GROUPBY: args.push('GROUPBY'); if (!step.properties) { args.push('0'); } else { pushVerdictArgument(args, step.properties); } if (Array.isArray(step.REDUCE)) { for (const reducer of step.REDUCE) { pushGroupByReducer(args, reducer); } } else { pushGroupByReducer(args, step.REDUCE); } break; case AggregateSteps.SORTBY: pushSortByArguments(args, 'SORTBY', step.BY); if (step.MAX) { args.push('MAX', step.MAX.toString()); } break; case AggregateSteps.APPLY: args.push('APPLY', step.expression, 'AS', step.AS); break; case AggregateSteps.LIMIT: args.push('LIMIT', step.from.toString(), step.size.toString()); break; case AggregateSteps.FILTER: args.push('FILTER', step.expression); break; } } } pushParamsArgs(args, options?.PARAMS); if (options?.DIALECT) { args.push('DIALECT', options.DIALECT.toString()); } return args; } function pushLoadField(args: RedisCommandArguments, toLoad: LoadField): void { if (typeof toLoad === 'string') { args.push(toLoad); } else { args.push(toLoad.identifier); if (toLoad.AS) { args.push('AS', toLoad.AS); } } } function pushGroupByReducer(args: RedisCommandArguments, reducer: GroupByReducers): void { args.push('REDUCE', reducer.type); switch (reducer.type) { case AggregateGroupByReducers.COUNT: args.push('0'); break; case AggregateGroupByReducers.COUNT_DISTINCT: case AggregateGroupByReducers.COUNT_DISTINCTISH: case AggregateGroupByReducers.SUM: case AggregateGroupByReducers.MIN: case AggregateGroupByReducers.MAX: case AggregateGroupByReducers.AVG: case AggregateGroupByReducers.STDDEV: case AggregateGroupByReducers.TOLIST: args.push('1', reducer.property); break; case AggregateGroupByReducers.QUANTILE: args.push('2', reducer.property, reducer.quantile.toString()); break; case AggregateGroupByReducers.FIRST_VALUE: { pushArgumentsWithLength(args, () => { args.push(reducer.property); if (reducer.BY) { args.push('BY'); if (typeof reducer.BY === 'string') { args.push(reducer.BY); } else { args.push(reducer.BY.property); if (reducer.BY.direction) { args.push(reducer.BY.direction); } } } }); break; } case AggregateGroupByReducers.RANDOM_SAMPLE: args.push('2', reducer.property, reducer.sampleSize.toString()); break; } if (reducer.AS) { args.push('AS', reducer.AS); } } export type AggregateRawReply = [ total: number, ...results: Array> ]; export interface AggregateReply { total: number; results: Array>; } export function transformReply(rawReply: AggregateRawReply): AggregateReply { const results: Array> = []; for (let i = 1; i < rawReply.length; i++) { results.push( transformTuplesReply(rawReply[i] as Array) ); } return { total: rawReply[0], results }; }node-redis-redis-4.5.1/packages/search/lib/commands/AGGREGATE_WITHCURSOR.spec.ts000066400000000000000000000021701433774114400266400ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './AGGREGATE_WITHCURSOR'; import { SchemaFieldTypes } from '.'; describe('AGGREGATE WITHCURSOR', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index', '*'), ['FT.AGGREGATE', 'index', '*', 'WITHCURSOR'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('index', '*', { COUNT: 1 }), ['FT.AGGREGATE', 'index', '*', 'WITHCURSOR', 'COUNT', '1'] ); }); }); testUtils.testWithClient('client.ft.aggregateWithCursor', async client => { await client.ft.create('index', { field: SchemaFieldTypes.NUMERIC }); assert.deepEqual( await client.ft.aggregateWithCursor('index', '*'), { total: 0, results: [], cursor: 0 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/AGGREGATE_WITHCURSOR.ts000066400000000000000000000020121433774114400257020ustar00rootroot00000000000000import { AggregateOptions, AggregateRawReply, AggregateReply, transformArguments as transformAggregateArguments, transformReply as transformAggregateReply } from './AGGREGATE'; export { FIRST_KEY_INDEX, IS_READ_ONLY } from './AGGREGATE'; interface AggregateWithCursorOptions extends AggregateOptions { COUNT?: number; } export function transformArguments( index: string, query: string, options?: AggregateWithCursorOptions ) { const args = transformAggregateArguments(index, query, options); args.push('WITHCURSOR'); if (options?.COUNT) { args.push('COUNT', options.COUNT.toString()); } return args; } type AggregateWithCursorRawReply = [ result: AggregateRawReply, cursor: number ]; interface AggregateWithCursorReply extends AggregateReply { cursor: number; } export function transformReply(reply: AggregateWithCursorRawReply): AggregateWithCursorReply { return { ...transformAggregateReply(reply[0]), cursor: reply[1] }; } node-redis-redis-4.5.1/packages/search/lib/commands/ALIASADD.spec.ts000066400000000000000000000004601433774114400247230ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './ALIASADD'; describe('ALIASADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('alias', 'index'), ['FT.ALIASADD', 'alias', 'index'] ); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/ALIASADD.ts000066400000000000000000000002551433774114400237740ustar00rootroot00000000000000export function transformArguments(name: string, index: string): Array { return ['FT.ALIASADD', name, index]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/ALIASDEL.spec.ts000066400000000000000000000004601433774114400247370ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './ALIASDEL'; describe('ALIASDEL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('alias', 'index'), ['FT.ALIASDEL', 'alias', 'index'] ); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/ALIASDEL.ts000066400000000000000000000002551433774114400240100ustar00rootroot00000000000000export function transformArguments(name: string, index: string): Array { return ['FT.ALIASDEL', name, index]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/ALIASUPDATE.spec.ts000066400000000000000000000004711433774114400253170ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './ALIASUPDATE'; describe('ALIASUPDATE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('alias', 'index'), ['FT.ALIASUPDATE', 'alias', 'index'] ); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/ALIASUPDATE.ts000066400000000000000000000002601433774114400243620ustar00rootroot00000000000000export function transformArguments(name: string, index: string): Array { return ['FT.ALIASUPDATE', name, index]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/ALTER.spec.ts000066400000000000000000000021731433774114400244330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ALTER'; import { SchemaFieldTypes } from '.'; describe('ALTER', () => { describe('transformArguments', () => { it('with NOINDEX', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, NOINDEX: true, SORTABLE: 'UNF', AS: 'text' } }), ['FT.ALTER', 'index', 'SCHEMA', 'ADD', 'field', 'AS', 'text', 'TEXT', 'SORTABLE', 'UNF', 'NOINDEX'] ); }); }); testUtils.testWithClient('client.ft.create', async client => { await Promise.all([ client.ft.create('index', { title: SchemaFieldTypes.TEXT }), ]); assert.equal( await client.ft.alter('index', { body: SchemaFieldTypes.TEXT }), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/ALTER.ts000066400000000000000000000004521433774114400235000ustar00rootroot00000000000000import { RediSearchSchema, pushSchema } from '.'; export function transformArguments(index: string, schema: RediSearchSchema): Array { const args = ['FT.ALTER', index, 'SCHEMA', 'ADD']; pushSchema(args, schema); return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/CONFIG_GET.spec.ts000066400000000000000000000013461433774114400252310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CONFIG_GET'; describe('CONFIG GET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('TIMEOUT'), ['FT.CONFIG', 'GET', 'TIMEOUT'] ); }); testUtils.testWithClient('client.ft.configGet', async client => { assert.deepEqual( await client.ft.configGet('TIMEOUT'), Object.create(null, { TIMEOUT: { value: '500', configurable: true, enumerable: true } }) ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/CONFIG_GET.ts000066400000000000000000000006711433774114400243000ustar00rootroot00000000000000export function transformArguments(option: string) { return ['FT.CONFIG', 'GET', option]; } interface ConfigGetReply { [option: string]: string | null; } export function transformReply(rawReply: Array<[string, string | null]>): ConfigGetReply { const transformedReply: ConfigGetReply = Object.create(null); for (const [key, value] of rawReply) { transformedReply[key] = value; } return transformedReply; } node-redis-redis-4.5.1/packages/search/lib/commands/CONFIG_SET.spec.ts000066400000000000000000000005541433774114400252450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CONFIG_SET'; describe('CONFIG SET', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('TIMEOUT', '500'), ['FT.CONFIG', 'SET', 'TIMEOUT', '500'] ); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/CONFIG_SET.ts000066400000000000000000000002661433774114400243140ustar00rootroot00000000000000export function transformArguments(option: string, value: string): Array { return ['FT.CONFIG', 'SET', option, value]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/CREATE.spec.ts000066400000000000000000000355311433774114400245330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CREATE'; import { SchemaFieldTypes, SchemaTextFieldPhonetics, RedisSearchLanguages, VectorAlgorithms } from '.'; describe('CREATE', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('index', {}), ['FT.CREATE', 'index', 'SCHEMA'] ); }); describe('with fields', () => { describe('TEXT', () => { it('without options', () => { assert.deepEqual( transformArguments('index', { field: SchemaFieldTypes.TEXT }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT'] ); }); it('with NOSTEM', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, NOSTEM: true } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'NOSTEM'] ); }); it('with WEIGHT', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, WEIGHT: 1 } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'WEIGHT', '1'] ); }); it('with PHONETIC', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, PHONETIC: SchemaTextFieldPhonetics.DM_EN } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'PHONETIC', SchemaTextFieldPhonetics.DM_EN] ); }); it('with WITHSUFFIXTRIE', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, WITHSUFFIXTRIE: true } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'WITHSUFFIXTRIE'] ); }); }); it('NUMERIC', () => { assert.deepEqual( transformArguments('index', { field: SchemaFieldTypes.NUMERIC }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'NUMERIC'] ); }); it('GEO', () => { assert.deepEqual( transformArguments('index', { field: SchemaFieldTypes.GEO }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'GEO'] ); }); describe('TAG', () => { describe('without options', () => { it('SchemaFieldTypes.TAG', () => { assert.deepEqual( transformArguments('index', { field: SchemaFieldTypes.TAG }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TAG'] ); }); it('{ type: SchemaFieldTypes.TAG }', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TAG } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TAG'] ); }); }); it('with SEPARATOR', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TAG, SEPARATOR: 'separator' } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TAG', 'SEPARATOR', 'separator'] ); }); it('with CASESENSITIVE', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TAG, CASESENSITIVE: true } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TAG', 'CASESENSITIVE'] ); }); it('with WITHSUFFIXTRIE', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TAG, WITHSUFFIXTRIE: true } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TAG', 'WITHSUFFIXTRIE'] ); }); }); describe('VECTOR', () => { it('Flat algorithm', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.VECTOR, ALGORITHM: VectorAlgorithms.FLAT, TYPE: 'FLOAT32', DIM: 2, DISTANCE_METRIC: 'L2', INITIAL_CAP: 1000000, BLOCK_SIZE: 1000 } }), [ 'FT.CREATE', 'index', 'SCHEMA', 'field', 'VECTOR', 'FLAT', '10', 'TYPE', 'FLOAT32', 'DIM', '2', 'DISTANCE_METRIC', 'L2', 'INITIAL_CAP', '1000000', 'BLOCK_SIZE', '1000' ] ); }); it('HNSW algorithm', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.VECTOR, ALGORITHM: VectorAlgorithms.HNSW, TYPE: 'FLOAT32', DIM: 2, DISTANCE_METRIC: 'L2', INITIAL_CAP: 1000000, M: 40, EF_CONSTRUCTION: 250, EF_RUNTIME: 20 } }), [ 'FT.CREATE', 'index', 'SCHEMA', 'field', 'VECTOR', 'HNSW', '14', 'TYPE', 'FLOAT32', 'DIM', '2', 'DISTANCE_METRIC', 'L2', 'INITIAL_CAP', '1000000', 'M', '40', 'EF_CONSTRUCTION', '250', 'EF_RUNTIME', '20' ] ); }); }); describe('with generic options', () => { it('with AS', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, AS: 'as' } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'AS', 'as', 'TEXT'] ); }); describe('with SORTABLE', () => { it('true', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, SORTABLE: true } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'SORTABLE'] ); }); it('UNF', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, SORTABLE: 'UNF' } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'SORTABLE', 'UNF'] ); }); }); it('with NOINDEX', () => { assert.deepEqual( transformArguments('index', { field: { type: SchemaFieldTypes.TEXT, NOINDEX: true } }), ['FT.CREATE', 'index', 'SCHEMA', 'field', 'TEXT', 'NOINDEX'] ); }); }); }); it('with ON', () => { assert.deepEqual( transformArguments('index', {}, { ON: 'HASH' }), ['FT.CREATE', 'index', 'ON', 'HASH', 'SCHEMA'] ); }); describe('with PREFIX', () => { it('string', () => { assert.deepEqual( transformArguments('index', {}, { PREFIX: 'prefix' }), ['FT.CREATE', 'index', 'PREFIX', '1', 'prefix', 'SCHEMA'] ); }); it('Array', () => { assert.deepEqual( transformArguments('index', {}, { PREFIX: ['1', '2'] }), ['FT.CREATE', 'index', 'PREFIX', '2', '1', '2', 'SCHEMA'] ); }); }); it('with FILTER', () => { assert.deepEqual( transformArguments('index', {}, { FILTER: '@field != ""' }), ['FT.CREATE', 'index', 'FILTER', '@field != ""', 'SCHEMA'] ); }); it('with LANGUAGE', () => { assert.deepEqual( transformArguments('index', {}, { LANGUAGE: RedisSearchLanguages.ARABIC }), ['FT.CREATE', 'index', 'LANGUAGE', RedisSearchLanguages.ARABIC, 'SCHEMA'] ); }); it('with LANGUAGE_FIELD', () => { assert.deepEqual( transformArguments('index', {}, { LANGUAGE_FIELD: '@field' }), ['FT.CREATE', 'index', 'LANGUAGE_FIELD', '@field', 'SCHEMA'] ); }); it('with SCORE', () => { assert.deepEqual( transformArguments('index', {}, { SCORE: 1 }), ['FT.CREATE', 'index', 'SCORE', '1', 'SCHEMA'] ); }); it('with SCORE_FIELD', () => { assert.deepEqual( transformArguments('index', {}, { SCORE_FIELD: '@field' }), ['FT.CREATE', 'index', 'SCORE_FIELD', '@field', 'SCHEMA'] ); }); it('with MAXTEXTFIELDS', () => { assert.deepEqual( transformArguments('index', {}, { MAXTEXTFIELDS: true }), ['FT.CREATE', 'index', 'MAXTEXTFIELDS', 'SCHEMA'] ); }); it('with TEMPORARY', () => { assert.deepEqual( transformArguments('index', {}, { TEMPORARY: 1 }), ['FT.CREATE', 'index', 'TEMPORARY', '1', 'SCHEMA'] ); }); it('with NOOFFSETS', () => { assert.deepEqual( transformArguments('index', {}, { NOOFFSETS: true }), ['FT.CREATE', 'index', 'NOOFFSETS', 'SCHEMA'] ); }); it('with NOHL', () => { assert.deepEqual( transformArguments('index', {}, { NOHL: true }), ['FT.CREATE', 'index', 'NOHL', 'SCHEMA'] ); }); it('with NOFIELDS', () => { assert.deepEqual( transformArguments('index', {}, { NOFIELDS: true }), ['FT.CREATE', 'index', 'NOFIELDS', 'SCHEMA'] ); }); it('with NOFREQS', () => { assert.deepEqual( transformArguments('index', {}, { NOFREQS: true }), ['FT.CREATE', 'index', 'NOFREQS', 'SCHEMA'] ); }); it('with SKIPINITIALSCAN', () => { assert.deepEqual( transformArguments('index', {}, { SKIPINITIALSCAN: true }), ['FT.CREATE', 'index', 'SKIPINITIALSCAN', 'SCHEMA'] ); }); describe('with STOPWORDS', () => { it('string', () => { assert.deepEqual( transformArguments('index', {}, { STOPWORDS: 'stopword' }), ['FT.CREATE', 'index', 'STOPWORDS', '1', 'stopword', 'SCHEMA'] ); }); it('Array', () => { assert.deepEqual( transformArguments('index', {}, { STOPWORDS: ['1', '2'] }), ['FT.CREATE', 'index', 'STOPWORDS', '2', '1', '2', 'SCHEMA'] ); }); }); }); testUtils.testWithClient('client.ft.create', async client => { assert.equal( await client.ft.create('index', { field: SchemaFieldTypes.TEXT }), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/CREATE.ts000066400000000000000000000042471433774114400236020ustar00rootroot00000000000000import { pushOptionalVerdictArgument } from '@redis/client/dist/lib/commands/generic-transformers'; import { RedisSearchLanguages, PropertyName, RediSearchSchema, pushSchema } from '.'; interface CreateOptions { ON?: 'HASH' | 'JSON'; PREFIX?: string | Array; FILTER?: string; LANGUAGE?: RedisSearchLanguages; LANGUAGE_FIELD?: PropertyName; SCORE?: number; SCORE_FIELD?: PropertyName; // PAYLOAD_FIELD?: string; MAXTEXTFIELDS?: true; TEMPORARY?: number; NOOFFSETS?: true; NOHL?: true; NOFIELDS?: true; NOFREQS?: true; SKIPINITIALSCAN?: true; STOPWORDS?: string | Array; } export function transformArguments(index: string, schema: RediSearchSchema, options?: CreateOptions): Array { const args = ['FT.CREATE', index]; if (options?.ON) { args.push('ON', options.ON); } pushOptionalVerdictArgument(args, 'PREFIX', options?.PREFIX); if (options?.FILTER) { args.push('FILTER', options.FILTER); } if (options?.LANGUAGE) { args.push('LANGUAGE', options.LANGUAGE); } if (options?.LANGUAGE_FIELD) { args.push('LANGUAGE_FIELD', options.LANGUAGE_FIELD); } if (options?.SCORE) { args.push('SCORE', options.SCORE.toString()); } if (options?.SCORE_FIELD) { args.push('SCORE_FIELD', options.SCORE_FIELD); } // if (options?.PAYLOAD_FIELD) { // args.push('PAYLOAD_FIELD', options.PAYLOAD_FIELD); // } if (options?.MAXTEXTFIELDS) { args.push('MAXTEXTFIELDS'); } if (options?.TEMPORARY) { args.push('TEMPORARY', options.TEMPORARY.toString()); } if (options?.NOOFFSETS) { args.push('NOOFFSETS'); } if (options?.NOHL) { args.push('NOHL'); } if (options?.NOFIELDS) { args.push('NOFIELDS'); } if (options?.NOFREQS) { args.push('NOFREQS'); } if (options?.SKIPINITIALSCAN) { args.push('SKIPINITIALSCAN'); } pushOptionalVerdictArgument(args, 'STOPWORDS', options?.STOPWORDS); args.push('SCHEMA'); pushSchema(args, schema); return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/CURSOR_DEL.spec.ts000066400000000000000000000016731433774114400252710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { SchemaFieldTypes } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CURSOR_DEL'; describe('CURSOR DEL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('index', 0), ['FT.CURSOR', 'DEL', 'index', '0'] ); }); testUtils.testWithClient('client.ft.cursorDel', async client => { const [ ,, { cursor } ] = await Promise.all([ client.ft.create('idx', { field: { type: SchemaFieldTypes.TEXT } }), client.hSet('key', 'field', 'value'), client.ft.aggregateWithCursor('idx', '*', { COUNT: 1 }) ]); assert.equal( await client.ft.cursorDel('idx', cursor), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/CURSOR_DEL.ts000066400000000000000000000005261433774114400243340ustar00rootroot00000000000000import { RedisCommandArgument } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export function transformArguments(index: RedisCommandArgument, cursorId: number) { return [ 'FT.CURSOR', 'DEL', index, cursorId.toString() ]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/CURSOR_READ.spec.ts000066400000000000000000000020371433774114400253730ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { SchemaFieldTypes } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CURSOR_READ'; describe('CURSOR READ', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('index', 0), ['FT.CURSOR', 'READ', 'index', '0'] ); }); testUtils.testWithClient('client.ft.cursorRead', async client => { const [ ,, { cursor } ] = await Promise.all([ client.ft.create('idx', { field: { type: SchemaFieldTypes.TEXT } }), client.hSet('key', 'field', 'value'), client.ft.aggregateWithCursor('idx', '*', { COUNT: 1 }) ]); assert.deepEqual( await client.ft.cursorRead('idx', cursor), { total: 0, results: [], cursor: 0 } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/CURSOR_READ.ts000066400000000000000000000006671433774114400244510ustar00rootroot00000000000000import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( index: RedisCommandArgument, cursor: number ): RedisCommandArguments { return [ 'FT.CURSOR', 'READ', index, cursor.toString() ]; } export { transformReply } from './AGGREGATE_WITHCURSOR'; node-redis-redis-4.5.1/packages/search/lib/commands/DICTADD.spec.ts000066400000000000000000000014761433774114400246250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DICTADD'; describe('DICTADD', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('dictionary', 'term'), ['FT.DICTADD', 'dictionary', 'term'] ); }); it('Array', () => { assert.deepEqual( transformArguments('dictionary', ['1', '2']), ['FT.DICTADD', 'dictionary', '1', '2'] ); }); }); testUtils.testWithClient('client.ft.dictAdd', async client => { assert.equal( await client.ft.dictAdd('dictionary', 'term'), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/DICTADD.ts000066400000000000000000000006151433774114400236660ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export function transformArguments(dictionary: string, term: string | Array): RedisCommandArguments { return pushVerdictArguments(['FT.DICTADD', dictionary], term); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/search/lib/commands/DICTDEL.spec.ts000066400000000000000000000014761433774114400246410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DICTDEL'; describe('DICTDEL', () => { describe('transformArguments', () => { it('string', () => { assert.deepEqual( transformArguments('dictionary', 'term'), ['FT.DICTDEL', 'dictionary', 'term'] ); }); it('Array', () => { assert.deepEqual( transformArguments('dictionary', ['1', '2']), ['FT.DICTDEL', 'dictionary', '1', '2'] ); }); }); testUtils.testWithClient('client.ft.dictDel', async client => { assert.equal( await client.ft.dictDel('dictionary', 'term'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/DICTDEL.ts000066400000000000000000000006151433774114400237020ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export function transformArguments(dictionary: string, term: string | Array): RedisCommandArguments { return pushVerdictArguments(['FT.DICTDEL', dictionary], term); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/search/lib/commands/DICTDUMP.spec.ts000066400000000000000000000011471433774114400247750ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DICTDUMP'; describe('DICTDUMP', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('dictionary'), ['FT.DICTDUMP', 'dictionary'] ); }); testUtils.testWithClient('client.ft.dictDump', async client => { await client.ft.dictAdd('dictionary', 'string') assert.deepEqual( await client.ft.dictDump('dictionary'), ['string'] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/DICTDUMP.ts000066400000000000000000000002541433774114400240420ustar00rootroot00000000000000export function transformArguments(dictionary: string): Array { return ['FT.DICTDUMP', dictionary]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/search/lib/commands/DROPINDEX.spec.ts000066400000000000000000000016531433774114400251220ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { SchemaFieldTypes } from '.'; import { transformArguments } from './DROPINDEX'; describe('DROPINDEX', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index'), ['FT.DROPINDEX', 'index'] ); }); it('with DD', () => { assert.deepEqual( transformArguments('index', { DD: true }), ['FT.DROPINDEX', 'index', 'DD'] ); }); }); testUtils.testWithClient('client.ft.dropIndex', async client => { await client.ft.create('index', { field: SchemaFieldTypes.TEXT }); assert.equal( await client.ft.dropIndex('index'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/DROPINDEX.ts000066400000000000000000000004641433774114400241700ustar00rootroot00000000000000interface DropIndexOptions { DD?: true; } export function transformArguments(index: string, options?: DropIndexOptions): Array { const args = ['FT.DROPINDEX', index]; if (options?.DD) { args.push('DD'); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/EXPLAIN.spec.ts000066400000000000000000000016601433774114400246640ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './EXPLAIN'; describe('EXPLAIN', () => { describe('transformArguments', () => { it('simple', () => { assert.deepEqual( transformArguments('index', '*'), ['FT.EXPLAIN', 'index', '*'] ); }); it('with PARAMS', () => { assert.deepEqual( transformArguments('index', '*', { PARAMS: { param: 'value' } }), ['FT.EXPLAIN', 'index', '*', 'PARAMS', '2', 'param', 'value'] ); }); it('with DIALECT', () => { assert.deepEqual( transformArguments('index', '*', { DIALECT: 1 }), ['FT.EXPLAIN', 'index', '*', 'DIALECT', '1'] ); }); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/EXPLAIN.ts000066400000000000000000000010221433774114400237230ustar00rootroot00000000000000import { Params, pushParamsArgs } from "."; export const IS_READ_ONLY = true; interface ExplainOptions { PARAMS?: Params; DIALECT?: number; } export function transformArguments( index: string, query: string, options?: ExplainOptions ): Array { const args = ['FT.EXPLAIN', index, query]; pushParamsArgs(args, options?.PARAMS); if (options?.DIALECT) { args.push('DIALECT', options.DIALECT.toString()); } return args; } export declare function transformReply(): string; node-redis-redis-4.5.1/packages/search/lib/commands/EXPLAINCLI.spec.ts000066400000000000000000000004561433774114400252160ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { transformArguments } from './EXPLAINCLI'; describe('EXPLAINCLI', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('index', '*'), ['FT.EXPLAINCLI', 'index', '*'] ); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/EXPLAINCLI.ts000066400000000000000000000003351433774114400242610ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(index: string, query: string): Array { return ['FT.EXPLAINCLI', index, query]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/search/lib/commands/INFO.spec.ts000066400000000000000000000064671433774114400243310ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { SchemaFieldTypes } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './INFO'; describe('INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('index'), ['FT.INFO', 'index'] ); }); testUtils.testWithClient('client.ft.info', async client => { await client.ft.create('index', { field: SchemaFieldTypes.TEXT }); assert.deepEqual( await client.ft.info('index'), { indexName: 'index', indexOptions: [], indexDefinition: Object.create(null, { default_score: { value: '1', configurable: true, enumerable: true }, key_type: { value: 'HASH', configurable: true, enumerable: true }, prefixes: { value: [''], configurable: true, enumerable: true } }), attributes: [Object.create(null, { identifier: { value: 'field', configurable: true, enumerable: true }, attribute: { value: 'field', configurable: true, enumerable: true }, type: { value: 'TEXT', configurable: true, enumerable: true }, WEIGHT: { value: '1', configurable: true, enumerable: true } })], numDocs: '0', maxDocId: '0', numTerms: '0', numRecords: '0', invertedSzMb: '0', vectorIndexSzMb: '0', totalInvertedIndexBlocks: '0', offsetVectorsSzMb: '0', docTableSizeMb: '0', sortableValuesSizeMb: '0', keyTableSizeMb: '0', recordsPerDocAvg: '-nan', bytesPerRecordAvg: '-nan', offsetsPerTermAvg: '-nan', offsetBitsPerRecordAvg: '-nan', hashIndexingFailures: '0', indexing: '0', percentIndexed: '1', gcStats: { bytesCollected: '0', totalMsRun: '0', totalCycles: '0', averageCycleTimeMs: '-nan', lastRunTimeMs: '0', gcNumericTreesMissed: '0', gcBlocksDenied: '0' }, cursorStats: { globalIdle: 0, globalTotal: 0, indexCapacity: 128, idnexTotal: 0 }, stopWords: undefined } ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/INFO.ts000066400000000000000000000121461433774114400233670ustar00rootroot00000000000000import { RedisCommandArgument } from '@redis/client/dist/lib/commands'; import { transformTuplesReply } from '@redis/client/dist/lib/commands/generic-transformers'; export function transformArguments(index: string): Array { return ['FT.INFO', index]; } type InfoRawReply = [ 'index_name', RedisCommandArgument, 'index_options', Array, 'index_definition', Array, 'attributes', Array>, 'num_docs', RedisCommandArgument, 'max_doc_id', RedisCommandArgument, 'num_terms', RedisCommandArgument, 'num_records', RedisCommandArgument, 'inverted_sz_mb', RedisCommandArgument, 'vector_index_sz_mb', RedisCommandArgument, 'total_inverted_index_blocks', RedisCommandArgument, 'offset_vectors_sz_mb', RedisCommandArgument, 'doc_table_size_mb', RedisCommandArgument, 'sortable_values_size_mb', RedisCommandArgument, 'key_table_size_mb', RedisCommandArgument, 'records_per_doc_avg', RedisCommandArgument, 'bytes_per_record_avg', RedisCommandArgument, 'offsets_per_term_avg', RedisCommandArgument, 'offset_bits_per_record_avg', RedisCommandArgument, 'hash_indexing_failures', RedisCommandArgument, 'indexing', RedisCommandArgument, 'percent_indexed', RedisCommandArgument, 'gc_stats', [ 'bytes_collected', RedisCommandArgument, 'total_ms_run', RedisCommandArgument, 'total_cycles', RedisCommandArgument, 'average_cycle_time_ms', RedisCommandArgument, 'last_run_time_ms', RedisCommandArgument, 'gc_numeric_trees_missed', RedisCommandArgument, 'gc_blocks_denied', RedisCommandArgument ], 'cursor_stats', [ 'global_idle', number, 'global_total', number, 'index_capacity', number, 'index_total', number ], 'stopwords_list'?, Array? ]; interface InfoReply { indexName: RedisCommandArgument; indexOptions: Array; indexDefinition: Record; attributes: Array>; numDocs: RedisCommandArgument; maxDocId: RedisCommandArgument; numTerms: RedisCommandArgument; numRecords: RedisCommandArgument; invertedSzMb: RedisCommandArgument; vectorIndexSzMb: RedisCommandArgument; totalInvertedIndexBlocks: RedisCommandArgument; offsetVectorsSzMb: RedisCommandArgument; docTableSizeMb: RedisCommandArgument; sortableValuesSizeMb: RedisCommandArgument; keyTableSizeMb: RedisCommandArgument; recordsPerDocAvg: RedisCommandArgument; bytesPerRecordAvg: RedisCommandArgument; offsetsPerTermAvg: RedisCommandArgument; offsetBitsPerRecordAvg: RedisCommandArgument; hashIndexingFailures: RedisCommandArgument; indexing: RedisCommandArgument; percentIndexed: RedisCommandArgument; gcStats: { bytesCollected: RedisCommandArgument; totalMsRun: RedisCommandArgument; totalCycles: RedisCommandArgument; averageCycleTimeMs: RedisCommandArgument; lastRunTimeMs: RedisCommandArgument; gcNumericTreesMissed: RedisCommandArgument; gcBlocksDenied: RedisCommandArgument; }; cursorStats: { globalIdle: number; globalTotal: number; indexCapacity: number; idnexTotal: number; }; stopWords: Array | undefined; } export function transformReply(rawReply: InfoRawReply): InfoReply { return { indexName: rawReply[1], indexOptions: rawReply[3], indexDefinition: transformTuplesReply(rawReply[5]), attributes: rawReply[7].map(attribute => transformTuplesReply(attribute)), numDocs: rawReply[9], maxDocId: rawReply[11], numTerms: rawReply[13], numRecords: rawReply[15], invertedSzMb: rawReply[17], vectorIndexSzMb: rawReply[19], totalInvertedIndexBlocks: rawReply[21], offsetVectorsSzMb: rawReply[23], docTableSizeMb: rawReply[25], sortableValuesSizeMb: rawReply[27], keyTableSizeMb: rawReply[29], recordsPerDocAvg: rawReply[31], bytesPerRecordAvg: rawReply[33], offsetsPerTermAvg: rawReply[35], offsetBitsPerRecordAvg: rawReply[37], hashIndexingFailures: rawReply[39], indexing: rawReply[41], percentIndexed: rawReply[43], gcStats: { bytesCollected: rawReply[45][1], totalMsRun: rawReply[45][3], totalCycles: rawReply[45][5], averageCycleTimeMs: rawReply[45][7], lastRunTimeMs: rawReply[45][9], gcNumericTreesMissed: rawReply[45][11], gcBlocksDenied: rawReply[45][13] }, cursorStats: { globalIdle: rawReply[47][1], globalTotal: rawReply[47][3], indexCapacity: rawReply[47][5], idnexTotal: rawReply[47][7] }, stopWords: rawReply[49] }; } node-redis-redis-4.5.1/packages/search/lib/commands/PROFILE_AGGREGATE.spec.ts000066400000000000000000000031641433774114400262330ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { SchemaFieldTypes } from '.'; import { transformArguments } from './PROFILE_AGGREGATE'; import { AggregateSteps } from './AGGREGATE'; describe('PROFILE AGGREGATE', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index', 'query'), ['FT.PROFILE', 'index', 'AGGREGATE', 'QUERY', 'query'] ); }); it('with options', () => { assert.deepEqual( transformArguments('index', 'query', { LIMITED: true, VERBATIM: true, STEPS: [{ type: AggregateSteps.SORTBY, BY: '@by' }] }), ['FT.PROFILE', 'index', 'AGGREGATE', 'LIMITED', 'QUERY', 'query', 'VERBATIM', 'SORTBY', '1', '@by'] ); }); }); testUtils.testWithClient('client.ft.search', async client => { await Promise.all([ client.ft.create('index', { field: SchemaFieldTypes.NUMERIC }), client.hSet('1', 'field', '1'), client.hSet('2', 'field', '2') ]); const res = await client.ft.profileAggregate('index', '*'); assert.ok(typeof res.profile.iteratorsProfile.counter === 'number'); assert.ok(typeof res.profile.parsingTime === 'string'); assert.ok(res.results.total == 1); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/PROFILE_AGGREGATE.ts000066400000000000000000000015531433774114400253020ustar00rootroot00000000000000import { pushAggregatehOptions, AggregateOptions, transformReply as transformAggregateReply, AggregateRawReply } from './AGGREGATE'; import { ProfileOptions, ProfileRawReply, ProfileReply, transformProfile } from '.'; export const IS_READ_ONLY = true; export function transformArguments( index: string, query: string, options?: ProfileOptions & AggregateOptions ): Array { const args = ['FT.PROFILE', index, 'AGGREGATE']; if (options?.LIMITED) { args.push('LIMITED'); } args.push('QUERY', query); pushAggregatehOptions(args, options) return args; } type ProfileAggeregateRawReply = ProfileRawReply; export function transformReply(reply: ProfileAggeregateRawReply): ProfileReply { return { results: transformAggregateReply(reply[0]), profile: transformProfile(reply[1]) }; } node-redis-redis-4.5.1/packages/search/lib/commands/PROFILE_SEARCH.spec.ts000066400000000000000000000026411433774114400257110ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { SchemaFieldTypes } from '.'; import { transformArguments } from './PROFILE_SEARCH'; describe('PROFILE SEARCH', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index', 'query'), ['FT.PROFILE', 'index', 'SEARCH', 'QUERY', 'query'] ); }); it('with options', () => { assert.deepEqual( transformArguments('index', 'query', { LIMITED: true, VERBATIM: true, INKEYS: 'key' }), ['FT.PROFILE', 'index', 'SEARCH', 'LIMITED', 'QUERY', 'query', 'VERBATIM', 'INKEYS', '1', 'key'] ); }); }); testUtils.testWithClient('client.ft.search', async client => { await Promise.all([ client.ft.create('index', { field: SchemaFieldTypes.NUMERIC }), client.hSet('1', 'field', '1') ]); const res = await client.ft.profileSearch('index', '*'); assert.ok(typeof res.profile.iteratorsProfile.counter === 'number'); assert.ok(typeof res.profile.parsingTime === 'string'); assert.ok(res.results.total == 1); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/PROFILE_SEARCH.ts000066400000000000000000000016131433774114400247560ustar00rootroot00000000000000import { SearchOptions, SearchRawReply, transformReply as transformSearchReply } from './SEARCH'; import { pushSearchOptions, ProfileOptions, ProfileRawReply, ProfileReply, transformProfile } from '.'; import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const IS_READ_ONLY = true; export function transformArguments( index: string, query: string, options?: ProfileOptions & SearchOptions ): RedisCommandArguments { const args = ['FT.PROFILE', index, 'SEARCH']; if (options?.LIMITED) { args.push('LIMITED'); } args.push('QUERY', query); return pushSearchOptions(args, options); } type ProfileSearchRawReply = ProfileRawReply; export function transformReply(reply: ProfileSearchRawReply): ProfileReply { return { results: transformSearchReply(reply[0]), profile: transformProfile(reply[1]) }; } node-redis-redis-4.5.1/packages/search/lib/commands/SEARCH.spec.ts000066400000000000000000000245011433774114400245300ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { RedisSearchLanguages, SchemaFieldTypes } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SEARCH'; describe('SEARCH', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index', 'query'), ['FT.SEARCH', 'index', 'query'] ); }); it('with VERBATIM', () => { assert.deepEqual( transformArguments('index', 'query', { VERBATIM: true }), ['FT.SEARCH', 'index', 'query', 'VERBATIM'] ); }); it('with NOSTOPWORDS', () => { assert.deepEqual( transformArguments('index', 'query', { NOSTOPWORDS: true }), ['FT.SEARCH', 'index', 'query', 'NOSTOPWORDS'] ); }); it('with INKEYS', () => { assert.deepEqual( transformArguments('index', 'query', { INKEYS: 'key' }), ['FT.SEARCH', 'index', 'query', 'INKEYS', '1', 'key'] ); }); it('with INFIELDS', () => { assert.deepEqual( transformArguments('index', 'query', { INFIELDS: 'field' }), ['FT.SEARCH', 'index', 'query', 'INFIELDS', '1', 'field'] ); }); it('with RETURN', () => { assert.deepEqual( transformArguments('index', 'query', { RETURN: 'return' }), ['FT.SEARCH', 'index', 'query', 'RETURN', '1', 'return'] ); }); describe('with SUMMARIZE', () => { it('true', () => { assert.deepEqual( transformArguments('index', 'query', { SUMMARIZE: true }), ['FT.SEARCH', 'index', 'query', 'SUMMARIZE'] ); }); describe('with FIELDS', () => { it('string', () => { assert.deepEqual( transformArguments('index', 'query', { SUMMARIZE: { FIELDS: ['@field'] } }), ['FT.SEARCH', 'index', 'query', 'SUMMARIZE', 'FIELDS', '1', '@field'] ); }); it('Array', () => { assert.deepEqual( transformArguments('index', 'query', { SUMMARIZE: { FIELDS: ['@1', '@2'] } }), ['FT.SEARCH', 'index', 'query', 'SUMMARIZE', 'FIELDS', '2', '@1', '@2'] ); }); }); it('with FRAGS', () => { assert.deepEqual( transformArguments('index', 'query', { SUMMARIZE: { FRAGS: 1 } }), ['FT.SEARCH', 'index', 'query', 'SUMMARIZE', 'FRAGS', '1'] ); }); it('with LEN', () => { assert.deepEqual( transformArguments('index', 'query', { SUMMARIZE: { LEN: 1 } }), ['FT.SEARCH', 'index', 'query', 'SUMMARIZE', 'LEN', '1'] ); }); it('with SEPARATOR', () => { assert.deepEqual( transformArguments('index', 'query', { SUMMARIZE: { SEPARATOR: 'separator' } }), ['FT.SEARCH', 'index', 'query', 'SUMMARIZE', 'SEPARATOR', 'separator'] ); }); }); describe('with HIGHLIGHT', () => { it('true', () => { assert.deepEqual( transformArguments('index', 'query', { HIGHLIGHT: true }), ['FT.SEARCH', 'index', 'query', 'HIGHLIGHT'] ); }); describe('with FIELDS', () => { it('string', () => { assert.deepEqual( transformArguments('index', 'query', { HIGHLIGHT: { FIELDS: ['@field'] } }), ['FT.SEARCH', 'index', 'query', 'HIGHLIGHT', 'FIELDS', '1', '@field'] ); }); it('Array', () => { assert.deepEqual( transformArguments('index', 'query', { HIGHLIGHT: { FIELDS: ['@1', '@2'] } }), ['FT.SEARCH', 'index', 'query', 'HIGHLIGHT', 'FIELDS', '2', '@1', '@2'] ); }); }); it('with TAGS', () => { assert.deepEqual( transformArguments('index', 'query', { HIGHLIGHT: { TAGS: { open: 'open', close: 'close' } } }), ['FT.SEARCH', 'index', 'query', 'HIGHLIGHT', 'TAGS', 'open', 'close'] ); }); }); it('with SLOP', () => { assert.deepEqual( transformArguments('index', 'query', { SLOP: 1 }), ['FT.SEARCH', 'index', 'query', 'SLOP', '1'] ); }); it('with INORDER', () => { assert.deepEqual( transformArguments('index', 'query', { INORDER: true }), ['FT.SEARCH', 'index', 'query', 'INORDER'] ); }); it('with LANGUAGE', () => { assert.deepEqual( transformArguments('index', 'query', { LANGUAGE: RedisSearchLanguages.ARABIC }), ['FT.SEARCH', 'index', 'query', 'LANGUAGE', RedisSearchLanguages.ARABIC] ); }); it('with EXPANDER', () => { assert.deepEqual( transformArguments('index', 'query', { EXPANDER: 'expender' }), ['FT.SEARCH', 'index', 'query', 'EXPANDER', 'expender'] ); }); it('with SCORER', () => { assert.deepEqual( transformArguments('index', 'query', { SCORER: 'scorer' }), ['FT.SEARCH', 'index', 'query', 'SCORER', 'scorer'] ); }); it('with SORTBY', () => { assert.deepEqual( transformArguments('index', 'query', { SORTBY: '@by' }), ['FT.SEARCH', 'index', 'query', 'SORTBY', '@by'] ); }); it('with LIMIT', () => { assert.deepEqual( transformArguments('index', 'query', { LIMIT: { from: 0, size: 1 } }), ['FT.SEARCH', 'index', 'query', 'LIMIT', '0', '1'] ); }); it('with PARAMS', () => { assert.deepEqual( transformArguments('index', 'query', { PARAMS: { param: 'value' } }), ['FT.SEARCH', 'index', 'query', 'PARAMS', '2', 'param', 'value'] ); }); it('with DIALECT', () => { assert.deepEqual( transformArguments('index', 'query', { DIALECT: 1 }), ['FT.SEARCH', 'index', 'query', 'DIALECT', '1'] ); }); }); describe('client.ft.search', () => { testUtils.testWithClient('DIALECT 1', async client => { await Promise.all([ client.ft.create('index', { field: SchemaFieldTypes.NUMERIC }), client.hSet('1', 'field', '1') ]); assert.deepEqual( await client.ft.search('index', '*', { DIALECT: 1 }), { total: 1, documents: [{ id: '1', value: Object.create(null, { field: { value: '1', configurable: true, enumerable: true } }) }] } ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('DIALECT 2', async client => { await Promise.all([ client.ft.create('index', { field: SchemaFieldTypes.NUMERIC }), client.hSet('1', 'field', '1'), client.hSet('2', 'field', '2'), client.hSet('3', 'field', '3') ]); assert.deepEqual( await client.ft.search('index', '@field:[$min $max]', { PARAMS: { min: 1, max: 2 }, DIALECT: 2 }), { total: 2, documents: [{ id: '1', value: Object.create(null, { field: { value: '1', configurable: true, enumerable: true } }) }, { id: '2', value: Object.create(null, { field: { value: '2', configurable: true, enumerable: true } }) }] } ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/SEARCH.ts000066400000000000000000000045351433774114400236040ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { transformTuplesReply } from '@redis/client/dist/lib/commands/generic-transformers'; import { pushSearchOptions, RedisSearchLanguages, Params, PropertyName, SortByProperty, SearchReply } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export interface SearchOptions { // NOCONTENT?: true; TODO VERBATIM?: true; NOSTOPWORDS?: true; // WITHSCORES?: true; // WITHPAYLOADS?: true; WITHSORTKEYS?: true; // FILTER?: { // field: string; // min: number | string; // max: number | string; // }; // GEOFILTER?: { // field: string; // lon: number; // lat: number; // radius: number; // unit: 'm' | 'km' | 'mi' | 'ft'; // }; INKEYS?: string | Array; INFIELDS?: string | Array; RETURN?: string | Array; SUMMARIZE?: true | { FIELDS?: PropertyName | Array; FRAGS?: number; LEN?: number; SEPARATOR?: string; }; HIGHLIGHT?: true | { FIELDS?: PropertyName | Array; TAGS?: { open: string; close: string; }; }; SLOP?: number; INORDER?: true; LANGUAGE?: RedisSearchLanguages; EXPANDER?: string; SCORER?: string; // EXPLAINSCORE?: true; // TODO: WITHSCORES // PAYLOAD?: ; SORTBY?: SortByProperty; // MSORTBY?: SortByProperty | Array; LIMIT?: { from: number | string; size: number | string; }; PARAMS?: Params; DIALECT?: number; } export function transformArguments( index: string, query: string, options?: SearchOptions ): RedisCommandArguments { return pushSearchOptions( ['FT.SEARCH', index, query], options ); } export type SearchRawReply = Array; export function transformReply(reply: SearchRawReply): SearchReply { const documents = []; for (let i = 1; i < reply.length; i += 2) { const tuples = reply[i + 1]; documents.push({ id: reply[i], value: tuples.length === 2 && tuples[0] === '$' ? JSON.parse(tuples[1]) : transformTuplesReply(tuples) }); } return { total: reply[0], documents }; } node-redis-redis-4.5.1/packages/search/lib/commands/SPELLCHECK.spec.ts000066400000000000000000000050611433774114400252000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { SchemaFieldTypes } from '.'; import { transformArguments } from './SPELLCHECK'; describe('SPELLCHECK', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('index', 'query'), ['FT.SPELLCHECK', 'index', 'query'] ); }); it('with DISTANCE', () => { assert.deepEqual( transformArguments('index', 'query', { DISTANCE: 2 }), ['FT.SPELLCHECK', 'index', 'query', 'DISTANCE', '2'] ); }); describe('with TERMS', () => { it('single', () => { assert.deepEqual( transformArguments('index', 'query', { TERMS: { mode: 'INCLUDE', dictionary: 'dictionary' } }), ['FT.SPELLCHECK', 'index', 'query', 'TERMS', 'INCLUDE', 'dictionary'] ); }); it('multiple', () => { assert.deepEqual( transformArguments('index', 'query', { TERMS: [{ mode: 'INCLUDE', dictionary: 'include' }, { mode: 'EXCLUDE', dictionary: 'exclude' }] }), ['FT.SPELLCHECK', 'index', 'query', 'TERMS', 'INCLUDE', 'include', 'TERMS', 'EXCLUDE', 'exclude'] ); }); }); it('with DIALECT', () => { assert.deepEqual( transformArguments('index', 'query', { DIALECT: 1 }), ['FT.SPELLCHECK', 'index', 'query', 'DIALECT', '1'] ); }); }); testUtils.testWithClient('client.ft.spellCheck', async client => { await Promise.all([ client.ft.create('index', { field: SchemaFieldTypes.TEXT }), client.hSet('key', 'field', 'query') ]); assert.deepEqual( await client.ft.spellCheck('index', 'quer'), [{ term: 'quer', suggestions: [{ score: 1, suggestion: 'query' }] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/SPELLCHECK.ts000066400000000000000000000027751433774114400242600ustar00rootroot00000000000000interface SpellCheckTerms { mode: 'INCLUDE' | 'EXCLUDE'; dictionary: string; } interface SpellCheckOptions { DISTANCE?: number; TERMS?: SpellCheckTerms | Array; DIALECT?: number; } export function transformArguments(index: string, query: string, options?: SpellCheckOptions): Array { const args = ['FT.SPELLCHECK', index, query]; if (options?.DISTANCE) { args.push('DISTANCE', options.DISTANCE.toString()); } if (options?.TERMS) { if (Array.isArray(options.TERMS)) { for (const term of options.TERMS) { pushTerms(args, term); } } else { pushTerms(args, options.TERMS); } } if (options?.DIALECT) { args.push('DIALECT', options.DIALECT.toString()); } return args; } function pushTerms(args: Array, { mode, dictionary }: SpellCheckTerms): void { args.push('TERMS', mode, dictionary); } type SpellCheckRawReply = Array<[ _: string, term: string, suggestions: Array<[score: string, suggestion: string]> ]>; type SpellCheckReply = Array<{ term: string, suggestions: Array<{ score: number, suggestion: string }> }>; export function transformReply(rawReply: SpellCheckRawReply): SpellCheckReply { return rawReply.map(([, term, suggestions]) => ({ term, suggestions: suggestions.map(([score, suggestion]) => ({ score: Number(score), suggestion })) })); } node-redis-redis-4.5.1/packages/search/lib/commands/SUGADD.spec.ts000066400000000000000000000021101433774114400245220ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGADD'; describe('SUGADD', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key', 'string', 1), ['FT.SUGADD', 'key', 'string', '1'] ); }); it('with INCR', () => { assert.deepEqual( transformArguments('key', 'string', 1, { INCR: true }), ['FT.SUGADD', 'key', 'string', '1', 'INCR'] ); }); it('with PAYLOAD', () => { assert.deepEqual( transformArguments('key', 'string', 1, { PAYLOAD: 'payload' }), ['FT.SUGADD', 'key', 'string', '1', 'PAYLOAD', 'payload'] ); }); }); testUtils.testWithClient('client.ft.sugAdd', async client => { assert.equal( await client.ft.sugAdd('key', 'string', 1), 1 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGADD.ts000066400000000000000000000007201433774114400235760ustar00rootroot00000000000000interface SugAddOptions { INCR?: true; PAYLOAD?: string; } export function transformArguments(key: string, string: string, score: number, options?: SugAddOptions): Array { const args = ['FT.SUGADD', key, string, score.toString()]; if (options?.INCR) { args.push('INCR'); } if (options?.PAYLOAD) { args.push('PAYLOAD', options.PAYLOAD); } return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/search/lib/commands/SUGDEL.spec.ts000066400000000000000000000010441433774114400245430ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGDEL'; describe('SUGDEL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'string'), ['FT.SUGDEL', 'key', 'string'] ); }); testUtils.testWithClient('client.ft.sugDel', async client => { assert.equal( await client.ft.sugDel('key', 'string'), false ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGDEL.ts000066400000000000000000000003531433774114400236140ustar00rootroot00000000000000export function transformArguments(key: string, string: string): Array { return ['FT.SUGDEL', key, string]; } export { transformBooleanReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers'; node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET.spec.ts000066400000000000000000000025731433774114400245660ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGGET'; describe('SUGGET', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key', 'prefix'), ['FT.SUGGET', 'key', 'prefix'] ); }); it('with FUZZY', () => { assert.deepEqual( transformArguments('key', 'prefix', { FUZZY: true }), ['FT.SUGGET', 'key', 'prefix', 'FUZZY'] ); }); it('with MAX', () => { assert.deepEqual( transformArguments('key', 'prefix', { MAX: 10 }), ['FT.SUGGET', 'key', 'prefix', 'MAX', '10'] ); }); }); describe('client.ft.sugGet', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.ft.sugGet('key', 'prefix'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with suggestions', async client => { await client.ft.sugAdd('key', 'string', 1); assert.deepEqual( await client.ft.sugGet('key', 'string'), ['string'] ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET.ts000066400000000000000000000007451433774114400236340ustar00rootroot00000000000000export const IS_READ_ONLY = true; export interface SugGetOptions { FUZZY?: true; MAX?: number; } export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array { const args = ['FT.SUGGET', key, prefix]; if (options?.FUZZY) { args.push('FUZZY'); } if (options?.MAX) { args.push('MAX', options.MAX.toString()); } return args; } export declare function transformReply(): null | Array; node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET_WITHPAYLOADS.spec.ts000066400000000000000000000021051433774114400265450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGGET_WITHPAYLOADS'; describe('SUGGET WITHPAYLOADS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'prefix'), ['FT.SUGGET', 'key', 'prefix', 'WITHPAYLOADS'] ); }); describe('client.ft.sugGetWithPayloads', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.ft.sugGetWithPayloads('key', 'prefix'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with suggestions', async client => { await client.ft.sugAdd('key', 'string', 1, { PAYLOAD: 'payload' }); assert.deepEqual( await client.ft.sugGetWithPayloads('key', 'string'), [{ suggestion: 'string', payload: 'payload' }] ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET_WITHPAYLOADS.ts000066400000000000000000000014771433774114400256270ustar00rootroot00000000000000import { SugGetOptions, transformArguments as transformSugGetArguments } from './SUGGET'; export { IS_READ_ONLY } from './SUGGET'; export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array { return [ ...transformSugGetArguments(key, prefix, options), 'WITHPAYLOADS' ]; } export interface SuggestionWithPayload { suggestion: string; payload: string | null; } export function transformReply(rawReply: Array | null): Array | null { if (rawReply === null) return null; const transformedReply = []; for (let i = 0; i < rawReply.length; i += 2) { transformedReply.push({ suggestion: rawReply[i]!, payload: rawReply[i + 1] }); } return transformedReply; } node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET_WITHSCORES.spec.ts000066400000000000000000000020401433774114400263250ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGGET_WITHSCORES'; describe('SUGGET WITHSCORES', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'prefix'), ['FT.SUGGET', 'key', 'prefix', 'WITHSCORES'] ); }); describe('client.ft.sugGetWithScores', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.ft.sugGetWithScores('key', 'prefix'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with suggestions', async client => { await client.ft.sugAdd('key', 'string', 1); assert.deepEqual( await client.ft.sugGetWithScores('key', 'string'), [{ suggestion: 'string', score: 2147483648 }] ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET_WITHSCORES.ts000066400000000000000000000014601433774114400254010ustar00rootroot00000000000000import { SugGetOptions, transformArguments as transformSugGetArguments } from './SUGGET'; export { IS_READ_ONLY } from './SUGGET'; export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array { return [ ...transformSugGetArguments(key, prefix, options), 'WITHSCORES' ]; } export interface SuggestionWithScores { suggestion: string; score: number; } export function transformReply(rawReply: Array | null): Array | null { if (rawReply === null) return null; const transformedReply = []; for (let i = 0; i < rawReply.length; i += 2) { transformedReply.push({ suggestion: rawReply[i], score: Number(rawReply[i + 1]) }); } return transformedReply; } node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET_WITHSCORES_WITHPAYLOADS.spec.ts000066400000000000000000000022561433774114400303260ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGGET_WITHSCORES_WITHPAYLOADS'; describe('SUGGET WITHSCORES WITHPAYLOADS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', 'prefix'), ['FT.SUGGET', 'key', 'prefix', 'WITHSCORES', 'WITHPAYLOADS'] ); }); describe('client.ft.sugGetWithScoresWithPayloads', () => { testUtils.testWithClient('null', async client => { assert.equal( await client.ft.sugGetWithScoresWithPayloads('key', 'prefix'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with suggestions', async client => { await client.ft.sugAdd('key', 'string', 1, { PAYLOAD: 'payload' }); assert.deepEqual( await client.ft.sugGetWithScoresWithPayloads('key', 'string'), [{ suggestion: 'string', score: 2147483648, payload: 'payload' }] ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGGET_WITHSCORES_WITHPAYLOADS.ts000066400000000000000000000017751433774114400274020ustar00rootroot00000000000000import { SugGetOptions, transformArguments as transformSugGetArguments } from './SUGGET'; import { SuggestionWithPayload } from './SUGGET_WITHPAYLOADS'; import { SuggestionWithScores } from './SUGGET_WITHSCORES'; export { IS_READ_ONLY } from './SUGGET'; export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array { return [ ...transformSugGetArguments(key, prefix, options), 'WITHSCORES', 'WITHPAYLOADS' ]; } type SuggestionWithScoresAndPayloads = SuggestionWithScores & SuggestionWithPayload; export function transformReply(rawReply: Array | null): Array | null { if (rawReply === null) return null; const transformedReply = []; for (let i = 0; i < rawReply.length; i += 3) { transformedReply.push({ suggestion: rawReply[i]!, score: Number(rawReply[i + 1]!), payload: rawReply[i + 2] }); } return transformedReply; } node-redis-redis-4.5.1/packages/search/lib/commands/SUGLEN.spec.ts000066400000000000000000000010021433774114400245470ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SUGLEN'; describe('SUGLEN', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['FT.SUGLEN', 'key'] ); }); testUtils.testWithClient('client.ft.sugLen', async client => { assert.equal( await client.ft.sugLen('key'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/SUGLEN.ts000066400000000000000000000002701433774114400236240ustar00rootroot00000000000000export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['FT.SUGLEN', key]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/search/lib/commands/SYNDUMP.spec.ts000066400000000000000000000012301433774114400247140ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SYNDUMP'; import { SchemaFieldTypes } from '.'; describe('SYNDUMP', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('index'), ['FT.SYNDUMP', 'index'] ); }); testUtils.testWithClient('client.ft.synDump', async client => { await client.ft.create('index', { field: SchemaFieldTypes.TEXT }); assert.deepEqual( await client.ft.synDump('index'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/SYNDUMP.ts000066400000000000000000000002411433774114400237640ustar00rootroot00000000000000export function transformArguments(index: string): Array { return ['FT.SYNDUMP', index]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/search/lib/commands/SYNUPDATE.spec.ts000066400000000000000000000024171433774114400251410ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './SYNUPDATE'; import { SchemaFieldTypes } from '.'; describe('SYNUPDATE', () => { describe('transformArguments', () => { it('single term', () => { assert.deepEqual( transformArguments('index', 'groupId', 'term'), ['FT.SYNUPDATE', 'index', 'groupId', 'term'] ); }); it('multiple terms', () => { assert.deepEqual( transformArguments('index', 'groupId', ['1', '2']), ['FT.SYNUPDATE', 'index', 'groupId', '1', '2'] ); }); it('with SKIPINITIALSCAN', () => { assert.deepEqual( transformArguments('index', 'groupId', 'term', { SKIPINITIALSCAN: true }), ['FT.SYNUPDATE', 'index', 'groupId', 'SKIPINITIALSCAN', 'term'] ); }); }); testUtils.testWithClient('client.ft.synUpdate', async client => { await client.ft.create('index', { field: SchemaFieldTypes.TEXT }); assert.equal( await client.ft.synUpdate('index', 'groupId', 'term'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/SYNUPDATE.ts000066400000000000000000000011621433774114400242040ustar00rootroot00000000000000import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; interface SynUpdateOptions { SKIPINITIALSCAN?: true; } export function transformArguments( index: string, groupId: string, terms: string | Array, options?: SynUpdateOptions ): RedisCommandArguments { const args = ['FT.SYNUPDATE', index, groupId]; if (options?.SKIPINITIALSCAN) { args.push('SKIPINITIALSCAN'); } return pushVerdictArguments(args, terms); } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/search/lib/commands/TAGVALS.spec.ts000066400000000000000000000012641433774114400246650ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { SchemaFieldTypes } from '.'; import { transformArguments } from './TAGVALS'; describe('TAGVALS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('index', '@field'), ['FT.TAGVALS', 'index', '@field'] ); }); testUtils.testWithClient('client.ft.tagVals', async client => { await client.ft.create('index', { field: SchemaFieldTypes.TAG }); assert.deepEqual( await client.ft.tagVals('index', 'field'), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/TAGVALS.ts000066400000000000000000000002771433774114400237370ustar00rootroot00000000000000export function transformArguments(index: string, fieldName: string): Array { return ['FT.TAGVALS', index, fieldName]; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/search/lib/commands/_LIST.spec.ts000066400000000000000000000007611433774114400244770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './_LIST'; describe('_LIST', () => { it('transformArguments', () => { assert.deepEqual( transformArguments(), ['FT._LIST'] ); }); testUtils.testWithClient('client.ft._list', async client => { assert.deepEqual( await client.ft._list(), [] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/search/lib/commands/_LIST.ts000066400000000000000000000002131433774114400235360ustar00rootroot00000000000000export function transformArguments(): Array { return ['FT._LIST']; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/search/lib/commands/index.spec.ts000066400000000000000000000023431433774114400246720ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { pushArgumentsWithLength, pushSortByArguments } from '.'; describe('pushSortByArguments', () => { describe('single', () => { it('string', () => { assert.deepEqual( pushSortByArguments([], 'SORTBY', '@property'), ['SORTBY', '1', '@property'] ); }); it('.BY', () => { assert.deepEqual( pushSortByArguments([], 'SORTBY', { BY: '@property' }), ['SORTBY', '1', '@property'] ); }); it('with DIRECTION', () => { assert.deepEqual( pushSortByArguments([], 'SORTBY', { BY: '@property', DIRECTION: 'ASC' }), ['SORTBY', '2', '@property', 'ASC'] ); }); }); it('multiple', () => { assert.deepEqual( pushSortByArguments([], 'SORTBY', ['@1', '@2']), ['SORTBY', '2', '@1', '@2'] ); }); }); it('pushArgumentsWithLength', () => { assert.deepEqual( pushArgumentsWithLength(['a'], args => { args.push('b', 'c'); }), ['a', '2', 'b', 'c'] ); }); node-redis-redis-4.5.1/packages/search/lib/commands/index.ts000066400000000000000000000411571433774114400237470ustar00rootroot00000000000000import * as _LIST from './_LIST'; import * as ALTER from './ALTER'; import * as AGGREGATE_WITHCURSOR from './AGGREGATE_WITHCURSOR'; import * as AGGREGATE from './AGGREGATE'; import * as ALIASADD from './ALIASADD'; import * as ALIASDEL from './ALIASDEL'; import * as ALIASUPDATE from './ALIASUPDATE'; import * as CONFIG_GET from './CONFIG_GET'; import * as CONFIG_SET from './CONFIG_SET'; import * as CREATE from './CREATE'; import * as CURSOR_DEL from './CURSOR_DEL'; import * as CURSOR_READ from './CURSOR_READ'; import * as DICTADD from './DICTADD'; import * as DICTDEL from './DICTDEL'; import * as DICTDUMP from './DICTDUMP'; import * as DROPINDEX from './DROPINDEX'; import * as EXPLAIN from './EXPLAIN'; import * as EXPLAINCLI from './EXPLAINCLI'; import * as INFO from './INFO'; import * as PROFILESEARCH from './PROFILE_SEARCH'; import * as PROFILEAGGREGATE from './PROFILE_AGGREGATE'; import * as SEARCH from './SEARCH'; import * as SPELLCHECK from './SPELLCHECK'; import * as SUGADD from './SUGADD'; import * as SUGDEL from './SUGDEL'; import * as SUGGET_WITHPAYLOADS from './SUGGET_WITHPAYLOADS'; import * as SUGGET_WITHSCORES_WITHPAYLOADS from './SUGGET_WITHSCORES_WITHPAYLOADS'; import * as SUGGET_WITHSCORES from './SUGGET_WITHSCORES'; import * as SUGGET from './SUGGET'; import * as SUGLEN from './SUGLEN'; import * as SYNDUMP from './SYNDUMP'; import * as SYNUPDATE from './SYNUPDATE'; import * as TAGVALS from './TAGVALS'; import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushOptionalVerdictArgument, pushVerdictArgument } from '@redis/client/dist/lib/commands/generic-transformers'; import { SearchOptions } from './SEARCH'; export default { _LIST, _list: _LIST, ALTER, alter: ALTER, AGGREGATE_WITHCURSOR, aggregateWithCursor: AGGREGATE_WITHCURSOR, AGGREGATE, aggregate: AGGREGATE, ALIASADD, aliasAdd: ALIASADD, ALIASDEL, aliasDel: ALIASDEL, ALIASUPDATE, aliasUpdate: ALIASUPDATE, CONFIG_GET, configGet: CONFIG_GET, CONFIG_SET, configSet: CONFIG_SET, CREATE, create: CREATE, CURSOR_DEL, cursorDel: CURSOR_DEL, CURSOR_READ, cursorRead: CURSOR_READ, DICTADD, dictAdd: DICTADD, DICTDEL, dictDel: DICTDEL, DICTDUMP, dictDump: DICTDUMP, DROPINDEX, dropIndex: DROPINDEX, EXPLAIN, explain: EXPLAIN, EXPLAINCLI, explainCli: EXPLAINCLI, INFO, info: INFO, PROFILESEARCH, profileSearch: PROFILESEARCH, PROFILEAGGREGATE, profileAggregate: PROFILEAGGREGATE, SEARCH, search: SEARCH, SPELLCHECK, spellCheck: SPELLCHECK, SUGADD, sugAdd: SUGADD, SUGDEL, sugDel: SUGDEL, SUGGET_WITHPAYLOADS, sugGetWithPayloads: SUGGET_WITHPAYLOADS, SUGGET_WITHSCORES_WITHPAYLOADS, sugGetWithScoresWithPayloads: SUGGET_WITHSCORES_WITHPAYLOADS, SUGGET_WITHSCORES, sugGetWithScores: SUGGET_WITHSCORES, SUGGET, sugGet: SUGGET, SUGLEN, sugLen: SUGLEN, SYNDUMP, synDump: SYNDUMP, SYNUPDATE, synUpdate: SYNUPDATE, TAGVALS, tagVals: TAGVALS }; export enum RedisSearchLanguages { ARABIC = 'Arabic', BASQUE = 'Basque', CATALANA = 'Catalan', DANISH = 'Danish', DUTCH = 'Dutch', ENGLISH = 'English', FINNISH = 'Finnish', FRENCH = 'French', GERMAN = 'German', GREEK = 'Greek', HUNGARIAN = 'Hungarian', INDONESAIN = 'Indonesian', IRISH = 'Irish', ITALIAN = 'Italian', LITHUANIAN = 'Lithuanian', NEPALI = 'Nepali', NORWEIGAN = 'Norwegian', PORTUGUESE = 'Portuguese', ROMANIAN = 'Romanian', RUSSIAN = 'Russian', SPANISH = 'Spanish', SWEDISH = 'Swedish', TAMIL = 'Tamil', TURKISH = 'Turkish', CHINESE = 'Chinese' } export type PropertyName = `${'@' | '$.'}${string}`; export type SortByProperty = PropertyName | { BY: PropertyName; DIRECTION?: 'ASC' | 'DESC'; }; export function pushSortByProperty(args: RedisCommandArguments, sortBy: SortByProperty): void { if (typeof sortBy === 'string') { args.push(sortBy); } else { args.push(sortBy.BY); if (sortBy.DIRECTION) { args.push(sortBy.DIRECTION); } } } export function pushSortByArguments(args: RedisCommandArguments, name: string, sortBy: SortByProperty | Array): RedisCommandArguments { const lengthBefore = args.push( name, '' // will be overwritten ); if (Array.isArray(sortBy)) { for (const field of sortBy) { pushSortByProperty(args, field); } } else { pushSortByProperty(args, sortBy); } args[lengthBefore - 1] = (args.length - lengthBefore).toString(); return args; } export function pushArgumentsWithLength(args: RedisCommandArguments, fn: (args: RedisCommandArguments) => void): RedisCommandArguments { const lengthIndex = args.push('') - 1; fn(args); args[lengthIndex] = (args.length - lengthIndex - 1).toString(); return args; } export enum SchemaFieldTypes { TEXT = 'TEXT', NUMERIC = 'NUMERIC', GEO = 'GEO', TAG = 'TAG', VECTOR = 'VECTOR' } type CreateSchemaField< T extends SchemaFieldTypes, E = Record > = T | ({ type: T; AS?: string; } & E); type CreateSchemaCommonField< T extends SchemaFieldTypes, E = Record > = CreateSchemaField< T, ({ SORTABLE?: true | 'UNF'; NOINDEX?: true; } & E) >; export enum SchemaTextFieldPhonetics { DM_EN = 'dm:en', DM_FR = 'dm:fr', FM_PT = 'dm:pt', DM_ES = 'dm:es' } type CreateSchemaTextField = CreateSchemaCommonField; type CreateSchemaNumericField = CreateSchemaCommonField; type CreateSchemaGeoField = CreateSchemaCommonField; type CreateSchemaTagField = CreateSchemaCommonField; export enum VectorAlgorithms { FLAT = 'FLAT', HNSW = 'HNSW' } type CreateSchemaVectorField< T extends VectorAlgorithms, A extends Record > = CreateSchemaField; type CreateSchemaFlatVectorField = CreateSchemaVectorField; type CreateSchemaHNSWVectorField = CreateSchemaVectorField; export interface RediSearchSchema { [field: string]: CreateSchemaTextField | CreateSchemaNumericField | CreateSchemaGeoField | CreateSchemaTagField | CreateSchemaFlatVectorField | CreateSchemaHNSWVectorField; } export function pushSchema(args: RedisCommandArguments, schema: RediSearchSchema) { for (const [field, fieldOptions] of Object.entries(schema)) { args.push(field); if (typeof fieldOptions === 'string') { args.push(fieldOptions); continue; } if (fieldOptions.AS) { args.push('AS', fieldOptions.AS); } args.push(fieldOptions.type); switch (fieldOptions.type) { case SchemaFieldTypes.TEXT: if (fieldOptions.NOSTEM) { args.push('NOSTEM'); } if (fieldOptions.WEIGHT) { args.push('WEIGHT', fieldOptions.WEIGHT.toString()); } if (fieldOptions.PHONETIC) { args.push('PHONETIC', fieldOptions.PHONETIC); } if (fieldOptions.WITHSUFFIXTRIE) { args.push('WITHSUFFIXTRIE'); } break; // case SchemaFieldTypes.NUMERIC: // case SchemaFieldTypes.GEO: // break; case SchemaFieldTypes.TAG: if (fieldOptions.SEPARATOR) { args.push('SEPARATOR', fieldOptions.SEPARATOR); } if (fieldOptions.CASESENSITIVE) { args.push('CASESENSITIVE'); } if (fieldOptions.WITHSUFFIXTRIE) { args.push('WITHSUFFIXTRIE'); } break; case SchemaFieldTypes.VECTOR: args.push(fieldOptions.ALGORITHM); pushArgumentsWithLength(args, () => { args.push( 'TYPE', fieldOptions.TYPE, 'DIM', fieldOptions.DIM.toString(), 'DISTANCE_METRIC', fieldOptions.DISTANCE_METRIC ); if (fieldOptions.INITIAL_CAP) { args.push('INITIAL_CAP', fieldOptions.INITIAL_CAP.toString()); } switch (fieldOptions.ALGORITHM) { case VectorAlgorithms.FLAT: if (fieldOptions.BLOCK_SIZE) { args.push('BLOCK_SIZE', fieldOptions.BLOCK_SIZE.toString()); } break; case VectorAlgorithms.HNSW: if (fieldOptions.M) { args.push('M', fieldOptions.M.toString()); } if (fieldOptions.EF_CONSTRUCTION) { args.push('EF_CONSTRUCTION', fieldOptions.EF_CONSTRUCTION.toString()); } if (fieldOptions.EF_RUNTIME) { args.push('EF_RUNTIME', fieldOptions.EF_RUNTIME.toString()); } break; } }); continue; // vector fields do not contain SORTABLE and NOINDEX options } if (fieldOptions.SORTABLE) { args.push('SORTABLE'); if (fieldOptions.SORTABLE === 'UNF') { args.push('UNF'); } } if (fieldOptions.NOINDEX) { args.push('NOINDEX'); } } } export type Params = Record; export function pushParamsArgs( args: RedisCommandArguments, params?: Params ): RedisCommandArguments { if (params) { const enrties = Object.entries(params); args.push('PARAMS', (enrties.length * 2).toString()); for (const [key, value] of enrties) { args.push(key, typeof value === 'number' ? value.toString() : value); } } return args; } export function pushSearchOptions( args: RedisCommandArguments, options?: SearchOptions ): RedisCommandArguments { if (options?.VERBATIM) { args.push('VERBATIM'); } if (options?.NOSTOPWORDS) { args.push('NOSTOPWORDS'); } // if (options?.WITHSCORES) { // args.push('WITHSCORES'); // } // if (options?.WITHPAYLOADS) { // args.push('WITHPAYLOADS'); // } pushOptionalVerdictArgument(args, 'INKEYS', options?.INKEYS); pushOptionalVerdictArgument(args, 'INFIELDS', options?.INFIELDS); pushOptionalVerdictArgument(args, 'RETURN', options?.RETURN); if (options?.SUMMARIZE) { args.push('SUMMARIZE'); if (typeof options.SUMMARIZE === 'object') { if (options.SUMMARIZE.FIELDS) { args.push('FIELDS'); pushVerdictArgument(args, options.SUMMARIZE.FIELDS); } if (options.SUMMARIZE.FRAGS) { args.push('FRAGS', options.SUMMARIZE.FRAGS.toString()); } if (options.SUMMARIZE.LEN) { args.push('LEN', options.SUMMARIZE.LEN.toString()); } if (options.SUMMARIZE.SEPARATOR) { args.push('SEPARATOR', options.SUMMARIZE.SEPARATOR); } } } if (options?.HIGHLIGHT) { args.push('HIGHLIGHT'); if (typeof options.HIGHLIGHT === 'object') { if (options.HIGHLIGHT.FIELDS) { args.push('FIELDS'); pushVerdictArgument(args, options.HIGHLIGHT.FIELDS); } if (options.HIGHLIGHT.TAGS) { args.push('TAGS', options.HIGHLIGHT.TAGS.open, options.HIGHLIGHT.TAGS.close); } } } if (options?.SLOP) { args.push('SLOP', options.SLOP.toString()); } if (options?.INORDER) { args.push('INORDER'); } if (options?.LANGUAGE) { args.push('LANGUAGE', options.LANGUAGE); } if (options?.EXPANDER) { args.push('EXPANDER', options.EXPANDER); } if (options?.SCORER) { args.push('SCORER', options.SCORER); } // if (options?.EXPLAINSCORE) { // args.push('EXPLAINSCORE'); // } // if (options?.PAYLOAD) { // args.push('PAYLOAD', options.PAYLOAD); // } if (options?.SORTBY) { args.push('SORTBY'); pushSortByProperty(args, options.SORTBY); } // if (options?.MSORTBY) { // pushSortByArguments(args, 'MSORTBY', options.MSORTBY); // } if (options?.LIMIT) { args.push( 'LIMIT', options.LIMIT.from.toString(), options.LIMIT.size.toString() ); } if (options?.PARAMS) { pushParamsArgs(args, options.PARAMS); } if (options?.DIALECT) { args.push('DIALECT', options.DIALECT.toString()); } return args; } interface SearchDocumentValue { [key: string]: string | number | null | Array | SearchDocumentValue; } export interface SearchReply { total: number; documents: Array<{ id: string; value: SearchDocumentValue; }>; } export interface ProfileOptions { LIMITED?: true; } export type ProfileRawReply = [ results: T, profile: [ _: string, TotalProfileTime: string, _: string, ParsingTime: string, _: string, PipelineCreationTime: string, _: string, IteratorsProfile: Array ] ]; export interface ProfileReply { results: SearchReply | AGGREGATE.AggregateReply; profile: ProfileData; } interface ChildIterator { type?: string, counter?: number, term?: string, size?: number, time?: string, childIterators?: Array } interface IteratorsProfile { type?: string, counter?: number, queryType?: string, time?: string, childIterators?: Array } interface ProfileData { totalProfileTime: string, parsingTime: string, pipelineCreationTime: string, iteratorsProfile: IteratorsProfile } export function transformProfile(reply: Array): ProfileData{ return { totalProfileTime: reply[0][1], parsingTime: reply[1][1], pipelineCreationTime: reply[2][1], iteratorsProfile: transformIterators(reply[3][1]) }; } function transformIterators(IteratorsProfile: Array): IteratorsProfile { var res: IteratorsProfile = {}; for (let i = 0; i < IteratorsProfile.length; i += 2) { const value = IteratorsProfile[i+1]; switch (IteratorsProfile[i]) { case 'Type': res.type = value; break; case 'Counter': res.counter = value; break; case 'Time': res.time = value; break; case 'Query type': res.queryType = value; break; case 'Child iterators': res.childIterators = value.map(transformChildIterators); break; } } return res; } function transformChildIterators(IteratorsProfile: Array): ChildIterator { var res: ChildIterator = {}; for (let i = 1; i < IteratorsProfile.length; i += 2) { const value = IteratorsProfile[i+1]; switch (IteratorsProfile[i]) { case 'Type': res.type = value; break; case 'Counter': res.counter = value; break; case 'Time': res.time = value; break; case 'Size': res.size = value; break; case 'Term': res.term = value; break; case 'Child iterators': res.childIterators = value.map(transformChildIterators); break; } } return res; } node-redis-redis-4.5.1/packages/search/lib/index.ts000066400000000000000000000004451433774114400221410ustar00rootroot00000000000000export { default } from './commands'; export { RediSearchSchema, SchemaFieldTypes, SchemaTextFieldPhonetics, SearchReply, VectorAlgorithms } from './commands'; export { AggregateSteps, AggregateGroupByReducers } from './commands/AGGREGATE'; export { SearchOptions } from './commands/SEARCH'; node-redis-redis-4.5.1/packages/search/lib/test-utils.ts000066400000000000000000000010121433774114400231360ustar00rootroot00000000000000import TestUtils from '@redis/test-utils'; import RediSearch from '.'; export default new TestUtils({ dockerImageName: 'redislabs/redisearch', dockerImageVersionArgument: 'redisearch-version', defaultDockerVersion: '2.4.9' }); export const GLOBAL = { SERVERS: { OPEN: { serverArguments: ['--loadmodule /usr/lib/redis/modules/redisearch.so'], clientOptions: { modules: { ft: RediSearch } } } } }; node-redis-redis-4.5.1/packages/search/package.json000066400000000000000000000013221433774114400221750ustar00rootroot00000000000000{ "name": "@redis/search", "version": "1.1.0", "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", "documentation": "typedoc" }, "peerDependencies": { "@redis/client": "^1.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } } node-redis-redis-4.5.1/packages/search/tsconfig.json000066400000000000000000000005401433774114400224170ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./lib/**/*.ts" ], "exclude": [ "./lib/test-utils.ts", "./lib/**/*.spec.ts" ], "typedocOptions": { "entryPoints": [ "./lib" ], "entryPointStrategy": "expand", "out": "../../documentation/search" } } node-redis-redis-4.5.1/packages/test-utils/000077500000000000000000000000001433774114400205615ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/test-utils/docker/000077500000000000000000000000001433774114400220305ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/test-utils/docker/Dockerfile000066400000000000000000000002131433774114400240160ustar00rootroot00000000000000ARG IMAGE FROM ${IMAGE} ARG REDIS_ARGUMENTS ENV REDIS_ARGUMENTS=${REDIS_ARGUMENTS} COPY ./entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] node-redis-redis-4.5.1/packages/test-utils/docker/entrypoint.sh000077500000000000000000000000531433774114400246000ustar00rootroot00000000000000#!/bin/bash redis-server $REDIS_ARGUMENTS node-redis-redis-4.5.1/packages/test-utils/lib/000077500000000000000000000000001433774114400213275ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/test-utils/lib/dockers.ts000066400000000000000000000147151433774114400233410ustar00rootroot00000000000000import { createConnection } from 'net'; import { once } from 'events'; import { RedisModules, RedisFunctions, RedisScripts } from '@redis/client/dist/lib/commands'; import RedisClient, { RedisClientType } from '@redis/client/dist/lib/client'; import { promiseTimeout } from '@redis/client/dist/lib/utils'; import * as path from 'path'; import { promisify } from 'util'; import { exec } from 'child_process'; const execAsync = promisify(exec); interface ErrorWithCode extends Error { code: string; } async function isPortAvailable(port: number): Promise { try { const socket = createConnection({ port }); await once(socket, 'connect'); socket.end(); } catch (err) { if (err instanceof Error && (err as ErrorWithCode).code === 'ECONNREFUSED') { return true; } } return false; } const portIterator = (async function*(): AsyncIterableIterator { for (let i = 6379; i < 65535; i++) { if (await isPortAvailable(i)) { yield i; } } throw new Error('All ports are in use'); })(); export interface RedisServerDockerConfig { image: string; version: string; } export interface RedisServerDocker { port: number; dockerId: string; } // ".." cause it'll be in `./dist` const DOCKER_FODLER_PATH = path.join(__dirname, '../docker'); async function spawnRedisServerDocker({ image, version }: RedisServerDockerConfig, serverArguments: Array): Promise { const port = (await portIterator.next()).value, { stdout, stderr } = await execAsync( 'docker run -d --network host $(' + `docker build ${DOCKER_FODLER_PATH} -q ` + `--build-arg IMAGE=${image}:${version} ` + `--build-arg REDIS_ARGUMENTS="--save '' --port ${port.toString()} ${serverArguments.join(' ')}"` + ')' ); if (!stdout) { throw new Error(`docker run error - ${stderr}`); } while (await isPortAvailable(port)) { await promiseTimeout(500); } return { port, dockerId: stdout.trim() }; } const RUNNING_SERVERS = new Map, ReturnType>(); export function spawnRedisServer(dockerConfig: RedisServerDockerConfig, serverArguments: Array): Promise { const runningServer = RUNNING_SERVERS.get(serverArguments); if (runningServer) { return runningServer; } const dockerPromise = spawnRedisServerDocker(dockerConfig, serverArguments); RUNNING_SERVERS.set(serverArguments, dockerPromise); return dockerPromise; } async function dockerRemove(dockerId: string): Promise { const { stderr } = await execAsync(`docker rm -f ${dockerId}`); if (stderr) { throw new Error(`docker rm error - ${stderr}`); } } after(() => { return Promise.all( [...RUNNING_SERVERS.values()].map(async dockerPromise => await dockerRemove((await dockerPromise).dockerId) ) ); }); export interface RedisClusterDockersConfig extends RedisServerDockerConfig { numberOfNodes?: number; } async function spawnRedisClusterNodeDocker( dockersConfig: RedisClusterDockersConfig, serverArguments: Array, fromSlot: number, toSlot: number, waitForState: boolean, meetPort?: number ): Promise { const docker = await spawnRedisServerDocker(dockersConfig, [ ...serverArguments, '--cluster-enabled', 'yes', '--cluster-node-timeout', '5000' ]), client = RedisClient.create({ socket: { port: docker.port } }); await client.connect(); try { const range = []; for (let i = fromSlot; i < toSlot; i++) { range.push(i); } const promises: Array> = [client.clusterAddSlots(range)]; if (meetPort) { promises.push(client.clusterMeet('127.0.0.1', meetPort)); } if (waitForState) { promises.push(waitForClusterState(client)); } await Promise.all(promises); return docker; } finally { await client.disconnect(); } } async function waitForClusterState< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(client: RedisClientType): Promise { while ((await client.clusterInfo()).state !== 'ok') { await promiseTimeout(500); } } const SLOTS = 16384; async function spawnRedisClusterDockers(dockersConfig: RedisClusterDockersConfig, serverArguments: Array): Promise> { const numberOfNodes = dockersConfig.numberOfNodes ?? 3, slotsPerNode = Math.floor(SLOTS / numberOfNodes), dockers: Array = []; for (let i = 0; i < numberOfNodes; i++) { const fromSlot = i * slotsPerNode, [ toSlot, waitForState ] = i === numberOfNodes - 1 ? [SLOTS, true] : [fromSlot + slotsPerNode, false]; dockers.push( await spawnRedisClusterNodeDocker( dockersConfig, serverArguments, fromSlot, toSlot, waitForState, i === 0 ? undefined : dockers[i - 1].port ) ); } const client = RedisClient.create({ socket: { port: dockers[0].port } }); await client.connect(); try { while ((await client.clusterInfo()).state !== 'ok') { await promiseTimeout(500); } } finally { await client.disconnect(); } return dockers; } const RUNNING_CLUSTERS = new Map, ReturnType>(); export function spawnRedisCluster(dockersConfig: RedisClusterDockersConfig, serverArguments: Array): Promise> { const runningCluster = RUNNING_CLUSTERS.get(serverArguments); if (runningCluster) { return runningCluster; } const dockersPromise = spawnRedisClusterDockers(dockersConfig, serverArguments); RUNNING_CLUSTERS.set(serverArguments, dockersPromise); return dockersPromise; } after(() => { return Promise.all( [...RUNNING_CLUSTERS.values()].map(async dockersPromise => { return Promise.all( (await dockersPromise).map(({ dockerId }) => dockerRemove(dockerId)) ); }) ); }); node-redis-redis-4.5.1/packages/test-utils/lib/index.ts000066400000000000000000000157421433774114400230170ustar00rootroot00000000000000import { RedisModules, RedisFunctions, RedisScripts } from '@redis/client/lib/commands'; import RedisClient, { RedisClientOptions, RedisClientType } from '@redis/client/lib/client'; import RedisCluster, { RedisClusterOptions, RedisClusterType } from '@redis/client/lib/cluster'; import { RedisSocketCommonOptions } from '@redis/client/lib/client/socket'; import { RedisServerDockerConfig, spawnRedisServer, spawnRedisCluster } from './dockers'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; interface TestUtilsConfig { dockerImageName: string; dockerImageVersionArgument: string; defaultDockerVersion: string; } interface CommonTestOptions { minimumDockerVersion?: Array; } interface ClientTestOptions< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > extends CommonTestOptions { serverArguments: Array; clientOptions?: Partial, 'socket'> & { socket: RedisSocketCommonOptions }>; disableClientSetup?: boolean; } interface ClusterTestOptions< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts > extends CommonTestOptions { serverArguments: Array; clusterConfiguration?: Partial>; numberOfNodes?: number; } interface Version { string: string; numbers: Array; } export default class TestUtils { static #parseVersionNumber(version: string): Array { if (version === 'edge') return [Infinity]; const dashIndex = version.indexOf('-'); return (dashIndex === -1 ? version : version.substring(0, dashIndex)) .split('.') .map(x => { const value = Number(x); if (Number.isNaN(value)) { throw new TypeError(`${version} is not a valid redis version`); } return value; }); } static #getVersion(argumentName: string, defaultVersion: string): Version { return yargs(hideBin(process.argv)) .option(argumentName, { type: 'string', default: defaultVersion }) .coerce(argumentName, (version: string) => { return { string: version, numbers: TestUtils.#parseVersionNumber(version) }; }) .demandOption(argumentName) .parseSync()[argumentName]; } readonly #VERSION_NUMBERS: Array; readonly #DOCKER_IMAGE: RedisServerDockerConfig; constructor(config: TestUtilsConfig) { const { string, numbers } = TestUtils.#getVersion(config.dockerImageVersionArgument, config.defaultDockerVersion); this.#VERSION_NUMBERS = numbers; this.#DOCKER_IMAGE = { image: config.dockerImageName, version: string }; } isVersionGreaterThan(minimumVersion: Array | undefined): boolean { if (minimumVersion === undefined) return true; const lastIndex = Math.min(this.#VERSION_NUMBERS.length, minimumVersion.length) - 1; for (let i = 0; i < lastIndex; i++) { if (this.#VERSION_NUMBERS[i] > minimumVersion[i]) { return true; } else if (minimumVersion[i] > this.#VERSION_NUMBERS[i]) { return false; } } return this.#VERSION_NUMBERS[lastIndex] >= minimumVersion[lastIndex]; } isVersionGreaterThanHook(minimumVersion: Array | undefined): void { const isVersionGreaterThan = this.isVersionGreaterThan.bind(this); before(function () { if (!isVersionGreaterThan(minimumVersion)) { return this.skip(); } }); } testWithClient< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( title: string, fn: (client: RedisClientType) => unknown, options: ClientTestOptions ): void { let dockerPromise: ReturnType; if (this.isVersionGreaterThan(options.minimumDockerVersion)) { const dockerImage = this.#DOCKER_IMAGE; before(function () { this.timeout(30000); dockerPromise = spawnRedisServer(dockerImage, options.serverArguments); return dockerPromise; }); } it(title, async function() { if (!dockerPromise) return this.skip(); const client = RedisClient.create({ ...options?.clientOptions, socket: { ...options?.clientOptions?.socket, port: (await dockerPromise).port } }); if (options.disableClientSetup) { return fn(client); } await client.connect(); try { await client.flushAll(); await fn(client); } finally { if (client.isOpen) { await client.flushAll(); await client.disconnect(); } } }); } static async #clusterFlushAll< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >(cluster: RedisClusterType): Promise { await Promise.all( cluster.getMasters().map(({ client }) => client.flushAll()) ); } testWithCluster< M extends RedisModules, F extends RedisFunctions, S extends RedisScripts >( title: string, fn: (cluster: RedisClusterType) => unknown, options: ClusterTestOptions ): void { let dockersPromise: ReturnType; if (this.isVersionGreaterThan(options.minimumDockerVersion)) { const dockerImage = this.#DOCKER_IMAGE; before(function () { this.timeout(30000); dockersPromise = spawnRedisCluster({ ...dockerImage, numberOfNodes: options?.numberOfNodes }, options.serverArguments); return dockersPromise; }); } it(title, async function () { if (!dockersPromise) return this.skip(); const dockers = await dockersPromise, cluster = RedisCluster.create({ ...options.clusterConfiguration, rootNodes: dockers.map(({ port }) => ({ socket: { port } })) }); await cluster.connect(); try { await TestUtils.#clusterFlushAll(cluster); await fn(cluster); } finally { await TestUtils.#clusterFlushAll(cluster); await cluster.disconnect(); } }); } } node-redis-redis-4.5.1/packages/test-utils/package.json000066400000000000000000000010411433774114400230430ustar00rootroot00000000000000{ "name": "@redis/test-utils", "private": true, "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { "build": "tsc" }, "peerDependencies": { "@redis/client": "^1.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^10.0.0", "@types/node": "^18.11.6", "@types/yargs": "^17.0.13", "mocha": "^10.1.0", "nyc": "^15.1.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typescript": "^4.8.4", "yargs": "^17.6.0" } } node-redis-redis-4.5.1/packages/test-utils/tsconfig.json000066400000000000000000000002071433774114400232670ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./lib/**/*.ts" ] } node-redis-redis-4.5.1/packages/time-series/000077500000000000000000000000001433774114400206725ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/time-series/.npmignore000066400000000000000000000001071433774114400226670ustar00rootroot00000000000000.nyc_output/ coverage/ lib/ .nycrc.json .release-it.json tsconfig.json node-redis-redis-4.5.1/packages/time-series/.nycrc.json000066400000000000000000000001511433774114400227560ustar00rootroot00000000000000{ "extends": "@istanbuljs/nyc-config-typescript", "exclude": ["**/*.spec.ts", "lib/test-utils.ts"] } node-redis-redis-4.5.1/packages/time-series/.release-it.json000066400000000000000000000003131433774114400236720ustar00rootroot00000000000000{ "git": { "tagName": "time-series@${version}", "commitMessage": "Release ${tagName}", "tagAnnotation": "Release ${tagName}" }, "npm": { "publishArgs": ["--access", "public"] } } node-redis-redis-4.5.1/packages/time-series/README.md000066400000000000000000000121451433774114400221540ustar00rootroot00000000000000# @redis/time-series This package provides support for the [RedisTimeSeries](https://redistimeseries.io) module, which adds a time series data structure to Redis. It extends the [Node Redis client](https://github.com/redis/node-redis) to include functions for each of the RedisTimeSeries commands. To use these extra commands, your Redis server must have the RedisTimeSeries module installed. ## Usage For a complete example, see [`time-series.js`](https://github.com/redis/node-redis/blob/master/examples/time-series.js) in the Node Redis examples folder. ### Creating Time Series data structure in Redis The [`TS.CREATE`](https://oss.redis.com/redistimeseries/commands/#tscreate) command creates a new time series. Here, we'll create a new time series "`temperature`": ```javascript import { createClient } from 'redis'; import { TimeSeriesDuplicatePolicies, TimeSeriesEncoding, TimeSeriesAggregationType } from '@redis/time-series'; ... const created = await client.ts.create('temperature', { RETENTION: 86400000, // 1 day in milliseconds ENCODING: TimeSeriesEncoding.UNCOMPRESSED, // No compression - When not specified, the option is set to COMPRESSED DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.BLOCK, // No duplicates - When not specified: set to the global DUPLICATE_POLICY configuration of the database (which by default, is BLOCK). }); if (created === 'OK') { console.log('Created timeseries.'); } else { console.log('Error creating timeseries :('); process.exit(1); } ``` ### Adding new value to a Time Series data structure in Redis With RedisTimeSeries, we can add a single value to time series data structure using the [`TS.ADD`](https://redis.io/commands/ts.add/) command and if we would like to add multiple values we can use the [`TS.MADD`](https://redis.io/commands/ts.madd/) command. ```javascript let value = Math.floor(Math.random() * 1000) + 1; // Random data point value let currentTimestamp = 1640995200000; // Jan 1 2022 00:00:00 let num = 0; while (num < 10000) { // Add a new value to the timeseries, providing our own timestamp: // https://redis.io/commands/ts.add/ await client.ts.add('temperature', currentTimestamp, value); console.log(`Added timestamp ${currentTimestamp}, value ${value}.`); num += 1; value = Math.floor(Math.random() * 1000) + 1; // Get another random value currentTimestamp += 1000; // Move on one second. } // Add multiple values to the timeseries in round trip to the server: // https://redis.io/commands/ts.madd/ const response = await client.ts.mAdd([{ key: 'temperature', timestamp: currentTimestamp + 60000, value: Math.floor(Math.random() * 1000) + 1 }, { key: 'temperature', timestamp: currentTimestamp + 120000, value: Math.floor(Math.random() * 1000) + 1 }]); ``` ### Retrieving Time Series data from Redis With RedisTimeSeries, we can retrieve the time series data using the [`TS.RANGE`](https://redis.io/commands/ts.range/) command by passing the criteria as follows: ```javascript // Query the timeseries with TS.RANGE: // https://redis.io/commands/ts.range/ const fromTimestamp = 1640995200000; // Jan 1 2022 00:00:00 const toTimestamp = 1640995260000; // Jan 1 2022 00:01:00 const rangeResponse = await client.ts.range('temperature', fromTimestamp, toTimestamp, { // Group into 10 second averages. AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 10000 } }); console.log('RANGE RESPONSE:'); // rangeResponse looks like: // [ // { timestamp: 1640995200000, value: 356.8 }, // { timestamp: 1640995210000, value: 534.8 }, // { timestamp: 1640995220000, value: 481.3 }, // { timestamp: 1640995230000, value: 437 }, // { timestamp: 1640995240000, value: 507.3 }, // { timestamp: 1640995250000, value: 581.2 }, // { timestamp: 1640995260000, value: 600 } // ] ``` ### Altering Time Series data Stored in Redis RedisTimeSeries includes commands that can update values in a time series data structure. Using the [`TS.ALTER`](https://redis.io/commands/ts.alter/) command, we can update time series retention like this: ```javascript // https://redis.io/commands/ts.alter/ const alterResponse = await client.ts.alter('temperature', { RETENTION: 0 // Keep the entries forever }); ``` ### Retrieving Information about the timeseries Stored in Redis RedisTimeSeries also includes commands that can help to view the information on the state of a time series. Using the [`TS.INFO`](https://redis.io/commands/ts.info/) command, we can view timeseries information like this: ```javascript // Get some information about the state of the timeseries. // https://redis.io/commands/ts.info/ const tsInfo = await client.ts.info('temperature'); // tsInfo looks like this: // { // totalSamples: 1440, // memoryUsage: 28904, // firstTimestamp: 1641508920000, // lastTimestamp: 1641595320000, // retentionTime: 86400000, // chunkCount: 7, // chunkSize: 4096, // chunkType: 'uncompressed', // duplicatePolicy: 'block', // labels: [], // sourceKey: null, // rules: [] // } ``` node-redis-redis-4.5.1/packages/time-series/lib/000077500000000000000000000000001433774114400214405ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/time-series/lib/commands/000077500000000000000000000000001433774114400232415ustar00rootroot00000000000000node-redis-redis-4.5.1/packages/time-series/lib/commands/ADD.spec.ts000066400000000000000000000052161433774114400251360ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ADD'; import { TimeSeriesDuplicatePolicies, TimeSeriesEncoding } from '.'; describe('ADD', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key', '*', 1), ['TS.ADD', 'key', '*', '1'] ); }); it('with RETENTION', () => { assert.deepEqual( transformArguments('key', '*', 1, { RETENTION: 1 }), ['TS.ADD', 'key', '*', '1', 'RETENTION', '1'] ); }); it('with ENCODING', () => { assert.deepEqual( transformArguments('key', '*', 1, { ENCODING: TimeSeriesEncoding.UNCOMPRESSED }), ['TS.ADD', 'key', '*', '1', 'ENCODING', 'UNCOMPRESSED'] ); }); it('with CHUNK_SIZE', () => { assert.deepEqual( transformArguments('key', '*', 1, { CHUNK_SIZE: 1 }), ['TS.ADD', 'key', '*', '1', 'CHUNK_SIZE', '1'] ); }); it('with ON_DUPLICATE', () => { assert.deepEqual( transformArguments('key', '*', 1, { ON_DUPLICATE: TimeSeriesDuplicatePolicies.BLOCK }), ['TS.ADD', 'key', '*', '1', 'ON_DUPLICATE', 'BLOCK'] ); }); it('with LABELS', () => { assert.deepEqual( transformArguments('key', '*', 1, { LABELS: { label: 'value' } }), ['TS.ADD', 'key', '*', '1', 'LABELS', 'label', 'value'] ); }); it('with RETENTION, ENCODING, CHUNK_SIZE, ON_DUPLICATE, LABELS', () => { assert.deepEqual( transformArguments('key', '*', 1, { RETENTION: 1, ENCODING: TimeSeriesEncoding.UNCOMPRESSED, CHUNK_SIZE: 1, ON_DUPLICATE: TimeSeriesDuplicatePolicies.BLOCK, LABELS: { label: 'value' } }), ['TS.ADD', 'key', '*', '1', 'RETENTION', '1', 'ENCODING', 'UNCOMPRESSED', 'CHUNK_SIZE', '1', 'ON_DUPLICATE', 'BLOCK', 'LABELS', 'label', 'value'] ); }); }); testUtils.testWithClient('client.ts.add', async client => { assert.equal( await client.ts.add('key', 0, 1), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/ADD.ts000066400000000000000000000020761433774114400242060ustar00rootroot00000000000000import { transformTimestampArgument, pushRetentionArgument, TimeSeriesEncoding, pushEncodingArgument, pushChunkSizeArgument, TimeSeriesDuplicatePolicies, Labels, pushLabelsArgument, Timestamp, } from '.'; interface AddOptions { RETENTION?: number; ENCODING?: TimeSeriesEncoding; CHUNK_SIZE?: number; ON_DUPLICATE?: TimeSeriesDuplicatePolicies; LABELS?: Labels; } export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, timestamp: Timestamp, value: number, options?: AddOptions): Array { const args = [ 'TS.ADD', key, transformTimestampArgument(timestamp), value.toString() ]; pushRetentionArgument(args, options?.RETENTION); pushEncodingArgument(args, options?.ENCODING); pushChunkSizeArgument(args, options?.CHUNK_SIZE); if (options?.ON_DUPLICATE) { args.push('ON_DUPLICATE', options.ON_DUPLICATE); } pushLabelsArgument(args, options?.LABELS); return args; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/time-series/lib/commands/ALTER.spec.ts000066400000000000000000000043401433774114400254120ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { TimeSeriesDuplicatePolicies } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './ALTER'; describe('ALTER', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key'), ['TS.ALTER', 'key'] ); }); it('with RETENTION', () => { assert.deepEqual( transformArguments('key', { RETENTION: 1 }), ['TS.ALTER', 'key', 'RETENTION', '1'] ); }); it('with CHUNK_SIZE', () => { assert.deepEqual( transformArguments('key', { CHUNK_SIZE: 1 }), ['TS.ALTER', 'key', 'CHUNK_SIZE', '1'] ); }); it('with DUPLICATE_POLICY', () => { assert.deepEqual( transformArguments('key', { DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.BLOCK }), ['TS.ALTER', 'key', 'DUPLICATE_POLICY', 'BLOCK'] ); }); it('with LABELS', () => { assert.deepEqual( transformArguments('key', { LABELS: { label: 'value' } }), ['TS.ALTER', 'key', 'LABELS', 'label', 'value'] ); }); it('with RETENTION, CHUNK_SIZE, DUPLICATE_POLICY, LABELS', () => { assert.deepEqual( transformArguments('key', { RETENTION: 1, CHUNK_SIZE: 1, DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.BLOCK, LABELS: { label: 'value' } }), ['TS.ALTER', 'key', 'RETENTION', '1', 'CHUNK_SIZE', '1', 'DUPLICATE_POLICY', 'BLOCK', 'LABELS', 'label', 'value'] ); }); }); testUtils.testWithClient('client.ts.alter', async client => { await client.ts.create('key'); assert.equal( await client.ts.alter('key', { RETENTION: 1 }), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/ALTER.ts000066400000000000000000000013441433774114400244620ustar00rootroot00000000000000import { pushRetentionArgument, Labels, pushLabelsArgument, TimeSeriesDuplicatePolicies, pushChunkSizeArgument, pushDuplicatePolicy } from '.'; export const FIRST_KEY_INDEX = 1; interface AlterOptions { RETENTION?: number; CHUNK_SIZE?: number; DUPLICATE_POLICY?: TimeSeriesDuplicatePolicies; LABELS?: Labels; } export function transformArguments(key: string, options?: AlterOptions): Array { const args = ['TS.ALTER', key]; pushRetentionArgument(args, options?.RETENTION); pushChunkSizeArgument(args, options?.CHUNK_SIZE); pushDuplicatePolicy(args, options?.DUPLICATE_POLICY); pushLabelsArgument(args, options?.LABELS); return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/time-series/lib/commands/CREATE.spec.ts000066400000000000000000000051061433774114400255070ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { TimeSeriesDuplicatePolicies, TimeSeriesEncoding } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CREATE'; describe('CREATE', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key'), ['TS.CREATE', 'key'] ); }); it('with RETENTION', () => { assert.deepEqual( transformArguments('key', { RETENTION: 1 }), ['TS.CREATE', 'key', 'RETENTION', '1'] ); }); it('with ENCODING', () => { assert.deepEqual( transformArguments('key', { ENCODING: TimeSeriesEncoding.UNCOMPRESSED }), ['TS.CREATE', 'key', 'ENCODING', 'UNCOMPRESSED'] ); }); it('with CHUNK_SIZE', () => { assert.deepEqual( transformArguments('key', { CHUNK_SIZE: 1 }), ['TS.CREATE', 'key', 'CHUNK_SIZE', '1'] ); }); it('with DUPLICATE_POLICY', () => { assert.deepEqual( transformArguments('key', { DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.BLOCK }), ['TS.CREATE', 'key', 'DUPLICATE_POLICY', 'BLOCK'] ); }); it('with LABELS', () => { assert.deepEqual( transformArguments('key', { LABELS: { label: 'value' } }), ['TS.CREATE', 'key', 'LABELS', 'label', 'value'] ); }); it('with RETENTION, ENCODING, CHUNK_SIZE, DUPLICATE_POLICY, LABELS', () => { assert.deepEqual( transformArguments('key', { RETENTION: 1, ENCODING: TimeSeriesEncoding.UNCOMPRESSED, CHUNK_SIZE: 1, DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.BLOCK, LABELS: { label: 'value' } }), ['TS.CREATE', 'key', 'RETENTION', '1', 'ENCODING', 'UNCOMPRESSED', 'CHUNK_SIZE', '1', 'DUPLICATE_POLICY', 'BLOCK', 'LABELS', 'label', 'value'] ); }); }); testUtils.testWithClient('client.ts.create', async client => { assert.equal( await client.ts.create('key'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/CREATE.ts000066400000000000000000000016101433774114400245520ustar00rootroot00000000000000import { pushRetentionArgument, TimeSeriesEncoding, pushEncodingArgument, pushChunkSizeArgument, TimeSeriesDuplicatePolicies, Labels, pushLabelsArgument, pushDuplicatePolicy } from '.'; export const FIRST_KEY_INDEX = 1; interface CreateOptions { RETENTION?: number; ENCODING?: TimeSeriesEncoding; CHUNK_SIZE?: number; DUPLICATE_POLICY?: TimeSeriesDuplicatePolicies; LABELS?: Labels; } export function transformArguments(key: string, options?: CreateOptions): Array { const args = ['TS.CREATE', key]; pushRetentionArgument(args, options?.RETENTION); pushEncodingArgument(args, options?.ENCODING); pushChunkSizeArgument(args, options?.CHUNK_SIZE); pushDuplicatePolicy(args, options?.DUPLICATE_POLICY); pushLabelsArgument(args, options?.LABELS); return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/time-series/lib/commands/CREATERULE.spec.ts000066400000000000000000000023171433774114400262000ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { TimeSeriesAggregationType } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './CREATERULE'; describe('CREATERULE', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1), ['TS.CREATERULE', 'source', 'destination', 'AGGREGATION', 'AVG', '1'] ); }); it('with alignTimestamp', () => { assert.deepEqual( transformArguments('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1, 1), ['TS.CREATERULE', 'source', 'destination', 'AGGREGATION', 'AVG', '1', '1'] ); }); }); testUtils.testWithClient('client.ts.createRule', async client => { await Promise.all([ client.ts.create('source'), client.ts.create('destination') ]); assert.equal( await client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/CREATERULE.ts000066400000000000000000000011511433774114400252420ustar00rootroot00000000000000import { TimeSeriesAggregationType } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments( sourceKey: string, destinationKey: string, aggregationType: TimeSeriesAggregationType, bucketDuration: number, alignTimestamp?: number ): Array { const args = [ 'TS.CREATERULE', sourceKey, destinationKey, 'AGGREGATION', aggregationType, bucketDuration.toString() ]; if (alignTimestamp) { args.push(alignTimestamp.toString()); } return args; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/time-series/lib/commands/DECRBY.spec.ts000066400000000000000000000047021433774114400255150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DECRBY'; describe('DECRBY', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key', 1), ['TS.DECRBY', 'key', '1'] ); }); it('with TIMESTAMP', () => { assert.deepEqual( transformArguments('key', 1, { TIMESTAMP: '*' }), ['TS.DECRBY', 'key', '1', 'TIMESTAMP', '*'] ); }); it('with RETENTION', () => { assert.deepEqual( transformArguments('key', 1, { RETENTION: 1 }), ['TS.DECRBY', 'key', '1', 'RETENTION', '1'] ); }); it('with UNCOMPRESSED', () => { assert.deepEqual( transformArguments('key', 1, { UNCOMPRESSED: true }), ['TS.DECRBY', 'key', '1', 'UNCOMPRESSED'] ); }); it('with CHUNK_SIZE', () => { assert.deepEqual( transformArguments('key', 1, { CHUNK_SIZE: 100 }), ['TS.DECRBY', 'key', '1', 'CHUNK_SIZE', '100'] ); }); it('with LABELS', () => { assert.deepEqual( transformArguments('key', 1, { LABELS: { label: 'value' } }), ['TS.DECRBY', 'key', '1', 'LABELS', 'label', 'value'] ); }); it('with TIMESTAMP, RETENTION, UNCOMPRESSED, CHUNK_SIZE and LABELS', () => { assert.deepEqual( transformArguments('key', 1, { TIMESTAMP: '*', RETENTION: 1, UNCOMPRESSED: true, CHUNK_SIZE: 2, LABELS: { label: 'value' } }), ['TS.DECRBY', 'key', '1', 'TIMESTAMP', '*', 'RETENTION', '1', 'UNCOMPRESSED', 'CHUNK_SIZE', '2', 'LABELS', 'label', 'value'] ); }); }); testUtils.testWithClient('client.ts.decrBy', async client => { assert.equal( await client.ts.decrBy('key', 1, { TIMESTAMP: 0 }), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/DECRBY.ts000066400000000000000000000006371433774114400245670ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { IncrDecrOptions, transformIncrDecrArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, value: number, options?: IncrDecrOptions): RedisCommandArguments { return transformIncrDecrArguments('TS.DECRBY', key, value, options); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/time-series/lib/commands/DEL.spec.ts000066400000000000000000000010711433774114400251450ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DEL'; describe('DEL', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '-', '+'), ['TS.DEL', 'key', '-', '+'] ); }); testUtils.testWithClient('client.ts.del', async client => { await client.ts.create('key'); assert.equal( await client.ts.del('key', '-', '+'), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/DEL.ts000066400000000000000000000007561433774114400242250ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { Timestamp, transformTimestampArgument } from '.'; export const FIRTS_KEY_INDEX = 1; export function transformArguments(key: string, fromTimestamp: Timestamp, toTimestamp: Timestamp): RedisCommandArguments { return [ 'TS.DEL', key, transformTimestampArgument(fromTimestamp), transformTimestampArgument(toTimestamp) ]; } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/time-series/lib/commands/DELETERULE.spec.ts000066400000000000000000000015341433774114400261770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { TimeSeriesAggregationType } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './DELETERULE'; describe('DELETERULE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('source', 'destination'), ['TS.DELETERULE', 'source', 'destination'] ); }); testUtils.testWithClient('client.ts.deleteRule', async client => { await Promise.all([ client.ts.create('source'), client.ts.create('destination'), client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1) ]); assert.equal( await client.ts.deleteRule('source', 'destination'), 'OK' ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/DELETERULE.ts000066400000000000000000000004141433774114400252420ustar00rootroot00000000000000export const FIRST_KEY_INDEX = 1; export function transformArguments(sourceKey: string, destinationKey: string): Array { return [ 'TS.DELETERULE', sourceKey, destinationKey ]; } export declare function transformReply(): 'OK'; node-redis-redis-4.5.1/packages/time-series/lib/commands/GET.spec.ts000066400000000000000000000023401433774114400251600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './GET'; describe('GET', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key'), ['TS.GET', 'key'] ); }); it('with LATEST', () => { assert.deepEqual( transformArguments('key', { LATEST: true }), ['TS.GET', 'key', 'LATEST'] ); }); }); describe('client.ts.get', () => { testUtils.testWithClient('null', async client => { await client.ts.create('key'); assert.equal( await client.ts.get('key'), null ); }, GLOBAL.SERVERS.OPEN); testUtils.testWithClient('with samples', async client => { await client.ts.add('key', 0, 1); assert.deepEqual( await client.ts.get('key'), { timestamp: 0, value: 1 } ); }, GLOBAL.SERVERS.OPEN); }); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/GET.ts000066400000000000000000000011431433774114400242270ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushLatestArgument, SampleRawReply, SampleReply, transformSampleReply } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; interface GetOptions { LATEST?: boolean; } export function transformArguments(key: string, options?: GetOptions): RedisCommandArguments { return pushLatestArgument(['TS.GET', key], options?.LATEST); } export function transformReply(reply: [] | SampleRawReply): null | SampleReply { if (reply.length === 0) return null; return transformSampleReply(reply); } node-redis-redis-4.5.1/packages/time-series/lib/commands/INCRBY.spec.ts000066400000000000000000000053101433774114400255270ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './INCRBY'; describe('INCRBY', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key', 1), ['TS.INCRBY', 'key', '1'] ); }); it('with TIMESTAMP', () => { assert.deepEqual( transformArguments('key', 1, { TIMESTAMP: '*' }), ['TS.INCRBY', 'key', '1', 'TIMESTAMP', '*'] ); }); it('with RETENTION', () => { assert.deepEqual( transformArguments('key', 1, { RETENTION: 1 }), ['TS.INCRBY', 'key', '1', 'RETENTION', '1'] ); }); it('with UNCOMPRESSED', () => { assert.deepEqual( transformArguments('key', 1, { UNCOMPRESSED: true }), ['TS.INCRBY', 'key', '1', 'UNCOMPRESSED'] ); }); it('without UNCOMPRESSED', () => { assert.deepEqual( transformArguments('key', 1, { UNCOMPRESSED: false }), ['TS.INCRBY', 'key', '1'] ); }); it('with CHUNK_SIZE', () => { assert.deepEqual( transformArguments('key', 1, { CHUNK_SIZE: 1 }), ['TS.INCRBY', 'key', '1', 'CHUNK_SIZE', '1'] ); }); it('with LABELS', () => { assert.deepEqual( transformArguments('key', 1, { LABELS: { label: 'value' } }), ['TS.INCRBY', 'key', '1', 'LABELS', 'label', 'value'] ); }); it('with TIMESTAMP, RETENTION, UNCOMPRESSED, CHUNK_SIZE and LABELS', () => { assert.deepEqual( transformArguments('key', 1, { TIMESTAMP: '*', RETENTION: 1, UNCOMPRESSED: true, CHUNK_SIZE: 1, LABELS: { label: 'value' } }), ['TS.INCRBY', 'key', '1', 'TIMESTAMP', '*', 'RETENTION', '1', 'UNCOMPRESSED', 'CHUNK_SIZE', '1', 'LABELS', 'label', 'value'] ); }); }); testUtils.testWithClient('client.ts.incrBy', async client => { assert.equal( await client.ts.incrBy('key', 1, { TIMESTAMP: 0 }), 0 ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/INCRBY.ts000066400000000000000000000006371433774114400246050ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { IncrDecrOptions, transformIncrDecrArguments } from '.'; export const FIRST_KEY_INDEX = 1; export function transformArguments(key: string, value: number, options?: IncrDecrOptions): RedisCommandArguments { return transformIncrDecrArguments('TS.INCRBY', key, value, options); } export declare function transformReply(): number; node-redis-redis-4.5.1/packages/time-series/lib/commands/INFO.spec.ts000066400000000000000000000040201433774114400252710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { TimeSeriesAggregationType, TimeSeriesDuplicatePolicies } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { InfoReply, transformArguments } from './INFO'; describe('INFO', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TS.INFO', 'key'] ); }); testUtils.testWithClient('client.ts.info', async client => { await Promise.all([ client.ts.create('key', { LABELS: { id: '1' }, DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.LAST }), client.ts.create('key2'), client.ts.createRule('key', 'key2', TimeSeriesAggregationType.COUNT, 5), client.ts.add('key', 1, 10) ]); assertInfo(await client.ts.info('key')); }, GLOBAL.SERVERS.OPEN); }); export function assertInfo(info: InfoReply): void { assert.equal(typeof info.totalSamples, 'number'); assert.equal(typeof info.memoryUsage, 'number'); assert.equal(typeof info.firstTimestamp, 'number'); assert.equal(typeof info.lastTimestamp, 'number'); assert.equal(typeof info.retentionTime, 'number'); assert.equal(typeof info.chunkCount, 'number'); assert.equal(typeof info.chunkSize, 'number'); assert.equal(typeof info.chunkType, 'string'); assert.equal(typeof info.duplicatePolicy, 'string'); assert.ok(Array.isArray(info.labels)); for (const label of info.labels) { assert.equal(typeof label, 'object'); assert.equal(typeof label.name, 'string'); assert.equal(typeof label.value, 'string'); } assert.ok(Array.isArray(info.rules)); for (const rule of info.rules) { assert.equal(typeof rule, 'object'); assert.equal(typeof rule.aggregationType, 'string'); assert.equal(typeof rule.key, 'string'); assert.equal(typeof rule.timeBucket, 'number'); } assert.ok(info.sourceKey === null || typeof info.sourceKey === 'string'); } node-redis-redis-4.5.1/packages/time-series/lib/commands/INFO.ts000066400000000000000000000036601433774114400243510ustar00rootroot00000000000000import { TimeSeriesAggregationType, TimeSeriesDuplicatePolicies } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments(key: string): Array { return ['TS.INFO', key]; } export type InfoRawReply = [ 'totalSamples', number, 'memoryUsage', number, 'firstTimestamp', number, 'lastTimestamp', number, 'retentionTime', number, 'chunkCount', number, 'chunkSize', number, 'chunkType', string, 'duplicatePolicy', TimeSeriesDuplicatePolicies | null, 'labels', Array<[name: string, value: string]>, 'sourceKey', string | null, 'rules', Array<[key: string, timeBucket: number, aggregationType: TimeSeriesAggregationType]> ]; export interface InfoReply { totalSamples: number; memoryUsage: number; firstTimestamp: number; lastTimestamp: number; retentionTime: number; chunkCount: number; chunkSize: number; chunkType: string; duplicatePolicy: TimeSeriesDuplicatePolicies | null; labels: Array<{ name: string; value: string; }>; sourceKey: string | null; rules: Array<{ key: string; timeBucket: number; aggregationType: TimeSeriesAggregationType }>; } export function transformReply(reply: InfoRawReply): InfoReply { return { totalSamples: reply[1], memoryUsage: reply[3], firstTimestamp: reply[5], lastTimestamp: reply[7], retentionTime: reply[9], chunkCount: reply[11], chunkSize: reply[13], chunkType: reply[15], duplicatePolicy: reply[17], labels: reply[19].map(([name, value]) => ({ name, value })), sourceKey: reply[21], rules: reply[23].map(([key, timeBucket, aggregationType]) => ({ key, timeBucket, aggregationType })) }; } node-redis-redis-4.5.1/packages/time-series/lib/commands/INFO_DEBUG.spec.ts000066400000000000000000000027771433774114400262200ustar00rootroot00000000000000import { strict as assert } from 'assert'; import { TimeSeriesAggregationType, TimeSeriesDuplicatePolicies } from '.'; import testUtils, { GLOBAL } from '../test-utils'; import { assertInfo } from './INFO.spec'; import { transformArguments } from './INFO_DEBUG'; describe('INFO_DEBUG', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key'), ['TS.INFO', 'key', 'DEBUG'] ); }); testUtils.testWithClient('client.ts.get', async client => { await Promise.all([ client.ts.create('key', { LABELS: { id: '1' }, DUPLICATE_POLICY: TimeSeriesDuplicatePolicies.LAST }), client.ts.create('key2'), client.ts.createRule('key', 'key2', TimeSeriesAggregationType.COUNT, 5), client.ts.add('key', 1, 10) ]); const infoDebug = await client.ts.infoDebug('key'); assertInfo(infoDebug); assert.equal(typeof infoDebug.keySelfName, 'string'); assert.ok(Array.isArray(infoDebug.chunks)); for (const chunk of infoDebug.chunks) { assert.equal(typeof chunk, 'object'); assert.equal(typeof chunk.startTimestamp, 'number'); assert.equal(typeof chunk.endTimestamp, 'number'); assert.equal(typeof chunk.samples, 'number'); assert.equal(typeof chunk.size, 'number'); assert.equal(typeof chunk.bytesPerSample, 'string'); } }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/INFO_DEBUG.ts000066400000000000000000000025531433774114400252570ustar00rootroot00000000000000import { transformArguments as transformInfoArguments, InfoRawReply, InfoReply, transformReply as transformInfoReply } from './INFO'; export { IS_READ_ONLY, FIRST_KEY_INDEX } from './INFO'; export function transformArguments(key: string): Array { const args = transformInfoArguments(key); args.push('DEBUG'); return args; } type InfoDebugRawReply = [ ...InfoRawReply, 'keySelfName', string, 'chunks', Array<[ 'startTimestamp', number, 'endTimestamp', number, 'samples', number, 'size', number, 'bytesPerSample', string ]> ]; interface InfoDebugReply extends InfoReply { keySelfName: string; chunks: Array<{ startTimestamp: number; endTimestamp: number; samples: number; size: number; bytesPerSample: string; }>; } export function transformReply(rawReply: InfoDebugRawReply): InfoDebugReply { const reply = transformInfoReply(rawReply as unknown as InfoRawReply); (reply as InfoDebugReply).keySelfName = rawReply[25]; (reply as InfoDebugReply).chunks = rawReply[27].map(chunk => ({ startTimestamp: chunk[1], endTimestamp: chunk[3], samples: chunk[5], size: chunk[7], bytesPerSample: chunk[9] })); return reply as InfoDebugReply; } node-redis-redis-4.5.1/packages/time-series/lib/commands/MADD.spec.ts000066400000000000000000000017471433774114400252600ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MADD'; describe('MADD', () => { it('transformArguments', () => { assert.deepEqual( transformArguments([{ key: '1', timestamp: 0, value: 0 }, { key: '2', timestamp: 1, value: 1 }]), ['TS.MADD', '1', '0', '0', '2', '1', '1'] ); }); // Should we check empty array? testUtils.testWithClient('client.ts.mAdd', async client => { await client.ts.create('key'); assert.deepEqual( await client.ts.mAdd([{ key: 'key', timestamp: 0, value: 0 }, { key: 'key', timestamp: 1, value: 1 }]), [0, 1] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MADD.ts000066400000000000000000000010541433774114400243160ustar00rootroot00000000000000import { Timestamp, transformTimestampArgument } from '.'; export const FIRST_KEY_INDEX = 1; interface MAddSample { key: string; timestamp: Timestamp; value: number; } export function transformArguments(toAdd: Array): Array { const args = ['TS.MADD']; for (const { key, timestamp, value } of toAdd) { args.push( key, transformTimestampArgument(timestamp), value.toString() ); } return args; } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/time-series/lib/commands/MGET.spec.ts000066400000000000000000000021401433774114400252730ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MGET'; describe('MGET', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('label=value'), ['TS.MGET', 'FILTER', 'label=value'] ); }); it('with LATEST', () => { assert.deepEqual( transformArguments('label=value', { LATEST: true }), ['TS.MGET', 'LATEST', 'FILTER', 'label=value'] ); }); }); testUtils.testWithClient('client.ts.mGet', async client => { await client.ts.add('key', 0, 0, { LABELS: { label: 'value' } }); assert.deepEqual( await client.ts.mGet('label=value'), [{ key: 'key', sample: { timestamp: 0, value: 0 } }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MGET.ts000066400000000000000000000015541433774114400243520ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { Filter, pushFilterArgument, pushLatestArgument, RawLabels, SampleRawReply, SampleReply, transformSampleReply } from '.'; export const IS_READ_ONLY = true; export interface MGetOptions { LATEST?: boolean; } export function transformArguments(filter: Filter, options?: MGetOptions): RedisCommandArguments { const args = pushLatestArgument(['TS.MGET'], options?.LATEST); return pushFilterArgument(args, filter); } export type MGetRawReply = Array<[ key: string, labels: RawLabels, sample: SampleRawReply ]>; export interface MGetReply { key: string, sample: SampleReply } export function transformReply(reply: MGetRawReply): Array { return reply.map(([key, _, sample]) => ({ key, sample: transformSampleReply(sample) })); } node-redis-redis-4.5.1/packages/time-series/lib/commands/MGET_WITHLABELS.spec.ts000066400000000000000000000023061433774114400270150ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MGET_WITHLABELS'; describe('MGET_WITHLABELS', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('label=value'), ['TS.MGET', 'WITHLABELS', 'FILTER', 'label=value'] ); }); it('with SELECTED_LABELS', () => { assert.deepEqual( transformArguments('label=value', { SELECTED_LABELS: 'label' }), ['TS.MGET', 'SELECTED_LABELS', 'label', 'FILTER', 'label=value'] ); }); }); testUtils.testWithClient('client.ts.mGetWithLabels', async client => { await client.ts.add('key', 0, 0, { LABELS: { label: 'value' } }); assert.deepEqual( await client.ts.mGetWithLabels('label=value'), [{ key: 'key', labels: { label: 'value'}, sample: { timestamp: 0, value: 0 } }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MGET_WITHLABELS.ts000066400000000000000000000017631433774114400260720ustar00rootroot00000000000000import { SelectedLabels, pushWithLabelsArgument, Labels, transformLablesReply, transformSampleReply, Filter, pushFilterArgument } from '.'; import { MGetOptions, MGetRawReply, MGetReply } from './MGET'; import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; export const IS_READ_ONLY = true; interface MGetWithLabelsOptions extends MGetOptions { SELECTED_LABELS?: SelectedLabels; } export function transformArguments( filter: Filter, options?: MGetWithLabelsOptions ): RedisCommandArguments { const args = pushWithLabelsArgument(['TS.MGET'], options?.SELECTED_LABELS); return pushFilterArgument(args, filter); } export interface MGetWithLabelsReply extends MGetReply { labels: Labels; }; export function transformReply(reply: MGetRawReply): Array { return reply.map(([key, labels, sample]) => ({ key, labels: transformLablesReply(labels), sample: transformSampleReply(sample) })); } node-redis-redis-4.5.1/packages/time-series/lib/commands/MRANGE.spec.ts000066400000000000000000000030771433774114400255220ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MRANGE'; import { TimeSeriesAggregationType, TimeSeriesReducers } from '.'; describe('MRANGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('-', '+', 'label=value', { FILTER_BY_TS: [0], FILTER_BY_VALUE: { min: 0, max: 1 }, COUNT: 1, ALIGN: '-', AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 }, GROUPBY: { label: 'label', reducer: TimeSeriesReducers.SUM }, }), ['TS.MRANGE', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE', '0', '1', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1', 'FILTER', 'label=value', 'GROUPBY', 'label', 'REDUCE', 'SUM'] ); }); testUtils.testWithClient('client.ts.mRange', async client => { await client.ts.add('key', 0, 0, { LABELS: { label: 'value'} }); assert.deepEqual( await client.ts.mRange('-', '+', 'label=value', { COUNT: 1 }), [{ key: 'key', samples: [{ timestamp: 0, value: 0 }] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MRANGE.ts000066400000000000000000000010541433774114400245620ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { MRangeOptions, Timestamp, pushMRangeArguments, Filter } from '.'; export const IS_READ_ONLY = true; export function transformArguments( fromTimestamp: Timestamp, toTimestamp: Timestamp, filters: Filter, options?: MRangeOptions ): RedisCommandArguments { return pushMRangeArguments( ['TS.MRANGE'], fromTimestamp, toTimestamp, filters, options ); } export { transformMRangeReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/time-series/lib/commands/MRANGE_WITHLABELS.spec.ts000066400000000000000000000033351433774114400272350ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MRANGE_WITHLABELS'; import { TimeSeriesAggregationType, TimeSeriesReducers } from '.'; describe('MRANGE_WITHLABELS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('-', '+', 'label=value', { FILTER_BY_TS: [0], FILTER_BY_VALUE: { min: 0, max: 1 }, SELECTED_LABELS: ['label'], COUNT: 1, ALIGN: '-', AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 }, GROUPBY: { label: 'label', reducer: TimeSeriesReducers.SUM }, }), ['TS.MRANGE', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE', '0', '1', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1', 'SELECTED_LABELS', 'label', 'FILTER', 'label=value', 'GROUPBY', 'label', 'REDUCE', 'SUM'] ); }); testUtils.testWithClient('client.ts.mRangeWithLabels', async client => { await client.ts.add('key', 0, 0, { LABELS: { label: 'value'} }); assert.deepEqual( await client.ts.mRangeWithLabels('-', '+', 'label=value', { COUNT: 1 }), [{ key: 'key', labels: { label: 'value' }, samples: [{ timestamp: 0, value: 0 }] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MRANGE_WITHLABELS.ts000066400000000000000000000011461433774114400263020ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { Timestamp, MRangeWithLabelsOptions, pushMRangeWithLabelsArguments } from '.'; export const IS_READ_ONLY = true; export function transformArguments( fromTimestamp: Timestamp, toTimestamp: Timestamp, filters: string | Array, options?: MRangeWithLabelsOptions ): RedisCommandArguments { return pushMRangeWithLabelsArguments( ['TS.MRANGE'], fromTimestamp, toTimestamp, filters, options ); } export { transformMRangeWithLabelsReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/time-series/lib/commands/MREVRANGE.spec.ts000066400000000000000000000031161433774114400260710ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MREVRANGE'; import { TimeSeriesAggregationType, TimeSeriesReducers } from '.'; describe('MREVRANGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('-', '+', 'label=value', { FILTER_BY_TS: [0], FILTER_BY_VALUE: { min: 0, max: 1 }, COUNT: 1, ALIGN: '-', AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 }, GROUPBY: { label: 'label', reducer: TimeSeriesReducers.SUM }, }), ['TS.MREVRANGE', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE', '0', '1', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1', 'FILTER', 'label=value', 'GROUPBY', 'label', 'REDUCE', 'SUM'] ); }); testUtils.testWithClient('client.ts.mRevRange', async client => { await client.ts.add('key', 0, 0, { LABELS: { label: 'value'} }); assert.deepEqual( await client.ts.mRevRange('-', '+', 'label=value', { COUNT: 1 }), [{ key: 'key', samples: [{ timestamp: 0, value: 0 }] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MREVRANGE.ts000066400000000000000000000010571433774114400251420ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { MRangeOptions, Timestamp, pushMRangeArguments, Filter } from '.'; export const IS_READ_ONLY = true; export function transformArguments( fromTimestamp: Timestamp, toTimestamp: Timestamp, filters: Filter, options?: MRangeOptions ): RedisCommandArguments { return pushMRangeArguments( ['TS.MREVRANGE'], fromTimestamp, toTimestamp, filters, options ); } export { transformMRangeReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/time-series/lib/commands/MREVRANGE_WITHLABELS.spec.ts000066400000000000000000000033541433774114400276130ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './MREVRANGE_WITHLABELS'; import { TimeSeriesAggregationType, TimeSeriesReducers } from '.'; describe('MREVRANGE_WITHLABELS', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('-', '+', 'label=value', { FILTER_BY_TS: [0], FILTER_BY_VALUE: { min: 0, max: 1 }, SELECTED_LABELS: ['label'], COUNT: 1, ALIGN: '-', AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 }, GROUPBY: { label: 'label', reducer: TimeSeriesReducers.SUM }, }), ['TS.MREVRANGE', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE', '0', '1', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1', 'SELECTED_LABELS', 'label', 'FILTER', 'label=value', 'GROUPBY', 'label', 'REDUCE', 'SUM'] ); }); testUtils.testWithClient('client.ts.mRevRangeWithLabels', async client => { await client.ts.add('key', 0, 0, { LABELS: { label: 'value'} }); assert.deepEqual( await client.ts.mRevRangeWithLabels('-', '+', 'label=value', { COUNT: 1 }), [{ key: 'key', labels: { label: 'value' }, samples: [{ timestamp: 0, value: 0 }] }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/MREVRANGE_WITHLABELS.ts000066400000000000000000000011411433774114400266520ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { Timestamp, MRangeWithLabelsOptions, pushMRangeWithLabelsArguments, Filter } from '.'; export const IS_READ_ONLY = true; export function transformArguments( fromTimestamp: Timestamp, toTimestamp: Timestamp, filters: Filter, options?: MRangeWithLabelsOptions ): RedisCommandArguments { return pushMRangeWithLabelsArguments( ['TS.MREVRANGE'], fromTimestamp, toTimestamp, filters, options ); } export { transformMRangeWithLabelsReply as transformReply } from '.'; node-redis-redis-4.5.1/packages/time-series/lib/commands/QUERYINDEX.spec.ts000066400000000000000000000016571433774114400262500ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './QUERYINDEX'; describe('QUERYINDEX', () => { describe('transformArguments', () => { it('single filter', () => { assert.deepEqual( transformArguments('*'), ['TS.QUERYINDEX', '*'] ); }); it('multiple filters', () => { assert.deepEqual( transformArguments(['a=1', 'b=2']), ['TS.QUERYINDEX', 'a=1', 'b=2'] ); }); }); testUtils.testWithClient('client.ts.queryIndex', async client => { await client.ts.create('key', { LABELS: { label: 'value' } }); assert.deepEqual( await client.ts.queryIndex('label=value'), ['key'] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/QUERYINDEX.ts000066400000000000000000000006521433774114400253110ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; import { Filter } from '.'; export const IS_READ_ONLY = true; export function transformArguments(filter: Filter): RedisCommandArguments { return pushVerdictArguments(['TS.QUERYINDEX'], filter); } export declare function transformReply(): Array; node-redis-redis-4.5.1/packages/time-series/lib/commands/RANGE.spec.ts000066400000000000000000000022341433774114400253770ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './RANGE'; import { TimeSeriesAggregationType } from '.'; describe('RANGE', () => { it('transformArguments', () => { assert.deepEqual( transformArguments('key', '-', '+', { FILTER_BY_TS: [0], FILTER_BY_VALUE: { min: 1, max: 2 }, COUNT: 1, ALIGN: '-', AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 } }), ['TS.RANGE', 'key', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE', '1', '2', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1'] ); }); testUtils.testWithClient('client.ts.range', async client => { await client.ts.add('key', 1, 2); assert.deepEqual( await client.ts.range('key', '-', '+'), [{ timestamp: 1, value: 2 }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/RANGE.ts000066400000000000000000000012441433774114400244460ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { RangeOptions, Timestamp, pushRangeArguments, SampleRawReply, SampleReply, transformRangeReply } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: string, fromTimestamp: Timestamp, toTimestamp: Timestamp, options?: RangeOptions ): RedisCommandArguments { return pushRangeArguments( ['TS.RANGE', key], fromTimestamp, toTimestamp, options ); } export function transformReply(reply: Array): Array { return transformRangeReply(reply); } node-redis-redis-4.5.1/packages/time-series/lib/commands/REVRANGE.spec.ts000066400000000000000000000064061433774114400257610ustar00rootroot00000000000000import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; import { transformArguments } from './REVRANGE'; import { TimeSeriesAggregationType } from '.'; describe('REVRANGE', () => { describe('transformArguments', () => { it('without options', () => { assert.deepEqual( transformArguments('key', '-', '+'), ['TS.REVRANGE', 'key', '-', '+'] ); }); it('with FILTER_BY_TS', () => { assert.deepEqual( transformArguments('key', '-', '+', { FILTER_BY_TS: [0] }), ['TS.REVRANGE', 'key', '-', '+', 'FILTER_BY_TS', '0'] ); }); it('with FILTER_BY_VALUE', () => { assert.deepEqual( transformArguments('key', '-', '+', { FILTER_BY_VALUE: { min: 1, max: 2 } }), ['TS.REVRANGE', 'key', '-', '+', 'FILTER_BY_VALUE', '1', '2'] ); }); it('with COUNT', () => { assert.deepEqual( transformArguments('key', '-', '+', { COUNT: 1 }), ['TS.REVRANGE', 'key', '-', '+', 'COUNT', '1'] ); }); it('with ALIGN', () => { assert.deepEqual( transformArguments('key', '-', '+', { ALIGN: '-' }), ['TS.REVRANGE', 'key', '-', '+', 'ALIGN', '-'] ); }); it('with AGGREGATION', () => { assert.deepEqual( transformArguments('key', '-', '+', { AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 } }), ['TS.REVRANGE', 'key', '-', '+', 'AGGREGATION', 'AVG', '1'] ); }); it('with FILTER_BY_TS, FILTER_BY_VALUE, COUNT, ALIGN, AGGREGATION', () => { assert.deepEqual( transformArguments('key', '-', '+', { FILTER_BY_TS: [0], FILTER_BY_VALUE: { min: 1, max: 2 }, COUNT: 1, ALIGN: '-', AGGREGATION: { type: TimeSeriesAggregationType.AVERAGE, timeBucket: 1 } }), [ 'TS.REVRANGE', 'key', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE', '1', '2', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1' ] ); }); }); testUtils.testWithClient('client.ts.revRange', async client => { await Promise.all([ client.ts.add('key', 0, 1), client.ts.add('key', 1, 2) ]); assert.deepEqual( await client.ts.revRange('key', '-', '+'), [{ timestamp: 1, value: 2 }, { timestamp: 0, value: 1 }] ); }, GLOBAL.SERVERS.OPEN); }); node-redis-redis-4.5.1/packages/time-series/lib/commands/REVRANGE.ts000066400000000000000000000012471433774114400250260ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { RangeOptions, Timestamp, pushRangeArguments, SampleRawReply, SampleReply, transformRangeReply } from '.'; export const FIRST_KEY_INDEX = 1; export const IS_READ_ONLY = true; export function transformArguments( key: string, fromTimestamp: Timestamp, toTimestamp: Timestamp, options?: RangeOptions ): RedisCommandArguments { return pushRangeArguments( ['TS.REVRANGE', key], fromTimestamp, toTimestamp, options ); } export function transformReply(reply: Array): Array { return transformRangeReply(reply); } node-redis-redis-4.5.1/packages/time-series/lib/commands/index.spec.ts000066400000000000000000000255301433774114400256560ustar00rootroot00000000000000import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { strict as assert } from 'assert'; import { transformTimestampArgument, pushRetentionArgument, TimeSeriesEncoding, pushEncodingArgument, pushChunkSizeArgument, pushDuplicatePolicy, pushLabelsArgument, transformIncrDecrArguments, transformSampleReply, TimeSeriesAggregationType, pushRangeArguments, pushMRangeGroupByArguments, TimeSeriesReducers, pushFilterArgument, pushMRangeArguments, pushWithLabelsArgument, pushMRangeWithLabelsArguments, transformRangeReply, transformMRangeReply, transformMRangeWithLabelsReply, TimeSeriesDuplicatePolicies, pushLatestArgument, TimeSeriesBucketTimestamp } from '.'; describe('transformTimestampArgument', () => { it('number', () => { assert.equal( transformTimestampArgument(0), '0' ); }); it('Date', () => { assert.equal( transformTimestampArgument(new Date(0)), '0' ); }); it('string', () => { assert.equal( transformTimestampArgument('*'), '*' ); }); }); function testOptionalArgument(fn: (args: RedisCommandArguments) => unknown): void { it('undefined', () => { assert.deepEqual( fn([]), [] ); }); } describe('pushRetentionArgument', () => { testOptionalArgument(pushRetentionArgument); it('number', () => { assert.deepEqual( pushRetentionArgument([], 1), ['RETENTION', '1'] ); }); }); describe('pushEncodingArgument', () => { testOptionalArgument(pushEncodingArgument); it('UNCOMPRESSED', () => { assert.deepEqual( pushEncodingArgument([], TimeSeriesEncoding.UNCOMPRESSED), ['ENCODING', 'UNCOMPRESSED'] ); }); }); describe('pushChunkSizeArgument', () => { testOptionalArgument(pushChunkSizeArgument); it('number', () => { assert.deepEqual( pushChunkSizeArgument([], 1), ['CHUNK_SIZE', '1'] ); }); }); describe('pushDuplicatePolicy', () => { testOptionalArgument(pushDuplicatePolicy); it('BLOCK', () => { assert.deepEqual( pushDuplicatePolicy([], TimeSeriesDuplicatePolicies.BLOCK), ['DUPLICATE_POLICY', 'BLOCK'] ); }); }); describe('pushLabelsArgument', () => { testOptionalArgument(pushLabelsArgument); it("{ label: 'value' }", () => { assert.deepEqual( pushLabelsArgument([], { label: 'value' }), ['LABELS', 'label', 'value'] ); }); }); describe('transformIncrDecrArguments', () => { it('without options', () => { assert.deepEqual( transformIncrDecrArguments('TS.INCRBY', 'key', 1), ['TS.INCRBY', 'key', '1'] ); }); it('with TIMESTAMP', () => { assert.deepEqual( transformIncrDecrArguments('TS.INCRBY', 'key', 1, { TIMESTAMP: '*' }), ['TS.INCRBY', 'key', '1', 'TIMESTAMP', '*'] ); }); it('with UNCOMPRESSED', () => { assert.deepEqual( transformIncrDecrArguments('TS.INCRBY', 'key', 1, { UNCOMPRESSED: true }), ['TS.INCRBY', 'key', '1', 'UNCOMPRESSED'] ); }); it('with UNCOMPRESSED false', () => { assert.deepEqual( transformIncrDecrArguments('TS.INCRBY', 'key', 1, { UNCOMPRESSED: false }), ['TS.INCRBY', 'key', '1'] ); }); }); it('transformSampleReply', () => { assert.deepEqual( transformSampleReply([1, '1.1']), { timestamp: 1, value: 1.1 } ); }); describe('pushRangeArguments', () => { it('without options', () => { assert.deepEqual( pushRangeArguments([], '-', '+'), ['-', '+'] ); }); describe('with FILTER_BY_TS', () => { it('string', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { FILTER_BY_TS: ['ts'] }), ['-', '+', 'FILTER_BY_TS', 'ts'] ); }); it('Array', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { FILTER_BY_TS: ['1', '2'] }), ['-', '+', 'FILTER_BY_TS', '1', '2'] ); }); }); it('with FILTER_BY_VALUE', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { FILTER_BY_VALUE: { min: 1, max: 2 } }), ['-', '+', 'FILTER_BY_VALUE', '1', '2'] ); }); it('with COUNT', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { COUNT: 1 }), ['-', '+', 'COUNT', '1'] ); }); it('with ALIGN', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { ALIGN: 1 }), ['-', '+', 'ALIGN', '1'] ); }); describe('with AGGREGATION', () => { it('without options', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { AGGREGATION: { type: TimeSeriesAggregationType.FIRST, timeBucket: 1 } }), ['-', '+', 'AGGREGATION', 'FIRST', '1'] ); }); it('with BUCKETTIMESTAMP', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { AGGREGATION: { type: TimeSeriesAggregationType.FIRST, timeBucket: 1, BUCKETTIMESTAMP: TimeSeriesBucketTimestamp.LOW } }), ['-', '+', 'AGGREGATION', 'FIRST', '1', 'BUCKETTIMESTAMP', '-'] ); }); it('with BUCKETTIMESTAMP', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { AGGREGATION: { type: TimeSeriesAggregationType.FIRST, timeBucket: 1, EMPTY: true } }), ['-', '+', 'AGGREGATION', 'FIRST', '1', 'EMPTY'] ); }); }); it('with FILTER_BY_TS, FILTER_BY_VALUE, COUNT, ALIGN, AGGREGATION', () => { assert.deepEqual( pushRangeArguments([], '-', '+', { FILTER_BY_TS: ['ts'], FILTER_BY_VALUE: { min: 1, max: 2 }, COUNT: 1, ALIGN: 1, AGGREGATION: { type: TimeSeriesAggregationType.FIRST, timeBucket: 1, BUCKETTIMESTAMP: TimeSeriesBucketTimestamp.LOW, EMPTY: true } }), ['-', '+', 'FILTER_BY_TS', 'ts', 'FILTER_BY_VALUE', '1', '2', 'COUNT', '1', 'ALIGN', '1', 'AGGREGATION', 'FIRST', '1', 'BUCKETTIMESTAMP', '-', 'EMPTY'] ); }); }); describe('pushMRangeGroupByArguments', () => { it('undefined', () => { assert.deepEqual( pushMRangeGroupByArguments([]), [] ); }); it('with GROUPBY', () => { assert.deepEqual( pushMRangeGroupByArguments([], { label: 'label', reducer: TimeSeriesReducers.MAXIMUM }), ['GROUPBY', 'label', 'REDUCE', 'MAX'] ); }); }); describe('pushFilterArgument', () => { it('string', () => { assert.deepEqual( pushFilterArgument([], 'label=value'), ['FILTER', 'label=value'] ); }); it('Array', () => { assert.deepEqual( pushFilterArgument([], ['1=1', '2=2']), ['FILTER', '1=1', '2=2'] ); }); }); describe('pushMRangeArguments', () => { it('without options', () => { assert.deepEqual( pushMRangeArguments([], '-', '+', 'label=value'), ['-', '+', 'FILTER', 'label=value'] ); }); it('with GROUPBY', () => { assert.deepEqual( pushMRangeArguments([], '-', '+', 'label=value', { GROUPBY: { label: 'label', reducer: TimeSeriesReducers.MAXIMUM } }), ['-', '+', 'FILTER', 'label=value', 'GROUPBY', 'label', 'REDUCE', 'MAX'] ); }); }); describe('pushWithLabelsArgument', () => { it('without selected labels', () => { assert.deepEqual( pushWithLabelsArgument([]), ['WITHLABELS'] ); }); it('with selected labels', () => { assert.deepEqual( pushWithLabelsArgument([], ['label']), ['SELECTED_LABELS', 'label'] ); }); }); it('pushMRangeWithLabelsArguments', () => { assert.deepEqual( pushMRangeWithLabelsArguments([], '-', '+', 'label=value'), ['-', '+', 'WITHLABELS', 'FILTER', 'label=value'] ); }); it('transformRangeReply', () => { assert.deepEqual( transformRangeReply([[1, '1.1'], [2, '2.2']]), [{ timestamp: 1, value: 1.1 }, { timestamp: 2, value: 2.2 }] ); }); describe('transformMRangeReply', () => { assert.deepEqual( transformMRangeReply([[ 'key', [], [[1, '1.1'], [2, '2.2']] ]]), [{ key: 'key', samples: [{ timestamp: 1, value: 1.1 }, { timestamp: 2, value: 2.2 }] }] ); }); describe('transformMRangeWithLabelsReply', () => { assert.deepEqual( transformMRangeWithLabelsReply([[ 'key', [['label', 'value']], [[1, '1.1'], [2, '2.2']] ]]), [{ key: 'key', labels: { label: 'value' }, samples: [{ timestamp: 1, value: 1.1 }, { timestamp: 2, value: 2.2 }] }] ); }); describe('pushLatestArgument', () => { it('undefined', () => { assert.deepEqual( pushLatestArgument([]), [] ); }); it('false', () => { assert.deepEqual( pushLatestArgument([], false), [] ); }); it('true', () => { assert.deepEqual( pushLatestArgument([], true), ['LATEST'] ); }); }) node-redis-redis-4.5.1/packages/time-series/lib/commands/index.ts000066400000000000000000000255641433774114400247340ustar00rootroot00000000000000import * as ADD from './ADD'; import * as ALTER from './ALTER'; import * as CREATE from './CREATE'; import * as CREATERULE from './CREATERULE'; import * as DECRBY from './DECRBY'; import * as DEL from './DEL'; import * as DELETERULE from './DELETERULE'; import * as GET from './GET'; import * as INCRBY from './INCRBY'; import * as INFO_DEBUG from './INFO_DEBUG'; import * as INFO from './INFO'; import * as MADD from './MADD'; import * as MGET from './MGET'; import * as MGET_WITHLABELS from './MGET_WITHLABELS'; import * as QUERYINDEX from './QUERYINDEX'; import * as RANGE from './RANGE'; import * as REVRANGE from './REVRANGE'; import * as MRANGE from './MRANGE'; import * as MRANGE_WITHLABELS from './MRANGE_WITHLABELS'; import * as MREVRANGE from './MREVRANGE'; import * as MREVRANGE_WITHLABELS from './MREVRANGE_WITHLABELS'; import { RedisCommandArguments } from '@redis/client/dist/lib/commands'; import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers'; export default { ADD, add: ADD, ALTER, alter: ALTER, CREATE, create: CREATE, CREATERULE, createRule: CREATERULE, DECRBY, decrBy: DECRBY, DEL, del: DEL, DELETERULE, deleteRule: DELETERULE, GET, get: GET, INCRBY, incrBy: INCRBY, INFO_DEBUG, infoDebug: INFO_DEBUG, INFO, info: INFO, MADD, mAdd: MADD, MGET, mGet: MGET, MGET_WITHLABELS, mGetWithLabels: MGET_WITHLABELS, QUERYINDEX, queryIndex: QUERYINDEX, RANGE, range: RANGE, REVRANGE, revRange: REVRANGE, MRANGE, mRange: MRANGE, MRANGE_WITHLABELS, mRangeWithLabels: MRANGE_WITHLABELS, MREVRANGE, mRevRange: MREVRANGE, MREVRANGE_WITHLABELS, mRevRangeWithLabels: MREVRANGE_WITHLABELS }; export enum TimeSeriesAggregationType { AVG = 'AVG', // @deprecated AVERAGE = 'AVG', FIRST = 'FIRST', LAST = 'LAST', MIN = 'MIN', // @deprecated MINIMUM = 'MIN', MAX = 'MAX', // @deprecated MAXIMUM = 'MAX', SUM = 'SUM', RANGE = 'RANGE', COUNT = 'COUNT', STD_P = 'STD.P', STD_S = 'STD.S', VAR_P = 'VAR.P', VAR_S = 'VAR.S', TWA = 'TWA' } export enum TimeSeriesDuplicatePolicies { BLOCK = 'BLOCK', FIRST = 'FIRST', LAST = 'LAST', MIN = 'MIN', MAX = 'MAX', SUM = 'SUM' } export enum TimeSeriesReducers { AVG = 'AVG', SUM = 'SUM', MIN = 'MIN', // @deprecated MINIMUM = 'MIN', MAX = 'MAX', // @deprecated MAXIMUM = 'MAX', RANGE = 'range', COUNT = 'COUNT', STD_P = 'STD.P', STD_S = 'STD.S', VAR_P = 'VAR.P', VAR_S = 'VAR.S', } export type Timestamp = number | Date | string; export function transformTimestampArgument(timestamp: Timestamp): string { if (typeof timestamp === 'string') return timestamp; return ( typeof timestamp === 'number' ? timestamp : timestamp.getTime() ).toString(); } export function pushRetentionArgument(args: RedisCommandArguments, retention?: number): RedisCommandArguments { if (retention) { args.push( 'RETENTION', retention.toString() ); } return args; } export enum TimeSeriesEncoding { COMPRESSED = 'COMPRESSED', UNCOMPRESSED = 'UNCOMPRESSED' } export function pushEncodingArgument(args: RedisCommandArguments, encoding?: TimeSeriesEncoding): RedisCommandArguments { if (encoding) { args.push( 'ENCODING', encoding ); } return args; } export function pushChunkSizeArgument(args: RedisCommandArguments, chunkSize?: number): RedisCommandArguments { if (chunkSize) { args.push( 'CHUNK_SIZE', chunkSize.toString() ); } return args; } export function pushDuplicatePolicy(args: RedisCommandArguments, duplicatePolicy?: TimeSeriesDuplicatePolicies): RedisCommandArguments { if (duplicatePolicy) { args.push( 'DUPLICATE_POLICY', duplicatePolicy ); } return args; } export type RawLabels = Array<[label: string, value: string]>; export type Labels = { [label: string]: string; }; export function transformLablesReply(reply: RawLabels): Labels { const labels: Labels = {}; for (const [key, value] of reply) { labels[key] = value; } return labels } export function pushLabelsArgument(args: RedisCommandArguments, labels?: Labels): RedisCommandArguments { if (labels) { args.push('LABELS'); for (const [label, value] of Object.entries(labels)) { args.push(label, value); } } return args; } export interface IncrDecrOptions { TIMESTAMP?: Timestamp; RETENTION?: number; UNCOMPRESSED?: boolean; CHUNK_SIZE?: number; LABELS?: Labels; } export function transformIncrDecrArguments( command: 'TS.INCRBY' | 'TS.DECRBY', key: string, value: number, options?: IncrDecrOptions ): RedisCommandArguments { const args = [ command, key, value.toString() ]; if (options?.TIMESTAMP !== undefined && options?.TIMESTAMP !== null) { args.push('TIMESTAMP', transformTimestampArgument(options.TIMESTAMP)); } pushRetentionArgument(args, options?.RETENTION); if (options?.UNCOMPRESSED) { args.push('UNCOMPRESSED'); } pushChunkSizeArgument(args, options?.CHUNK_SIZE); pushLabelsArgument(args, options?.LABELS); return args; } export type SampleRawReply = [timestamp: number, value: string]; export interface SampleReply { timestamp: number; value: number; } export function transformSampleReply(reply: SampleRawReply): SampleReply { return { timestamp: reply[0], value: Number(reply[1]) }; } export enum TimeSeriesBucketTimestamp { LOW = '-', HIGH = '+', MID = '~' } export interface RangeOptions { LATEST?: boolean; FILTER_BY_TS?: Array; FILTER_BY_VALUE?: { min: number; max: number; }; COUNT?: number; ALIGN?: Timestamp; AGGREGATION?: { type: TimeSeriesAggregationType; timeBucket: Timestamp; BUCKETTIMESTAMP?: TimeSeriesBucketTimestamp; EMPTY?: boolean; }; } export function pushRangeArguments( args: RedisCommandArguments, fromTimestamp: Timestamp, toTimestamp: Timestamp, options?: RangeOptions ): RedisCommandArguments { args.push( transformTimestampArgument(fromTimestamp), transformTimestampArgument(toTimestamp) ); pushLatestArgument(args, options?.LATEST); if (options?.FILTER_BY_TS) { args.push('FILTER_BY_TS'); for (const ts of options.FILTER_BY_TS) { args.push(transformTimestampArgument(ts)); } } if (options?.FILTER_BY_VALUE) { args.push( 'FILTER_BY_VALUE', options.FILTER_BY_VALUE.min.toString(), options.FILTER_BY_VALUE.max.toString() ); } if (options?.COUNT) { args.push( 'COUNT', options.COUNT.toString() ); } if (options?.ALIGN) { args.push( 'ALIGN', transformTimestampArgument(options.ALIGN) ); } if (options?.AGGREGATION) { args.push( 'AGGREGATION', options.AGGREGATION.type, transformTimestampArgument(options.AGGREGATION.timeBucket) ); if (options.AGGREGATION.BUCKETTIMESTAMP) { args.push( 'BUCKETTIMESTAMP', options.AGGREGATION.BUCKETTIMESTAMP ); } if (options.AGGREGATION.EMPTY) { args.push('EMPTY'); } } return args; } interface MRangeGroupBy { label: string; reducer: TimeSeriesReducers; } export function pushMRangeGroupByArguments(args: RedisCommandArguments, groupBy?: MRangeGroupBy): RedisCommandArguments { if (groupBy) { args.push( 'GROUPBY', groupBy.label, 'REDUCE', groupBy.reducer ); } return args; } export type Filter = string | Array; export function pushFilterArgument(args: RedisCommandArguments, filter: string | Array): RedisCommandArguments { args.push('FILTER'); return pushVerdictArguments(args, filter); } export interface MRangeOptions extends RangeOptions { GROUPBY?: MRangeGroupBy; } export function pushMRangeArguments( args: RedisCommandArguments, fromTimestamp: Timestamp, toTimestamp: Timestamp, filter: Filter, options?: MRangeOptions ): RedisCommandArguments { args = pushRangeArguments(args, fromTimestamp, toTimestamp, options); args = pushFilterArgument(args, filter); return pushMRangeGroupByArguments(args, options?.GROUPBY); } export type SelectedLabels = string | Array; export function pushWithLabelsArgument(args: RedisCommandArguments, selectedLabels?: SelectedLabels): RedisCommandArguments { if (!selectedLabels) { args.push('WITHLABELS'); } else { args.push('SELECTED_LABELS'); args = pushVerdictArguments(args, selectedLabels); } return args; } export interface MRangeWithLabelsOptions extends MRangeOptions { SELECTED_LABELS?: SelectedLabels; } export function pushMRangeWithLabelsArguments( args: RedisCommandArguments, fromTimestamp: Timestamp, toTimestamp: Timestamp, filter: Filter, options?: MRangeWithLabelsOptions ): RedisCommandArguments { args = pushRangeArguments(args, fromTimestamp, toTimestamp, options); args = pushWithLabelsArgument(args, options?.SELECTED_LABELS); args = pushFilterArgument(args, filter); return pushMRangeGroupByArguments(args, options?.GROUPBY); } export function transformRangeReply(reply: Array): Array { return reply.map(transformSampleReply); } type MRangeRawReply = Array<[ key: string, labels: RawLabels, samples: Array ]>; interface MRangeReplyItem { key: string; samples: Array; } export function transformMRangeReply(reply: MRangeRawReply): Array { const args = []; for (const [key, _, sample] of reply) { args.push({ key, samples: sample.map(transformSampleReply) }); } return args; } export interface MRangeWithLabelsReplyItem extends MRangeReplyItem { labels: Labels; } export function transformMRangeWithLabelsReply(reply: MRangeRawReply): Array { const args = []; for (const [key, labels, samples] of reply) { args.push({ key, labels: transformLablesReply(labels), samples: samples.map(transformSampleReply) }); } return args; } export function pushLatestArgument(args: RedisCommandArguments, latest?: boolean): RedisCommandArguments { if (latest) { args.push('LATEST'); } return args; } node-redis-redis-4.5.1/packages/time-series/lib/index.ts000066400000000000000000000003111433774114400231120ustar00rootroot00000000000000export { default } from './commands'; export { TimeSeriesDuplicatePolicies, TimeSeriesEncoding, TimeSeriesAggregationType, TimeSeriesReducers, TimeSeriesBucketTimestamp } from './commands'; node-redis-redis-4.5.1/packages/time-series/lib/test-utils.ts000066400000000000000000000010241433774114400241220ustar00rootroot00000000000000import TestUtils from '@redis/test-utils'; import TimeSeries from '.'; export default new TestUtils({ dockerImageName: 'redislabs/redistimeseries', dockerImageVersionArgument: 'timeseries-version', defaultDockerVersion: '1.8.0' }); export const GLOBAL = { SERVERS: { OPEN: { serverArguments: ['--loadmodule /usr/lib/redis/modules/redistimeseries.so'], clientOptions: { modules: { ts: TimeSeries } } } } }; node-redis-redis-4.5.1/packages/time-series/package.json000066400000000000000000000013271433774114400231630ustar00rootroot00000000000000{ "name": "@redis/time-series", "version": "1.0.4", "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", "documentation": "typedoc" }, "peerDependencies": { "@redis/client": "^1.0.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@redis/test-utils": "*", "@types/node": "^18.11.6", "nyc": "^15.1.0", "release-it": "^15.5.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "typedoc": "^0.23.18", "typescript": "^4.8.4" } } node-redis-redis-4.5.1/packages/time-series/tsconfig.json000066400000000000000000000005451433774114400234050ustar00rootroot00000000000000{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./lib/**/*.ts" ], "exclude": [ "./lib/test-utils.ts", "./lib/**/*.spec.ts" ], "typedocOptions": { "entryPoints": [ "./lib" ], "entryPointStrategy": "expand", "out": "../../documentation/time-series" } } node-redis-redis-4.5.1/tsconfig.base.json000066400000000000000000000003441433774114400203070ustar00rootroot00000000000000{ "extends": "@tsconfig/node14/tsconfig.json", "compilerOptions": { "declaration": true, "allowJs": true, "useDefineForClassFields": true, "esModuleInterop": false }, "ts-node": { "files": true } } node-redis-redis-4.5.1/tsconfig.json000066400000000000000000000002001433774114400173650ustar00rootroot00000000000000{ "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./dist" }, "include": [ "./index.ts" ] }