diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f027739..fe8dcc17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: #RediSearch redisearch-selected: ${{(github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.tests, 'redisearch') || github.event.inputs.tests == 'All'))}} redisearch-code-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, '/redisearch/')}} - redisearch-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, 'redisearch.ts')}} + redisearch-test-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, 'redisearch.ts')}} #RedisGraph redisgraph-selected: ${{(github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.tests, 'redisgraph') || github.event.inputs.tests == 'All'))}} redisgraph-code-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, '/redisgraph/')}} @@ -41,7 +41,7 @@ jobs: #RedisBloom Topk rebloom-topk-selected: ${{(github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.tests, 'rebloom-topk') || github.event.inputs.tests == 'All'))}} rebloom-topk-code-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, '/bloom-topk/')}} - rebloom-topk-test-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, 'redisblook-topk.ts')}} + rebloom-topk-test-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, 'redisbloom-topk.ts')}} #RedisBloom CMK rebloom-cmk-selected: ${{(github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.tests, 'rebloom-cmk') || github.event.inputs.tests == 'All'))}} rebloom-cmk-code-changes: ${{github.event_name == 'pull_request' && contains(steps.files.outputs.all, '/bloom-cmk/')}} diff --git a/index.ts b/index.ts index 71a794c7..1e5d23c0 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,4 @@ -export { RedisModules as Redis } from './modules/redis-modules'; +export { RedisModules } from './modules/redis-modules'; /* ** Redis JSON ***/ export { ReJSON } from './modules/rejson/rejson'; export { ReJSONGetParameters } from './modules/rejson/rejson.types' @@ -41,4 +41,4 @@ export { } from './modules/redis-ai/redis-ai.types'; /* ** RedisIntervalSets ***/ export { RedisIntervalSets } from './modules/ris/ris'; -export { RISSet } from './modules/ris/ris.types'; \ No newline at end of file +export { RedisIntervalSet } from './modules/ris/ris.types'; \ No newline at end of file diff --git a/modules/bloom/redisbloom.ts b/modules/bloom/redisbloom.ts index ff466b3b..7194489f 100644 --- a/modules/bloom/redisbloom.ts +++ b/modules/bloom/redisbloom.ts @@ -8,7 +8,6 @@ export class RedisBloom extends Module { private bloomCommander = new BloomCommander(); /** * Initializing the module object - * @param name The name of the module * @param clusterNodes The nodes of the cluster * @param moduleOptions The additional module options * @param moduleOptions.isHandleError If to throw error on error @@ -18,7 +17,6 @@ export class RedisBloom extends Module { constructor(clusterNodes: Redis.ClusterNode[], moduleOptions?: RedisModuleOptions, clusterOptions?: Redis.ClusterOptions) /** * Initializing the module object - * @param name The name of the module * @param redisOptions The options of the redis database * @param moduleOptions The additional module options * @param moduleOptions.isHandleError If to throw error on error diff --git a/modules/module.base.ts b/modules/module.base.ts index 239d300d..146f1e43 100644 --- a/modules/module.base.ts +++ b/modules/module.base.ts @@ -72,8 +72,7 @@ export class Module { /** * Running a Redis command - * @param command The redis command - * @param args The args of the redis command + * @param data The command data of a command to send. Consists of command and args. */ async sendCommand(data: CommandData): Promise { try { @@ -95,7 +94,6 @@ export class Module { /** * Handling a error - * @param module The name of the module * @param error The message of the error */ handleError(error: string): any { @@ -107,7 +105,6 @@ export class Module { /** * Simpilizing the response of the Module command * @param response The array response from the module - * @param isSearchQuery If we should try to build search result object from result array (default: false) */ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types handleResponse(response: any): any { diff --git a/modules/redis-ai/redis-ai.commander.ts b/modules/redis-ai/redis-ai.commander.ts index d976675e..2210f588 100644 --- a/modules/redis-ai/redis-ai.commander.ts +++ b/modules/redis-ai/redis-ai.commander.ts @@ -10,7 +10,7 @@ export class RedisAICommander { * @param key The tensor's key name * @param type The tensor's data type can be one of: FLOAT , DOUBLE , INT8 , INT16 , INT32 , INT64 , UINT8 or UINT16 * @param data The tensor's data (binary/numberic) - * @param shape One or more dimensions, or the number of elements per axis, for the tensor + * @param shapes One or more dimensions, or the number of elements per axis, for the tensor */ tensorset(key: string, type: TensorType, shapes: number[], data?: number[] | Buffer[]): CommandData { const args: (number | string | Buffer)[] = [key, type]; diff --git a/modules/ris/ris.commander.ts b/modules/ris/ris.commander.ts index b54f2299..dd22335b 100644 --- a/modules/ris/ris.commander.ts +++ b/modules/ris/ris.commander.ts @@ -1,5 +1,5 @@ import { CommandData } from "../module.base"; -import { RISSet } from "./ris.types"; +import { RedisIntervalSet } from "./ris.types"; export class RedisIntervalSetsCommander { @@ -8,7 +8,7 @@ export class RedisIntervalSetsCommander { * @param key The name of the key * @param sets A list of sets to create. At least 1 set is required. */ - add(key: string, sets: RISSet[]): CommandData { + add(key: string, sets: RedisIntervalSet[]): CommandData { let args: (number | string)[] = [key]; for(const set of sets){ args = args.concat([set.name, set.minimum, set.maximum]) diff --git a/modules/ris/ris.helpers.ts b/modules/ris/ris.helpers.ts index c47c0312..948622e9 100644 --- a/modules/ris/ris.helpers.ts +++ b/modules/ris/ris.helpers.ts @@ -1,12 +1,12 @@ -import { RISSet } from "./ris.types"; +import { RedisIntervalSet } from "./ris.types"; export class RedisIntervalSetsHelpers { /** * Parsing the iset.get command response * @param sets The list of sets */ - parseGet(sets: string[][]): RISSet[] { - const parsedSets: RISSet[] = []; + parseGet(sets: string[][]): RedisIntervalSet[] { + const parsedSets: RedisIntervalSet[] = []; for(const set of sets) { if(set.length > 2){ parsedSets.push({name: set[0], minimum: parseInt(set[1]), maximum: parseInt(set[2])}) diff --git a/modules/ris/ris.ts b/modules/ris/ris.ts index fe0dba3b..9a95909a 100644 --- a/modules/ris/ris.ts +++ b/modules/ris/ris.ts @@ -2,7 +2,7 @@ import * as Redis from 'ioredis'; import { Module, RedisModuleOptions } from '../module.base'; import { RedisIntervalSetsCommander } from './ris.commander'; import { RedisIntervalSetsHelpers } from './ris.helpers'; -import { RISSet } from './ris.types'; +import { RedisIntervalSet } from './ris.types'; export class RedisIntervalSets extends Module { private risHelpers = new RedisIntervalSetsHelpers(); @@ -35,7 +35,7 @@ export class RedisIntervalSets extends Module { * @param key The name of the key * @param sets A list of sets to create. At least 1 set is required. */ - async add(key: string, sets: RISSet[]): Promise<'OK'> { + async add(key: string, sets: RedisIntervalSet[]): Promise<'OK'> { const command = this.risCommander.add(key, sets); return await this.sendCommand(command); } @@ -45,7 +45,7 @@ export class RedisIntervalSets extends Module { * @param key The name of the key * @param setName Optional. The name of specific set. If not passed all interval sets under key will be retrieved. */ - async get(key: string, setName?: string): Promise { + async get(key: string, setName?: string): Promise { const command = this.risCommander.get(key, setName); const response = await this.sendCommand(command); return this.risHelpers.parseGet(response); diff --git a/modules/ris/ris.types.ts b/modules/ris/ris.types.ts index ea26dabd..14594c59 100644 --- a/modules/ris/ris.types.ts +++ b/modules/ris/ris.types.ts @@ -4,7 +4,7 @@ * @param minimum The minimum score of the interval set * @param maximum The maximum score of the interval set */ -export type RISSet = { +export type RedisIntervalSet = { name?: string, minimum: number, maximum: number diff --git a/package.json b/package.json index 167ebbe8..a7718597 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,13 @@ "test": "mocha -r ts-node/register", "run-redis": "docker run -p 6379:6379 -d --rm redis && docker ps -a", "run-redis-with-rejson-module": "docker run -p 6379:6379 -d --rm redislabs/rejson:edge && docker ps -a", - "run-redis-with-rts-module":"docker run -p 6379:6379 -d --rm redislabs/redistimeseries:edge && docker ps -a", + "run-redis-with-rts-module": "docker run -p 6379:6379 -d --rm redislabs/redistimeseries:edge && docker ps -a", "run-redis-with-redisearch-module": "docker run -p 6379:6379 -d --rm redislabs/redisearch:edge && docker ps -a", "run-redis-with-redisgraph-module": "docker run -p 6379:6379 -d --rm redislabs/redisgraph:edge && docker ps -a", "run-redis-with-redisgears-module": "docker run -p 6379:6379 -d --rm redislabs/redisgears:latest && docker ps -a", "run-redis-with-bloom-module": "docker run -p 6379:6379 -d --rm redislabs/rebloom:latest && docker ps -a", "run-redis-with-redisai-module": "docker run -p 6379:6379 -d --rm redislabs/redisai:edge-cpu-bionic && docker ps -a", "run-redis-with-ris-module": "docker run -p 6379:6379 -d --rm danitseitlin/redis-interval-sets && docker ps -a", - "rejson-module-tests": "npm run test tests/rejson.ts -- -- --host=127.0.0.1 --port=6379", "rts-module-tests": "npm run test tests/rts.ts -- -- --host=127.0.0.1 --port=6379", "redisearch-module-tests": "npm run test tests/redisearch.ts -- -- --host=127.0.0.1 --port=6379", diff --git a/tests/redis-ai.ts b/tests/redis-ai.ts index bd86d0bd..4a0996bf 100644 --- a/tests/redis-ai.ts +++ b/tests/redis-ai.ts @@ -1,7 +1,7 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' import * as fs from 'fs'; -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; import { AIModel, AIScript, AIScriptInfo, AITensorInfo } from '../modules/redis-ai/redis-ai.types'; let redis: RedisModules; describe('AI testing', async function() { diff --git a/tests/redisbloom-cmk.ts b/tests/redisbloom-cmk.ts index dbe5bc66..3326a1fe 100644 --- a/tests/redisbloom-cmk.ts +++ b/tests/redisbloom-cmk.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; const key1 = 'key1cmk' const key2 = 'key1cmk2'; diff --git a/tests/redisbloom-cuckoo.ts b/tests/redisbloom-cuckoo.ts index 595bef71..9d057bcf 100644 --- a/tests/redisbloom-cuckoo.ts +++ b/tests/redisbloom-cuckoo.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; const key1 = 'key1cuckoo' const key2 = '1' const key3 = 'cuckoo' diff --git a/tests/redisbloom-tdigest.ts b/tests/redisbloom-tdigest.ts index c1a04271..8e96d958 100644 --- a/tests/redisbloom-tdigest.ts +++ b/tests/redisbloom-tdigest.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; const key1 = 'mykey1' const key2 = 'mykey2'; diff --git a/tests/redisbloom-topk.ts b/tests/redisbloom-topk.ts index 3d813030..2b0cd81e 100644 --- a/tests/redisbloom-topk.ts +++ b/tests/redisbloom-topk.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; const key1 = 'key1topk'; diff --git a/tests/redisbloom.ts b/tests/redisbloom.ts index f63fee38..be817686 100644 --- a/tests/redisbloom.ts +++ b/tests/redisbloom.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; const key1 = 'key1bloom'; const key2 = '1'; diff --git a/tests/redisearch.ts b/tests/redisearch.ts index ca396650..bf8c62d7 100644 --- a/tests/redisearch.ts +++ b/tests/redisearch.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser' import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules' +import { RedisModules } from '../' import { FTParsedSearchResponse, FTSearchArrayResponse } from '../modules/redisearch/redisearch.types' import * as fs from 'fs'; let redis: RedisModules diff --git a/tests/redisgears.ts b/tests/redisgears.ts index af79e875..1e93c1cf 100644 --- a/tests/redisgears.ts +++ b/tests/redisgears.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; let executionId1: string; let executionId2: string; diff --git a/tests/redisgraph.ts b/tests/redisgraph.ts index f4477f1a..346bed80 100644 --- a/tests/redisgraph.ts +++ b/tests/redisgraph.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; import { GraphConfigInfo } from '../modules/redisgraph/redisgraph.types'; let redis: RedisModules; const graphName = 'Test' diff --git a/tests/rejson.ts b/tests/rejson.ts index 6ec18881..e9affdb7 100644 --- a/tests/rejson.ts +++ b/tests/rejson.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; const key1 = 'key1'; const key2 = 'key2'; diff --git a/tests/ris.ts b/tests/ris.ts index 325439ea..62a36c8b 100644 --- a/tests/ris.ts +++ b/tests/ris.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; describe('RedisIntervalSets Module testing', async function() { diff --git a/tests/rts.ts b/tests/rts.ts index 640a7f1e..b2298cf2 100644 --- a/tests/rts.ts +++ b/tests/rts.ts @@ -1,6 +1,6 @@ import { cliArguments } from 'cli-argument-parser'; import { expect } from 'chai' -import { RedisModules } from '../modules/redis-modules'; +import { RedisModules } from '../'; let redis: RedisModules; const date = new Date(2019, 11, 24, 19).getTime(); const key1 = 'key:2:32';