falkordb 6.5.1 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/src/clients/client.d.ts +4 -4
- package/dist/src/clients/cluster.d.ts +7 -7
- package/dist/src/clients/nullClient.d.ts +4 -4
- package/dist/src/clients/single.d.ts +6 -7
- package/dist/src/clients/single.js +2 -40
- package/dist/src/commands/CONFIG_GET.d.ts +3 -1
- package/dist/src/commands/CONFIG_GET.js +8 -0
- package/dist/src/commands/CONFIG_SET.d.ts +3 -1
- package/dist/src/commands/CONFIG_SET.js +8 -0
- package/dist/src/commands/CONSTRAINT_CREATE.d.ts +3 -1
- package/dist/src/commands/CONSTRAINT_CREATE.js +8 -0
- package/dist/src/commands/CONSTRAINT_DROP.d.ts +3 -1
- package/dist/src/commands/CONSTRAINT_DROP.js +8 -0
- package/dist/src/commands/COPY.d.ts +3 -1
- package/dist/src/commands/COPY.js +8 -0
- package/dist/src/commands/DELETE.d.ts +3 -1
- package/dist/src/commands/DELETE.js +9 -0
- package/dist/src/commands/EXPLAIN.d.ts +3 -1
- package/dist/src/commands/EXPLAIN.js +10 -0
- package/dist/src/commands/INFO.d.ts +3 -1
- package/dist/src/commands/INFO.js +11 -0
- package/dist/src/commands/LIST.d.ts +3 -1
- package/dist/src/commands/LIST.js +8 -0
- package/dist/src/commands/MEMORY_USAGE.d.ts +3 -1
- package/dist/src/commands/MEMORY_USAGE.js +11 -0
- package/dist/src/commands/PROFILE.d.ts +3 -1
- package/dist/src/commands/PROFILE.js +10 -0
- package/dist/src/commands/QUERY.d.ts +3 -2
- package/dist/src/commands/QUERY.js +5 -0
- package/dist/src/commands/RO_QUERY.d.ts +3 -2
- package/dist/src/commands/RO_QUERY.js +5 -0
- package/dist/src/commands/SENTINEL_MASTER.d.ts +3 -1
- package/dist/src/commands/SENTINEL_MASTER.js +8 -0
- package/dist/src/commands/SENTINEL_MASTERS.d.ts +3 -1
- package/dist/src/commands/SENTINEL_MASTERS.js +8 -0
- package/dist/src/commands/SLOWLOG.d.ts +2 -0
- package/dist/src/commands/SLOWLOG.js +5 -0
- package/dist/src/commands/UDF_DELETE.d.ts +3 -1
- package/dist/src/commands/UDF_DELETE.js +8 -0
- package/dist/src/commands/UDF_FLUSH.d.ts +3 -1
- package/dist/src/commands/UDF_FLUSH.js +8 -0
- package/dist/src/commands/UDF_LIST.d.ts +3 -1
- package/dist/src/commands/UDF_LIST.js +14 -0
- package/dist/src/commands/UDF_LOAD.d.ts +3 -1
- package/dist/src/commands/UDF_LOAD.js +27 -0
- package/dist/src/commands/index.d.ts +3 -3
- package/dist/src/falkordb.d.ts +2 -7
- package/dist/src/falkordb.js +0 -4
- package/dist/src/graph.d.ts +3 -3
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as Graph } from './src/graph';
|
|
2
2
|
export { ConstraintType, EntityType } from './src/graph';
|
|
3
|
-
export { default as FalkorDB
|
|
3
|
+
export { default as FalkorDB } from './src/falkordb';
|
|
4
|
+
export type { FalkorDBOptions } from './src/falkordb';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisArgument } from "@redis/client";
|
|
2
2
|
import { QueryOptions } from "../commands";
|
|
3
3
|
import { ConstraintType, EntityType } from "../graph";
|
|
4
4
|
import FalkorDB from "../falkordb";
|
|
@@ -11,9 +11,9 @@ export interface Client {
|
|
|
11
11
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
12
12
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
13
13
|
info(section?: string): Promise<(string | string[])[]>;
|
|
14
|
-
query<T>(graph: string, query:
|
|
15
|
-
profile<T>(graph: string, query:
|
|
16
|
-
roQuery<T>(graph: string, query:
|
|
14
|
+
query<T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<any>;
|
|
15
|
+
profile<T>(graph: string, query: RedisArgument): Promise<any>;
|
|
16
|
+
roQuery<T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<any>;
|
|
17
17
|
copy<T>(srcGraph: string, destGraph: string): Promise<any>;
|
|
18
18
|
delete(graph: string): Promise<void>;
|
|
19
19
|
explain(graph: string, query: string): Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from "./client";
|
|
2
2
|
import { ConstraintType, EntityType } from "../graph";
|
|
3
|
-
import {
|
|
3
|
+
import { RedisArgument, RedisFunctions, RedisScripts } from "@redis/client";
|
|
4
4
|
import commands, { QueryOptions } from "../commands";
|
|
5
5
|
import { RedisClusterType } from "@redis/client";
|
|
6
6
|
import FalkorDB from "../falkordb";
|
|
@@ -9,7 +9,7 @@ import { MemoryUsageOptions, MemoryUsageReply } from "../commands/MEMORY_USAGE";
|
|
|
9
9
|
import { UdfListReply } from "../commands/UDF_LIST";
|
|
10
10
|
export type ClusterGraphConnection = RedisClusterType<{
|
|
11
11
|
falkordb: typeof commands;
|
|
12
|
-
}, RedisFunctions, RedisScripts>;
|
|
12
|
+
}, RedisFunctions, RedisScripts, 2>;
|
|
13
13
|
/**
|
|
14
14
|
* A client that connects to a Redis Cluster.
|
|
15
15
|
*/
|
|
@@ -18,9 +18,9 @@ export declare class Cluster implements Client {
|
|
|
18
18
|
constructor(client: SingleGraphConnection);
|
|
19
19
|
getConnection(): Promise<import("@redis/client").RedisClientType<{
|
|
20
20
|
falkordb: typeof commands;
|
|
21
|
-
}, RedisFunctions, RedisScripts>>;
|
|
21
|
+
}, RedisFunctions, RedisScripts, 2, {}>>;
|
|
22
22
|
init(falkordb: FalkorDB): Promise<void>;
|
|
23
|
-
query<T>(graph: string, query:
|
|
23
|
+
query<T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
24
24
|
headers: undefined;
|
|
25
25
|
data: undefined;
|
|
26
26
|
metadata: string[];
|
|
@@ -29,7 +29,7 @@ export declare class Cluster implements Client {
|
|
|
29
29
|
data: (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[];
|
|
30
30
|
metadata: string[];
|
|
31
31
|
}>;
|
|
32
|
-
roQuery<T>(graph: string, query:
|
|
32
|
+
roQuery<T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
33
33
|
headers: undefined;
|
|
34
34
|
data: undefined;
|
|
35
35
|
metadata: string[];
|
|
@@ -39,7 +39,7 @@ export declare class Cluster implements Client {
|
|
|
39
39
|
metadata: string[];
|
|
40
40
|
}>;
|
|
41
41
|
delete(graph: string): Promise<void>;
|
|
42
|
-
explain(graph: string, query: string): Promise<string
|
|
42
|
+
explain(graph: string, query: string): Promise<string[]>;
|
|
43
43
|
list(): Promise<Array<string>>;
|
|
44
44
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
45
45
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
@@ -58,7 +58,7 @@ export declare class Cluster implements Client {
|
|
|
58
58
|
udfList(lib?: string, withCode?: boolean): Promise<UdfListReply>;
|
|
59
59
|
udfFlush(): Promise<string>;
|
|
60
60
|
udfDelete(lib: string): Promise<string>;
|
|
61
|
-
profile<_T>(graph: string, query: string): Promise<string
|
|
61
|
+
profile<_T>(graph: string, query: string): Promise<string[]>;
|
|
62
62
|
quit(): Promise<void>;
|
|
63
63
|
disconnect(): Promise<void>;
|
|
64
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisArgument } from "@redis/client";
|
|
2
2
|
import { QueryOptions } from "../commands";
|
|
3
3
|
import FalkorDB from "../falkordb";
|
|
4
4
|
import { ConstraintType, EntityType } from "../graph";
|
|
@@ -24,9 +24,9 @@ export declare class NullClient implements Client {
|
|
|
24
24
|
configGet(_configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
25
25
|
configSet(_configKey: string, _value: number | string): Promise<void>;
|
|
26
26
|
info(_section?: string): Promise<(string | string[])[]>;
|
|
27
|
-
query<_T>(_graph: string, _query:
|
|
28
|
-
profile<_T>(_graph: string, _query:
|
|
29
|
-
roQuery<_T>(_graph: string, _query:
|
|
27
|
+
query<_T>(_graph: string, _query: RedisArgument, _options?: QueryOptions): Promise<any>;
|
|
28
|
+
profile<_T>(_graph: string, _query: RedisArgument): Promise<any>;
|
|
29
|
+
roQuery<_T>(_graph: string, _query: RedisArgument, _options?: QueryOptions): Promise<any>;
|
|
30
30
|
copy<_T>(_srcGraph: string, _destGraph: string): Promise<any>;
|
|
31
31
|
delete(_graph: string): Promise<void>;
|
|
32
32
|
explain(_graph: string, _query: string): Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from "./client";
|
|
2
2
|
import { ConstraintType, EntityType } from "../graph";
|
|
3
|
-
import {
|
|
3
|
+
import { RedisArgument, RedisFunctions, RedisScripts } from "@redis/client";
|
|
4
4
|
import commands, { QueryOptions } from "../commands";
|
|
5
5
|
import { RedisClientType } from "@redis/client";
|
|
6
6
|
import FalkorDB from "../falkordb";
|
|
@@ -8,13 +8,12 @@ import { MemoryUsageOptions, MemoryUsageReply } from "../commands/MEMORY_USAGE";
|
|
|
8
8
|
import { UdfListReply } from "../commands/UDF_LIST";
|
|
9
9
|
export type SingleGraphConnection = RedisClientType<{
|
|
10
10
|
falkordb: typeof commands;
|
|
11
|
-
}, RedisFunctions, RedisScripts>;
|
|
11
|
+
}, RedisFunctions, RedisScripts, 2>;
|
|
12
12
|
export declare class Single implements Client {
|
|
13
|
-
#private;
|
|
14
13
|
protected client: SingleGraphConnection;
|
|
15
14
|
constructor(client: SingleGraphConnection);
|
|
16
15
|
init(_falkordb: FalkorDB): Promise<void>;
|
|
17
|
-
query<_T>(graph: string, query:
|
|
16
|
+
query<_T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
18
17
|
headers: undefined;
|
|
19
18
|
data: undefined;
|
|
20
19
|
metadata: string[];
|
|
@@ -23,7 +22,7 @@ export declare class Single implements Client {
|
|
|
23
22
|
data: (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[];
|
|
24
23
|
metadata: string[];
|
|
25
24
|
}>;
|
|
26
|
-
roQuery<_T>(graph: string, query:
|
|
25
|
+
roQuery<_T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
27
26
|
headers: undefined;
|
|
28
27
|
data: undefined;
|
|
29
28
|
metadata: string[];
|
|
@@ -33,8 +32,8 @@ export declare class Single implements Client {
|
|
|
33
32
|
metadata: string[];
|
|
34
33
|
}>;
|
|
35
34
|
delete(graph: string): Promise<void>;
|
|
36
|
-
explain(graph: string, query: string): Promise<string
|
|
37
|
-
profile<_T>(graph: string, query: string): Promise<string
|
|
35
|
+
explain(graph: string, query: string): Promise<string[]>;
|
|
36
|
+
profile<_T>(graph: string, query: string): Promise<string[]>;
|
|
38
37
|
list(): Promise<string[]>;
|
|
39
38
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
40
39
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
@@ -3,54 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Single = void 0;
|
|
4
4
|
class Single {
|
|
5
5
|
client;
|
|
6
|
-
#usePool;
|
|
7
6
|
constructor(client) {
|
|
8
7
|
this.client = client;
|
|
9
|
-
this.#usePool = !!this.client.options?.isolationPoolOptions;
|
|
10
8
|
}
|
|
11
9
|
init(_falkordb) {
|
|
12
10
|
return Promise.resolve();
|
|
13
11
|
}
|
|
14
12
|
async query(graph, query, options, compact = true) {
|
|
15
|
-
|
|
16
|
-
? await this.client.executeIsolated(async (isolatedClient) => {
|
|
17
|
-
return isolatedClient.falkordb.query(graph, query, options, compact);
|
|
18
|
-
})
|
|
19
|
-
: await this.client.falkordb.query(graph, query, options, compact);
|
|
20
|
-
return reply;
|
|
13
|
+
return await this.client.falkordb.query(graph, query, options, compact);
|
|
21
14
|
}
|
|
22
15
|
async roQuery(graph, query, options, compact = true) {
|
|
23
|
-
|
|
24
|
-
? await this.client.executeIsolated(async (isolatedClient) => {
|
|
25
|
-
return isolatedClient.falkordb.roQuery(graph, query, options, compact);
|
|
26
|
-
})
|
|
27
|
-
: await this.client.falkordb.roQuery(graph, query, options, compact);
|
|
28
|
-
return reply;
|
|
16
|
+
return await this.client.falkordb.roQuery(graph, query, options, compact);
|
|
29
17
|
}
|
|
30
18
|
async delete(graph) {
|
|
31
|
-
if (this.#usePool) {
|
|
32
|
-
return this.client.executeIsolated(async (isolatedClient) => {
|
|
33
|
-
const reply = isolatedClient.falkordb.delete(graph);
|
|
34
|
-
return reply.then(() => { });
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
19
|
const reply = this.client.falkordb.delete(graph);
|
|
38
20
|
return reply.then(() => { });
|
|
39
21
|
}
|
|
40
22
|
async explain(graph, query) {
|
|
41
|
-
if (this.#usePool) {
|
|
42
|
-
return this.client.executeIsolated(async (isolatedClient) => {
|
|
43
|
-
return isolatedClient.falkordb.explain(graph, query);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
23
|
return this.client.falkordb.explain(graph, query);
|
|
47
24
|
}
|
|
48
25
|
async profile(graph, query) {
|
|
49
|
-
if (this.#usePool) {
|
|
50
|
-
return this.client.executeIsolated(async (isolatedClient) => {
|
|
51
|
-
return isolatedClient.falkordb.profile(graph, query);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
26
|
return this.client.falkordb.profile(graph, query);
|
|
55
27
|
}
|
|
56
28
|
async list() {
|
|
@@ -67,19 +39,9 @@ class Single {
|
|
|
67
39
|
return this.client.falkordb.info(section);
|
|
68
40
|
}
|
|
69
41
|
async slowLog(graph) {
|
|
70
|
-
if (this.#usePool) {
|
|
71
|
-
return this.client.executeIsolated(async (isolatedClient) => {
|
|
72
|
-
return isolatedClient.falkordb.slowLog(graph);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
42
|
return this.client.falkordb.slowLog(graph);
|
|
76
43
|
}
|
|
77
44
|
async memoryUsage(graph, options) {
|
|
78
|
-
if (this.#usePool) {
|
|
79
|
-
return this.client.executeIsolated(async (isolatedClient) => {
|
|
80
|
-
return isolatedClient.falkordb.memoryUsage(graph, options);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
45
|
return this.client.falkordb.memoryUsage(graph, options);
|
|
84
46
|
}
|
|
85
47
|
async constraintCreate(graph, constraintType, entityType, label, ...properties) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser, configKey: string): void;
|
|
2
4
|
export declare function transformArguments(configKey: string): Array<string>;
|
|
3
5
|
type ConfigItem = [
|
|
4
6
|
configKey: string,
|
|
5
7
|
value: number
|
|
6
8
|
];
|
|
7
|
-
export declare function transformReply(): ConfigItem | Array<ConfigItem>;
|
|
9
|
+
export declare function transformReply(reply: unknown): ConfigItem | Array<ConfigItem>;
|
|
8
10
|
export {};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser, configKey) {
|
|
9
|
+
parser.push('GRAPH.CONFIG', 'GET', configKey);
|
|
10
|
+
}
|
|
6
11
|
function transformArguments(configKey) {
|
|
7
12
|
return ['GRAPH.CONFIG', 'GET', configKey];
|
|
8
13
|
}
|
|
14
|
+
function transformReply(reply) {
|
|
15
|
+
return reply;
|
|
16
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export declare function parseCommand(parser: CommandParser, configKey: string, value: number | string): void;
|
|
1
3
|
export declare function transformArguments(configKey: string, value: number | string): Array<string>;
|
|
2
|
-
export declare function transformReply(): 'OK';
|
|
4
|
+
export declare function transformReply(reply: unknown): 'OK';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
6
|
+
function parseCommand(parser, configKey, value) {
|
|
7
|
+
parser.push('GRAPH.CONFIG', 'SET', configKey, typeof value === "string" ? value : value.toString());
|
|
8
|
+
}
|
|
4
9
|
function transformArguments(configKey, value) {
|
|
5
10
|
return [
|
|
6
11
|
'GRAPH.CONFIG',
|
|
@@ -9,3 +14,6 @@ function transformArguments(configKey, value) {
|
|
|
9
14
|
typeof value === "string" ? value : value.toString()
|
|
10
15
|
];
|
|
11
16
|
}
|
|
17
|
+
function transformReply(reply) {
|
|
18
|
+
return reply;
|
|
19
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare enum ConstraintType {
|
|
2
3
|
MANDATORY = "MANDATORY",
|
|
3
4
|
UNIQUE = "UNIQUE"
|
|
@@ -6,5 +7,6 @@ export declare enum EntityType {
|
|
|
6
7
|
NODE = "NODE",
|
|
7
8
|
RELATIONSHIP = "RELATIONSHIP"
|
|
8
9
|
}
|
|
10
|
+
export declare function parseCommand(parser: CommandParser, key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): void;
|
|
9
11
|
export declare function transformArguments(key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Array<string>;
|
|
10
|
-
export declare function transformReply(): 'PENDING';
|
|
12
|
+
export declare function transformReply(reply: unknown): 'PENDING';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EntityType = exports.ConstraintType = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
var ConstraintType;
|
|
6
8
|
(function (ConstraintType) {
|
|
7
9
|
ConstraintType["MANDATORY"] = "MANDATORY";
|
|
@@ -13,6 +15,9 @@ var EntityType;
|
|
|
13
15
|
EntityType["RELATIONSHIP"] = "RELATIONSHIP";
|
|
14
16
|
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
15
17
|
// GRAPH.CONSTRAINT CREATE key constraintType {NODE label | RELATIONSHIP reltype} PROPERTIES propCount prop [prop...]
|
|
18
|
+
function parseCommand(parser, key, constraintType, entityType, label, ...properties) {
|
|
19
|
+
parser.push('GRAPH.CONSTRAINT', 'CREATE', key, constraintType, entityType, label, 'PROPERTIES', properties.length.toString(), ...properties);
|
|
20
|
+
}
|
|
16
21
|
function transformArguments(key, constraintType, entityType, label, ...properties) {
|
|
17
22
|
return [
|
|
18
23
|
'GRAPH.CONSTRAINT', 'CREATE',
|
|
@@ -20,3 +25,6 @@ function transformArguments(key, constraintType, entityType, label, ...propertie
|
|
|
20
25
|
'PROPERTIES', properties.length.toString(), ...properties
|
|
21
26
|
];
|
|
22
27
|
}
|
|
28
|
+
function transformReply(reply) {
|
|
29
|
+
return reply;
|
|
30
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
import { ConstraintType, EntityType } from "./CONSTRAINT_CREATE";
|
|
3
|
+
export declare function parseCommand(parser: CommandParser, key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): void;
|
|
2
4
|
export declare function transformArguments(key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Array<string>;
|
|
3
|
-
export declare function transformReply(): 'OK';
|
|
5
|
+
export declare function transformReply(reply: unknown): 'OK';
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
4
6
|
// GRAPH.CONSTRAINT DROP key constraintType {NODE label | RELATIONSHIP reltype} PROPERTIES propCount prop [prop...]
|
|
7
|
+
function parseCommand(parser, key, constraintType, entityType, label, ...properties) {
|
|
8
|
+
parser.push('GRAPH.CONSTRAINT', 'DROP', key, constraintType, entityType, label, 'PROPERTIES', properties.length.toString(), ...properties);
|
|
9
|
+
}
|
|
5
10
|
function transformArguments(key, constraintType, entityType, label, ...properties) {
|
|
6
11
|
return [
|
|
7
12
|
'GRAPH.CONSTRAINT', 'DROP',
|
|
@@ -9,3 +14,6 @@ function transformArguments(key, constraintType, entityType, label, ...propertie
|
|
|
9
14
|
'PROPERTIES', properties.length.toString(), ...properties
|
|
10
15
|
];
|
|
11
16
|
}
|
|
17
|
+
function transformReply(reply) {
|
|
18
|
+
return reply;
|
|
19
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export declare function parseCommand(parser: CommandParser, srcGraph: string, destGraph: string): void;
|
|
1
3
|
export declare function transformArguments(srcGraph: string, destGraph: string): Array<string>;
|
|
2
|
-
export declare function transformReply(): 'OK';
|
|
4
|
+
export declare function transformReply(reply: unknown): 'OK';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
6
|
+
function parseCommand(parser, srcGraph, destGraph) {
|
|
7
|
+
parser.push('GRAPH.COPY', srcGraph, destGraph);
|
|
8
|
+
}
|
|
4
9
|
function transformArguments(srcGraph, destGraph) {
|
|
5
10
|
return [
|
|
6
11
|
'GRAPH.COPY',
|
|
@@ -8,3 +13,6 @@ function transformArguments(srcGraph, destGraph) {
|
|
|
8
13
|
destGraph
|
|
9
14
|
];
|
|
10
15
|
}
|
|
16
|
+
function transformReply(reply) {
|
|
17
|
+
return reply;
|
|
18
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const FIRST_KEY_INDEX = 1;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser, key: string): void;
|
|
2
4
|
export declare function transformArguments(key: string): Array<string>;
|
|
3
|
-
export declare function transformReply(): string;
|
|
5
|
+
export declare function transformReply(reply: unknown): string;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.FIRST_KEY_INDEX = 1;
|
|
8
|
+
function parseCommand(parser, key) {
|
|
9
|
+
parser.push('GRAPH.DELETE');
|
|
10
|
+
parser.pushKey(key);
|
|
11
|
+
}
|
|
6
12
|
function transformArguments(key) {
|
|
7
13
|
return ['GRAPH.DELETE', key];
|
|
8
14
|
}
|
|
15
|
+
function transformReply(reply) {
|
|
16
|
+
return reply;
|
|
17
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const FIRST_KEY_INDEX = 1;
|
|
2
3
|
export declare const IS_READ_ONLY = true;
|
|
4
|
+
export declare function parseCommand(parser: CommandParser, key: string, query: string): void;
|
|
3
5
|
export declare function transformArguments(key: string, query: string): Array<string>;
|
|
4
|
-
export declare function
|
|
6
|
+
export declare function transformReply(reply: unknown): Array<string>;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.FIRST_KEY_INDEX = 1;
|
|
6
8
|
exports.IS_READ_ONLY = true;
|
|
9
|
+
function parseCommand(parser, key, query) {
|
|
10
|
+
parser.push('GRAPH.EXPLAIN');
|
|
11
|
+
parser.pushKey(key);
|
|
12
|
+
parser.push(query);
|
|
13
|
+
}
|
|
7
14
|
function transformArguments(key, query) {
|
|
8
15
|
return ['GRAPH.EXPLAIN', key, query];
|
|
9
16
|
}
|
|
17
|
+
function transformReply(reply) {
|
|
18
|
+
return reply;
|
|
19
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser, section?: string): void;
|
|
2
4
|
export declare function transformArguments(section?: string): Array<string>;
|
|
3
|
-
export declare function transformReply(): Array<string | Array<string>>;
|
|
5
|
+
export declare function transformReply(reply: unknown): Array<string | Array<string>>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser, section) {
|
|
9
|
+
parser.push('GRAPH.INFO');
|
|
10
|
+
if (section) {
|
|
11
|
+
parser.push(section);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
6
14
|
function transformArguments(section) {
|
|
7
15
|
const args = ['GRAPH.INFO'];
|
|
8
16
|
if (section) {
|
|
@@ -10,3 +18,6 @@ function transformArguments(section) {
|
|
|
10
18
|
}
|
|
11
19
|
return args;
|
|
12
20
|
}
|
|
21
|
+
function transformReply(reply) {
|
|
22
|
+
return reply;
|
|
23
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser): void;
|
|
2
4
|
export declare function transformArguments(): Array<string>;
|
|
3
|
-
export declare function transformReply(): Array<string>;
|
|
5
|
+
export declare function transformReply(reply: unknown): Array<string>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser) {
|
|
9
|
+
parser.push('GRAPH.LIST');
|
|
10
|
+
}
|
|
6
11
|
function transformArguments() {
|
|
7
12
|
return ['GRAPH.LIST'];
|
|
8
13
|
}
|
|
14
|
+
function transformReply(reply) {
|
|
15
|
+
return reply;
|
|
16
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export interface MemoryUsageOptions {
|
|
2
3
|
SAMPLES?: number;
|
|
3
4
|
}
|
|
5
|
+
export declare function parseCommand(parser: CommandParser, key: string, options?: MemoryUsageOptions): void;
|
|
4
6
|
export declare function transformArguments(key: string, options?: MemoryUsageOptions): Array<string>;
|
|
5
7
|
export type MemoryUsageReply = Array<string | number | MemoryUsageReply>;
|
|
6
|
-
export declare function transformReply(): MemoryUsageReply;
|
|
8
|
+
export declare function transformReply(reply: unknown): MemoryUsageReply;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
6
|
+
function parseCommand(parser, key, options) {
|
|
7
|
+
parser.push("GRAPH.MEMORY", "USAGE", key);
|
|
8
|
+
if (options?.SAMPLES) {
|
|
9
|
+
parser.push(String(options.SAMPLES));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
function transformArguments(key, options) {
|
|
5
13
|
const args = ["GRAPH.MEMORY", "USAGE", key];
|
|
6
14
|
return options?.SAMPLES ? [...args, String(options.SAMPLES)] : [...args];
|
|
7
15
|
}
|
|
16
|
+
function transformReply(reply) {
|
|
17
|
+
return reply;
|
|
18
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const FIRST_KEY_INDEX = 1;
|
|
2
3
|
export declare const IS_READ_ONLY = true;
|
|
4
|
+
export declare function parseCommand(parser: CommandParser, key: string, query: string): void;
|
|
3
5
|
export declare function transformArguments(key: string, query: string): Array<string>;
|
|
4
|
-
export declare function
|
|
6
|
+
export declare function transformReply(reply: unknown): Array<string>;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.FIRST_KEY_INDEX = 1;
|
|
6
8
|
exports.IS_READ_ONLY = true;
|
|
9
|
+
function parseCommand(parser, key, query) {
|
|
10
|
+
parser.push('GRAPH.PROFILE');
|
|
11
|
+
parser.pushKey(key);
|
|
12
|
+
parser.push(query);
|
|
13
|
+
}
|
|
7
14
|
function transformArguments(key, query) {
|
|
8
15
|
return ['GRAPH.PROFILE', key, query];
|
|
9
16
|
}
|
|
17
|
+
function transformReply(reply) {
|
|
18
|
+
return reply;
|
|
19
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisArgument, CommandParser } from '@redis/client';
|
|
2
2
|
import { QueryOptionsBackwardCompatible } from '.';
|
|
3
3
|
export declare const FIRST_KEY_INDEX = 1;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function parseCommand(parser: CommandParser, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): void;
|
|
5
|
+
export declare function transformArguments(graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): Array<RedisArgument>;
|
|
5
6
|
type Headers = Array<string>;
|
|
6
7
|
type Data = Array<string | number | null | Data>;
|
|
7
8
|
type Metadata = Array<string>;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
5
6
|
exports.transformReply = transformReply;
|
|
6
7
|
const _1 = require(".");
|
|
7
8
|
exports.FIRST_KEY_INDEX = 1;
|
|
9
|
+
function parseCommand(parser, graph, query, options, compact) {
|
|
10
|
+
const args = (0, _1.pushQueryArguments)(['GRAPH.QUERY'], graph, query, options, compact);
|
|
11
|
+
parser.push(...args);
|
|
12
|
+
}
|
|
8
13
|
function transformArguments(graph, query, options, compact) {
|
|
9
14
|
return (0, _1.pushQueryArguments)(['GRAPH.QUERY'], graph, query, options, compact);
|
|
10
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisArgument, CommandParser } from '@redis/client';
|
|
2
2
|
import { QueryOptionsBackwardCompatible } from '.';
|
|
3
3
|
export { FIRST_KEY_INDEX } from './QUERY';
|
|
4
4
|
export declare const IS_READ_ONLY = true;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function parseCommand(parser: CommandParser, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): void;
|
|
6
|
+
export declare function transformArguments(graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): Array<RedisArgument>;
|
|
6
7
|
export { transformReply } from './QUERY';
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformReply = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
5
6
|
const _1 = require(".");
|
|
6
7
|
var QUERY_1 = require("./QUERY");
|
|
7
8
|
Object.defineProperty(exports, "FIRST_KEY_INDEX", { enumerable: true, get: function () { return QUERY_1.FIRST_KEY_INDEX; } });
|
|
8
9
|
exports.IS_READ_ONLY = true;
|
|
10
|
+
function parseCommand(parser, graph, query, options, compact) {
|
|
11
|
+
const args = (0, _1.pushQueryArguments)(['GRAPH.RO_QUERY'], graph, query, options, compact);
|
|
12
|
+
parser.push(...args);
|
|
13
|
+
}
|
|
9
14
|
function transformArguments(graph, query, options, compact) {
|
|
10
15
|
return (0, _1.pushQueryArguments)(['GRAPH.RO_QUERY'], graph, query, options, compact);
|
|
11
16
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser, dbname: string): void;
|
|
2
4
|
export declare function transformArguments(dbname: string): Array<string>;
|
|
3
|
-
export declare function transformReply(): Array<string>;
|
|
5
|
+
export declare function transformReply(reply: unknown): Array<string>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser, dbname) {
|
|
9
|
+
parser.push('SENTINEL', 'MASTER', dbname);
|
|
10
|
+
}
|
|
6
11
|
function transformArguments(dbname) {
|
|
7
12
|
return ['SENTINEL', 'MASTER', dbname];
|
|
8
13
|
}
|
|
14
|
+
function transformReply(reply) {
|
|
15
|
+
return reply;
|
|
16
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser): void;
|
|
2
4
|
export declare function transformArguments(): Array<string>;
|
|
3
|
-
export declare function transformReply(): Array<Array<string>>;
|
|
5
|
+
export declare function transformReply(reply: unknown): Array<Array<string>>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser) {
|
|
9
|
+
parser.push('SENTINEL', 'MASTERS');
|
|
10
|
+
}
|
|
6
11
|
function transformArguments() {
|
|
7
12
|
return ['SENTINEL', 'MASTERS'];
|
|
8
13
|
}
|
|
14
|
+
function transformReply(reply) {
|
|
15
|
+
return reply;
|
|
16
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
2
3
|
export declare const FIRST_KEY_INDEX = 1;
|
|
4
|
+
export declare function parseCommand(parser: CommandParser, key: string): void;
|
|
3
5
|
export declare function transformArguments(key: string): string[];
|
|
4
6
|
type SlowLogRawReply = Array<[
|
|
5
7
|
timestamp: string,
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FIRST_KEY_INDEX = exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
5
6
|
exports.transformReply = transformReply;
|
|
6
7
|
exports.IS_READ_ONLY = true;
|
|
7
8
|
exports.FIRST_KEY_INDEX = 1;
|
|
9
|
+
function parseCommand(parser, key) {
|
|
10
|
+
parser.push('GRAPH.SLOWLOG');
|
|
11
|
+
parser.pushKey(key);
|
|
12
|
+
}
|
|
8
13
|
function transformArguments(key) {
|
|
9
14
|
return ['GRAPH.SLOWLOG', key];
|
|
10
15
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export declare function parseCommand(parser: CommandParser, lib: string): void;
|
|
1
3
|
export declare function transformArguments(lib: string): Array<string>;
|
|
2
|
-
export declare function transformReply(): string;
|
|
4
|
+
export declare function transformReply(reply: unknown): string;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
6
|
+
function parseCommand(parser, lib) {
|
|
7
|
+
parser.push('GRAPH.UDF', 'DELETE', lib);
|
|
8
|
+
}
|
|
4
9
|
function transformArguments(lib) {
|
|
5
10
|
return ['GRAPH.UDF', 'DELETE', lib];
|
|
6
11
|
}
|
|
12
|
+
function transformReply(reply) {
|
|
13
|
+
return reply;
|
|
14
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export declare function parseCommand(parser: CommandParser): void;
|
|
1
3
|
export declare function transformArguments(): Array<string>;
|
|
2
|
-
export declare function transformReply(): string;
|
|
4
|
+
export declare function transformReply(reply: unknown): string;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
6
|
+
function parseCommand(parser) {
|
|
7
|
+
parser.push('GRAPH.UDF', 'FLUSH');
|
|
8
|
+
}
|
|
4
9
|
function transformArguments() {
|
|
5
10
|
return ['GRAPH.UDF', 'FLUSH'];
|
|
6
11
|
}
|
|
12
|
+
function transformReply(reply) {
|
|
13
|
+
return reply;
|
|
14
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
1
2
|
export declare const IS_READ_ONLY = true;
|
|
2
3
|
export type UdfLibraryEntry = [string, string[]] | [string, string[], string];
|
|
3
4
|
export type UdfListReply = UdfLibraryEntry[];
|
|
5
|
+
export declare function parseCommand(parser: CommandParser, lib?: string, withCode?: boolean): void;
|
|
4
6
|
export declare function transformArguments(lib?: string, withCode?: boolean): Array<string>;
|
|
5
|
-
export declare function transformReply(): UdfListReply;
|
|
7
|
+
export declare function transformReply(reply: unknown): UdfListReply;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
4
5
|
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
5
7
|
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser, lib, withCode = false) {
|
|
9
|
+
parser.push('GRAPH.UDF', 'LIST');
|
|
10
|
+
if (lib !== undefined) {
|
|
11
|
+
parser.push(lib);
|
|
12
|
+
}
|
|
13
|
+
if (withCode) {
|
|
14
|
+
parser.push('WITHCODE');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
6
17
|
function transformArguments(lib, withCode = false) {
|
|
7
18
|
const args = ['GRAPH.UDF', 'LIST'];
|
|
8
19
|
if (lib !== undefined) {
|
|
@@ -13,3 +24,6 @@ function transformArguments(lib, withCode = false) {
|
|
|
13
24
|
}
|
|
14
25
|
return args;
|
|
15
26
|
}
|
|
27
|
+
function transformReply(reply) {
|
|
28
|
+
return reply;
|
|
29
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export declare function parseCommand(parser: CommandParser, name: string, script: string | Function, replace?: boolean): void;
|
|
1
3
|
export declare function transformArguments(name: string, script: string | Function, replace?: boolean): Array<string>;
|
|
2
|
-
export declare function transformReply(): string;
|
|
4
|
+
export declare function transformReply(reply: unknown): string;
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommand = parseCommand;
|
|
3
4
|
exports.transformArguments = transformArguments;
|
|
5
|
+
exports.transformReply = transformReply;
|
|
6
|
+
function parseCommand(parser, name, script, replace = false) {
|
|
7
|
+
parser.push('GRAPH.UDF', 'LOAD');
|
|
8
|
+
if (replace) {
|
|
9
|
+
parser.push('REPLACE');
|
|
10
|
+
}
|
|
11
|
+
parser.push(name);
|
|
12
|
+
// If script is a function, convert it to string and add falkor.register() call
|
|
13
|
+
let scriptStr;
|
|
14
|
+
if (typeof script === 'function') {
|
|
15
|
+
const functionStr = script.toString();
|
|
16
|
+
const functionName = script.name;
|
|
17
|
+
if (!functionName) {
|
|
18
|
+
throw new Error('Function must have a name to be registered as a UDF');
|
|
19
|
+
}
|
|
20
|
+
// Add the function definition and register call
|
|
21
|
+
scriptStr = `${functionStr}\nfalkor.register("${functionName}", ${functionName});`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
scriptStr = script;
|
|
25
|
+
}
|
|
26
|
+
parser.push(scriptStr);
|
|
27
|
+
}
|
|
4
28
|
function transformArguments(name, script, replace = false) {
|
|
5
29
|
const args = ['GRAPH.UDF', 'LOAD'];
|
|
6
30
|
if (replace) {
|
|
@@ -24,3 +48,6 @@ function transformArguments(name, script, replace = false) {
|
|
|
24
48
|
args.push(scriptStr);
|
|
25
49
|
return args;
|
|
26
50
|
}
|
|
51
|
+
function transformReply(reply) {
|
|
52
|
+
return reply;
|
|
53
|
+
}
|
|
@@ -18,7 +18,7 @@ import * as UDF_LOAD from './UDF_LOAD';
|
|
|
18
18
|
import * as UDF_LIST from './UDF_LIST';
|
|
19
19
|
import * as UDF_FLUSH from './UDF_FLUSH';
|
|
20
20
|
import * as UDF_DELETE from './UDF_DELETE';
|
|
21
|
-
import {
|
|
21
|
+
import { RedisArgument } from '@redis/client';
|
|
22
22
|
declare const _default: {
|
|
23
23
|
CONFIG_GET: typeof CONFIG_GET;
|
|
24
24
|
configGet: typeof CONFIG_GET;
|
|
@@ -71,5 +71,5 @@ export interface QueryOptions {
|
|
|
71
71
|
TIMEOUT?: number;
|
|
72
72
|
}
|
|
73
73
|
export type QueryOptionsBackwardCompatible = QueryOptions | number;
|
|
74
|
-
export declare function pushQueryArguments(args:
|
|
75
|
-
export { UdfListReply, UdfLibraryEntry } from './UDF_LIST';
|
|
74
|
+
export declare function pushQueryArguments(args: Array<RedisArgument>, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): Array<RedisArgument>;
|
|
75
|
+
export type { UdfListReply, UdfLibraryEntry } from './UDF_LIST';
|
package/dist/src/falkordb.d.ts
CHANGED
|
@@ -5,17 +5,16 @@ import { RedisClientOptions, RedisFunctions, RedisScripts } from 'redis';
|
|
|
5
5
|
import Graph from './graph';
|
|
6
6
|
import commands from './commands';
|
|
7
7
|
import { RedisClusterOptions } from '@redis/client';
|
|
8
|
-
import { Options as PoolOptions } from 'generic-pool';
|
|
9
8
|
import { SingleGraphConnection } from './clients/single';
|
|
10
9
|
type NetSocketOptions = Partial<net.SocketConnectOpts> & {
|
|
11
10
|
tls?: false;
|
|
12
11
|
};
|
|
13
12
|
export type TypedRedisClientOptions = RedisClientOptions<{
|
|
14
13
|
falkordb: typeof commands;
|
|
15
|
-
}, RedisFunctions, RedisScripts>;
|
|
14
|
+
}, RedisFunctions, RedisScripts, 2>;
|
|
16
15
|
export type TypedRedisClusterClientOptions = RedisClusterOptions<{
|
|
17
16
|
falkordb: typeof commands;
|
|
18
|
-
}, RedisFunctions, RedisScripts>;
|
|
17
|
+
}, RedisFunctions, RedisScripts, 2>;
|
|
19
18
|
interface TlsSocketOptions extends tls.ConnectionOptions {
|
|
20
19
|
tls: true;
|
|
21
20
|
}
|
|
@@ -76,10 +75,6 @@ export interface FalkorDBOptions {
|
|
|
76
75
|
* Tag to append to library name that is sent to the Redis server
|
|
77
76
|
*/
|
|
78
77
|
clientInfoTag?: string;
|
|
79
|
-
/**
|
|
80
|
-
* Connection pool options
|
|
81
|
-
*/
|
|
82
|
-
poolOptions?: PoolOptions;
|
|
83
78
|
}
|
|
84
79
|
export default class FalkorDB extends EventEmitter {
|
|
85
80
|
#private;
|
package/dist/src/falkordb.js
CHANGED
|
@@ -27,10 +27,6 @@ class FalkorDB extends events_1.EventEmitter {
|
|
|
27
27
|
if (redisOption.url && redisOption.url.startsWith('falkor')) {
|
|
28
28
|
redisOption.url = redisOption.url.replace('falkor', 'redis');
|
|
29
29
|
}
|
|
30
|
-
// Just copy the pool options to the isolation pool options as expected by the redis client
|
|
31
|
-
if (options?.poolOptions) {
|
|
32
|
-
redisOption.isolationPoolOptions = options.poolOptions;
|
|
33
|
-
}
|
|
34
30
|
redisOption.modules = {
|
|
35
31
|
falkordb: commands_1.default
|
|
36
32
|
};
|
package/dist/src/graph.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisArgument } from "@redis/client";
|
|
2
2
|
import { QueryOptions } from "./commands";
|
|
3
3
|
import { QueryReply } from "./commands/QUERY";
|
|
4
4
|
import { ConstraintType, EntityType } from "./commands/CONSTRAINT_CREATE";
|
|
@@ -11,8 +11,8 @@ export type GraphReply<T> = Omit<QueryReply, "headers" | "data"> & {
|
|
|
11
11
|
export default class Graph {
|
|
12
12
|
#private;
|
|
13
13
|
constructor(client: Client, name: string);
|
|
14
|
-
query<T>(query:
|
|
15
|
-
roQuery<T>(query:
|
|
14
|
+
query<T>(query: RedisArgument, options?: QueryOptions): Promise<GraphReply<T>>;
|
|
15
|
+
roQuery<T>(query: RedisArgument, options?: QueryOptions): Promise<GraphReply<T>>;
|
|
16
16
|
delete(): Promise<void>;
|
|
17
17
|
explain(query: string): Promise<any>;
|
|
18
18
|
profile(query: string): Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "falkordb",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "A FalkorDB javascript library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"@typescript-eslint/parser": "^8.18.2",
|
|
45
45
|
"eslint": "^9.17.0",
|
|
46
46
|
"gh-pages": "^6.2.0",
|
|
47
|
-
"jest": "^
|
|
47
|
+
"jest": "^30.2.0",
|
|
48
48
|
"release-it": "^19.0.3",
|
|
49
|
-
"ts-jest": "^29.
|
|
49
|
+
"ts-jest": "^29.4.6",
|
|
50
50
|
"typescript": "^5.9.3"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@js-temporal/polyfill": "^0.5.1",
|
|
54
|
-
"@redis/client": "^
|
|
54
|
+
"@redis/client": "^5.10.0",
|
|
55
55
|
"cluster-key-slot": "1.1.2",
|
|
56
56
|
"generic-pool": "^3.9.0",
|
|
57
57
|
"lodash": "^4.17.21",
|
|
58
|
-
"redis": "^
|
|
58
|
+
"redis": "^5.10.0"
|
|
59
59
|
}
|
|
60
60
|
}
|