From 810e8425dd2753d9a8098de407dbfc2a5482d66b Mon Sep 17 00:00:00 2001 From: Nikolay Karadzhov Date: Tue, 29 Apr 2025 15:14:40 +0300 Subject: [PATCH 1/3] fix: exports align exports with v4 as much as possible --- packages/client/index.ts | 6 +++--- packages/redis/index.ts | 10 +++++----- packages/search/lib/index.ts | 26 ++++++++++++++++++++------ packages/time-series/lib/index.ts | 1 + 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/packages/client/index.ts b/packages/client/index.ts index 56cdf703ca3..969fa688703 100644 --- a/packages/client/index.ts +++ b/packages/client/index.ts @@ -2,7 +2,7 @@ export { RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping/* export { RESP_TYPES } from './lib/RESP/decoder'; export { VerbatimString } from './lib/RESP/verbatim-string'; export { defineScript } from './lib/lua-script'; -// export * from './lib/errors'; +export * from './lib/errors'; import RedisClient, { RedisClientOptions, RedisClientType } from './lib/client'; export { RedisClientOptions, RedisClientType }; @@ -20,8 +20,8 @@ import RedisSentinel from './lib/sentinel'; export { RedisSentinelOptions, RedisSentinelType } from './lib/sentinel/types'; export const createSentinel = RedisSentinel.create; -// export { GeoReplyWith } from './lib/commands/generic-transformers'; +export { GEO_REPLY_WITH, GeoReplyWith } from './lib/commands/GEOSEARCH_WITH'; // export { SetOptions } from './lib/commands/SET'; -// export { RedisFlushModes } from './lib/commands/FLUSHALL'; +export { REDIS_FLUSH_MODES } from './lib/commands/FLUSHALL'; diff --git a/packages/redis/index.ts b/packages/redis/index.ts index 73477363d3b..61da052ea20 100644 --- a/packages/redis/index.ts +++ b/packages/redis/index.ts @@ -19,11 +19,11 @@ import RedisJSON from '@redis/json'; import RediSearch from '@redis/search'; import RedisTimeSeries from '@redis/time-series'; -// export * from '@redis/client'; -// export * from '@redis/bloom'; -// export * from '@redis/json'; -// export * from '@redis/search'; -// export * from '@redis/time-series'; +export * from '@redis/client'; +export * from '@redis/bloom'; +export * from '@redis/json'; +export * from '@redis/search'; +export * from '@redis/time-series'; const modules = { ...RedisBloomModules, diff --git a/packages/search/lib/index.ts b/packages/search/lib/index.ts index 34d57e8ae5e..9bcfb91b956 100644 --- a/packages/search/lib/index.ts +++ b/packages/search/lib/index.ts @@ -1,7 +1,21 @@ -export { default } from './commands'; +export { default } from './commands' -export { SCHEMA_FIELD_TYPE, SchemaFieldType } from './commands/CREATE'; - -// export { RediSearchSchema, RedisSearchLanguages, SchemaFieldTypes, SchemaTextFieldPhonetics, SearchReply, VectorAlgorithms } from './commands'; -// export { AggregateGroupByReducers, AggregateSteps } from './commands/AGGREGATE'; -// export { SearchOptions } from './commands/SEARCH'; +export { SearchReply } from './commands/SEARCH' +export { RediSearchSchema } from './commands/CREATE' +export { + REDISEARCH_LANGUAGE, + RediSearchLanguage, + SCHEMA_FIELD_TYPE, + SchemaFieldType, + SCHEMA_TEXT_FIELD_PHONETIC, + SchemaTextFieldPhonetic, + SCHEMA_VECTOR_FIELD_ALGORITHM, + SchemaVectorFieldAlgorithm +} from './commands/CREATE' +export { + FT_AGGREGATE_GROUP_BY_REDUCERS, + FtAggregateGroupByReducer, + FT_AGGREGATE_STEPS, + FtAggregateStep +} from './commands/AGGREGATE' +export { FtSearchOptions } from './commands/SEARCH' diff --git a/packages/time-series/lib/index.ts b/packages/time-series/lib/index.ts index bd0be1e9cea..ad000c4fe7e 100644 --- a/packages/time-series/lib/index.ts +++ b/packages/time-series/lib/index.ts @@ -5,3 +5,4 @@ export { } from './commands'; export { TIME_SERIES_AGGREGATION_TYPE, TimeSeriesAggregationType } from './commands/CREATERULE'; export { TIME_SERIES_BUCKET_TIMESTAMP, TimeSeriesBucketTimestamp } from './commands/RANGE'; +export { TIME_SERIES_REDUCERS } from './commands/MRANGE_GROUPBY'; From b2fe7e969a3737c601d372d1858880cc4ad4f771 Mon Sep 17 00:00:00 2001 From: Nikolay Karadzhov Date: Tue, 29 Apr 2025 20:03:07 +0300 Subject: [PATCH 2/3] document breaking changes --- docs/v4-to-v5.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/v4-to-v5.md b/docs/v4-to-v5.md index 57ad3f9bbf6..3b09658b66f 100644 --- a/docs/v4-to-v5.md +++ b/docs/v4-to-v5.md @@ -141,6 +141,8 @@ In older versions, if the socket disconnects during the pipeline execution, i.e. In v5, any unwritten commands (in the same pipeline) will be discarded. +- `RedisFlushModes` -> `REDIS_FLUSH_MODES` [^enum-to-constants] + ## Commands ### Redis @@ -221,6 +223,13 @@ In v5, any unwritten commands (in the same pipeline) will be discarded. - `FT.SUGDEL`: [^boolean-to-number] - `FT.CURSOR READ`: `cursor` type changed from `number` to `string` (in and out) to avoid issues when the number is bigger than `Number.MAX_SAFE_INTEGER`. See [here](https://github.com/redis/node-redis/issues/2561). +- `AggregateGroupByReducers` -> `FT_AGGREGATE_GROUP_BY_REDUCERS` [^enum-to-constants] +- `AggregateSteps` -> `FT_AGGREGATE_STEPS` [^enum-to-constants] +- `RedisSearchLanguages` -> `REDISEARCH_LANGUAGE` [^enum-to-constants] +- `SchemaFieldTypes` -> `SCHEMA_FIELD_TYPE` [^enum-to-constants] +- `SchemaTextFieldPhonetics` -> `SCHEMA_TEXT_FIELD_PHONETIC` [^enum-to-constants] +- `SearchOptions` -> `FtSearchOptions` +- `VectorAlgorithms` -> `SCHEMA_VECTOR_FIELD_ALGORITHM` [^enum-to-constants] ### Time Series From 422be441a3ec171c9649e55c3b364beea377d88d Mon Sep 17 00:00:00 2001 From: Nikolay Karadzhov Date: Tue, 29 Apr 2025 20:08:32 +0300 Subject: [PATCH 3/3] export type return SetOptions export --- packages/client/index.ts | 2 +- packages/time-series/lib/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/index.ts b/packages/client/index.ts index 969fa688703..e426badf126 100644 --- a/packages/client/index.ts +++ b/packages/client/index.ts @@ -22,6 +22,6 @@ export const createSentinel = RedisSentinel.create; export { GEO_REPLY_WITH, GeoReplyWith } from './lib/commands/GEOSEARCH_WITH'; -// export { SetOptions } from './lib/commands/SET'; +export { SetOptions } from './lib/commands/SET'; export { REDIS_FLUSH_MODES } from './lib/commands/FLUSHALL'; diff --git a/packages/time-series/lib/index.ts b/packages/time-series/lib/index.ts index ad000c4fe7e..52422bf1b5a 100644 --- a/packages/time-series/lib/index.ts +++ b/packages/time-series/lib/index.ts @@ -5,4 +5,4 @@ export { } from './commands'; export { TIME_SERIES_AGGREGATION_TYPE, TimeSeriesAggregationType } from './commands/CREATERULE'; export { TIME_SERIES_BUCKET_TIMESTAMP, TimeSeriesBucketTimestamp } from './commands/RANGE'; -export { TIME_SERIES_REDUCERS } from './commands/MRANGE_GROUPBY'; +export { TIME_SERIES_REDUCERS, TimeSeriesReducer } from './commands/MRANGE_GROUPBY';