falkordb 6.8.0 → 6.9.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.
Files changed (72) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/index.js +8 -5
  3. package/dist/src/clients/client.d.ts +5 -13
  4. package/dist/src/clients/cluster.d.ts +7 -12
  5. package/dist/src/clients/cluster.js +38 -5
  6. package/dist/src/clients/nullClient.d.ts +3 -11
  7. package/dist/src/clients/sentinel.d.ts +31 -0
  8. package/dist/src/clients/sentinel.js +179 -24
  9. package/dist/src/clients/single.d.ts +16 -12
  10. package/dist/src/clients/single.js +29 -21
  11. package/dist/src/commands/CONFIG_GET.d.ts +1 -5
  12. package/dist/src/commands/CONSTRAINT_CREATE.d.ts +2 -8
  13. package/dist/src/commands/CONSTRAINT_CREATE.js +3 -10
  14. package/dist/src/commands/CONSTRAINT_DROP.d.ts +1 -1
  15. package/dist/src/commands/MEMORY_USAGE.d.ts +2 -4
  16. package/dist/src/commands/QUERY.d.ts +4 -23
  17. package/dist/src/commands/QUERY.js +14 -4
  18. package/dist/src/commands/RO_QUERY.d.ts +2 -2
  19. package/dist/src/commands/RO_QUERY.js +4 -4
  20. package/dist/src/commands/SLOWLOG.d.ts +1 -13
  21. package/dist/src/commands/UDF_LIST.d.ts +2 -2
  22. package/dist/src/commands/index.d.ts +4 -11
  23. package/dist/src/commands/index.js +58 -22
  24. package/dist/src/enums/constraint-type.d.ts +4 -0
  25. package/dist/src/enums/constraint-type.js +8 -0
  26. package/dist/src/enums/entity-type.d.ts +4 -0
  27. package/dist/src/enums/entity-type.js +8 -0
  28. package/dist/src/enums/graph-value-types.d.ts +19 -0
  29. package/dist/src/enums/graph-value-types.js +24 -0
  30. package/dist/src/enums/index.d.ts +3 -0
  31. package/dist/src/enums/index.js +19 -0
  32. package/dist/src/errors.d.ts +10 -0
  33. package/dist/src/errors.js +18 -0
  34. package/dist/src/falkordb.d.ts +13 -88
  35. package/dist/src/falkordb.js +131 -8
  36. package/dist/src/graph.d.ts +27 -15
  37. package/dist/src/graph.js +90 -52
  38. package/dist/src/types/cluster-graph-connection.d.ts +5 -0
  39. package/dist/src/types/cluster-graph-connection.js +2 -0
  40. package/dist/src/types/config-item.d.ts +4 -0
  41. package/dist/src/types/config-item.js +2 -0
  42. package/dist/src/types/falkordb-options.d.ts +65 -0
  43. package/dist/src/types/falkordb-options.js +2 -0
  44. package/dist/src/types/graph-metadata.d.ts +5 -0
  45. package/dist/src/types/graph-metadata.js +2 -0
  46. package/dist/src/types/graph-raw-value.d.ts +29 -0
  47. package/dist/src/types/graph-raw-value.js +2 -0
  48. package/dist/src/types/graph-value.d.ts +29 -0
  49. package/dist/src/types/graph-value.js +2 -0
  50. package/dist/src/types/index.d.ts +16 -0
  51. package/dist/src/types/index.js +32 -0
  52. package/dist/src/types/memory-usage.d.ts +4 -0
  53. package/dist/src/types/memory-usage.js +2 -0
  54. package/dist/src/types/net-socket-options.d.ts +4 -0
  55. package/dist/src/types/net-socket-options.js +2 -0
  56. package/dist/src/types/query-options.d.ts +9 -0
  57. package/dist/src/types/query-options.js +2 -0
  58. package/dist/src/types/query-reply.d.ts +20 -0
  59. package/dist/src/types/query-reply.js +2 -0
  60. package/dist/src/types/single-graph-connection.d.ts +5 -0
  61. package/dist/src/types/single-graph-connection.js +2 -0
  62. package/dist/src/types/slow-log.d.ts +12 -0
  63. package/dist/src/types/slow-log.js +2 -0
  64. package/dist/src/types/socket-options.d.ts +40 -0
  65. package/dist/src/types/socket-options.js +2 -0
  66. package/dist/src/types/tls-socket-options.d.ts +4 -0
  67. package/dist/src/types/tls-socket-options.js +2 -0
  68. package/dist/src/types/typed-redis-client-options.d.ts +9 -0
  69. package/dist/src/types/typed-redis-client-options.js +2 -0
  70. package/dist/src/types/udf-list.d.ts +2 -0
  71. package/dist/src/types/udf-list.js +2 -0
  72. package/package.json +7 -6
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cluster-graph-connection"), exports);
18
+ __exportStar(require("./config-item"), exports);
19
+ __exportStar(require("./falkordb-options"), exports);
20
+ __exportStar(require("./graph-metadata"), exports);
21
+ __exportStar(require("./graph-raw-value"), exports);
22
+ __exportStar(require("./graph-value"), exports);
23
+ __exportStar(require("./memory-usage"), exports);
24
+ __exportStar(require("./net-socket-options"), exports);
25
+ __exportStar(require("./query-options"), exports);
26
+ __exportStar(require("./query-reply"), exports);
27
+ __exportStar(require("./single-graph-connection"), exports);
28
+ __exportStar(require("./slow-log"), exports);
29
+ __exportStar(require("./socket-options"), exports);
30
+ __exportStar(require("./tls-socket-options"), exports);
31
+ __exportStar(require("./typed-redis-client-options"), exports);
32
+ __exportStar(require("./udf-list"), exports);
@@ -0,0 +1,4 @@
1
+ export interface MemoryUsageOptions {
2
+ SAMPLES?: number;
3
+ }
4
+ export type MemoryUsageReply = Array<string | number | MemoryUsageReply>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as net from 'net';
2
+ export type NetSocketOptions = Partial<net.SocketConnectOpts> & {
3
+ tls?: false;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export type QueryParam = null | string | number | boolean | QueryParams | Array<QueryParam>;
2
+ export type QueryParams = {
3
+ [key: string]: QueryParam;
4
+ };
5
+ export interface QueryOptions {
6
+ params?: QueryParams;
7
+ TIMEOUT?: number;
8
+ }
9
+ export type QueryOptionsBackwardCompatible = QueryOptions | number;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ type Headers = Array<string>;
2
+ type Data = Array<string | number | null | Data>;
3
+ type Metadata = Array<string>;
4
+ export type QueryRawReply = [
5
+ headers: Headers,
6
+ data: Data,
7
+ metadata: Metadata
8
+ ] | [
9
+ metadata: Metadata
10
+ ];
11
+ export type QueryReply = {
12
+ headers: undefined;
13
+ data: undefined;
14
+ metadata: Metadata;
15
+ } | {
16
+ headers: Headers;
17
+ data: Data;
18
+ metadata: Metadata;
19
+ };
20
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { RedisClientType, RedisFunctions, RedisScripts } from '@redis/client';
2
+ import type commands from '../commands';
3
+ export type SingleGraphConnection = RedisClientType<{
4
+ falkordb: typeof commands;
5
+ }, RedisFunctions, RedisScripts, 2>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export type SlowLogRawReply = Array<[
2
+ timestamp: string,
3
+ command: string,
4
+ query: string,
5
+ took: string
6
+ ]>;
7
+ export type SlowLogReply = Array<{
8
+ timestamp: Date;
9
+ command: string;
10
+ query: string;
11
+ took: number;
12
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ import type { NetSocketOptions } from './net-socket-options';
2
+ import type { TlsSocketOptions } from './tls-socket-options';
3
+ export interface SocketCommonOptions {
4
+ /**
5
+ * Connection Timeout (in milliseconds)
6
+ */
7
+ connectTimeout?: number;
8
+ /**
9
+ * Toggle [`Nagle's algorithm`](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay)
10
+ */
11
+ noDelay?: boolean;
12
+ /**
13
+ * Toggle [`keep-alive`](https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay)
14
+ */
15
+ keepAlive?: number | false;
16
+ /**
17
+ * When the socket closes unexpectedly (without calling `.close()`), the client uses `reconnectStrategy` to decide what to do:
18
+ * 1. `false` -> do not reconnect, close the client and flush the command queue.
19
+ * 2. `number` -> wait for `X` milliseconds before reconnecting.
20
+ * 3. `(retries, cause) => false | number | Error` -> `number` is the same as configuring a `number` directly, `Error` is the same as `false`, but with a custom error.
21
+ *
22
+ * By default the initial connection is retried 3 times before `FalkorDB.connect()` rejects.
23
+ * After that, reconnects back off exponentially up to 2 seconds between attempts, with no
24
+ * limit on the number of attempts. A socket timeout (see `socketTimeout`) is never retried:
25
+ * the client closes instead.
26
+ */
27
+ reconnectStrategy?: false | number | ((retries: number, cause: Error) => false | Error | number);
28
+ /**
29
+ * Timeout (in milliseconds) after which an idle socket is closed. `undefined` means no timeout.
30
+ * With the default `reconnectStrategy` a timed-out client is not reconnected.
31
+ */
32
+ socketTimeout?: number;
33
+ /**
34
+ * Whether to use TLS for this socket connection.
35
+ * When `true`, TLS-specific options from {@link TlsSocketOptions} are expected;
36
+ * when `false` or omitted, {@link NetSocketOptions} are used.
37
+ */
38
+ tls?: boolean;
39
+ }
40
+ export type SocketOptions = SocketCommonOptions & (NetSocketOptions | TlsSocketOptions);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as tls from 'tls';
2
+ export interface TlsSocketOptions extends tls.ConnectionOptions {
3
+ tls: true;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { RedisClientOptions, RedisFunctions, RedisScripts } from 'redis';
2
+ import type { RedisClusterOptions } from '@redis/client';
3
+ import type commands from '../commands';
4
+ export type TypedRedisClientOptions = RedisClientOptions<{
5
+ falkordb: typeof commands;
6
+ }, RedisFunctions, RedisScripts, 2>;
7
+ export type TypedRedisClusterClientOptions = RedisClusterOptions<{
8
+ falkordb: typeof commands;
9
+ }, RedisFunctions, RedisScripts, 2>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export type UdfLibraryEntry = [string, string[]] | [string, string[], string];
2
+ export type UdfListReply = UdfLibraryEntry[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "falkordb",
3
- "version": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "description": "A FalkorDB javascript library",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -40,21 +40,22 @@
40
40
  "@types/jest": "^30.0.0",
41
41
  "@types/lodash": "^4.17.13",
42
42
  "@types/node": "^26.2.0",
43
- "@typescript-eslint/eslint-plugin": "^8.18.2",
44
- "@typescript-eslint/parser": "^8.18.2",
43
+ "@typescript-eslint/eslint-plugin": "^8.70.0",
44
+ "@typescript-eslint/parser": "^8.70.0",
45
+ "@typescript/native": "npm:typescript@^7.0.2",
45
46
  "eslint": "^10.0.1",
46
47
  "gh-pages": "^6.2.0",
47
48
  "jest": "^30.2.0",
48
49
  "release-it": "^21.0.2",
49
50
  "ts-jest": "^29.4.6",
50
- "typescript": "^5.9.3"
51
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
51
52
  },
52
53
  "dependencies": {
53
54
  "@js-temporal/polyfill": "^0.5.1",
54
- "@redis/client": "^5.10.0",
55
+ "@redis/client": "^6.2.1",
55
56
  "cluster-key-slot": "1.1.2",
56
57
  "generic-pool": "^3.9.0",
57
58
  "lodash": "^4.17.21",
58
- "redis": "^5.10.0"
59
+ "redis": "^6.2.0"
59
60
  }
60
61
  }