falkordb 6.8.0 → 6.9.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.
- package/dist/index.d.ts +5 -4
- package/dist/index.js +9 -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 +14 -88
- package/dist/src/falkordb.js +133 -8
- package/dist/src/graph.d.ts +28 -15
- package/dist/src/graph.js +92 -53
- 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
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { CommandParser } from '@redis/client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
UNIQUE = "UNIQUE"
|
|
5
|
-
}
|
|
6
|
-
export declare enum EntityType {
|
|
7
|
-
NODE = "NODE",
|
|
8
|
-
RELATIONSHIP = "RELATIONSHIP"
|
|
9
|
-
}
|
|
2
|
+
import { ConstraintType, EntityType } from '../enums';
|
|
3
|
+
export { ConstraintType, EntityType };
|
|
10
4
|
export declare function parseCommand(parser: CommandParser, key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): void;
|
|
11
5
|
export declare function transformArguments(key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Array<string>;
|
|
12
6
|
export declare function transformReply(reply: unknown): 'PENDING';
|
|
@@ -4,16 +4,9 @@ exports.EntityType = exports.ConstraintType = void 0;
|
|
|
4
4
|
exports.parseCommand = parseCommand;
|
|
5
5
|
exports.transformArguments = transformArguments;
|
|
6
6
|
exports.transformReply = transformReply;
|
|
7
|
-
|
|
8
|
-
(function (
|
|
9
|
-
|
|
10
|
-
ConstraintType["UNIQUE"] = "UNIQUE";
|
|
11
|
-
})(ConstraintType || (exports.ConstraintType = ConstraintType = {}));
|
|
12
|
-
var EntityType;
|
|
13
|
-
(function (EntityType) {
|
|
14
|
-
EntityType["NODE"] = "NODE";
|
|
15
|
-
EntityType["RELATIONSHIP"] = "RELATIONSHIP";
|
|
16
|
-
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
7
|
+
const enums_1 = require("../enums");
|
|
8
|
+
Object.defineProperty(exports, "ConstraintType", { enumerable: true, get: function () { return enums_1.ConstraintType; } });
|
|
9
|
+
Object.defineProperty(exports, "EntityType", { enumerable: true, get: function () { return enums_1.EntityType; } });
|
|
17
10
|
// GRAPH.CONSTRAINT CREATE key constraintType {NODE label | RELATIONSHIP reltype} PROPERTIES propCount prop [prop...]
|
|
18
11
|
function parseCommand(parser, key, constraintType, entityType, label, ...properties) {
|
|
19
12
|
parser.push('GRAPH.CONSTRAINT', 'CREATE', key, constraintType, entityType, label, 'PROPERTIES', properties.length.toString(), ...properties);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandParser } from '@redis/client';
|
|
2
|
-
import { ConstraintType, EntityType } from
|
|
2
|
+
import { ConstraintType, EntityType } from '../enums';
|
|
3
3
|
export declare function parseCommand(parser: CommandParser, key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): void;
|
|
4
4
|
export declare function transformArguments(key: string, constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Array<string>;
|
|
5
5
|
export declare function transformReply(reply: unknown): 'OK';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { CommandParser } from '@redis/client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
import type { MemoryUsageOptions, MemoryUsageReply } from '../types';
|
|
3
|
+
export type { MemoryUsageOptions, MemoryUsageReply };
|
|
5
4
|
export declare function parseCommand(parser: CommandParser, key: string, options?: MemoryUsageOptions): void;
|
|
6
5
|
export declare function transformArguments(key: string, options?: MemoryUsageOptions): Array<string>;
|
|
7
|
-
export type MemoryUsageReply = Array<string | number | MemoryUsageReply>;
|
|
8
6
|
export declare function transformReply(reply: unknown): MemoryUsageReply;
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import { RedisArgument, CommandParser } from '@redis/client';
|
|
2
|
-
import { QueryOptionsBackwardCompatible } from '
|
|
2
|
+
import type { QueryOptionsBackwardCompatible, QueryRawReply, QueryReply } from '../types';
|
|
3
|
+
export type { QueryReply };
|
|
3
4
|
export declare const FIRST_KEY_INDEX = 1;
|
|
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>;
|
|
6
|
-
type Headers = Array<string>;
|
|
7
|
-
type Data = Array<string | number | null | Data>;
|
|
8
|
-
type Metadata = Array<string>;
|
|
9
|
-
type QueryRawReply = [
|
|
10
|
-
headers: Headers,
|
|
11
|
-
data: Data,
|
|
12
|
-
metadata: Metadata
|
|
13
|
-
] | [
|
|
14
|
-
metadata: Metadata
|
|
15
|
-
];
|
|
16
|
-
export type QueryReply = {
|
|
17
|
-
headers: undefined;
|
|
18
|
-
data: undefined;
|
|
19
|
-
metadata: Metadata;
|
|
20
|
-
} | {
|
|
21
|
-
headers: Headers;
|
|
22
|
-
data: Data;
|
|
23
|
-
metadata: Metadata;
|
|
24
|
-
};
|
|
5
|
+
export declare function parseCommand(parser: CommandParser, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean, version?: number): void;
|
|
6
|
+
export declare function transformArguments(graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean, version?: number): Array<RedisArgument>;
|
|
25
7
|
export declare function transformReply(reply: QueryRawReply): QueryReply;
|
|
26
|
-
export {};
|
|
@@ -5,15 +5,25 @@ exports.parseCommand = parseCommand;
|
|
|
5
5
|
exports.transformArguments = transformArguments;
|
|
6
6
|
exports.transformReply = transformReply;
|
|
7
7
|
const _1 = require(".");
|
|
8
|
+
const errors_1 = require("../errors");
|
|
8
9
|
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);
|
|
10
|
+
function parseCommand(parser, graph, query, options, compact, version) {
|
|
11
|
+
const args = (0, _1.pushQueryArguments)(['GRAPH.QUERY'], graph, query, options, compact, version);
|
|
11
12
|
parser.push(...args);
|
|
12
13
|
}
|
|
13
|
-
function transformArguments(graph, query, options, compact) {
|
|
14
|
-
return (0, _1.pushQueryArguments)(['GRAPH.QUERY'], graph, query, options, compact);
|
|
14
|
+
function transformArguments(graph, query, options, compact, version) {
|
|
15
|
+
return (0, _1.pushQueryArguments)(['GRAPH.QUERY'], graph, query, options, compact, version);
|
|
15
16
|
}
|
|
16
17
|
function transformReply(reply) {
|
|
18
|
+
// A query sent with a stale `version` is rejected with
|
|
19
|
+
// `[error "version mismatch", current version]` and not executed
|
|
20
|
+
const [first, second] = reply;
|
|
21
|
+
if (first instanceof Error) {
|
|
22
|
+
if (first.message === 'version mismatch') {
|
|
23
|
+
throw new errors_1.SchemaVersionMismatchError(second);
|
|
24
|
+
}
|
|
25
|
+
throw first;
|
|
26
|
+
}
|
|
17
27
|
return reply.length === 1 ? {
|
|
18
28
|
headers: undefined,
|
|
19
29
|
data: undefined,
|
|
@@ -2,6 +2,6 @@ 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 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>;
|
|
5
|
+
export declare function parseCommand(parser: CommandParser, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean, version?: number): void;
|
|
6
|
+
export declare function transformArguments(graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean, version?: number): Array<RedisArgument>;
|
|
7
7
|
export { transformReply } from './QUERY';
|
|
@@ -7,12 +7,12 @@ const _1 = require(".");
|
|
|
7
7
|
var QUERY_1 = require("./QUERY");
|
|
8
8
|
Object.defineProperty(exports, "FIRST_KEY_INDEX", { enumerable: true, get: function () { return QUERY_1.FIRST_KEY_INDEX; } });
|
|
9
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);
|
|
10
|
+
function parseCommand(parser, graph, query, options, compact, version) {
|
|
11
|
+
const args = (0, _1.pushQueryArguments)(['GRAPH.RO_QUERY'], graph, query, options, compact, version);
|
|
12
12
|
parser.push(...args);
|
|
13
13
|
}
|
|
14
|
-
function transformArguments(graph, query, options, compact) {
|
|
15
|
-
return (0, _1.pushQueryArguments)(['GRAPH.RO_QUERY'], graph, query, options, compact);
|
|
14
|
+
function transformArguments(graph, query, options, compact, version) {
|
|
15
|
+
return (0, _1.pushQueryArguments)(['GRAPH.RO_QUERY'], graph, query, options, compact, version);
|
|
16
16
|
}
|
|
17
17
|
var QUERY_2 = require("./QUERY");
|
|
18
18
|
Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return QUERY_2.transformReply; } });
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import { CommandParser } from '@redis/client';
|
|
2
|
+
import type { SlowLogRawReply, SlowLogReply } from '../types';
|
|
2
3
|
export declare const IS_READ_ONLY = true;
|
|
3
4
|
export declare const FIRST_KEY_INDEX = 1;
|
|
4
5
|
export declare function parseCommand(parser: CommandParser, key: string): void;
|
|
5
6
|
export declare function transformArguments(key: string): string[];
|
|
6
|
-
type SlowLogRawReply = Array<[
|
|
7
|
-
timestamp: string,
|
|
8
|
-
command: string,
|
|
9
|
-
query: string,
|
|
10
|
-
took: string
|
|
11
|
-
]>;
|
|
12
|
-
type SlowLogReply = Array<{
|
|
13
|
-
timestamp: Date;
|
|
14
|
-
command: string;
|
|
15
|
-
query: string;
|
|
16
|
-
took: number;
|
|
17
|
-
}>;
|
|
18
7
|
export declare function transformReply(logs: SlowLogRawReply): SlowLogReply;
|
|
19
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandParser } from '@redis/client';
|
|
2
2
|
export declare const IS_READ_ONLY = true;
|
|
3
|
-
|
|
4
|
-
export type UdfListReply
|
|
3
|
+
import type { UdfListReply } from '../types';
|
|
4
|
+
export type { UdfLibraryEntry, UdfListReply } from '../types';
|
|
5
5
|
export declare function parseCommand(parser: CommandParser, lib?: string, withCode?: boolean): void;
|
|
6
6
|
export declare function transformArguments(lib?: string, withCode?: boolean): Array<string>;
|
|
7
7
|
export declare function transformReply(reply: unknown): UdfListReply;
|
|
@@ -20,6 +20,7 @@ import * as UDF_LIST from './UDF_LIST';
|
|
|
20
20
|
import * as UDF_FLUSH from './UDF_FLUSH';
|
|
21
21
|
import * as UDF_DELETE from './UDF_DELETE';
|
|
22
22
|
import { RedisArgument } from '@redis/client';
|
|
23
|
+
import type { QueryOptionsBackwardCompatible } from '../types';
|
|
23
24
|
declare const _default: {
|
|
24
25
|
CONFIG_GET: typeof CONFIG_GET;
|
|
25
26
|
configGet: typeof CONFIG_GET;
|
|
@@ -65,14 +66,6 @@ declare const _default: {
|
|
|
65
66
|
udfDelete: typeof UDF_DELETE;
|
|
66
67
|
};
|
|
67
68
|
export default _default;
|
|
68
|
-
type
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
export interface QueryOptions {
|
|
73
|
-
params?: QueryParams;
|
|
74
|
-
TIMEOUT?: number;
|
|
75
|
-
}
|
|
76
|
-
export type QueryOptionsBackwardCompatible = QueryOptions | number;
|
|
77
|
-
export declare function pushQueryArguments(args: Array<RedisArgument>, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean): Array<RedisArgument>;
|
|
78
|
-
export type { UdfListReply, UdfLibraryEntry } from './UDF_LIST';
|
|
69
|
+
export type { QueryOptions, QueryOptionsBackwardCompatible, QueryParam, QueryParams } from '../types';
|
|
70
|
+
export declare function pushQueryArguments(args: Array<RedisArgument>, graph: RedisArgument, query: RedisArgument, options?: QueryOptionsBackwardCompatible, compact?: boolean, version?: number): Array<RedisArgument>;
|
|
71
|
+
export type { UdfListReply, UdfLibraryEntry } from '../types';
|
|
@@ -1,27 +1,60 @@
|
|
|
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.pushQueryArguments = pushQueryArguments;
|
|
4
|
-
const CONFIG_GET = require("./CONFIG_GET");
|
|
5
|
-
const CONFIG_SET = require("./CONFIG_SET");
|
|
6
|
-
const DELETE = require("./DELETE");
|
|
7
|
-
const EXPLAIN = require("./EXPLAIN");
|
|
8
|
-
const INFO = require("./INFO");
|
|
9
|
-
const LIST = require("./LIST");
|
|
10
|
-
const PROFILE = require("./PROFILE");
|
|
11
|
-
const QUERY = require("./QUERY");
|
|
12
|
-
const RO_QUERY = require("./RO_QUERY");
|
|
13
|
-
const SLOWLOG = require("./SLOWLOG");
|
|
14
|
-
const STUBS = require("./STUBS");
|
|
15
|
-
const CONSTRAINT_CREATE = require("./CONSTRAINT_CREATE");
|
|
16
|
-
const CONSTRAINT_DROP = require("./CONSTRAINT_DROP");
|
|
17
|
-
const COPY = require("./COPY");
|
|
18
|
-
const SENTINEL_MASTER = require("./SENTINEL_MASTER");
|
|
19
|
-
const SENTINEL_MASTERS = require("./SENTINEL_MASTERS");
|
|
20
|
-
const MEMORY_USAGE = require("./MEMORY_USAGE");
|
|
21
|
-
const UDF_LOAD = require("./UDF_LOAD");
|
|
22
|
-
const UDF_LIST = require("./UDF_LIST");
|
|
23
|
-
const UDF_FLUSH = require("./UDF_FLUSH");
|
|
24
|
-
const UDF_DELETE = require("./UDF_DELETE");
|
|
37
|
+
const CONFIG_GET = __importStar(require("./CONFIG_GET"));
|
|
38
|
+
const CONFIG_SET = __importStar(require("./CONFIG_SET"));
|
|
39
|
+
const DELETE = __importStar(require("./DELETE"));
|
|
40
|
+
const EXPLAIN = __importStar(require("./EXPLAIN"));
|
|
41
|
+
const INFO = __importStar(require("./INFO"));
|
|
42
|
+
const LIST = __importStar(require("./LIST"));
|
|
43
|
+
const PROFILE = __importStar(require("./PROFILE"));
|
|
44
|
+
const QUERY = __importStar(require("./QUERY"));
|
|
45
|
+
const RO_QUERY = __importStar(require("./RO_QUERY"));
|
|
46
|
+
const SLOWLOG = __importStar(require("./SLOWLOG"));
|
|
47
|
+
const STUBS = __importStar(require("./STUBS"));
|
|
48
|
+
const CONSTRAINT_CREATE = __importStar(require("./CONSTRAINT_CREATE"));
|
|
49
|
+
const CONSTRAINT_DROP = __importStar(require("./CONSTRAINT_DROP"));
|
|
50
|
+
const COPY = __importStar(require("./COPY"));
|
|
51
|
+
const SENTINEL_MASTER = __importStar(require("./SENTINEL_MASTER"));
|
|
52
|
+
const SENTINEL_MASTERS = __importStar(require("./SENTINEL_MASTERS"));
|
|
53
|
+
const MEMORY_USAGE = __importStar(require("./MEMORY_USAGE"));
|
|
54
|
+
const UDF_LOAD = __importStar(require("./UDF_LOAD"));
|
|
55
|
+
const UDF_LIST = __importStar(require("./UDF_LIST"));
|
|
56
|
+
const UDF_FLUSH = __importStar(require("./UDF_FLUSH"));
|
|
57
|
+
const UDF_DELETE = __importStar(require("./UDF_DELETE"));
|
|
25
58
|
exports.default = {
|
|
26
59
|
CONFIG_GET,
|
|
27
60
|
configGet: CONFIG_GET,
|
|
@@ -66,7 +99,7 @@ exports.default = {
|
|
|
66
99
|
UDF_DELETE,
|
|
67
100
|
udfDelete: UDF_DELETE,
|
|
68
101
|
};
|
|
69
|
-
function pushQueryArguments(args, graph, query, options, compact) {
|
|
102
|
+
function pushQueryArguments(args, graph, query, options, compact, version) {
|
|
70
103
|
args.push(graph);
|
|
71
104
|
if (typeof options === 'number') {
|
|
72
105
|
args.push(query);
|
|
@@ -80,6 +113,9 @@ function pushQueryArguments(args, graph, query, options, compact) {
|
|
|
80
113
|
pushTimeout(args, options.TIMEOUT);
|
|
81
114
|
}
|
|
82
115
|
}
|
|
116
|
+
if (version !== undefined) {
|
|
117
|
+
args.push('version', version.toString());
|
|
118
|
+
}
|
|
83
119
|
if (compact) {
|
|
84
120
|
args.push('--compact');
|
|
85
121
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConstraintType = void 0;
|
|
4
|
+
var ConstraintType;
|
|
5
|
+
(function (ConstraintType) {
|
|
6
|
+
ConstraintType["MANDATORY"] = "MANDATORY";
|
|
7
|
+
ConstraintType["UNIQUE"] = "UNIQUE";
|
|
8
|
+
})(ConstraintType || (exports.ConstraintType = ConstraintType = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityType = void 0;
|
|
4
|
+
var EntityType;
|
|
5
|
+
(function (EntityType) {
|
|
6
|
+
EntityType["NODE"] = "NODE";
|
|
7
|
+
EntityType["RELATIONSHIP"] = "RELATIONSHIP";
|
|
8
|
+
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum GraphValueTypes {
|
|
2
|
+
UNKNOWN = 0,
|
|
3
|
+
NULL = 1,
|
|
4
|
+
STRING = 2,
|
|
5
|
+
INTEGER = 3,
|
|
6
|
+
BOOLEAN = 4,
|
|
7
|
+
DOUBLE = 5,
|
|
8
|
+
ARRAY = 6,
|
|
9
|
+
EDGE = 7,
|
|
10
|
+
NODE = 8,
|
|
11
|
+
PATH = 9,
|
|
12
|
+
MAP = 10,
|
|
13
|
+
POINT = 11,
|
|
14
|
+
VECTORF32 = 12,
|
|
15
|
+
DATETIME = 13,
|
|
16
|
+
DATE = 14,
|
|
17
|
+
TIME = 15,
|
|
18
|
+
DURATION = 16
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphValueTypes = void 0;
|
|
4
|
+
// https://github.com/FalkorDB/FalkorDB/blob/master/src/resultset/formatters/resultset_formatter.h#L20
|
|
5
|
+
var GraphValueTypes;
|
|
6
|
+
(function (GraphValueTypes) {
|
|
7
|
+
GraphValueTypes[GraphValueTypes["UNKNOWN"] = 0] = "UNKNOWN";
|
|
8
|
+
GraphValueTypes[GraphValueTypes["NULL"] = 1] = "NULL";
|
|
9
|
+
GraphValueTypes[GraphValueTypes["STRING"] = 2] = "STRING";
|
|
10
|
+
GraphValueTypes[GraphValueTypes["INTEGER"] = 3] = "INTEGER";
|
|
11
|
+
GraphValueTypes[GraphValueTypes["BOOLEAN"] = 4] = "BOOLEAN";
|
|
12
|
+
GraphValueTypes[GraphValueTypes["DOUBLE"] = 5] = "DOUBLE";
|
|
13
|
+
GraphValueTypes[GraphValueTypes["ARRAY"] = 6] = "ARRAY";
|
|
14
|
+
GraphValueTypes[GraphValueTypes["EDGE"] = 7] = "EDGE";
|
|
15
|
+
GraphValueTypes[GraphValueTypes["NODE"] = 8] = "NODE";
|
|
16
|
+
GraphValueTypes[GraphValueTypes["PATH"] = 9] = "PATH";
|
|
17
|
+
GraphValueTypes[GraphValueTypes["MAP"] = 10] = "MAP";
|
|
18
|
+
GraphValueTypes[GraphValueTypes["POINT"] = 11] = "POINT";
|
|
19
|
+
GraphValueTypes[GraphValueTypes["VECTORF32"] = 12] = "VECTORF32";
|
|
20
|
+
GraphValueTypes[GraphValueTypes["DATETIME"] = 13] = "DATETIME";
|
|
21
|
+
GraphValueTypes[GraphValueTypes["DATE"] = 14] = "DATE";
|
|
22
|
+
GraphValueTypes[GraphValueTypes["TIME"] = 15] = "TIME";
|
|
23
|
+
GraphValueTypes[GraphValueTypes["DURATION"] = 16] = "DURATION";
|
|
24
|
+
})(GraphValueTypes || (exports.GraphValueTypes = GraphValueTypes = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./constraint-type"), exports);
|
|
18
|
+
__exportStar(require("./entity-type"), exports);
|
|
19
|
+
__exportStar(require("./graph-value-types"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server rejected a query because the graph's schema (its labels,
|
|
3
|
+
* relationship types and property keys) no longer matches the version the
|
|
4
|
+
* client sent with it. The query was not executed.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SchemaVersionMismatchError extends Error {
|
|
7
|
+
/** The graph's current schema version. */
|
|
8
|
+
readonly version: number;
|
|
9
|
+
constructor(version: number);
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchemaVersionMismatchError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The server rejected a query because the graph's schema (its labels,
|
|
6
|
+
* relationship types and property keys) no longer matches the version the
|
|
7
|
+
* client sent with it. The query was not executed.
|
|
8
|
+
*/
|
|
9
|
+
class SchemaVersionMismatchError extends Error {
|
|
10
|
+
/** The graph's current schema version. */
|
|
11
|
+
version;
|
|
12
|
+
constructor(version) {
|
|
13
|
+
super('version mismatch');
|
|
14
|
+
this.name = 'SchemaVersionMismatchError';
|
|
15
|
+
this.version = version;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.SchemaVersionMismatchError = SchemaVersionMismatchError;
|
package/dist/src/falkordb.d.ts
CHANGED
|
@@ -1,94 +1,20 @@
|
|
|
1
|
-
import * as tls from 'tls';
|
|
2
|
-
import * as net from 'net';
|
|
3
1
|
import { EventEmitter } from 'events';
|
|
4
|
-
import { RedisClientOptions, RedisFunctions, RedisScripts } from 'redis';
|
|
5
2
|
import Graph from './graph';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import { SingleGraphConnection } from './clients/single';
|
|
9
|
-
type NetSocketOptions = Partial<net.SocketConnectOpts> & {
|
|
10
|
-
tls?: false;
|
|
11
|
-
};
|
|
12
|
-
export type TypedRedisClientOptions = RedisClientOptions<{
|
|
13
|
-
falkordb: typeof commands;
|
|
14
|
-
}, RedisFunctions, RedisScripts, 2>;
|
|
15
|
-
export type TypedRedisClusterClientOptions = RedisClusterOptions<{
|
|
16
|
-
falkordb: typeof commands;
|
|
17
|
-
}, RedisFunctions, RedisScripts, 2>;
|
|
18
|
-
interface TlsSocketOptions extends tls.ConnectionOptions {
|
|
19
|
-
tls: true;
|
|
20
|
-
}
|
|
21
|
-
interface SocketCommonOptions {
|
|
22
|
-
/**
|
|
23
|
-
* Connection Timeout (in milliseconds)
|
|
24
|
-
*/
|
|
25
|
-
connectTimeout?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Toggle [`Nagle's algorithm`](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay)
|
|
28
|
-
*/
|
|
29
|
-
noDelay?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Toggle [`keep-alive`](https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay)
|
|
32
|
-
*/
|
|
33
|
-
keepAlive?: number | false;
|
|
34
|
-
/**
|
|
35
|
-
* When the socket closes unexpectedly (without calling `.quit()`/`.disconnect()`), the client uses `reconnectStrategy` to decide what to do. The following values are supported:
|
|
36
|
-
*/
|
|
37
|
-
tls?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export type SocketOptions = SocketCommonOptions & (NetSocketOptions | TlsSocketOptions);
|
|
40
|
-
export interface FalkorDBOptions {
|
|
41
|
-
/**
|
|
42
|
-
* `falkor[s]://[[username][:password]@][host][:port][/db-number]`
|
|
43
|
-
*/
|
|
44
|
-
url?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Socket connection properties
|
|
47
|
-
*/
|
|
48
|
-
socket?: SocketOptions;
|
|
49
|
-
/**
|
|
50
|
-
* Server hostname, shorthand for `socket.host`.
|
|
51
|
-
* Ignored when `url` or `socket.host` is provided.
|
|
52
|
-
*/
|
|
53
|
-
host?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Server port, shorthand for `socket.port`.
|
|
56
|
-
* Ignored when `url` or `socket.port` is provided.
|
|
57
|
-
*/
|
|
58
|
-
port?: number;
|
|
59
|
-
/**
|
|
60
|
-
* ACL username ([see ACL guide](https://redis.io/topics/acl))
|
|
61
|
-
*/
|
|
62
|
-
username?: string;
|
|
63
|
-
/**
|
|
64
|
-
* ACL password or the old "--requirepass" password
|
|
65
|
-
*/
|
|
66
|
-
password?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Client name ([see `CLIENT SETNAME`](https://redis.io/commands/client-setname))
|
|
69
|
-
*/
|
|
70
|
-
name?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Connect in [`READONLY`](https://redis.io/commands/readonly) mode
|
|
73
|
-
*/
|
|
74
|
-
readonly?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Send `PING` command at interval (in ms).
|
|
77
|
-
* Useful with Redis deployments that do not use TCP Keep-Alive.
|
|
78
|
-
*/
|
|
79
|
-
pingInterval?: number;
|
|
80
|
-
/**
|
|
81
|
-
* If set to true, disables sending client identifier (user-agent like message) to the redis server
|
|
82
|
-
*/
|
|
83
|
-
disableClientInfo?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Tag to append to library name that is sent to the Redis server
|
|
86
|
-
*/
|
|
87
|
-
clientInfoTag?: string;
|
|
88
|
-
}
|
|
3
|
+
import type { FalkorDBOptions, SingleGraphConnection } from './types';
|
|
4
|
+
export type { FalkorDBOptions, SocketOptions, TypedRedisClientOptions, TypedRedisClusterClientOptions, } from './types';
|
|
89
5
|
export default class FalkorDB extends EventEmitter {
|
|
90
6
|
#private;
|
|
91
7
|
static connect(options?: FalkorDBOptions): Promise<FalkorDB>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the `Graph` for `graphId`. Repeated calls with the same id return
|
|
10
|
+
* the same instance, so its cached metadata (labels, relationship types and
|
|
11
|
+
* property keys) is shared instead of being refetched by every new handle.
|
|
12
|
+
* The instance is released when the graph is deleted through it, or when
|
|
13
|
+
* more than `MAX_CACHED_GRAPHS` graphs have been selected since its last use.
|
|
14
|
+
* Each query carries the schema version the cached metadata matches, so a
|
|
15
|
+
* schema changed by another client (e.g. the graph deleted and recreated) is
|
|
16
|
+
* rejected by the server and the metadata refreshed before the query is retried.
|
|
17
|
+
*/
|
|
92
18
|
selectGraph(graphId: string): Graph;
|
|
93
19
|
get connection(): Promise<SingleGraphConnection>;
|
|
94
20
|
list(): Promise<string[]>;
|
|
@@ -101,7 +27,7 @@ export default class FalkorDB extends EventEmitter {
|
|
|
101
27
|
* should treat such a rejection as "no offloading support".
|
|
102
28
|
*/
|
|
103
29
|
stubs(): Promise<string[]>;
|
|
104
|
-
configGet(configKey: string): Promise<(string | number)[] | (string | number)[]
|
|
30
|
+
configGet(configKey: string): Promise<(string | number)[][] | (string | number)[]>;
|
|
105
31
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
106
32
|
info(section?: string): Promise<(string | string[])[]>;
|
|
107
33
|
udfLoad(name: string, script: string | Function, replace?: boolean): Promise<string>;
|
|
@@ -113,4 +39,4 @@ export default class FalkorDB extends EventEmitter {
|
|
|
113
39
|
*/
|
|
114
40
|
close(): Promise<void>;
|
|
115
41
|
}
|
|
116
|
-
export {};
|
|
42
|
+
export { FalkorDB };
|