You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
WIP
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
- Does `close`/`destory` actually close the connection from the Redis POV? Works with OSS, but what about Redis Enterprie?
|
|
||||||
- "Isolation Pool" -> pool
|
- "Isolation Pool" -> pool
|
||||||
- Cluster request response policies (either implement, or block "server" commands in cluster)
|
- Cluster request response policies (either implement, or block "server" commands in cluster)
|
||||||
|
|
||||||
Docs:
|
Docs:
|
||||||
- [v4 to v5](./v4-to-v5.md) - Legacy mode
|
|
||||||
- [Command Options](./command-options.md)
|
- [Command Options](./command-options.md)
|
||||||
- [RESP](./RESP.md)
|
- [RESP](./RESP.md)
|
||||||
|
@@ -77,7 +77,11 @@ legacyClient.set('key', 'value', (err, reply) => {
|
|||||||
|
|
||||||
## Isolation Pool
|
## Isolation Pool
|
||||||
|
|
||||||
TODO
|
[TODO](./blocking-commands.md).
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
await client.get(client.commandOptions({ isolated: true }), 'key');
|
||||||
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
await client.sendCommand(['GET', 'key']);
|
await client.sendCommand(['GET', 'key']);
|
||||||
@@ -123,35 +127,47 @@ await cluster.multi()
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Some command arguments/replies have changed to align more closely to data types returned by Redis:
|
### Redis
|
||||||
|
|
||||||
- `ACL GETUSER`: `selectors`
|
- `ACL GETUSER`: `selectors`
|
||||||
|
- `COPY`: `destinationDb` -> `DB`, `replace` -> `REPLACE`, `boolean` -> `number` [^boolean-to-number]
|
||||||
- `CLIENT KILL`: `enum ClientKillFilters` -> `const CLIENT_KILL_FILTERS` [^enum-to-constants]
|
- `CLIENT KILL`: `enum ClientKillFilters` -> `const CLIENT_KILL_FILTERS` [^enum-to-constants]
|
||||||
- `CLUSTER FAILOVER`: `enum FailoverModes` -> `const FAILOVER_MODES` [^enum-to-constants]
|
- `CLUSTER FAILOVER`: `enum FailoverModes` -> `const FAILOVER_MODES` [^enum-to-constants]
|
||||||
- `LCS IDX`: `length` has been changed to `len`, `matches` has been changed from `Array<{ key1: RangeReply; key2: RangeReply; }>` to `Array<[key1: RangeReply, key2: RangeReply]>`
|
- `CLIENT TRACKINGINFO`: `flags` in RESP2 - `Set<string>` -> `Array<string>` (to match RESP3 default type mapping)
|
||||||
|
- `CLUSETER SETSLOT`: `ClusterSlotStates` -> `CLUSTER_SLOT_STATES` [^enum-to-constants]
|
||||||
|
- `CLUSTER RESET`: the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
||||||
|
- `CLUSTER FAILOVER`: `enum FailoverModes` -> `const FAILOVER_MODES` [^enum-to-constants], the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
||||||
|
- `CLUSTER LINKS`: `createTime` -> `create-time`, `sendBufferAllocated` -> `send-buffer-allocated`, `sendBufferUsed` -> `send-buffer-used` [^map-keys]
|
||||||
|
- `CLUSTER NODES`, `CLUSTER REPLICAS`, `CLUSTER INFO`: returning the raw `VerbatimStringReply`
|
||||||
|
- `EXPIRE`: `boolean` -> `number` [^boolean-to-number]
|
||||||
|
- `EXPIREAT`: `boolean` -> `number` [^boolean-to-number]
|
||||||
|
- `HSCAN`: `tuples` has been renamed to `entries`
|
||||||
- `HEXISTS`: `boolean` -> `number` [^boolean-to-number]
|
- `HEXISTS`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `HRANDFIELD_COUNT_WITHVALUES`: `Record<BlobString, BlobString>` -> `Array<{ field: BlobString; value: BlobString; }>` (it can return duplicates).
|
- `HRANDFIELD_COUNT_WITHVALUES`: `Record<BlobString, BlobString>` -> `Array<{ field: BlobString; value: BlobString; }>` (it can return duplicates).
|
||||||
- `SCAN`, `HSCAN`, `SSCAN`, and `ZSCAN`: `cursor` type is `string | Buffer` instead of `number`
|
|
||||||
- `HSETNX`: `boolean` -> `number` [^boolean-to-number]
|
- `HSETNX`: `boolean` -> `number` [^boolean-to-number]
|
||||||
|
|
||||||
|
- `LCS IDX`: `length` has been changed to `len`, `matches` has been changed from `Array<{ key1: RangeReply; key2: RangeReply; }>` to `Array<[key1: RangeReply, key2: RangeReply]>`
|
||||||
|
|
||||||
|
|
||||||
- `ZINTER`: instead of `client.ZINTER('key', { WEIGHTS: [1] })` use `client.ZINTER({ key: 'key', weight: 1 }])`
|
- `ZINTER`: instead of `client.ZINTER('key', { WEIGHTS: [1] })` use `client.ZINTER({ key: 'key', weight: 1 }])`
|
||||||
- `ZINTER_WITHSCORES`: instead of `client.ZINTER_WITHSCORES('key', { WEIGHTS: [1] })` use `client.ZINTER_WITHSCORES({ key: 'key', weight: 1 }])`
|
- `ZINTER_WITHSCORES`: instead of `client.ZINTER_WITHSCORES('key', { WEIGHTS: [1] })` use `client.ZINTER_WITHSCORES({ key: 'key', weight: 1 }])`
|
||||||
- `ZUNION`: instead of `client.ZUNION('key', { WEIGHTS: [1] })` use `client.ZUNION({ key: 'key', weight: 1 }])`
|
- `ZUNION`: instead of `client.ZUNION('key', { WEIGHTS: [1] })` use `client.ZUNION({ key: 'key', weight: 1 }])`
|
||||||
- `ZUNION_WITHSCORES`: instead of `client.ZUNION_WITHSCORES('key', { WEIGHTS: [1] })` use `client.ZUNION_WITHSCORES({ key: 'key', weight: 1 }])`
|
- `ZUNION_WITHSCORES`: instead of `client.ZUNION_WITHSCORES('key', { WEIGHTS: [1] })` use `client.ZUNION_WITHSCORES({ key: 'key', weight: 1 }])`
|
||||||
- `SETNX`: `boolean` -> `number` [^boolean-to-number]
|
- `ZMPOP`: `{ elements: Array<{ member: string; score: number; }>; }` -> `{ members: Array<{ value: string; score: number; }>; }` to match other sorted set commands (e.g. `ZRANGE`, `ZSCAN`)
|
||||||
- `COPY`: `destinationDb` -> `DB`, `replace` -> `REPLACE`, `boolean` -> `number` [^boolean-to-number]
|
|
||||||
- `EXPIRE`: `boolean` -> `number` [^boolean-to-number]
|
|
||||||
- `EXPIREAT`: `boolean` -> `number` [^boolean-to-number]
|
|
||||||
- `MOVE`: `boolean` -> `number` [^boolean-to-number]
|
- `MOVE`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `PEXPIRE`: `boolean` -> `number` [^boolean-to-number]
|
- `PEXPIRE`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `PEXPIREAT`: `boolean` -> `number` [^boolean-to-number]
|
- `PEXPIREAT`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `RENAMENX`: `boolean` -> `number` [^boolean-to-number]
|
|
||||||
- `HSCAN`: `tuples` has been renamed to `entries`
|
|
||||||
- `PFADD`: `boolean` -> `number` [^boolean-to-number]
|
- `PFADD`: `boolean` -> `number` [^boolean-to-number]
|
||||||
|
|
||||||
|
- `RENAMENX`: `boolean` -> `number` [^boolean-to-number]
|
||||||
|
- `SETNX`: `boolean` -> `number` [^boolean-to-number]
|
||||||
|
- `SCAN`, `HSCAN`, `SSCAN`, and `ZSCAN`: `reply.cursor` will not be converted to number to avoid issues when the number is bigger than `Number.MAX_SAFE_INTEGER`. See [here](https://github.com/redis/node-redis/issues/2561).
|
||||||
- `SCRIPT EXISTS`: `Array<boolean>` -> `Array<number>` [^boolean-to-number]
|
- `SCRIPT EXISTS`: `Array<boolean>` -> `Array<number>` [^boolean-to-number]
|
||||||
- `SISMEMBER`: `boolean` -> `number` [^boolean-to-number]
|
- `SISMEMBER`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `SMISMEMBER`: `Array<boolean>` -> `Array<number>` [^boolean-to-number]
|
- `SMISMEMBER`: `Array<boolean>` -> `Array<number>` [^boolean-to-number]
|
||||||
- `SMOVE`: `boolean` -> `number` [^boolean-to-number]
|
- `SMOVE`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `TS.ADD`: `boolean` -> `number` [^boolean-to-number]
|
|
||||||
- `GEOSEARCH_WITH`/`GEORADIUS_WITH`: `GeoReplyWith` -> `GEO_REPLY_WITH` [^enum-to-constants]
|
- `GEOSEARCH_WITH`/`GEORADIUS_WITH`: `GeoReplyWith` -> `GEO_REPLY_WITH` [^enum-to-constants]
|
||||||
- `GEORADIUSSTORE` -> `GEORADIUS_STORE`
|
- `GEORADIUSSTORE` -> `GEORADIUS_STORE`
|
||||||
- `GEORADIUSBYMEMBERSTORE` -> `GEORADIUSBYMEMBER_STORE`
|
- `GEORADIUSBYMEMBERSTORE` -> `GEORADIUSBYMEMBER_STORE`
|
||||||
@@ -161,34 +177,46 @@ Some command arguments/replies have changed to align more closely to data types
|
|||||||
- `HELLO`: `protover` moved from the options object to it's own argument, `auth` -> `AUTH`, `clientName` -> `SETNAME`
|
- `HELLO`: `protover` moved from the options object to it's own argument, `auth` -> `AUTH`, `clientName` -> `SETNAME`
|
||||||
- `MODULE LIST`: `version` -> `ver` [^map-keys]
|
- `MODULE LIST`: `version` -> `ver` [^map-keys]
|
||||||
- `MEMORY STATS`: [^map-keys]
|
- `MEMORY STATS`: [^map-keys]
|
||||||
- `CLIENT TRACKINGINFO`: `flags` in RESP2 - `Set<string>` -> `Array<string>` (to match RESP3 default type mapping)
|
|
||||||
- `CLUSETER SETSLOT`: `ClusterSlotStates` -> `CLUSTER_SLOT_STATES` [^enum-to-constants]
|
|
||||||
- `FUNCTION RESTORE`: the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
- `FUNCTION RESTORE`: the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
||||||
- `FUNCTION STATS`: `runningScript` -> `running_script`, `durationMs` -> `duration_ms`, `librariesCount` -> `libraries_count`, `functionsCount` -> `functions_count` [^map-keys]
|
- `FUNCTION STATS`: `runningScript` -> `running_script`, `durationMs` -> `duration_ms`, `librariesCount` -> `libraries_count`, `functionsCount` -> `functions_count` [^map-keys]
|
||||||
- `CLUSTER RESET`: the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
|
||||||
- `CLUSTER FAILOVER`: `enum FailoverModes` -> `const FAILOVER_MODES` [^enum-to-constants], the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
|
||||||
- `CLUSTER LINKS`: `createTime` -> `create-time`, `sendBufferAllocated` -> `send-buffer-allocated`, `sendBufferUsed` -> `send-buffer-used` [^map-keys]
|
|
||||||
- `TIME`: `Date` -> `[unixTimestamp: string, microseconds: string]`
|
- `TIME`: `Date` -> `[unixTimestamp: string, microseconds: string]`
|
||||||
- `ZMPOP`: `{ elements: Array<{ member: string; score: number; }>; }` -> `{ members: Array<{ value: string; score: number; }>; }` to match other sorted set commands (e.g. `ZRANGE`, `ZSCAN`)
|
|
||||||
- `XGROUP_CREATECONSUMER`: [^boolean-to-number]
|
- `XGROUP_CREATECONSUMER`: [^boolean-to-number]
|
||||||
- `XGROUP_DESTROY`: [^boolean-to-number]
|
- `XGROUP_DESTROY`: [^boolean-to-number]
|
||||||
- `XINFO GROUPS`: `lastDeliveredId` -> `last-delivered-id` [^map-keys]
|
- `XINFO GROUPS`: `lastDeliveredId` -> `last-delivered-id` [^map-keys]
|
||||||
- `XINFO STREAM`: `radixTreeKeys` -> `radix-tree-keys`, `radixTreeNodes` -> `radix-tree-nodes`, `lastGeneratedId` -> `last-generated-id`, `maxDeletedEntryId` -> `max-deleted-entry-id`, `entriesAdded` -> `entries-added`, `recordedFirstEntryId` -> `recorded-first-entry-id`, `firstEntry` -> `first-entry`, `lastEntry` -> `last-entry`
|
- `XINFO STREAM`: `radixTreeKeys` -> `radix-tree-keys`, `radixTreeNodes` -> `radix-tree-nodes`, `lastGeneratedId` -> `last-generated-id`, `maxDeletedEntryId` -> `max-deleted-entry-id`, `entriesAdded` -> `entries-added`, `recordedFirstEntryId` -> `recorded-first-entry-id`, `firstEntry` -> `first-entry`, `lastEntry` -> `last-entry`
|
||||||
- `XAUTOCLAIM`, `XCLAIM`, `XRANGE`, `XREVRANGE`: `Array<{ name: string; messages: Array<{ id: string; message: Record<string, string> }>; }>` -> `Record<string, Array<{ id: string; message: Record<string, string> }>>`
|
- `XAUTOCLAIM`, `XCLAIM`, `XRANGE`, `XREVRANGE`: `Array<{ name: string; messages: Array<{ id: string; message: Record<string, string> }>; }>` -> `Record<string, Array<{ id: string; message: Record<string, string> }>>`
|
||||||
- `FT.SUGDEL`: [^boolean-to-number]
|
|
||||||
|
- `COMMAND LIST`: `enum FilterBy` -> `const COMMAND_LIST_FILTER_BY` [^enum-to-constants], the filter argument has been moved from a "top level argument" into ` { FILTERBY: { type: <MODULE|ACLCAT|PATTERN>; value: <value> } }`
|
||||||
|
|
||||||
|
### Bloom
|
||||||
|
|
||||||
- `TOPK.QUERY`: `Array<number>` -> `Array<boolean>`
|
- `TOPK.QUERY`: `Array<number>` -> `Array<boolean>`
|
||||||
|
|
||||||
|
### Graph
|
||||||
|
|
||||||
- `GRAPH.SLOWLOG`: `timestamp` has been changed from `Date` to `number`
|
- `GRAPH.SLOWLOG`: `timestamp` has been changed from `Date` to `number`
|
||||||
|
|
||||||
|
### JSON
|
||||||
|
|
||||||
- `JSON.ARRINDEX`: `start` and `end` arguments moved to `{ range: { start: number; end: number; }; }` [^future-proofing]
|
- `JSON.ARRINDEX`: `start` and `end` arguments moved to `{ range: { start: number; end: number; }; }` [^future-proofing]
|
||||||
- `JSON.ARRPOP`: `path` and `index` arguments moved to `{ path: string; index: number; }` [^future-proofing]
|
- `JSON.ARRPOP`: `path` and `index` arguments moved to `{ path: string; index: number; }` [^future-proofing]
|
||||||
- `JSON.ARRLEN`, `JSON.CLEAR`, `JSON.DEBUG MEMORY`, `JSON.DEL`, `JSON.FORGET`, `JSON.OBJKEYS`, `JSON.OBJLEN`, `JSON.STRAPPEND`, `JSON.STRLEN`, `JSON.TYPE`: `path` argument moved to `{ path: string; }` [^future-proofing]
|
- `JSON.ARRLEN`, `JSON.CLEAR`, `JSON.DEBUG MEMORY`, `JSON.DEL`, `JSON.FORGET`, `JSON.OBJKEYS`, `JSON.OBJLEN`, `JSON.STRAPPEND`, `JSON.STRLEN`, `JSON.TYPE`: `path` argument moved to `{ path: string; }` [^future-proofing]
|
||||||
|
|
||||||
|
### Search
|
||||||
|
|
||||||
|
- `FT.SUGDEL`: [^boolean-to-number]
|
||||||
|
|
||||||
|
### Time Series
|
||||||
|
|
||||||
|
- `TS.ADD`: `boolean` -> `number` [^boolean-to-number]
|
||||||
- `TS.[M][REV]RANGE`: `enum TimeSeriesBucketTimestamp` -> `const TIME_SERIES_BUCKET_TIMESTAMP` [^enum-to-constants], `enum TimeSeriesReducers` -> `const TIME_SERIES_REDUCERS` [^enum-to-constants], the `ALIGN` argument has been moved into `AGGREGRATION`
|
- `TS.[M][REV]RANGE`: `enum TimeSeriesBucketTimestamp` -> `const TIME_SERIES_BUCKET_TIMESTAMP` [^enum-to-constants], `enum TimeSeriesReducers` -> `const TIME_SERIES_REDUCERS` [^enum-to-constants], the `ALIGN` argument has been moved into `AGGREGRATION`
|
||||||
- `TS.SYNUPDATE`: `Array<string | Array<string>>` -> `Record<string, Array<string>>`
|
- `TS.SYNUPDATE`: `Array<string | Array<string>>` -> `Record<string, Array<string>>`
|
||||||
- `CLUSTER NODES`, `CLUSTER REPLICAS`, `CLUSTER INFO`: returning the raw `VerbatimStringReply`
|
- `TS.M[REV]RANGE[_WITHLABELS]`, `TS.MGET[_WITHLABELS]`: TODO
|
||||||
|
|
||||||
[^enum-to-constants]: TODO
|
[^enum-to-constants]: TODO
|
||||||
|
|
||||||
[^boolean-to-number]: TODO
|
[^map-keys]: To avoid unnecessary transformations and confusion, map keys will not be transformed to "js friendly" names (i.e. `number-of-keys` will not be renamed to `numberOfKeys`). See [here](https://github.com/redis/node-redis/discussions/2506).
|
||||||
|
|
||||||
[^map-keys]: [TODO](https://github.com/redis/node-redis/discussions/2506)
|
[^future-proofing]: TODO
|
||||||
|
|
||||||
[^future-proofing]: TODO
|
|
||||||
|
260
package-lock.json
generated
260
package-lock.json
generated
@@ -11,15 +11,15 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||||
"@tsconfig/node18": "^18.2.2",
|
"@tsconfig/node18": "^18.2.2",
|
||||||
"@types/mocha": "^10.0.1",
|
"@types/mocha": "^10.0.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
||||||
"@typescript-eslint/parser": "^6.7.2",
|
"@typescript-eslint/parser": "^6.9.0",
|
||||||
"gh-pages": "^6.0.0",
|
"gh-pages": "^6.0.0",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.25.1",
|
"typedoc": "^0.25.2",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -131,18 +131,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/compat-data": {
|
"node_modules/@babel/compat-data": {
|
||||||
"version": "7.22.20",
|
"version": "7.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz",
|
||||||
"integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==",
|
"integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/core": {
|
"node_modules/@babel/core": {
|
||||||
"version": "7.23.0",
|
"version": "7.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz",
|
||||||
"integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==",
|
"integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ampproject/remapping": "^2.2.0",
|
"@ampproject/remapping": "^2.2.0",
|
||||||
@@ -150,10 +150,10 @@
|
|||||||
"@babel/generator": "^7.23.0",
|
"@babel/generator": "^7.23.0",
|
||||||
"@babel/helper-compilation-targets": "^7.22.15",
|
"@babel/helper-compilation-targets": "^7.22.15",
|
||||||
"@babel/helper-module-transforms": "^7.23.0",
|
"@babel/helper-module-transforms": "^7.23.0",
|
||||||
"@babel/helpers": "^7.23.0",
|
"@babel/helpers": "^7.23.2",
|
||||||
"@babel/parser": "^7.23.0",
|
"@babel/parser": "^7.23.0",
|
||||||
"@babel/template": "^7.22.15",
|
"@babel/template": "^7.22.15",
|
||||||
"@babel/traverse": "^7.23.0",
|
"@babel/traverse": "^7.23.2",
|
||||||
"@babel/types": "^7.23.0",
|
"@babel/types": "^7.23.0",
|
||||||
"convert-source-map": "^2.0.0",
|
"convert-source-map": "^2.0.0",
|
||||||
"debug": "^4.1.0",
|
"debug": "^4.1.0",
|
||||||
@@ -341,13 +341,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/helpers": {
|
"node_modules/@babel/helpers": {
|
||||||
"version": "7.23.1",
|
"version": "7.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz",
|
||||||
"integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==",
|
"integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/template": "^7.22.15",
|
"@babel/template": "^7.22.15",
|
||||||
"@babel/traverse": "^7.23.0",
|
"@babel/traverse": "^7.23.2",
|
||||||
"@babel/types": "^7.23.0"
|
"@babel/types": "^7.23.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -466,9 +466,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/traverse": {
|
"node_modules/@babel/traverse": {
|
||||||
"version": "7.23.0",
|
"version": "7.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
|
||||||
"integrity": "sha512-t/QaEvyIoIkwzpiZ7aoSKK8kObQYeF7T2v+dazAYCb8SXtp58zEVkWW7zAnju8FNKNdr4ScAOEDmMItbyOmEYw==",
|
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.22.13",
|
"@babel/code-frame": "^7.22.13",
|
||||||
@@ -580,9 +580,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "8.50.0",
|
"version": "8.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz",
|
||||||
"integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==",
|
"integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -934,34 +934,37 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/json-schema": {
|
"node_modules/@types/json-schema": {
|
||||||
"version": "7.0.13",
|
"version": "7.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz",
|
||||||
"integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==",
|
"integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/mocha": {
|
"node_modules/@types/mocha": {
|
||||||
"version": "10.0.2",
|
"version": "10.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.3.tgz",
|
||||||
"integrity": "sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w==",
|
"integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.8.0",
|
"version": "20.8.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz",
|
||||||
"integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==",
|
"integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": "~5.25.1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/semver": {
|
"node_modules/@types/semver": {
|
||||||
"version": "7.5.3",
|
"version": "7.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz",
|
||||||
"integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==",
|
"integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/sinon": {
|
"node_modules/@types/sinon": {
|
||||||
"version": "10.0.17",
|
"version": "10.0.19",
|
||||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.17.tgz",
|
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.19.tgz",
|
||||||
"integrity": "sha512-+6ILpcixQ0Ma3dHMTLv4rSycbDXkDljgKL+E0nI2RUxxhYTFyPSjt6RVMxh7jUshvyVcBvicb0Ktj+lAJcjgeA==",
|
"integrity": "sha512-MWZNGPSchIdDfb5FL+VFi4zHsHbNOTQEgjqFQk7HazXSXwUU9PAX3z9XBqb3AJGYr9YwrtCtaSMsT3brYsN/jQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/sinonjs__fake-timers": "*"
|
"@types/sinonjs__fake-timers": "*"
|
||||||
@@ -974,9 +977,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/yargs": {
|
"node_modules/@types/yargs": {
|
||||||
"version": "17.0.26",
|
"version": "17.0.28",
|
||||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.26.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.28.tgz",
|
||||||
"integrity": "sha512-Y3vDy2X6zw/ZCumcwLpdhM5L7jmyGpmBCTYMHDLqT2IKVMYRRLdv6ZakA+wxhra6Z/3bwhNbNl9bDGXaFU+6rw==",
|
"integrity": "sha512-N3e3fkS86hNhtk6BEnc0rj3zcehaxx8QWhCROJkqpl5Zaoi7nAic3jH8q94jVD3zu5LGk+PUB6KAiDmimYOEQw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/yargs-parser": "*"
|
"@types/yargs-parser": "*"
|
||||||
@@ -989,16 +992,16 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.0.tgz",
|
||||||
"integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==",
|
"integrity": "sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.5.1",
|
"@eslint-community/regexpp": "^4.5.1",
|
||||||
"@typescript-eslint/scope-manager": "6.7.4",
|
"@typescript-eslint/scope-manager": "6.9.0",
|
||||||
"@typescript-eslint/type-utils": "6.7.4",
|
"@typescript-eslint/type-utils": "6.9.0",
|
||||||
"@typescript-eslint/utils": "6.7.4",
|
"@typescript-eslint/utils": "6.9.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.7.4",
|
"@typescript-eslint/visitor-keys": "6.9.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"graphemer": "^1.4.0",
|
"graphemer": "^1.4.0",
|
||||||
"ignore": "^5.2.4",
|
"ignore": "^5.2.4",
|
||||||
@@ -1024,15 +1027,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.0.tgz",
|
||||||
"integrity": "sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==",
|
"integrity": "sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "6.7.4",
|
"@typescript-eslint/scope-manager": "6.9.0",
|
||||||
"@typescript-eslint/types": "6.7.4",
|
"@typescript-eslint/types": "6.9.0",
|
||||||
"@typescript-eslint/typescript-estree": "6.7.4",
|
"@typescript-eslint/typescript-estree": "6.9.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.7.4",
|
"@typescript-eslint/visitor-keys": "6.9.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1052,13 +1055,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz",
|
||||||
"integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==",
|
"integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "6.7.4",
|
"@typescript-eslint/types": "6.9.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.7.4"
|
"@typescript-eslint/visitor-keys": "6.9.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.0.0 || >=18.0.0"
|
"node": "^16.0.0 || >=18.0.0"
|
||||||
@@ -1069,13 +1072,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.0.tgz",
|
||||||
"integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==",
|
"integrity": "sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/typescript-estree": "6.7.4",
|
"@typescript-eslint/typescript-estree": "6.9.0",
|
||||||
"@typescript-eslint/utils": "6.7.4",
|
"@typescript-eslint/utils": "6.9.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"ts-api-utils": "^1.0.1"
|
"ts-api-utils": "^1.0.1"
|
||||||
},
|
},
|
||||||
@@ -1096,9 +1099,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz",
|
||||||
"integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==",
|
"integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.0.0 || >=18.0.0"
|
"node": "^16.0.0 || >=18.0.0"
|
||||||
@@ -1109,13 +1112,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz",
|
||||||
"integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==",
|
"integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "6.7.4",
|
"@typescript-eslint/types": "6.9.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.7.4",
|
"@typescript-eslint/visitor-keys": "6.9.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"globby": "^11.1.0",
|
"globby": "^11.1.0",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
@@ -1136,17 +1139,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.0.tgz",
|
||||||
"integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==",
|
"integrity": "sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.4.0",
|
"@eslint-community/eslint-utils": "^4.4.0",
|
||||||
"@types/json-schema": "^7.0.12",
|
"@types/json-schema": "^7.0.12",
|
||||||
"@types/semver": "^7.5.0",
|
"@types/semver": "^7.5.0",
|
||||||
"@typescript-eslint/scope-manager": "6.7.4",
|
"@typescript-eslint/scope-manager": "6.9.0",
|
||||||
"@typescript-eslint/types": "6.7.4",
|
"@typescript-eslint/types": "6.9.0",
|
||||||
"@typescript-eslint/typescript-estree": "6.7.4",
|
"@typescript-eslint/typescript-estree": "6.9.0",
|
||||||
"semver": "^7.5.4"
|
"semver": "^7.5.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1161,12 +1164,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "6.7.4",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz",
|
||||||
"integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==",
|
"integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "6.7.4",
|
"@typescript-eslint/types": "6.9.0",
|
||||||
"eslint-visitor-keys": "^3.4.1"
|
"eslint-visitor-keys": "^3.4.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1460,9 +1463,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001542",
|
"version": "1.0.30001549",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001542.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001549.tgz",
|
||||||
"integrity": "sha512-UrtAXVcj1mvPBFQ4sKd38daP8dEcXXr5sQe6QNNinaPd0iA/cxg9/l3VrSdL73jgw5sKyuQ6jNgiKO12W3SsVA==",
|
"integrity": "sha512-qRp48dPYSCYaP+KurZLhDYdVE+yEyht/3NlmcJgVQ2VMGt6JL36ndQ/7rgspdZsJuxDPFIo/OzBT2+GmIJ53BA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1581,9 +1584,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/commander": {
|
"node_modules/commander": {
|
||||||
"version": "11.0.0",
|
"version": "11.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
|
||||||
"integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==",
|
"integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=16"
|
||||||
@@ -1710,9 +1713,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.4.537",
|
"version": "1.4.556",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.537.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.556.tgz",
|
||||||
"integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==",
|
"integrity": "sha512-6RPN0hHfzDU8D56E72YkDvnLw5Cj2NMXZGg3UkgyoHxjVhG99KZpsKgBWMmTy0Ei89xwan+rbRsVB9yzATmYzQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/email-addresses": {
|
"node_modules/email-addresses": {
|
||||||
@@ -1755,16 +1758,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "8.50.0",
|
"version": "8.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz",
|
||||||
"integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==",
|
"integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.6.1",
|
"@eslint-community/regexpp": "^4.6.1",
|
||||||
"@eslint/eslintrc": "^2.1.2",
|
"@eslint/eslintrc": "^2.1.2",
|
||||||
"@eslint/js": "8.50.0",
|
"@eslint/js": "8.51.0",
|
||||||
"@humanwhocodes/config-array": "^0.11.11",
|
"@humanwhocodes/config-array": "^0.11.11",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@@ -2067,13 +2070,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/flat-cache": {
|
"node_modules/flat-cache": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz",
|
||||||
"integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==",
|
"integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"flatted": "^3.2.7",
|
"flatted": "^3.2.9",
|
||||||
"keyv": "^4.5.3",
|
"keyv": "^4.5.3",
|
||||||
"rimraf": "^3.0.2"
|
"rimraf": "^3.0.2"
|
||||||
},
|
},
|
||||||
@@ -2274,9 +2277,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/globals": {
|
"node_modules/globals": {
|
||||||
"version": "13.22.0",
|
"version": "13.23.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",
|
||||||
"integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==",
|
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2757,9 +2760,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/keyv": {
|
"node_modules/keyv": {
|
||||||
"version": "4.5.3",
|
"version": "4.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
||||||
"integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==",
|
"integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3768,9 +3771,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/shiki": {
|
"node_modules/shiki": {
|
||||||
"version": "0.14.4",
|
"version": "0.14.5",
|
||||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.4.tgz",
|
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz",
|
||||||
"integrity": "sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ==",
|
"integrity": "sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-sequence-parser": "^1.1.0",
|
"ansi-sequence-parser": "^1.1.0",
|
||||||
@@ -3786,9 +3789,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/sinon": {
|
"node_modules/sinon": {
|
||||||
"version": "16.0.0",
|
"version": "16.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-16.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/sinon/-/sinon-16.1.0.tgz",
|
||||||
"integrity": "sha512-B8AaZZm9CT5pqe4l4uWJztfD/mOTa7dL8Qo0W4+s+t74xECOgSZDDQCBjNgIK3+n4kyxQrSTv2V5ul8K25qkiQ==",
|
"integrity": "sha512-ZSgzF0vwmoa8pq0GEynqfdnpEDyP1PkYmEChnkjW0Vyh8IDlyFEJ+fkMhCP0il6d5cJjPl2PUsnUSAuP5sttOQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinonjs/commons": "^3.0.0",
|
"@sinonjs/commons": "^3.0.0",
|
||||||
@@ -4115,9 +4118,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typedoc": {
|
"node_modules/typedoc": {
|
||||||
"version": "0.25.1",
|
"version": "0.25.2",
|
||||||
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.1.tgz",
|
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.2.tgz",
|
||||||
"integrity": "sha512-c2ye3YUtGIadxN2O6YwPEXgrZcvhlZ6HlhWZ8jQRNzwLPn2ylhdGqdR8HbyDRyALP8J6lmSANILCkkIdNPFxqA==",
|
"integrity": "sha512-286F7BeATBiWe/qC4PCOCKlSTwfnsLbC/4cZ68oGBbvAqb9vV33quEOXx7q176OXotD+JdEerdQ1OZGJ818lnA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lunr": "^2.3.9",
|
"lunr": "^2.3.9",
|
||||||
@@ -4172,6 +4175,13 @@
|
|||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "5.25.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz",
|
||||||
|
"integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==",
|
||||||
|
"dev": true,
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/universalify": {
|
"node_modules/universalify": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||||
@@ -4467,31 +4477,13 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@redis/bloom": "1.2.0",
|
"@redis/bloom": "1.2.0",
|
||||||
"@redis/client": "1.5.11",
|
"@redis/client": "2.0.0-next.2",
|
||||||
"@redis/graph": "1.1.0",
|
"@redis/graph": "1.1.0",
|
||||||
"@redis/json": "1.0.6",
|
"@redis/json": "1.0.6",
|
||||||
"@redis/search": "1.1.5",
|
"@redis/search": "1.1.5",
|
||||||
"@redis/time-series": "1.0.5"
|
"@redis/time-series": "1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/redis/node_modules/@redis/client": {
|
|
||||||
"version": "1.5.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.11.tgz",
|
|
||||||
"integrity": "sha512-cV7yHcOAtNQ5x/yQl7Yw1xf53kO0FNDTdDU6bFIMbW6ljB7U7ns0YRM+QIkpoqTAt6zK5k9Fq0QWlUbLcq9AvA==",
|
|
||||||
"dependencies": {
|
|
||||||
"cluster-key-slot": "1.1.2",
|
|
||||||
"generic-pool": "3.9.0",
|
|
||||||
"yallist": "4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/redis/node_modules/yallist": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
|
||||||
},
|
|
||||||
"packages/search": {
|
"packages/search": {
|
||||||
"name": "@redis/search",
|
"name": "@redis/search",
|
||||||
"version": "1.1.5",
|
"version": "1.1.5",
|
||||||
|
10
package.json
10
package.json
@@ -6,22 +6,22 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run test -ws --if-present",
|
"test": "npm run test -ws --if-present",
|
||||||
"build": "tsc --build",
|
"build": "NODE_OPTIONS='--max-old-space-size=8192' tsc --build",
|
||||||
"documentation": "typedoc",
|
"documentation": "typedoc",
|
||||||
"gh-pages": "gh-pages -d ./documentation -e ./documentation -u 'documentation-bot <documentation@bot>'"
|
"gh-pages": "gh-pages -d ./documentation -e ./documentation -u 'documentation-bot <documentation@bot>'"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||||
"@tsconfig/node18": "^18.2.2",
|
"@tsconfig/node18": "^18.2.2",
|
||||||
"@types/mocha": "^10.0.1",
|
"@types/mocha": "^10.0.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
||||||
"@typescript-eslint/parser": "^6.7.2",
|
"@typescript-eslint/parser": "^6.9.0",
|
||||||
"gh-pages": "^6.0.0",
|
"gh-pages": "^6.0.0",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.25.1",
|
"typedoc": "^0.25.2",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ describe('CF.LOADCHUNK', () => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await client.cf.loadChunk('destination', iterator, chunk),
|
await client.cf.loadChunk('destination', iterator, chunk!),
|
||||||
'OK'
|
'OK'
|
||||||
);
|
);
|
||||||
}, {
|
}, {
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
"name": "@redis/bloom",
|
"name": "@redis/bloom",
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/lib/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"dist/",
|
||||||
"!dist/tsconfig.tsbuildinfo"
|
"!dist/tsconfig.tsbuildinfo"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
export { RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping/*, CommandPolicies*/ } from './lib/RESP/types';
|
export { RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping/*, CommandPolicies*/, RedisArgument } from './lib/RESP/types';
|
||||||
export { RESP_TYPES } from './lib/RESP/decoder';
|
export { RESP_TYPES } from './lib/RESP/decoder';
|
||||||
export { VerbatimString } from './lib/RESP/verbatim-string';
|
export { VerbatimString } from './lib/RESP/verbatim-string';
|
||||||
export { defineScript } from './lib/lua-script';
|
export { defineScript } from './lib/lua-script';
|
||||||
|
@@ -1,56 +1,62 @@
|
|||||||
// import { strict as assert } from 'node:assert';
|
import { strict as assert } from 'node:assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments, FilterBy } from './COMMAND_LIST';
|
import COMMAND_LIST from './COMMAND_LIST';
|
||||||
|
|
||||||
// describe('COMMAND LIST', () => {
|
describe('COMMAND LIST', () => {
|
||||||
// testUtils.isVersionGreaterThanHook([7]);
|
testUtils.isVersionGreaterThanHook([7]);
|
||||||
|
|
||||||
// describe('transformArguments', () => {
|
describe('transformArguments', () => {
|
||||||
// it('simple', () => {
|
it('simple', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments(),
|
COMMAND_LIST.transformArguments(),
|
||||||
// ['COMMAND', 'LIST']
|
['COMMAND', 'LIST']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// describe('with FILTERBY', () => {
|
describe('with FILTERBY', () => {
|
||||||
// it('MODULE', () => {
|
it('MODULE', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments({
|
COMMAND_LIST.transformArguments({
|
||||||
// filterBy: FilterBy.MODULE,
|
FILTERBY: {
|
||||||
// value: 'json'
|
type: 'MODULE',
|
||||||
// }),
|
value: 'JSON'
|
||||||
// ['COMMAND', 'LIST', 'FILTERBY', 'MODULE', 'json']
|
}
|
||||||
// );
|
}),
|
||||||
// });
|
['COMMAND', 'LIST', 'FILTERBY', 'MODULE', 'JSON']
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
// it('ACLCAT', () => {
|
it('ACLCAT', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments({
|
COMMAND_LIST.transformArguments({
|
||||||
// filterBy: FilterBy.ACLCAT,
|
FILTERBY: {
|
||||||
// value: 'admin'
|
type: 'ACLCAT',
|
||||||
// }),
|
value: 'admin'
|
||||||
// ['COMMAND', 'LIST', 'FILTERBY', 'ACLCAT', 'admin']
|
}
|
||||||
// );
|
}),
|
||||||
// });
|
['COMMAND', 'LIST', 'FILTERBY', 'ACLCAT', 'admin']
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
// it('PATTERN', () => {
|
it('PATTERN', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments({
|
COMMAND_LIST.transformArguments({
|
||||||
// filterBy: FilterBy.PATTERN,
|
FILTERBY: {
|
||||||
// value: 'a*'
|
type: 'PATTERN',
|
||||||
// }),
|
value: 'a*'
|
||||||
// ['COMMAND', 'LIST', 'FILTERBY', 'PATTERN', 'a*']
|
}
|
||||||
// );
|
}),
|
||||||
// });
|
['COMMAND', 'LIST', 'FILTERBY', 'PATTERN', 'a*']
|
||||||
// });
|
);
|
||||||
// });
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// testUtils.testWithClient('client.commandList', async client => {
|
testUtils.testWithClient('client.commandList', async client => {
|
||||||
// const commandList = await client.commandList();
|
const commandList = await client.commandList();
|
||||||
// assert.ok(Array.isArray(commandList));
|
assert.ok(Array.isArray(commandList));
|
||||||
// for (const command of commandList) {
|
for (const command of commandList) {
|
||||||
// assert.ok(typeof command === 'string');
|
assert.ok(typeof command === 'string');
|
||||||
// }
|
}
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
// });
|
});
|
||||||
|
@@ -1,31 +1,35 @@
|
|||||||
// import { RedisCommandArguments } from '.';
|
import { RedisArgument, ArrayReply, BlobStringReply, Command } from '../RESP/types';
|
||||||
|
|
||||||
// export const IS_READ_ONLY = true;
|
export const COMMAND_LIST_FILTER_BY = {
|
||||||
|
MODULE: 'MODULE',
|
||||||
|
ACLCAT: 'ACLCAT',
|
||||||
|
PATTERN: 'PATTERN'
|
||||||
|
} as const;
|
||||||
|
|
||||||
// export enum FilterBy {
|
export type CommandListFilterBy = typeof COMMAND_LIST_FILTER_BY[keyof typeof COMMAND_LIST_FILTER_BY];
|
||||||
// MODULE = 'MODULE',
|
|
||||||
// ACLCAT = 'ACLCAT',
|
|
||||||
// PATTERN = 'PATTERN'
|
|
||||||
// }
|
|
||||||
|
|
||||||
// interface Filter {
|
export interface CommandListOptions {
|
||||||
// filterBy: FilterBy;
|
FILTERBY?: {
|
||||||
// value: string;
|
type: CommandListFilterBy;
|
||||||
// }
|
value: RedisArgument;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
FIRST_KEY_INDEX: undefined,
|
||||||
|
IS_READ_ONLY: true,
|
||||||
|
transformArguments(options?: CommandListOptions) {
|
||||||
|
const args: Array<RedisArgument> = ['COMMAND', 'LIST'];
|
||||||
|
|
||||||
// export function transformArguments(filter?: Filter): RedisCommandArguments {
|
if (options?.FILTERBY) {
|
||||||
// const args = ['COMMAND', 'LIST'];
|
args.push(
|
||||||
|
'FILTERBY',
|
||||||
|
options.FILTERBY.type,
|
||||||
|
options.FILTERBY.value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// if (filter) {
|
return args;
|
||||||
// args.push(
|
},
|
||||||
// 'FILTERBY',
|
transformReply: undefined as unknown as () => ArrayReply<BlobStringReply>
|
||||||
// filter.filterBy,
|
} as const satisfies Command;
|
||||||
// filter.value
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return args;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export declare function transformReply(): Array<string>;
|
|
||||||
|
@@ -2,7 +2,7 @@ import { RedisArgument, Command } from '../RESP/types';
|
|||||||
import { transformSortedSetReply } from './generic-transformers';
|
import { transformSortedSetReply } from './generic-transformers';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FIRST_KEY_INDEX: undefined,
|
FIRST_KEY_INDEX: 1,
|
||||||
IS_READ_ONLY: false,
|
IS_READ_ONLY: false,
|
||||||
transformArguments(key: RedisArgument, count: number) {
|
transformArguments(key: RedisArgument, count: number) {
|
||||||
return ['ZPOPMIN', key, count.toString()];
|
return ['ZPOPMIN', key, count.toString()];
|
||||||
|
@@ -73,7 +73,7 @@ import COMMAND_COUNT from './COMMAND_COUNT';
|
|||||||
import COMMAND_GETKEYS from './COMMAND_GETKEYS';
|
import COMMAND_GETKEYS from './COMMAND_GETKEYS';
|
||||||
import COMMAND_GETKEYSANDFLAGS from './COMMAND_GETKEYSANDFLAGS';
|
import COMMAND_GETKEYSANDFLAGS from './COMMAND_GETKEYSANDFLAGS';
|
||||||
// import COMMAND_INFO from './COMMAND_INFO';
|
// import COMMAND_INFO from './COMMAND_INFO';
|
||||||
// import COMMAND_LIST from './COMMAND_LIST';
|
import COMMAND_LIST from './COMMAND_LIST';
|
||||||
// import COMMAND from './COMMAND';
|
// import COMMAND from './COMMAND';
|
||||||
import CONFIG_GET from './CONFIG_GET';
|
import CONFIG_GET from './CONFIG_GET';
|
||||||
import CONFIG_RESETASTAT from './CONFIG_RESETSTAT';
|
import CONFIG_RESETASTAT from './CONFIG_RESETSTAT';
|
||||||
@@ -483,8 +483,8 @@ export default {
|
|||||||
commandGetKeysAndFlags: COMMAND_GETKEYSANDFLAGS,
|
commandGetKeysAndFlags: COMMAND_GETKEYSANDFLAGS,
|
||||||
// COMMAND_INFO,
|
// COMMAND_INFO,
|
||||||
// commandInfo: COMMAND_INFO,
|
// commandInfo: COMMAND_INFO,
|
||||||
// COMMAND_LIST,
|
COMMAND_LIST,
|
||||||
// commandList: COMMAND_LIST,
|
commandList: COMMAND_LIST,
|
||||||
// COMMAND,
|
// COMMAND,
|
||||||
// command: COMMAND,
|
// command: COMMAND,
|
||||||
CONFIG_GET,
|
CONFIG_GET,
|
||||||
|
@@ -14,7 +14,7 @@ type QueryRawReply = TuplesReply<[
|
|||||||
metadata: Metadata
|
metadata: Metadata
|
||||||
]>;
|
]>;
|
||||||
|
|
||||||
type QueryParam = null | string | number | boolean | QueryParams | Array<QueryParam>;
|
type QueryParam = null | RedisArgument | number | boolean | QueryParams | Array<QueryParam>;
|
||||||
|
|
||||||
type QueryParams = {
|
type QueryParams = {
|
||||||
[key: string]: QueryParam;
|
[key: string]: QueryParam;
|
||||||
|
@@ -5,7 +5,7 @@ import SLOWLOG from './SLOWLOG';
|
|||||||
describe('GRAPH.SLOWLOG', () => {
|
describe('GRAPH.SLOWLOG', () => {
|
||||||
it('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
transformArguments('key'),
|
SLOWLOG.transformArguments('key'),
|
||||||
['GRAPH.SLOWLOG', 'key']
|
['GRAPH.SLOWLOG', 'key']
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -7,7 +7,7 @@ import LIST from './LIST';
|
|||||||
import PROFILE from './PROFILE';
|
import PROFILE from './PROFILE';
|
||||||
import QUERY from './QUERY';
|
import QUERY from './QUERY';
|
||||||
import RO_QUERY from './RO_QUERY';
|
import RO_QUERY from './RO_QUERY';
|
||||||
// import SLOWLOG from './SLOWLOG';
|
import SLOWLOG from './SLOWLOG';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
CONFIG_GET,
|
CONFIG_GET,
|
||||||
@@ -26,6 +26,6 @@ export default {
|
|||||||
query: QUERY,
|
query: QUERY,
|
||||||
RO_QUERY,
|
RO_QUERY,
|
||||||
roQuery: RO_QUERY,
|
roQuery: RO_QUERY,
|
||||||
// SLOWLOG,
|
SLOWLOG,
|
||||||
// slowLog: SLOWLOG
|
slowLog: SLOWLOG
|
||||||
} as const satisfies RedisCommands;
|
} as const satisfies RedisCommands;
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
"name": "@redis/graph",
|
"name": "@redis/graph",
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/lib/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"dist/",
|
||||||
"!dist/tsconfig.tsbuildinfo"
|
"!dist/tsconfig.tsbuildinfo"
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
"name": "@redis/json",
|
"name": "@redis/json",
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/lib/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/"
|
"dist/"
|
||||||
],
|
],
|
||||||
|
@@ -2,12 +2,14 @@ import {
|
|||||||
RedisModules,
|
RedisModules,
|
||||||
RedisFunctions,
|
RedisFunctions,
|
||||||
RedisScripts,
|
RedisScripts,
|
||||||
|
RespVersions,
|
||||||
|
TypeMapping,
|
||||||
createClient as _createClient,
|
createClient as _createClient,
|
||||||
RedisClientOptions,
|
RedisClientOptions,
|
||||||
RedisClientType as _RedisClientType,
|
RedisClientType as _RedisClientType,
|
||||||
createCluster as _createCluster,
|
createCluster as _createCluster,
|
||||||
RedisClusterOptions,
|
RedisClusterOptions,
|
||||||
RedisClusterType as _RedisClusterType
|
RedisClusterType as _RedisClusterType,
|
||||||
} from '@redis/client';
|
} from '@redis/client';
|
||||||
import RedisBloomModules from '@redis/bloom';
|
import RedisBloomModules from '@redis/bloom';
|
||||||
import RedisGraph from '@redis/graph';
|
import RedisGraph from '@redis/graph';
|
||||||
@@ -15,12 +17,12 @@ import RedisJSON from '@redis/json';
|
|||||||
import RediSearch from '@redis/search';
|
import RediSearch from '@redis/search';
|
||||||
import RedisTimeSeries from '@redis/time-series';
|
import RedisTimeSeries from '@redis/time-series';
|
||||||
|
|
||||||
export * from '@redis/client';
|
// export * from '@redis/client';
|
||||||
export * from '@redis/bloom';
|
// export * from '@redis/bloom';
|
||||||
export * from '@redis/graph';
|
// export * from '@redis/graph';
|
||||||
export * from '@redis/json';
|
// export * from '@redis/json';
|
||||||
export * from '@redis/search';
|
// export * from '@redis/search';
|
||||||
export * from '@redis/time-series';
|
// export * from '@redis/time-series';
|
||||||
|
|
||||||
const modules = {
|
const modules = {
|
||||||
...RedisBloomModules,
|
...RedisBloomModules,
|
||||||
@@ -34,17 +36,21 @@ export type RedisDefaultModules = typeof modules;
|
|||||||
|
|
||||||
export type RedisClientType<
|
export type RedisClientType<
|
||||||
M extends RedisModules = RedisDefaultModules,
|
M extends RedisModules = RedisDefaultModules,
|
||||||
F extends RedisFunctions = Record<string, never>,
|
F extends RedisFunctions = {},
|
||||||
S extends RedisScripts = Record<string, never>
|
S extends RedisScripts = {},
|
||||||
> = _RedisClientType<M, F, S>;
|
RESP extends RespVersions = 2,
|
||||||
|
TYPE_MAPPING extends TypeMapping = {}
|
||||||
|
> = _RedisClientType<M, F, S, RESP, TYPE_MAPPING>;
|
||||||
|
|
||||||
export function createClient<
|
export function createClient<
|
||||||
M extends RedisModules,
|
M extends RedisModules,
|
||||||
F extends RedisFunctions,
|
F extends RedisFunctions,
|
||||||
S extends RedisScripts
|
S extends RedisScripts,
|
||||||
|
RESP extends RespVersions,
|
||||||
|
TYPE_MAPPING extends TypeMapping
|
||||||
>(
|
>(
|
||||||
options?: RedisClientOptions<M, F, S>
|
options?: RedisClientOptions<M, F, S, RESP, TYPE_MAPPING>
|
||||||
): _RedisClientType<RedisDefaultModules & M, F, S> {
|
): _RedisClientType<RedisDefaultModules & M, F, S, RESP, TYPE_MAPPING> {
|
||||||
return _createClient({
|
return _createClient({
|
||||||
...options,
|
...options,
|
||||||
modules: {
|
modules: {
|
||||||
@@ -56,17 +62,21 @@ export function createClient<
|
|||||||
|
|
||||||
export type RedisClusterType<
|
export type RedisClusterType<
|
||||||
M extends RedisModules = RedisDefaultModules,
|
M extends RedisModules = RedisDefaultModules,
|
||||||
F extends RedisFunctions = Record<string, never>,
|
F extends RedisFunctions = {},
|
||||||
S extends RedisScripts = Record<string, never>
|
S extends RedisScripts = {},
|
||||||
> = _RedisClusterType<M, F, S>;
|
RESP extends RespVersions = 2,
|
||||||
|
TYPE_MAPPING extends TypeMapping = {}
|
||||||
|
> = _RedisClusterType<M, F, S, RESP, TYPE_MAPPING>;
|
||||||
|
|
||||||
export function createCluster<
|
export function createCluster<
|
||||||
M extends RedisModules,
|
M extends RedisModules,
|
||||||
F extends RedisFunctions,
|
F extends RedisFunctions,
|
||||||
S extends RedisScripts
|
S extends RedisScripts,
|
||||||
|
RESP extends RespVersions,
|
||||||
|
TYPE_MAPPING extends TypeMapping
|
||||||
>(
|
>(
|
||||||
options: RedisClusterOptions<M, F, S>
|
options: RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>
|
||||||
): RedisClusterType<RedisDefaultModules & M, F, S> {
|
): RedisClusterType<RedisDefaultModules & M, F, S, RESP, TYPE_MAPPING> {
|
||||||
return _createCluster({
|
return _createCluster({
|
||||||
...options,
|
...options,
|
||||||
modules: {
|
modules: {
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@redis/bloom": "1.2.0",
|
"@redis/bloom": "1.2.0",
|
||||||
"@redis/client": "1.5.11",
|
"@redis/client": "2.0.0-next.2",
|
||||||
"@redis/graph": "1.1.0",
|
"@redis/graph": "1.1.0",
|
||||||
"@redis/json": "1.0.6",
|
"@redis/json": "1.0.6",
|
||||||
"@redis/search": "1.1.5",
|
"@redis/search": "1.1.5",
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { strict as assert } from 'node:assert';
|
import { strict as assert } from 'node:assert';
|
||||||
import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
import { SchemaFieldTypes } from '.';
|
|
||||||
import SPELLCHECK from './SPELLCHECK';
|
import SPELLCHECK from './SPELLCHECK';
|
||||||
|
|
||||||
describe('FT.SPELLCHECK', () => {
|
describe('FT.SPELLCHECK', () => {
|
||||||
@@ -63,7 +62,7 @@ describe('FT.SPELLCHECK', () => {
|
|||||||
testUtils.testWithClient('client.ft.spellCheck', async client => {
|
testUtils.testWithClient('client.ft.spellCheck', async client => {
|
||||||
const [,, reply] = await Promise.all([
|
const [,, reply] = await Promise.all([
|
||||||
client.ft.create('index', {
|
client.ft.create('index', {
|
||||||
field: SchemaFieldTypes.TEXT
|
field: 'TEXT'
|
||||||
}),
|
}),
|
||||||
client.hSet('key', 'field', 'query'),
|
client.hSet('key', 'field', 'query'),
|
||||||
client.ft.spellCheck('index', 'quer')
|
client.ft.spellCheck('index', 'quer')
|
||||||
|
@@ -14,8 +14,8 @@ import DICTADD from './DICTADD';
|
|||||||
import DICTDEL from './DICTDEL';
|
import DICTDEL from './DICTDEL';
|
||||||
import DICTDUMP from './DICTDUMP';
|
import DICTDUMP from './DICTDUMP';
|
||||||
import DROPINDEX from './DROPINDEX';
|
import DROPINDEX from './DROPINDEX';
|
||||||
import EXPLAIN from './EXPLAIN';
|
// import EXPLAIN from './EXPLAIN';
|
||||||
import EXPLAINCLI from './EXPLAINCLI';
|
// import EXPLAINCLI from './EXPLAINCLI';
|
||||||
// import INFO from './INFO';
|
// import INFO from './INFO';
|
||||||
// import PROFILESEARCH from './PROFILE_SEARCH';
|
// import PROFILESEARCH from './PROFILE_SEARCH';
|
||||||
// import PROFILEAGGREGATE from './PROFILE_AGGREGATE';
|
// import PROFILEAGGREGATE from './PROFILE_AGGREGATE';
|
||||||
@@ -32,9 +32,9 @@ import SYNDUMP from './SYNDUMP';
|
|||||||
import SYNUPDATE from './SYNUPDATE';
|
import SYNUPDATE from './SYNUPDATE';
|
||||||
import TAGVALS from './TAGVALS';
|
import TAGVALS from './TAGVALS';
|
||||||
// import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
|
// import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
|
||||||
import { pushOptionalVariadicArgument, pushVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
// import { pushOptionalVariadicArgument, pushVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
||||||
import { SearchOptions } from './SEARCH';
|
// import { SearchOptions } from './SEARCH';
|
||||||
import { CommandArguments } from '@redis/client/dist/lib/RESP/types';
|
// import { CommandArguments } from '@redis/client/dist/lib/RESP/types';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
_LIST,
|
_LIST,
|
||||||
@@ -69,10 +69,10 @@ export default {
|
|||||||
dictDump: DICTDUMP,
|
dictDump: DICTDUMP,
|
||||||
DROPINDEX,
|
DROPINDEX,
|
||||||
dropIndex: DROPINDEX,
|
dropIndex: DROPINDEX,
|
||||||
EXPLAIN,
|
// EXPLAIN,
|
||||||
explain: EXPLAIN,
|
// explain: EXPLAIN,
|
||||||
EXPLAINCLI,
|
// EXPLAINCLI,
|
||||||
explainCli: EXPLAINCLI,
|
// explainCli: EXPLAINCLI,
|
||||||
// INFO,
|
// INFO,
|
||||||
// info: INFO,
|
// info: INFO,
|
||||||
// PROFILESEARCH,
|
// PROFILESEARCH,
|
||||||
@@ -135,41 +135,41 @@ export default {
|
|||||||
|
|
||||||
export type PropertyName = `${'@' | '$.'}${string}`;
|
export type PropertyName = `${'@' | '$.'}${string}`;
|
||||||
|
|
||||||
export type SortByProperty = string | {
|
// export type SortByProperty = string | {
|
||||||
BY: string;
|
// BY: string;
|
||||||
DIRECTION?: 'ASC' | 'DESC';
|
// DIRECTION?: 'ASC' | 'DESC';
|
||||||
};
|
// };
|
||||||
|
|
||||||
export function pushSortByProperty(args: RedisCommandArguments, sortBy: SortByProperty): void {
|
// export function pushSortByProperty(args: RedisCommandArguments, sortBy: SortByProperty): void {
|
||||||
if (typeof sortBy === 'string') {
|
// if (typeof sortBy === 'string') {
|
||||||
args.push(sortBy);
|
// args.push(sortBy);
|
||||||
} else {
|
// } else {
|
||||||
args.push(sortBy.BY);
|
// args.push(sortBy.BY);
|
||||||
|
|
||||||
if (sortBy.DIRECTION) {
|
// if (sortBy.DIRECTION) {
|
||||||
args.push(sortBy.DIRECTION);
|
// args.push(sortBy.DIRECTION);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function pushSortByArguments(args: RedisCommandArguments, name: string, sortBy: SortByProperty | Array<SortByProperty>): RedisCommandArguments {
|
// export function pushSortByArguments(args: RedisCommandArguments, name: string, sortBy: SortByProperty | Array<SortByProperty>): RedisCommandArguments {
|
||||||
const lengthBefore = args.push(
|
// const lengthBefore = args.push(
|
||||||
name,
|
// name,
|
||||||
'' // will be overwritten
|
// '' // will be overwritten
|
||||||
);
|
// );
|
||||||
|
|
||||||
if (Array.isArray(sortBy)) {
|
// if (Array.isArray(sortBy)) {
|
||||||
for (const field of sortBy) {
|
// for (const field of sortBy) {
|
||||||
pushSortByProperty(args, field);
|
// pushSortByProperty(args, field);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
pushSortByProperty(args, sortBy);
|
// pushSortByProperty(args, sortBy);
|
||||||
}
|
// }
|
||||||
|
|
||||||
args[lengthBefore - 1] = (args.length - lengthBefore).toString();
|
// args[lengthBefore - 1] = (args.length - lengthBefore).toString();
|
||||||
|
|
||||||
return args;
|
// return args;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// export function pushArgumentsWithLength(args: CommandArguments, fn: (args: CommandArguments) => void) {
|
// export function pushArgumentsWithLength(args: CommandArguments, fn: (args: CommandArguments) => void) {
|
||||||
// const lengthIndex = args.push('') - 1;
|
// const lengthIndex = args.push('') - 1;
|
||||||
@@ -375,268 +375,268 @@ export function pushSortByArguments(args: RedisCommandArguments, name: string, s
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export type Params = Record<string, RedisCommandArgument | number>;
|
// export type Params = Record<string, RedisCommandArgument | number>;
|
||||||
|
|
||||||
export function pushParamsArgs(
|
// export function pushParamsArgs(
|
||||||
args: RedisCommandArguments,
|
// args: RedisCommandArguments,
|
||||||
params?: Params
|
// params?: Params
|
||||||
): RedisCommandArguments {
|
// ): RedisCommandArguments {
|
||||||
if (params) {
|
// if (params) {
|
||||||
const enrties = Object.entries(params);
|
// const enrties = Object.entries(params);
|
||||||
args.push('PARAMS', (enrties.length * 2).toString());
|
// args.push('PARAMS', (enrties.length * 2).toString());
|
||||||
for (const [key, value] of enrties) {
|
// for (const [key, value] of enrties) {
|
||||||
args.push(key, typeof value === 'number' ? value.toString() : value);
|
// args.push(key, typeof value === 'number' ? value.toString() : value);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return args;
|
// return args;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function pushSearchOptions(
|
// export function pushSearchOptions(
|
||||||
args: RedisCommandArguments,
|
// args: RedisCommandArguments,
|
||||||
options?: SearchOptions
|
// options?: SearchOptions
|
||||||
): RedisCommandArguments {
|
// ): RedisCommandArguments {
|
||||||
if (options?.VERBATIM) {
|
// if (options?.VERBATIM) {
|
||||||
args.push('VERBATIM');
|
// args.push('VERBATIM');
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.NOSTOPWORDS) {
|
// if (options?.NOSTOPWORDS) {
|
||||||
args.push('NOSTOPWORDS');
|
// args.push('NOSTOPWORDS');
|
||||||
}
|
// }
|
||||||
|
|
||||||
// if (options?.WITHSCORES) {
|
// // if (options?.WITHSCORES) {
|
||||||
// args.push('WITHSCORES');
|
// // args.push('WITHSCORES');
|
||||||
// }
|
// // }
|
||||||
|
|
||||||
// if (options?.WITHPAYLOADS) {
|
// // if (options?.WITHPAYLOADS) {
|
||||||
// args.push('WITHPAYLOADS');
|
// // args.push('WITHPAYLOADS');
|
||||||
// }
|
// // }
|
||||||
|
|
||||||
pushOptionalVariadicArgument(args, 'INKEYS', options?.INKEYS);
|
// pushOptionalVariadicArgument(args, 'INKEYS', options?.INKEYS);
|
||||||
pushOptionalVariadicArgument(args, 'INFIELDS', options?.INFIELDS);
|
// pushOptionalVariadicArgument(args, 'INFIELDS', options?.INFIELDS);
|
||||||
pushOptionalVariadicArgument(args, 'RETURN', options?.RETURN);
|
// pushOptionalVariadicArgument(args, 'RETURN', options?.RETURN);
|
||||||
|
|
||||||
if (options?.SUMMARIZE) {
|
// if (options?.SUMMARIZE) {
|
||||||
args.push('SUMMARIZE');
|
// args.push('SUMMARIZE');
|
||||||
|
|
||||||
if (typeof options.SUMMARIZE === 'object') {
|
// if (typeof options.SUMMARIZE === 'object') {
|
||||||
if (options.SUMMARIZE.FIELDS) {
|
// if (options.SUMMARIZE.FIELDS) {
|
||||||
args.push('FIELDS');
|
// args.push('FIELDS');
|
||||||
pushVariadicArgument(args, options.SUMMARIZE.FIELDS);
|
// pushVariadicArgument(args, options.SUMMARIZE.FIELDS);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options.SUMMARIZE.FRAGS) {
|
// if (options.SUMMARIZE.FRAGS) {
|
||||||
args.push('FRAGS', options.SUMMARIZE.FRAGS.toString());
|
// args.push('FRAGS', options.SUMMARIZE.FRAGS.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options.SUMMARIZE.LEN) {
|
// if (options.SUMMARIZE.LEN) {
|
||||||
args.push('LEN', options.SUMMARIZE.LEN.toString());
|
// args.push('LEN', options.SUMMARIZE.LEN.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options.SUMMARIZE.SEPARATOR) {
|
// if (options.SUMMARIZE.SEPARATOR) {
|
||||||
args.push('SEPARATOR', options.SUMMARIZE.SEPARATOR);
|
// args.push('SEPARATOR', options.SUMMARIZE.SEPARATOR);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.HIGHLIGHT) {
|
// if (options?.HIGHLIGHT) {
|
||||||
args.push('HIGHLIGHT');
|
// args.push('HIGHLIGHT');
|
||||||
|
|
||||||
if (typeof options.HIGHLIGHT === 'object') {
|
// if (typeof options.HIGHLIGHT === 'object') {
|
||||||
if (options.HIGHLIGHT.FIELDS) {
|
// if (options.HIGHLIGHT.FIELDS) {
|
||||||
args.push('FIELDS');
|
// args.push('FIELDS');
|
||||||
pushVariadicArgument(args, options.HIGHLIGHT.FIELDS);
|
// pushVariadicArgument(args, options.HIGHLIGHT.FIELDS);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options.HIGHLIGHT.TAGS) {
|
// if (options.HIGHLIGHT.TAGS) {
|
||||||
args.push('TAGS', options.HIGHLIGHT.TAGS.open, options.HIGHLIGHT.TAGS.close);
|
// args.push('TAGS', options.HIGHLIGHT.TAGS.open, options.HIGHLIGHT.TAGS.close);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.SLOP) {
|
// if (options?.SLOP) {
|
||||||
args.push('SLOP', options.SLOP.toString());
|
// args.push('SLOP', options.SLOP.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.INORDER) {
|
// if (options?.INORDER) {
|
||||||
args.push('INORDER');
|
// args.push('INORDER');
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.LANGUAGE) {
|
// if (options?.LANGUAGE) {
|
||||||
args.push('LANGUAGE', options.LANGUAGE);
|
// args.push('LANGUAGE', options.LANGUAGE);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.EXPANDER) {
|
// if (options?.EXPANDER) {
|
||||||
args.push('EXPANDER', options.EXPANDER);
|
// args.push('EXPANDER', options.EXPANDER);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.SCORER) {
|
// if (options?.SCORER) {
|
||||||
args.push('SCORER', options.SCORER);
|
// args.push('SCORER', options.SCORER);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// if (options?.EXPLAINSCORE) {
|
// // if (options?.EXPLAINSCORE) {
|
||||||
// args.push('EXPLAINSCORE');
|
// // args.push('EXPLAINSCORE');
|
||||||
// }
|
// // }
|
||||||
|
|
||||||
// if (options?.PAYLOAD) {
|
// // if (options?.PAYLOAD) {
|
||||||
// args.push('PAYLOAD', options.PAYLOAD);
|
// // args.push('PAYLOAD', options.PAYLOAD);
|
||||||
// }
|
// // }
|
||||||
|
|
||||||
if (options?.SORTBY) {
|
// if (options?.SORTBY) {
|
||||||
args.push('SORTBY');
|
// args.push('SORTBY');
|
||||||
pushSortByProperty(args, options.SORTBY);
|
// pushSortByProperty(args, options.SORTBY);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// if (options?.MSORTBY) {
|
// // if (options?.MSORTBY) {
|
||||||
// pushSortByArguments(args, 'MSORTBY', options.MSORTBY);
|
// // pushSortByArguments(args, 'MSORTBY', options.MSORTBY);
|
||||||
// }
|
// // }
|
||||||
|
|
||||||
if (options?.LIMIT) {
|
// if (options?.LIMIT) {
|
||||||
args.push(
|
// args.push(
|
||||||
'LIMIT',
|
// 'LIMIT',
|
||||||
options.LIMIT.from.toString(),
|
// options.LIMIT.from.toString(),
|
||||||
options.LIMIT.size.toString()
|
// options.LIMIT.size.toString()
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.PARAMS) {
|
// if (options?.PARAMS) {
|
||||||
pushParamsArgs(args, options.PARAMS);
|
// pushParamsArgs(args, options.PARAMS);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.DIALECT) {
|
// if (options?.DIALECT) {
|
||||||
args.push('DIALECT', options.DIALECT.toString());
|
// args.push('DIALECT', options.DIALECT.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.RETURN?.length === 0) {
|
// if (options?.RETURN?.length === 0) {
|
||||||
args.preserve = true;
|
// args.preserve = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (options?.TIMEOUT !== undefined) {
|
// if (options?.TIMEOUT !== undefined) {
|
||||||
args.push('TIMEOUT', options.TIMEOUT.toString());
|
// args.push('TIMEOUT', options.TIMEOUT.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
return args;
|
// return args;
|
||||||
}
|
// }
|
||||||
|
|
||||||
interface SearchDocumentValue {
|
// interface SearchDocumentValue {
|
||||||
[key: string]: string | number | null | Array<SearchDocumentValue> | SearchDocumentValue;
|
// [key: string]: string | number | null | Array<SearchDocumentValue> | SearchDocumentValue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export interface SearchReply {
|
// export interface SearchReply {
|
||||||
total: number;
|
// total: number;
|
||||||
documents: Array<{
|
// documents: Array<{
|
||||||
id: string;
|
// id: string;
|
||||||
value: SearchDocumentValue;
|
// value: SearchDocumentValue;
|
||||||
}>;
|
// }>;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export interface ProfileOptions {
|
// export interface ProfileOptions {
|
||||||
LIMITED?: true;
|
// LIMITED?: true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export type ProfileRawReply<T> = [
|
// export type ProfileRawReply<T> = [
|
||||||
results: T,
|
// results: T,
|
||||||
profile: [
|
// profile: [
|
||||||
_: string,
|
// _: string,
|
||||||
TotalProfileTime: string,
|
// TotalProfileTime: string,
|
||||||
_: string,
|
// _: string,
|
||||||
ParsingTime: string,
|
// ParsingTime: string,
|
||||||
_: string,
|
// _: string,
|
||||||
PipelineCreationTime: string,
|
// PipelineCreationTime: string,
|
||||||
_: string,
|
// _: string,
|
||||||
IteratorsProfile: Array<any>
|
// IteratorsProfile: Array<any>
|
||||||
]
|
// ]
|
||||||
];
|
// ];
|
||||||
|
|
||||||
export interface ProfileReply {
|
// export interface ProfileReply {
|
||||||
results: SearchReply | AGGREGATE.AggregateReply;
|
// results: SearchReply | AGGREGATE.AggregateReply;
|
||||||
profile: ProfileData;
|
// profile: ProfileData;
|
||||||
}
|
// }
|
||||||
|
|
||||||
interface ChildIterator {
|
// interface ChildIterator {
|
||||||
type?: string,
|
// type?: string,
|
||||||
counter?: number,
|
// counter?: number,
|
||||||
term?: string,
|
// term?: string,
|
||||||
size?: number,
|
// size?: number,
|
||||||
time?: string,
|
// time?: string,
|
||||||
childIterators?: Array<ChildIterator>
|
// childIterators?: Array<ChildIterator>
|
||||||
}
|
// }
|
||||||
|
|
||||||
interface IteratorsProfile {
|
// interface IteratorsProfile {
|
||||||
type?: string,
|
// type?: string,
|
||||||
counter?: number,
|
// counter?: number,
|
||||||
queryType?: string,
|
// queryType?: string,
|
||||||
time?: string,
|
// time?: string,
|
||||||
childIterators?: Array<ChildIterator>
|
// childIterators?: Array<ChildIterator>
|
||||||
}
|
// }
|
||||||
|
|
||||||
interface ProfileData {
|
// interface ProfileData {
|
||||||
totalProfileTime: string,
|
// totalProfileTime: string,
|
||||||
parsingTime: string,
|
// parsingTime: string,
|
||||||
pipelineCreationTime: string,
|
// pipelineCreationTime: string,
|
||||||
iteratorsProfile: IteratorsProfile
|
// iteratorsProfile: IteratorsProfile
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function transformProfile(reply: Array<any>): ProfileData {
|
// export function transformProfile(reply: Array<any>): ProfileData {
|
||||||
return {
|
// return {
|
||||||
totalProfileTime: reply[0][1],
|
// totalProfileTime: reply[0][1],
|
||||||
parsingTime: reply[1][1],
|
// parsingTime: reply[1][1],
|
||||||
pipelineCreationTime: reply[2][1],
|
// pipelineCreationTime: reply[2][1],
|
||||||
iteratorsProfile: transformIterators(reply[3][1])
|
// iteratorsProfile: transformIterators(reply[3][1])
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
|
|
||||||
function transformIterators(IteratorsProfile: Array<any>): IteratorsProfile {
|
// function transformIterators(IteratorsProfile: Array<any>): IteratorsProfile {
|
||||||
var res: IteratorsProfile = {};
|
// var res: IteratorsProfile = {};
|
||||||
for (let i = 0; i < IteratorsProfile.length; i += 2) {
|
// for (let i = 0; i < IteratorsProfile.length; i += 2) {
|
||||||
const value = IteratorsProfile[i + 1];
|
// const value = IteratorsProfile[i + 1];
|
||||||
switch (IteratorsProfile[i]) {
|
// switch (IteratorsProfile[i]) {
|
||||||
case 'Type':
|
// case 'Type':
|
||||||
res.type = value;
|
// res.type = value;
|
||||||
break;
|
// break;
|
||||||
case 'Counter':
|
// case 'Counter':
|
||||||
res.counter = value;
|
// res.counter = value;
|
||||||
break;
|
// break;
|
||||||
case 'Time':
|
// case 'Time':
|
||||||
res.time = value;
|
// res.time = value;
|
||||||
break;
|
// break;
|
||||||
case 'Query type':
|
// case 'Query type':
|
||||||
res.queryType = value;
|
// res.queryType = value;
|
||||||
break;
|
// break;
|
||||||
case 'Child iterators':
|
// case 'Child iterators':
|
||||||
res.childIterators = value.map(transformChildIterators);
|
// res.childIterators = value.map(transformChildIterators);
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return res;
|
// return res;
|
||||||
}
|
// }
|
||||||
|
|
||||||
function transformChildIterators(IteratorsProfile: Array<any>): ChildIterator {
|
// function transformChildIterators(IteratorsProfile: Array<any>): ChildIterator {
|
||||||
var res: ChildIterator = {};
|
// var res: ChildIterator = {};
|
||||||
for (let i = 1; i < IteratorsProfile.length; i += 2) {
|
// for (let i = 1; i < IteratorsProfile.length; i += 2) {
|
||||||
const value = IteratorsProfile[i + 1];
|
// const value = IteratorsProfile[i + 1];
|
||||||
switch (IteratorsProfile[i]) {
|
// switch (IteratorsProfile[i]) {
|
||||||
case 'Type':
|
// case 'Type':
|
||||||
res.type = value;
|
// res.type = value;
|
||||||
break;
|
// break;
|
||||||
case 'Counter':
|
// case 'Counter':
|
||||||
res.counter = value;
|
// res.counter = value;
|
||||||
break;
|
// break;
|
||||||
case 'Time':
|
// case 'Time':
|
||||||
res.time = value;
|
// res.time = value;
|
||||||
break;
|
// break;
|
||||||
case 'Size':
|
// case 'Size':
|
||||||
res.size = value;
|
// res.size = value;
|
||||||
break;
|
// break;
|
||||||
case 'Term':
|
// case 'Term':
|
||||||
res.term = value;
|
// res.term = value;
|
||||||
break;
|
// break;
|
||||||
case 'Child iterators':
|
// case 'Child iterators':
|
||||||
res.childIterators = value.map(transformChildIterators);
|
// res.childIterators = value.map(transformChildIterators);
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return res;
|
// return res;
|
||||||
}
|
// }
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
export { default } from './commands';
|
export { default } from './commands';
|
||||||
|
|
||||||
export { RediSearchSchema, SchemaFieldTypes, SchemaTextFieldPhonetics, SearchReply, VectorAlgorithms } from './commands';
|
export { SCHEMA_FIELD_TYPE, SchemaFieldType } from './commands/CREATE';
|
||||||
export { AggregateSteps, AggregateGroupByReducers } from './commands/AGGREGATE';
|
|
||||||
export { SearchOptions } from './commands/SEARCH';
|
// export { RediSearchSchema, SchemaFieldTypes, SchemaTextFieldPhonetics, SearchReply, VectorAlgorithms } from './commands';
|
||||||
|
// export { AggregateSteps, AggregateGroupByReducers } from './commands/AGGREGATE';
|
||||||
|
// export { SearchOptions } from './commands/SEARCH';
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
"name": "@redis/search",
|
"name": "@redis/search",
|
||||||
"version": "1.1.5",
|
"version": "1.1.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/lib/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"dist/",
|
||||||
"!dist/tsconfig.tsbuildinfo"
|
"!dist/tsconfig.tsbuildinfo"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { RedisArgument, Command, CommandArguments } from '@redis/client/dist/lib/RESP/types';
|
import { RedisArgument, Command, CommandArguments } from '@redis/client/dist/lib/RESP/types';
|
||||||
import { RedisVariadicArgument, pushVariadicArguments } from '@redis/client/dist/lib/commands/generic-transformers';
|
import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
||||||
import { Timestamp } from '.';
|
import { Timestamp } from '.';
|
||||||
import { TsRangeOptions, pushRangeArguments } from './RANGE';
|
import { TsRangeOptions, pushRangeArguments } from './RANGE';
|
||||||
import { pushFilterArgument } from './MGET';
|
import { pushFilterArgument } from './MGET';
|
||||||
@@ -63,6 +63,5 @@ export default {
|
|||||||
IS_READ_ONLY: true,
|
IS_READ_ONLY: true,
|
||||||
transformArguments: transformMRangeArguments.bind(undefined, 'TS.MRANGE'),
|
transformArguments: transformMRangeArguments.bind(undefined, 'TS.MRANGE'),
|
||||||
// TODO
|
// TODO
|
||||||
// export { transformMRangeReply as transformReply } from '.';
|
|
||||||
transformReply: undefined as unknown as () => any
|
transformReply: undefined as unknown as () => any
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -27,6 +27,5 @@ export default {
|
|||||||
IS_READ_ONLY: true,
|
IS_READ_ONLY: true,
|
||||||
transformArguments: transformMRangeWithLabelsArguments.bind(undefined, 'TS.MRANGE'),
|
transformArguments: transformMRangeWithLabelsArguments.bind(undefined, 'TS.MRANGE'),
|
||||||
// TODO
|
// TODO
|
||||||
// export { transformMRangeWithLabelsReply as transformReply } from '.';
|
|
||||||
transformReply: undefined as unknown as () => any
|
transformReply: undefined as unknown as () => any
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
import { Command } from '@redis/client/dist/lib/RESP/types';
|
import { Command } from '@redis/client/dist/lib/RESP/types';
|
||||||
import { transformMRangeWithLabelsArguments } from './MRANGE_WITHLABELS';
|
import MRANGE_WITHLABELS, { transformMRangeWithLabelsArguments } from './MRANGE_WITHLABELS';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FIRST_KEY_INDEX: undefined,
|
FIRST_KEY_INDEX: MRANGE_WITHLABELS.FIRST_KEY_INDEX,
|
||||||
IS_READ_ONLY: true,
|
IS_READ_ONLY: MRANGE_WITHLABELS.IS_READ_ONLY,
|
||||||
transformArguments: transformMRangeWithLabelsArguments.bind(undefined, 'TS.MREVRANGE'),
|
transformArguments: transformMRangeWithLabelsArguments.bind(undefined, 'TS.MREVRANGE'),
|
||||||
// TODO
|
transformReply: MRANGE_WITHLABELS.transformReply
|
||||||
// export { transformMRangeWithLabelsReply as transformReply } from '.';
|
|
||||||
transformReply: undefined as unknown as () => any
|
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { CommandArguments, RedisArgument, Command } from '@redis/client/dist/lib/RESP/types';
|
import { CommandArguments, RedisArgument, ArrayReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
|
||||||
import { Timestamp, transformTimestampArgument } from '.';
|
import { Timestamp, transformTimestampArgument, SampleRawReply, transformSampleReply } from '.';
|
||||||
import { TimeSeriesAggregationType } from './CREATERULE';
|
import { TimeSeriesAggregationType } from './CREATERULE';
|
||||||
|
|
||||||
export const TIME_SERIES_BUCKET_TIMESTAMP = {
|
export const TIME_SERIES_BUCKET_TIMESTAMP = {
|
||||||
@@ -107,11 +107,13 @@ export default {
|
|||||||
FIRST_KEY_INDEX: 1,
|
FIRST_KEY_INDEX: 1,
|
||||||
IS_READ_ONLY: true,
|
IS_READ_ONLY: true,
|
||||||
transformArguments: transformRangeArguments.bind(undefined, 'TS.RANGE'),
|
transformArguments: transformRangeArguments.bind(undefined, 'TS.RANGE'),
|
||||||
// TODO
|
transformReply: {
|
||||||
// import { SampleReply, transformRangeReply } from '.';
|
2(reply: UnwrapReply<ArrayReply<SampleRawReply[2]>>) {
|
||||||
// export function transformReply(reply: Array<SampleRawReply>): Array<SampleReply> {
|
return reply.map(sample => transformSampleReply['2'](sample));
|
||||||
// return transformRangeReply(reply);
|
},
|
||||||
// }
|
3(reply: UnwrapReply<ArrayReply<SampleRawReply[3]>>) {
|
||||||
transformReply: undefined as unknown as () => any
|
return reply.map(sample => transformSampleReply['3'](sample));
|
||||||
|
}
|
||||||
|
}
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
|
||||||
|
@@ -1,94 +1,33 @@
|
|||||||
import { strict as assert } from 'node:assert';
|
import { strict as assert } from 'node:assert';
|
||||||
import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
import { transformArguments } from './REVRANGE';
|
import REVRANGE from './REVRANGE';
|
||||||
import { TimeSeriesAggregationType } from '.';
|
import { TIME_SERIES_AGGREGATION_TYPE } from '../index';
|
||||||
|
|
||||||
describe('TS.REVRANGE', () => {
|
describe('TS.REVRANGE', () => {
|
||||||
describe('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
it('without options', () => {
|
assert.deepEqual(
|
||||||
assert.deepEqual(
|
REVRANGE.transformArguments('key', '-', '+', {
|
||||||
transformArguments('key', '-', '+'),
|
FILTER_BY_TS: [0],
|
||||||
['TS.REVRANGE', 'key', '-', '+']
|
FILTER_BY_VALUE: {
|
||||||
);
|
min: 1,
|
||||||
});
|
max: 2
|
||||||
|
},
|
||||||
it('with FILTER_BY_TS', () => {
|
COUNT: 1,
|
||||||
assert.deepEqual(
|
ALIGN: '-',
|
||||||
transformArguments('key', '-', '+', {
|
AGGREGATION: {
|
||||||
FILTER_BY_TS: [0]
|
type: TIME_SERIES_AGGREGATION_TYPE.AVG,
|
||||||
}),
|
timeBucket: 1
|
||||||
['TS.REVRANGE', 'key', '-', '+', 'FILTER_BY_TS', '0']
|
}
|
||||||
);
|
}),
|
||||||
});
|
[
|
||||||
|
'TS.REVRANGE', 'key', '-', '+', 'FILTER_BY_TS', '0', 'FILTER_BY_VALUE',
|
||||||
it('with FILTER_BY_VALUE', () => {
|
'1', '2', 'COUNT', '1', 'ALIGN', '-', 'AGGREGATION', 'AVG', '1'
|
||||||
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 => {
|
testUtils.testWithClient('client.ts.revRange', async client => {
|
||||||
const [, , reply] = await Promise.all([
|
const [, reply] = await Promise.all([
|
||||||
client.ts.add('key', 0, 1),
|
|
||||||
client.ts.add('key', 1, 2),
|
client.ts.add('key', 1, 2),
|
||||||
client.ts.revRange('key', '-', '+')
|
client.ts.revRange('key', '-', '+')
|
||||||
]);
|
]);
|
||||||
@@ -96,9 +35,6 @@ describe('TS.REVRANGE', () => {
|
|||||||
assert.deepEqual(reply, [{
|
assert.deepEqual(reply, [{
|
||||||
timestamp: 1,
|
timestamp: 1,
|
||||||
value: 2
|
value: 2
|
||||||
}, {
|
|
||||||
timestamp: 0,
|
|
||||||
value: 1
|
|
||||||
}]);
|
}]);
|
||||||
}, GLOBAL.SERVERS.OPEN);
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
});
|
});
|
||||||
|
@@ -137,27 +137,20 @@ export function pushLabelsArgument(args: Array<RedisArgument>, labels?: Labels)
|
|||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
// export type RawLabelsReply = ArrayReply<TuplesReply<[BlobStringReply, BlobStringReply]>>;
|
export type SampleRawReply = {
|
||||||
|
2: TuplesReply<[timestamp: NumberReply, value: BlobStringReply]>;
|
||||||
// export function transformLablesReply(reply: RawLabelsReply) {
|
3: TuplesReply<[timestamp: NumberReply, value: DoubleReply]>;
|
||||||
// const labels: Record<string, BlobStringReply> = {};
|
};
|
||||||
|
|
||||||
// for (const [key, value] of reply) {
|
|
||||||
// labels[key.toString()] = value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return labels
|
|
||||||
// }
|
|
||||||
|
|
||||||
export const transformSampleReply = {
|
export const transformSampleReply = {
|
||||||
2(reply: TuplesReply<[timestamp: NumberReply, value: BlobStringReply]>) {
|
2(reply: SampleRawReply[2]) {
|
||||||
const [timestamp, value] = reply as unknown as UnwrapReply<typeof reply>;
|
const [timestamp, value] = reply as unknown as UnwrapReply<typeof reply>;
|
||||||
return {
|
return {
|
||||||
timestamp,
|
timestamp,
|
||||||
value: Number(value)
|
value: Number(value)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
3(reply: TuplesReply<[timestamp: NumberReply, value: DoubleReply]>) {
|
3(reply: SampleRawReply[3]) {
|
||||||
const [timestamp, value] = reply as unknown as UnwrapReply<typeof reply>;
|
const [timestamp, value] = reply as unknown as UnwrapReply<typeof reply>;
|
||||||
return {
|
return {
|
||||||
timestamp,
|
timestamp,
|
||||||
@@ -166,136 +159,6 @@ export const transformSampleReply = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// export enum TimeSeriesBucketTimestamp {
|
|
||||||
// LOW = '-',
|
|
||||||
// HIGH = '+',
|
|
||||||
// MID = '~'
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export interface RangeOptions {
|
|
||||||
// LATEST?: boolean;
|
|
||||||
// FILTER_BY_TS?: Array<Timestamp>;
|
|
||||||
// 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<string>;
|
|
||||||
|
|
||||||
// export function pushFilterArgument(args: RedisCommandArguments, filter: string | Array<string>): RedisCommandArguments {
|
|
||||||
// args.push('FILTER');
|
|
||||||
// return pushVariadicArguments(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<string>;
|
|
||||||
|
|
||||||
export function pushWithLabelsArgument(args: CommandArguments, selectedLabels?: RedisVariadicArgument) {
|
export function pushWithLabelsArgument(args: CommandArguments, selectedLabels?: RedisVariadicArgument) {
|
||||||
if (!selectedLabels) {
|
if (!selectedLabels) {
|
||||||
args.push('WITHLABELS');
|
args.push('WITHLABELS');
|
||||||
@@ -305,65 +168,3 @@ export function pushWithLabelsArgument(args: CommandArguments, selectedLabels?:
|
|||||||
return pushVariadicArguments(args, selectedLabels);
|
return pushVariadicArguments(args, selectedLabels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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<SampleRawReply>): Array<SampleReply> {
|
|
||||||
// return reply.map(transformSampleReply);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// type MRangeRawReply = Array<[
|
|
||||||
// key: string,
|
|
||||||
// labels: RawLabels,
|
|
||||||
// samples: Array<SampleRawReply>
|
|
||||||
// ]>;
|
|
||||||
|
|
||||||
// interface MRangeReplyItem {
|
|
||||||
// key: string;
|
|
||||||
// samples: Array<SampleReply>;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export function transformMRangeReply(reply: MRangeRawReply): Array<MRangeReplyItem> {
|
|
||||||
// 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<MRangeWithLabelsReplyItem> {
|
|
||||||
// const args = [];
|
|
||||||
|
|
||||||
// for (const [key, labels, samples] of reply) {
|
|
||||||
// args.push({
|
|
||||||
// key,
|
|
||||||
// labels: transformLablesReply(labels),
|
|
||||||
// samples: samples.map(transformSampleReply)
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return args;
|
|
||||||
// }
|
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
"name": "@redis/time-series",
|
"name": "@redis/time-series",
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/lib/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"dist/",
|
||||||
"!dist/tsconfig.tsbuildinfo"
|
"!dist/tsconfig.tsbuildinfo"
|
||||||
|
Reference in New Issue
Block a user