falkordb 6.6.0-beta.1 → 6.6.1

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.
Files changed (54) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/src/clients/client.d.ts +9 -4
  3. package/dist/src/clients/cluster.d.ts +12 -7
  4. package/dist/src/clients/cluster.js +12 -0
  5. package/dist/src/clients/nullClient.d.ts +9 -4
  6. package/dist/src/clients/nullClient.js +12 -0
  7. package/dist/src/clients/single.d.ts +11 -7
  8. package/dist/src/clients/single.js +14 -40
  9. package/dist/src/commands/CONFIG_GET.d.ts +3 -1
  10. package/dist/src/commands/CONFIG_GET.js +8 -0
  11. package/dist/src/commands/CONFIG_SET.d.ts +3 -1
  12. package/dist/src/commands/CONFIG_SET.js +8 -0
  13. package/dist/src/commands/CONSTRAINT_CREATE.d.ts +3 -1
  14. package/dist/src/commands/CONSTRAINT_CREATE.js +8 -0
  15. package/dist/src/commands/CONSTRAINT_DROP.d.ts +3 -1
  16. package/dist/src/commands/CONSTRAINT_DROP.js +8 -0
  17. package/dist/src/commands/COPY.d.ts +3 -1
  18. package/dist/src/commands/COPY.js +8 -0
  19. package/dist/src/commands/DELETE.d.ts +3 -1
  20. package/dist/src/commands/DELETE.js +9 -0
  21. package/dist/src/commands/EXPLAIN.d.ts +3 -1
  22. package/dist/src/commands/EXPLAIN.js +10 -0
  23. package/dist/src/commands/INFO.d.ts +3 -1
  24. package/dist/src/commands/INFO.js +11 -0
  25. package/dist/src/commands/LIST.d.ts +3 -1
  26. package/dist/src/commands/LIST.js +8 -0
  27. package/dist/src/commands/MEMORY_USAGE.d.ts +3 -1
  28. package/dist/src/commands/MEMORY_USAGE.js +11 -0
  29. package/dist/src/commands/PROFILE.d.ts +3 -1
  30. package/dist/src/commands/PROFILE.js +10 -0
  31. package/dist/src/commands/QUERY.d.ts +3 -2
  32. package/dist/src/commands/QUERY.js +5 -0
  33. package/dist/src/commands/RO_QUERY.d.ts +3 -2
  34. package/dist/src/commands/RO_QUERY.js +5 -0
  35. package/dist/src/commands/SENTINEL_MASTER.d.ts +3 -1
  36. package/dist/src/commands/SENTINEL_MASTER.js +8 -0
  37. package/dist/src/commands/SENTINEL_MASTERS.d.ts +3 -1
  38. package/dist/src/commands/SENTINEL_MASTERS.js +8 -0
  39. package/dist/src/commands/SLOWLOG.d.ts +2 -0
  40. package/dist/src/commands/SLOWLOG.js +5 -0
  41. package/dist/src/commands/UDF_DELETE.d.ts +3 -1
  42. package/dist/src/commands/UDF_DELETE.js +8 -0
  43. package/dist/src/commands/UDF_FLUSH.d.ts +3 -1
  44. package/dist/src/commands/UDF_FLUSH.js +8 -0
  45. package/dist/src/commands/UDF_LIST.d.ts +3 -1
  46. package/dist/src/commands/UDF_LIST.js +14 -0
  47. package/dist/src/commands/UDF_LOAD.d.ts +3 -1
  48. package/dist/src/commands/UDF_LOAD.js +27 -0
  49. package/dist/src/commands/index.d.ts +15 -2
  50. package/dist/src/commands/index.js +12 -0
  51. package/dist/src/falkordb.d.ts +6 -7
  52. package/dist/src/falkordb.js +12 -4
  53. package/dist/src/graph.d.ts +3 -3
  54. package/package.json +1 -1
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
3
  export { default as FalkorDB } from './src/falkordb';
4
+ export type { FalkorDBOptions } from './src/falkordb';
@@ -1,18 +1,19 @@
1
- import { RedisCommandArgument } from "@redis/client/dist/lib/commands";
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";
5
5
  import { SingleGraphConnection } from "./single";
6
6
  import { MemoryUsageOptions, MemoryUsageReply } from "../commands/MEMORY_USAGE";
7
+ import { UdfListReply } from "../commands/UDF_LIST";
7
8
  export interface Client {
8
9
  init(falkordb: FalkorDB): Promise<void>;
9
10
  list(): Promise<Array<string>>;
10
11
  configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
11
12
  configSet(configKey: string, value: number | string): Promise<void>;
12
13
  info(section?: string): Promise<(string | string[])[]>;
13
- query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<any>;
14
- profile<T>(graph: string, query: RedisCommandArgument): Promise<any>;
15
- roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<any>;
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>;
16
17
  copy<T>(srcGraph: string, destGraph: string): Promise<any>;
17
18
  delete(graph: string): Promise<void>;
18
19
  explain(graph: string, query: string): Promise<any>;
@@ -25,6 +26,10 @@ export interface Client {
25
26
  }[]>;
26
27
  constraintCreate(graph: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
27
28
  constraintDrop(graph: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
29
+ udfLoad(name: string, script: string | Function, replace?: boolean): Promise<string>;
30
+ udfList(lib?: string, withCode?: boolean): Promise<UdfListReply>;
31
+ udfFlush(): Promise<string>;
32
+ udfDelete(lib: string): Promise<string>;
28
33
  /**
29
34
  * @deprecated Use `disconnect` instead
30
35
  */
@@ -1,14 +1,15 @@
1
1
  import { Client } from "./client";
2
2
  import { ConstraintType, EntityType } from "../graph";
3
- import { RedisCommandArgument, RedisFunctions, RedisScripts } from "@redis/client/dist/lib/commands";
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";
7
7
  import { SingleGraphConnection } from "./single";
8
8
  import { MemoryUsageOptions, MemoryUsageReply } from "../commands/MEMORY_USAGE";
9
+ import { UdfListReply } from "../commands/UDF_LIST";
9
10
  export type ClusterGraphConnection = RedisClusterType<{
10
11
  falkordb: typeof commands;
11
- }, RedisFunctions, RedisScripts>;
12
+ }, RedisFunctions, RedisScripts, 2>;
12
13
  /**
13
14
  * A client that connects to a Redis Cluster.
14
15
  */
@@ -17,9 +18,9 @@ export declare class Cluster implements Client {
17
18
  constructor(client: SingleGraphConnection);
18
19
  getConnection(): Promise<import("@redis/client").RedisClientType<{
19
20
  falkordb: typeof commands;
20
- }, RedisFunctions, RedisScripts>>;
21
+ }, RedisFunctions, RedisScripts, 2, {}>>;
21
22
  init(falkordb: FalkorDB): Promise<void>;
22
- query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
23
+ query<T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
23
24
  headers: undefined;
24
25
  data: undefined;
25
26
  metadata: string[];
@@ -28,7 +29,7 @@ export declare class Cluster implements Client {
28
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)[];
29
30
  metadata: string[];
30
31
  }>;
31
- roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
32
+ roQuery<T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
32
33
  headers: undefined;
33
34
  data: undefined;
34
35
  metadata: string[];
@@ -38,7 +39,7 @@ export declare class Cluster implements Client {
38
39
  metadata: string[];
39
40
  }>;
40
41
  delete(graph: string): Promise<void>;
41
- explain(graph: string, query: string): Promise<string | number | (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 | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined>;
42
+ explain(graph: string, query: string): Promise<string[]>;
42
43
  list(): Promise<Array<string>>;
43
44
  configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
44
45
  configSet(configKey: string, value: number | string): Promise<void>;
@@ -53,7 +54,11 @@ export declare class Cluster implements Client {
53
54
  memoryUsage(graph: string, options?: MemoryUsageOptions): Promise<MemoryUsageReply>;
54
55
  constraintCreate(graph: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
55
56
  constraintDrop(graph: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
56
- profile<_T>(graph: string, query: string): Promise<string | number | (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 | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined>;
57
+ udfLoad(name: string, script: string | Function, replace?: boolean): Promise<string>;
58
+ udfList(lib?: string, withCode?: boolean): Promise<UdfListReply>;
59
+ udfFlush(): Promise<string>;
60
+ udfDelete(lib: string): Promise<string>;
61
+ profile<_T>(graph: string, query: string): Promise<string[]>;
57
62
  quit(): Promise<void>;
58
63
  disconnect(): Promise<void>;
59
64
  }
@@ -86,6 +86,18 @@ class Cluster {
86
86
  const reply = this.#client.falkordb.constraintDrop(graph, constraintType, entityType, label, ...properties);
87
87
  return reply.then(() => { });
88
88
  }
89
+ async udfLoad(name, script, replace = false) {
90
+ return this.#client.falkordb.udfLoad(name, script, replace);
91
+ }
92
+ async udfList(lib, withCode = false) {
93
+ return this.#client.falkordb.udfList(lib, withCode);
94
+ }
95
+ async udfFlush() {
96
+ return this.#client.falkordb.udfFlush();
97
+ }
98
+ async udfDelete(lib) {
99
+ return this.#client.falkordb.udfDelete(lib);
100
+ }
89
101
  async profile(graph, query) {
90
102
  return this.#client.falkordb.profile(graph, query);
91
103
  }
@@ -1,10 +1,11 @@
1
- import { RedisCommandArgument } from "@redis/client/dist/lib/commands";
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";
5
5
  import { Client } from "./client";
6
6
  import { SingleGraphConnection } from "./single";
7
7
  import { MemoryUsageOptions, MemoryUsageReply } from "../commands/MEMORY_USAGE";
8
+ import { UdfListReply } from "../commands/UDF_LIST";
8
9
  /**
9
10
  * The `NullClient` class is a placeholder implementation of the `Client` interface.
10
11
  *
@@ -23,9 +24,9 @@ export declare class NullClient implements Client {
23
24
  configGet(_configKey: string): Promise<(string | number)[] | (string | number)[][]>;
24
25
  configSet(_configKey: string, _value: number | string): Promise<void>;
25
26
  info(_section?: string): Promise<(string | string[])[]>;
26
- query<_T>(_graph: string, _query: RedisCommandArgument, _options?: QueryOptions): Promise<any>;
27
- profile<_T>(_graph: string, _query: RedisCommandArgument): Promise<any>;
28
- roQuery<_T>(_graph: string, _query: RedisCommandArgument, _options?: QueryOptions): Promise<any>;
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>;
29
30
  copy<_T>(_srcGraph: string, _destGraph: string): Promise<any>;
30
31
  delete(_graph: string): Promise<void>;
31
32
  explain(_graph: string, _query: string): Promise<any>;
@@ -38,6 +39,10 @@ export declare class NullClient implements Client {
38
39
  memoryUsage(_graph: string, _options?: MemoryUsageOptions): Promise<MemoryUsageReply>;
39
40
  constraintCreate(_graph: string, _constraintType: ConstraintType, _entityType: EntityType, _label: string, ..._properties: string[]): Promise<void>;
40
41
  constraintDrop(_graph: string, _constraintType: ConstraintType, _entityType: EntityType, _label: string, ..._properties: string[]): Promise<void>;
42
+ udfLoad(_name: string, _script: string | Function, _replace?: boolean): Promise<string>;
43
+ udfList(_lib?: string, _withCode?: boolean): Promise<UdfListReply>;
44
+ udfFlush(): Promise<string>;
45
+ udfDelete(_lib: string): Promise<string>;
41
46
  quit(): Promise<void>;
42
47
  disconnect(): Promise<void>;
43
48
  }
@@ -61,6 +61,18 @@ class NullClient {
61
61
  constraintDrop(_graph, _constraintType, _entityType, _label, ..._properties) {
62
62
  throw new Error("Method not implemented.");
63
63
  }
64
+ udfLoad(_name, _script, _replace) {
65
+ throw new Error("Method not implemented.");
66
+ }
67
+ udfList(_lib, _withCode) {
68
+ throw new Error("Method not implemented.");
69
+ }
70
+ udfFlush() {
71
+ throw new Error("Method not implemented.");
72
+ }
73
+ udfDelete(_lib) {
74
+ throw new Error("Method not implemented.");
75
+ }
64
76
  quit() {
65
77
  throw new Error("Method not implemented.");
66
78
  }
@@ -1,19 +1,19 @@
1
1
  import { Client } from "./client";
2
2
  import { ConstraintType, EntityType } from "../graph";
3
- import { RedisCommandArgument, RedisFunctions, RedisScripts } from "@redis/client/dist/lib/commands";
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";
7
7
  import { MemoryUsageOptions, MemoryUsageReply } from "../commands/MEMORY_USAGE";
8
+ import { UdfListReply } from "../commands/UDF_LIST";
8
9
  export type SingleGraphConnection = RedisClientType<{
9
10
  falkordb: typeof commands;
10
- }, RedisFunctions, RedisScripts>;
11
+ }, RedisFunctions, RedisScripts, 2>;
11
12
  export declare class Single implements Client {
12
- #private;
13
13
  protected client: SingleGraphConnection;
14
14
  constructor(client: SingleGraphConnection);
15
15
  init(_falkordb: FalkorDB): Promise<void>;
16
- query<_T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
16
+ query<_T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
17
17
  headers: undefined;
18
18
  data: undefined;
19
19
  metadata: string[];
@@ -22,7 +22,7 @@ export declare class Single implements Client {
22
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)[];
23
23
  metadata: string[];
24
24
  }>;
25
- roQuery<_T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
25
+ roQuery<_T>(graph: string, query: RedisArgument, options?: QueryOptions, compact?: boolean): Promise<{
26
26
  headers: undefined;
27
27
  data: undefined;
28
28
  metadata: string[];
@@ -32,8 +32,8 @@ export declare class Single implements Client {
32
32
  metadata: string[];
33
33
  }>;
34
34
  delete(graph: string): Promise<void>;
35
- explain(graph: string, query: string): Promise<string | number | (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 | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined>;
36
- profile<_T>(graph: string, query: string): Promise<string | number | (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 | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined>;
35
+ explain(graph: string, query: string): Promise<string[]>;
36
+ profile<_T>(graph: string, query: string): Promise<string[]>;
37
37
  list(): Promise<string[]>;
38
38
  configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
39
39
  configSet(configKey: string, value: number | string): Promise<void>;
@@ -47,6 +47,10 @@ export declare class Single implements Client {
47
47
  memoryUsage(graph: string, options?: MemoryUsageOptions): Promise<MemoryUsageReply>;
48
48
  constraintCreate(graph: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
49
49
  constraintDrop(graph: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
50
+ udfLoad(name: string, script: string | Function, replace?: boolean): Promise<string>;
51
+ udfList(lib?: string, withCode?: boolean): Promise<UdfListReply>;
52
+ udfFlush(): Promise<string>;
53
+ udfDelete(lib: string): Promise<string>;
50
54
  copy<_T>(srcGraph: string, destGraph: string): Promise<"OK">;
51
55
  quit(): Promise<void>;
52
56
  disconnect(): 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
- const reply = this.#usePool
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
- const reply = this.#usePool
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) {
@@ -90,6 +52,18 @@ class Single {
90
52
  const reply = this.client.falkordb.constraintDrop(graph, constraintType, entityType, label, ...properties);
91
53
  return reply.then(() => { });
92
54
  }
55
+ async udfLoad(name, script, replace = false) {
56
+ return this.client.falkordb.udfLoad(name, script, replace);
57
+ }
58
+ async udfList(lib, withCode = false) {
59
+ return this.client.falkordb.udfList(lib, withCode);
60
+ }
61
+ async udfFlush() {
62
+ return this.client.falkordb.udfFlush();
63
+ }
64
+ async udfDelete(lib) {
65
+ return this.client.falkordb.udfDelete(lib);
66
+ }
93
67
  async copy(srcGraph, destGraph) {
94
68
  return this.client.falkordb.copy(srcGraph, destGraph);
95
69
  }
@@ -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 transfromReply(): Array<string>;
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 transfromReply(): Array<string>;
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 { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
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 transformArguments(graph: RedisCommandArgument, query: RedisCommandArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): RedisCommandArguments;
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 { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
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 transformArguments(graph: RedisCommandArgument, query: RedisCommandArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): RedisCommandArguments;
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
+ }
@@ -14,7 +14,11 @@ import * as COPY from './COPY';
14
14
  import * as SENTINEL_MASTER from './SENTINEL_MASTER';
15
15
  import * as SENTINEL_MASTERS from './SENTINEL_MASTERS';
16
16
  import * as MEMORY_USAGE from './MEMORY_USAGE';
17
- import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
17
+ import * as UDF_LOAD from './UDF_LOAD';
18
+ import * as UDF_LIST from './UDF_LIST';
19
+ import * as UDF_FLUSH from './UDF_FLUSH';
20
+ import * as UDF_DELETE from './UDF_DELETE';
21
+ import { RedisArgument } from '@redis/client';
18
22
  declare const _default: {
19
23
  CONFIG_GET: typeof CONFIG_GET;
20
24
  configGet: typeof CONFIG_GET;
@@ -48,6 +52,14 @@ declare const _default: {
48
52
  sentinelMasters: typeof SENTINEL_MASTERS;
49
53
  MEMORY_USAGE: typeof MEMORY_USAGE;
50
54
  memoryUsage: typeof MEMORY_USAGE;
55
+ UDF_LOAD: typeof UDF_LOAD;
56
+ udfLoad: typeof UDF_LOAD;
57
+ UDF_LIST: typeof UDF_LIST;
58
+ udfList: typeof UDF_LIST;
59
+ UDF_FLUSH: typeof UDF_FLUSH;
60
+ udfFlush: typeof UDF_FLUSH;
61
+ UDF_DELETE: typeof UDF_DELETE;
62
+ udfDelete: typeof UDF_DELETE;
51
63
  };
52
64
  export default _default;
53
65
  type QueryParam = null | string | number | boolean | QueryParams | Array<QueryParam>;
@@ -59,4 +71,5 @@ export interface QueryOptions {
59
71
  TIMEOUT?: number;
60
72
  }
61
73
  export type QueryOptionsBackwardCompatible = QueryOptions | number;
62
- export declare function pushQueryArguments(args: RedisCommandArguments, graph: RedisCommandArgument, query: RedisCommandArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): RedisCommandArguments;
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';
@@ -17,6 +17,10 @@ const COPY = require("./COPY");
17
17
  const SENTINEL_MASTER = require("./SENTINEL_MASTER");
18
18
  const SENTINEL_MASTERS = require("./SENTINEL_MASTERS");
19
19
  const MEMORY_USAGE = require("./MEMORY_USAGE");
20
+ const UDF_LOAD = require("./UDF_LOAD");
21
+ const UDF_LIST = require("./UDF_LIST");
22
+ const UDF_FLUSH = require("./UDF_FLUSH");
23
+ const UDF_DELETE = require("./UDF_DELETE");
20
24
  exports.default = {
21
25
  CONFIG_GET,
22
26
  configGet: CONFIG_GET,
@@ -50,6 +54,14 @@ exports.default = {
50
54
  sentinelMasters: SENTINEL_MASTERS,
51
55
  MEMORY_USAGE,
52
56
  memoryUsage: MEMORY_USAGE,
57
+ UDF_LOAD,
58
+ udfLoad: UDF_LOAD,
59
+ UDF_LIST,
60
+ udfList: UDF_LIST,
61
+ UDF_FLUSH,
62
+ udfFlush: UDF_FLUSH,
63
+ UDF_DELETE,
64
+ udfDelete: UDF_DELETE,
53
65
  };
54
66
  function pushQueryArguments(args, graph, query, options, compact) {
55
67
  args.push(graph);
@@ -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;
@@ -90,6 +85,10 @@ export default class FalkorDB extends EventEmitter {
90
85
  configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
91
86
  configSet(configKey: string, value: number | string): Promise<void>;
92
87
  info(section?: string): Promise<(string | string[])[]>;
88
+ udfLoad(name: string, script: string | Function, replace?: boolean): Promise<string>;
89
+ udfList(lib?: string, withCode?: boolean): Promise<import("./commands").UdfListReply>;
90
+ udfFlush(): Promise<string>;
91
+ udfDelete(lib: string): Promise<string>;
93
92
  /**
94
93
  * Closes the client.
95
94
  */
@@ -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
  };
@@ -66,6 +62,18 @@ class FalkorDB extends events_1.EventEmitter {
66
62
  async info(section) {
67
63
  return this.#client.info(section);
68
64
  }
65
+ async udfLoad(name, script, replace = false) {
66
+ return this.#client.udfLoad(name, script, replace);
67
+ }
68
+ async udfList(lib, withCode = false) {
69
+ return this.#client.udfList(lib, withCode);
70
+ }
71
+ async udfFlush() {
72
+ return this.#client.udfFlush();
73
+ }
74
+ async udfDelete(lib) {
75
+ return this.#client.udfDelete(lib);
76
+ }
69
77
  /**
70
78
  * Closes the client.
71
79
  */
@@ -1,4 +1,4 @@
1
- import { RedisCommandArgument } from "@redis/client/dist/lib/commands";
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: RedisCommandArgument, options?: QueryOptions): Promise<GraphReply<T>>;
15
- roQuery<T>(query: RedisCommandArgument, options?: QueryOptions): Promise<GraphReply<T>>;
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.6.0-beta.1",
3
+ "version": "6.6.1",
4
4
  "description": "A FalkorDB javascript library",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",