-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init * implement graph commands * add graph to packages table * fix ts.infoDebug * fix redisearch tests * Update INFO_DEBUG.ts * fix INFO.spec.ts * test QUERY and SLOWLOG Co-authored-by: Avital-Fine <avital.fine@redis.com>
- Loading branch information
Showing
46 changed files
with
563 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "@istanbuljs/nyc-config-typescript", | ||
"exclude": ["**/*.spec.ts", "lib/test-utils.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"git": { | ||
"tagName": "graph@${version}", | ||
"commitMessage": "Release ${tagName}", | ||
"tagAnnotation": "Release ${tagName}" | ||
}, | ||
"npm": { | ||
"publishArgs": ["--access", "public"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @node-redis/graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { strict as assert } from 'assert'; | ||
import testUtils, { GLOBAL } from '../test-utils'; | ||
import { transformArguments } from './CONFIG_GET'; | ||
|
||
describe('CONFIG GET', () => { | ||
it('transformArguments', () => { | ||
assert.deepEqual( | ||
transformArguments('TIMEOUT'), | ||
['GRAPH.CONFIG', 'GET', 'TIMEOUT'] | ||
); | ||
}); | ||
|
||
testUtils.testWithClient('client.graph.configGet', async client => { | ||
assert.deepEqual( | ||
await client.graph.configGet('TIMEOUT'), | ||
[ | ||
'TIMEOUT', | ||
0 | ||
] | ||
); | ||
}, GLOBAL.SERVERS.OPEN); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const IS_READ_ONLY = true; | ||
|
||
export function transformArguments(configKey: string): Array<string> { | ||
return ['GRAPH.CONFIG', 'GET', configKey]; | ||
} | ||
|
||
type ConfigItem = [ | ||
configKey: string, | ||
value: number | ||
]; | ||
|
||
export declare function transformReply(): ConfigItem | Array<ConfigItem>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { strict as assert } from 'assert'; | ||
import testUtils, { GLOBAL } from '../test-utils'; | ||
import { transformArguments } from './CONFIG_SET'; | ||
|
||
describe('CONFIG SET', () => { | ||
it('transformArguments', () => { | ||
assert.deepEqual( | ||
transformArguments('TIMEOUT', 0), | ||
['GRAPH.CONFIG', 'SET', 'TIMEOUT', '0'] | ||
); | ||
}); | ||
|
||
testUtils.testWithClient('client.graph.configSet', async client => { | ||
assert.equal( | ||
await client.graph.configSet('TIMEOUT', 0), | ||
'OK' | ||
); | ||
}, GLOBAL.SERVERS.OPEN); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function transformArguments(configKey: string, value: number): Array<string> { | ||
return [ | ||
'GRAPH.CONFIG', | ||
'SET', | ||
configKey, | ||
value.toString() | ||
]; | ||
} | ||
|
||
export declare function transformReply(): 'OK'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { strict as assert } from 'assert'; | ||
import testUtils, { GLOBAL } from '../test-utils'; | ||
import { transformArguments } from './DELETE'; | ||
|
||
describe('', () => { | ||
it('transformArguments', () => { | ||
assert.deepEqual( | ||
transformArguments('key'), | ||
['GRAPH.DELETE', 'key'] | ||
); | ||
}); | ||
|
||
testUtils.testWithClient('client.graph.delete', async client => { | ||
await client.graph.query('key', 'RETURN 1'); | ||
|
||
assert.equal( | ||
typeof await client.graph.delete('key'), | ||
'string' | ||
); | ||
}, GLOBAL.SERVERS.OPEN); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const FIRST_KEY_INDEX = 1; | ||
|
||
export function transformArguments(key: string): Array<string> { | ||
return ['GRAPH.DELETE', key]; | ||
} | ||
|
||
export declare function transformReply(): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { strict as assert } from 'assert'; | ||
import testUtils, { GLOBAL } from '../test-utils'; | ||
import { transformArguments } from './EXPLAIN'; | ||
|
||
describe('EXPLAIN', () => { | ||
it('transformArguments', () => { | ||
assert.deepEqual( | ||
transformArguments('key', 'RETURN 0'), | ||
['GRAPH.EXPLAIN', 'key', 'RETURN 0'] | ||
); | ||
}); | ||
|
||
testUtils.testWithClient('client.graph.explain', async client => { | ||
const reply = await client.graph.explain('key', 'RETURN 0'); | ||
assert.ok(Array.isArray(reply)); | ||
assert.ok(!reply.find(x => typeof x !== 'string')); | ||
}, GLOBAL.SERVERS.OPEN); | ||
}); |
Oops, something went wrong.