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.
- package/dist/index.d.ts +3 -2
- package/dist/index.js +8 -5
- package/dist/src/clients/client.d.ts +5 -13
- package/dist/src/clients/cluster.d.ts +7 -12
- package/dist/src/clients/cluster.js +38 -5
- package/dist/src/clients/nullClient.d.ts +3 -11
- package/dist/src/clients/sentinel.d.ts +31 -0
- package/dist/src/clients/sentinel.js +179 -24
- package/dist/src/clients/single.d.ts +16 -12
- package/dist/src/clients/single.js +29 -21
- package/dist/src/commands/CONFIG_GET.d.ts +1 -5
- package/dist/src/commands/CONSTRAINT_CREATE.d.ts +2 -8
- package/dist/src/commands/CONSTRAINT_CREATE.js +3 -10
- package/dist/src/commands/CONSTRAINT_DROP.d.ts +1 -1
- package/dist/src/commands/MEMORY_USAGE.d.ts +2 -4
- package/dist/src/commands/QUERY.d.ts +4 -23
- package/dist/src/commands/QUERY.js +14 -4
- package/dist/src/commands/RO_QUERY.d.ts +2 -2
- package/dist/src/commands/RO_QUERY.js +4 -4
- package/dist/src/commands/SLOWLOG.d.ts +1 -13
- package/dist/src/commands/UDF_LIST.d.ts +2 -2
- package/dist/src/commands/index.d.ts +4 -11
- package/dist/src/commands/index.js +58 -22
- package/dist/src/enums/constraint-type.d.ts +4 -0
- package/dist/src/enums/constraint-type.js +8 -0
- package/dist/src/enums/entity-type.d.ts +4 -0
- package/dist/src/enums/entity-type.js +8 -0
- package/dist/src/enums/graph-value-types.d.ts +19 -0
- package/dist/src/enums/graph-value-types.js +24 -0
- package/dist/src/enums/index.d.ts +3 -0
- package/dist/src/enums/index.js +19 -0
- package/dist/src/errors.d.ts +10 -0
- package/dist/src/errors.js +18 -0
- package/dist/src/falkordb.d.ts +13 -88
- package/dist/src/falkordb.js +131 -8
- package/dist/src/graph.d.ts +27 -15
- package/dist/src/graph.js +90 -52
- package/dist/src/types/cluster-graph-connection.d.ts +5 -0
- package/dist/src/types/cluster-graph-connection.js +2 -0
- package/dist/src/types/config-item.d.ts +4 -0
- package/dist/src/types/config-item.js +2 -0
- package/dist/src/types/falkordb-options.d.ts +65 -0
- package/dist/src/types/falkordb-options.js +2 -0
- package/dist/src/types/graph-metadata.d.ts +5 -0
- package/dist/src/types/graph-metadata.js +2 -0
- package/dist/src/types/graph-raw-value.d.ts +29 -0
- package/dist/src/types/graph-raw-value.js +2 -0
- package/dist/src/types/graph-value.d.ts +29 -0
- package/dist/src/types/graph-value.js +2 -0
- package/dist/src/types/index.d.ts +16 -0
- package/dist/src/types/index.js +32 -0
- package/dist/src/types/memory-usage.d.ts +4 -0
- package/dist/src/types/memory-usage.js +2 -0
- package/dist/src/types/net-socket-options.d.ts +4 -0
- package/dist/src/types/net-socket-options.js +2 -0
- package/dist/src/types/query-options.d.ts +9 -0
- package/dist/src/types/query-options.js +2 -0
- package/dist/src/types/query-reply.d.ts +20 -0
- package/dist/src/types/query-reply.js +2 -0
- package/dist/src/types/single-graph-connection.d.ts +5 -0
- package/dist/src/types/single-graph-connection.js +2 -0
- package/dist/src/types/slow-log.d.ts +12 -0
- package/dist/src/types/slow-log.js +2 -0
- package/dist/src/types/socket-options.d.ts +40 -0
- package/dist/src/types/socket-options.js +2 -0
- package/dist/src/types/tls-socket-options.d.ts +4 -0
- package/dist/src/types/tls-socket-options.js +2 -0
- package/dist/src/types/typed-redis-client-options.d.ts +9 -0
- package/dist/src/types/typed-redis-client-options.js +2 -0
- package/dist/src/types/udf-list.d.ts +2 -0
- package/dist/src/types/udf-list.js +2 -0
- 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,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,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,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,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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "falkordb",
|
|
3
|
-
"version": "6.
|
|
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.
|
|
44
|
-
"@typescript-eslint/parser": "^8.
|
|
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": "
|
|
51
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
54
|
"@js-temporal/polyfill": "^0.5.1",
|
|
54
|
-
"@redis/client": "^
|
|
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": "^
|
|
59
|
+
"redis": "^6.2.0"
|
|
59
60
|
}
|
|
60
61
|
}
|