recker 1.0.102 → 1.0.103
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/clients/index.d.ts +1 -1
- package/dist/clients/index.js +1 -1
- package/dist/clients/reddb-proto.d.ts +1 -0
- package/dist/clients/reddb-proto.js +195 -0
- package/dist/clients/reddb.d.ts +306 -71
- package/dist/clients/reddb.js +1410 -324
- package/dist/protocols/index.d.ts +1 -1
- package/dist/protocols/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -1
package/dist/clients/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './reddb.js';
|
package/dist/clients/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './reddb.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REDDB_PROTO = "\nsyntax = \"proto3\";\n\npackage reddb.v1;\n\nservice RedDb {\n rpc Health(Empty) returns (HealthReply);\n rpc Ready(Empty) returns (HealthReply);\n rpc Stats(Empty) returns (StatsReply);\n rpc Collections(Empty) returns (CollectionsReply);\n rpc IndexStatuses(Empty) returns (PayloadReply);\n rpc Indexes(CollectionRequest) returns (PayloadReply);\n rpc SetIndexEnabled(IndexToggleRequest) returns (PayloadReply);\n rpc WarmupIndex(IndexNameRequest) returns (PayloadReply);\n rpc RebuildIndexes(CollectionRequest) returns (PayloadReply);\n rpc Scan(ScanRequest) returns (ScanReply);\n rpc ExplainQuery(QueryRequest) returns (PayloadReply);\n rpc Query(QueryRequest) returns (QueryReply);\n rpc BatchQuery(BatchQueryRequest) returns (BatchQueryReply);\n rpc Similar(JsonCreateRequest) returns (PayloadReply);\n rpc IvfSearch(JsonCreateRequest) returns (PayloadReply);\n rpc CreateRow(JsonCreateRequest) returns (EntityReply);\n rpc CreateNode(JsonCreateRequest) returns (EntityReply);\n rpc CreateEdge(JsonCreateRequest) returns (EntityReply);\n rpc CreateVector(JsonCreateRequest) returns (EntityReply);\n rpc CreateDocument(JsonCreateRequest) returns (EntityReply);\n rpc CreateKv(JsonCreateRequest) returns (EntityReply);\n rpc BulkCreateRows(JsonBulkCreateRequest) returns (BulkEntityReply);\n rpc BulkInsertBinary(BinaryBulkInsertRequest) returns (BulkInsertReply);\n rpc BulkCreateNodes(JsonBulkCreateRequest) returns (BulkEntityReply);\n rpc BulkCreateEdges(JsonBulkCreateRequest) returns (BulkEntityReply);\n rpc BulkCreateVectors(JsonBulkCreateRequest) returns (BulkEntityReply);\n rpc BulkCreateDocuments(JsonBulkCreateRequest) returns (BulkEntityReply);\n rpc PatchEntity(UpdateEntityRequest) returns (EntityReply);\n rpc DeleteEntity(DeleteEntityRequest) returns (OperationReply);\n rpc CreateCollection(JsonPayloadRequest) returns (PayloadReply);\n rpc DropCollection(JsonPayloadRequest) returns (OperationReply);\n rpc DescribeCollection(CollectionRequest) returns (PayloadReply);\n}\n\nmessage Empty {}\n\nmessage HealthReply {\n bool healthy = 1;\n string state = 2;\n uint64 checked_at_unix_ms = 3;\n}\n\nmessage StatsReply {\n uint64 collection_count = 1;\n uint64 total_entities = 2;\n uint64 total_memory_bytes = 3;\n uint64 cross_ref_count = 4;\n uint64 active_connections = 5;\n uint64 idle_connections = 6;\n uint64 total_checkouts = 7;\n bool paged_mode = 8;\n uint64 started_at_unix_ms = 9;\n}\n\nmessage CollectionsReply {\n repeated string collections = 1;\n}\n\nmessage CollectionRequest {\n string collection = 1;\n string artifact_kind = 2;\n}\n\nmessage IndexNameRequest {\n string name = 1;\n}\n\nmessage IndexToggleRequest {\n string name = 1;\n bool enabled = 2;\n}\n\nmessage ScanRequest {\n string collection = 1;\n uint64 offset = 2;\n uint64 limit = 3;\n}\n\nmessage ScanEntity {\n uint64 id = 1;\n string kind = 2;\n string collection = 3;\n string json = 4;\n}\n\nmessage ScanReply {\n string collection = 1;\n uint64 total = 2;\n optional uint64 next_offset = 3;\n repeated ScanEntity items = 4;\n}\n\nmessage QueryRequest {\n string query = 1;\n repeated string entity_types = 2;\n repeated string capabilities = 3;\n}\n\nmessage BatchQueryRequest {\n repeated string queries = 1;\n}\n\nmessage JsonPayloadRequest {\n string payload_json = 1;\n}\n\nmessage JsonCreateRequest {\n string collection = 1;\n string payload_json = 2;\n}\n\nmessage JsonBulkCreateRequest {\n string collection = 1;\n repeated string payload_json = 2;\n}\n\nmessage UpdateEntityRequest {\n string collection = 1;\n uint64 id = 2;\n string payload_json = 3;\n}\n\nmessage DeleteEntityRequest {\n string collection = 1;\n uint64 id = 2;\n}\n\nmessage QueryReply {\n bool ok = 1;\n string mode = 2;\n string statement = 3;\n string engine = 4;\n repeated string columns = 5;\n uint64 record_count = 6;\n string result_json = 7;\n}\n\nmessage BatchQueryReply {\n repeated QueryReply results = 1;\n}\n\nmessage EntityReply {\n bool ok = 1;\n uint64 id = 2;\n string entity_json = 3;\n}\n\nmessage BulkEntityReply {\n bool ok = 1;\n uint64 count = 2;\n repeated EntityReply items = 3;\n}\n\nmessage PayloadReply {\n bool ok = 1;\n string payload = 2;\n}\n\nmessage OperationReply {\n bool ok = 1;\n string message = 2;\n}\n\nmessage BinaryBulkInsertRequest {\n string collection = 1;\n repeated string field_names = 2;\n repeated BinaryRow rows = 3;\n}\n\nmessage BinaryRow {\n repeated BinaryValue values = 1;\n}\n\nmessage BinaryValue {\n oneof kind {\n string text_value = 1;\n int64 int_value = 2;\n double float_value = 3;\n bool bool_value = 4;\n bytes blob_value = 5;\n }\n}\n\nmessage BulkInsertReply {\n bool ok = 1;\n uint64 count = 2;\n uint64 first_id = 3;\n}\n";
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export const REDDB_PROTO = `
|
|
2
|
+
syntax = "proto3";
|
|
3
|
+
|
|
4
|
+
package reddb.v1;
|
|
5
|
+
|
|
6
|
+
service RedDb {
|
|
7
|
+
rpc Health(Empty) returns (HealthReply);
|
|
8
|
+
rpc Ready(Empty) returns (HealthReply);
|
|
9
|
+
rpc Stats(Empty) returns (StatsReply);
|
|
10
|
+
rpc Collections(Empty) returns (CollectionsReply);
|
|
11
|
+
rpc IndexStatuses(Empty) returns (PayloadReply);
|
|
12
|
+
rpc Indexes(CollectionRequest) returns (PayloadReply);
|
|
13
|
+
rpc SetIndexEnabled(IndexToggleRequest) returns (PayloadReply);
|
|
14
|
+
rpc WarmupIndex(IndexNameRequest) returns (PayloadReply);
|
|
15
|
+
rpc RebuildIndexes(CollectionRequest) returns (PayloadReply);
|
|
16
|
+
rpc Scan(ScanRequest) returns (ScanReply);
|
|
17
|
+
rpc ExplainQuery(QueryRequest) returns (PayloadReply);
|
|
18
|
+
rpc Query(QueryRequest) returns (QueryReply);
|
|
19
|
+
rpc BatchQuery(BatchQueryRequest) returns (BatchQueryReply);
|
|
20
|
+
rpc Similar(JsonCreateRequest) returns (PayloadReply);
|
|
21
|
+
rpc IvfSearch(JsonCreateRequest) returns (PayloadReply);
|
|
22
|
+
rpc CreateRow(JsonCreateRequest) returns (EntityReply);
|
|
23
|
+
rpc CreateNode(JsonCreateRequest) returns (EntityReply);
|
|
24
|
+
rpc CreateEdge(JsonCreateRequest) returns (EntityReply);
|
|
25
|
+
rpc CreateVector(JsonCreateRequest) returns (EntityReply);
|
|
26
|
+
rpc CreateDocument(JsonCreateRequest) returns (EntityReply);
|
|
27
|
+
rpc CreateKv(JsonCreateRequest) returns (EntityReply);
|
|
28
|
+
rpc BulkCreateRows(JsonBulkCreateRequest) returns (BulkEntityReply);
|
|
29
|
+
rpc BulkInsertBinary(BinaryBulkInsertRequest) returns (BulkInsertReply);
|
|
30
|
+
rpc BulkCreateNodes(JsonBulkCreateRequest) returns (BulkEntityReply);
|
|
31
|
+
rpc BulkCreateEdges(JsonBulkCreateRequest) returns (BulkEntityReply);
|
|
32
|
+
rpc BulkCreateVectors(JsonBulkCreateRequest) returns (BulkEntityReply);
|
|
33
|
+
rpc BulkCreateDocuments(JsonBulkCreateRequest) returns (BulkEntityReply);
|
|
34
|
+
rpc PatchEntity(UpdateEntityRequest) returns (EntityReply);
|
|
35
|
+
rpc DeleteEntity(DeleteEntityRequest) returns (OperationReply);
|
|
36
|
+
rpc CreateCollection(JsonPayloadRequest) returns (PayloadReply);
|
|
37
|
+
rpc DropCollection(JsonPayloadRequest) returns (OperationReply);
|
|
38
|
+
rpc DescribeCollection(CollectionRequest) returns (PayloadReply);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message Empty {}
|
|
42
|
+
|
|
43
|
+
message HealthReply {
|
|
44
|
+
bool healthy = 1;
|
|
45
|
+
string state = 2;
|
|
46
|
+
uint64 checked_at_unix_ms = 3;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message StatsReply {
|
|
50
|
+
uint64 collection_count = 1;
|
|
51
|
+
uint64 total_entities = 2;
|
|
52
|
+
uint64 total_memory_bytes = 3;
|
|
53
|
+
uint64 cross_ref_count = 4;
|
|
54
|
+
uint64 active_connections = 5;
|
|
55
|
+
uint64 idle_connections = 6;
|
|
56
|
+
uint64 total_checkouts = 7;
|
|
57
|
+
bool paged_mode = 8;
|
|
58
|
+
uint64 started_at_unix_ms = 9;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message CollectionsReply {
|
|
62
|
+
repeated string collections = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message CollectionRequest {
|
|
66
|
+
string collection = 1;
|
|
67
|
+
string artifact_kind = 2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message IndexNameRequest {
|
|
71
|
+
string name = 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message IndexToggleRequest {
|
|
75
|
+
string name = 1;
|
|
76
|
+
bool enabled = 2;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message ScanRequest {
|
|
80
|
+
string collection = 1;
|
|
81
|
+
uint64 offset = 2;
|
|
82
|
+
uint64 limit = 3;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message ScanEntity {
|
|
86
|
+
uint64 id = 1;
|
|
87
|
+
string kind = 2;
|
|
88
|
+
string collection = 3;
|
|
89
|
+
string json = 4;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message ScanReply {
|
|
93
|
+
string collection = 1;
|
|
94
|
+
uint64 total = 2;
|
|
95
|
+
optional uint64 next_offset = 3;
|
|
96
|
+
repeated ScanEntity items = 4;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message QueryRequest {
|
|
100
|
+
string query = 1;
|
|
101
|
+
repeated string entity_types = 2;
|
|
102
|
+
repeated string capabilities = 3;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message BatchQueryRequest {
|
|
106
|
+
repeated string queries = 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message JsonPayloadRequest {
|
|
110
|
+
string payload_json = 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
message JsonCreateRequest {
|
|
114
|
+
string collection = 1;
|
|
115
|
+
string payload_json = 2;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message JsonBulkCreateRequest {
|
|
119
|
+
string collection = 1;
|
|
120
|
+
repeated string payload_json = 2;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message UpdateEntityRequest {
|
|
124
|
+
string collection = 1;
|
|
125
|
+
uint64 id = 2;
|
|
126
|
+
string payload_json = 3;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message DeleteEntityRequest {
|
|
130
|
+
string collection = 1;
|
|
131
|
+
uint64 id = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message QueryReply {
|
|
135
|
+
bool ok = 1;
|
|
136
|
+
string mode = 2;
|
|
137
|
+
string statement = 3;
|
|
138
|
+
string engine = 4;
|
|
139
|
+
repeated string columns = 5;
|
|
140
|
+
uint64 record_count = 6;
|
|
141
|
+
string result_json = 7;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
message BatchQueryReply {
|
|
145
|
+
repeated QueryReply results = 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
message EntityReply {
|
|
149
|
+
bool ok = 1;
|
|
150
|
+
uint64 id = 2;
|
|
151
|
+
string entity_json = 3;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message BulkEntityReply {
|
|
155
|
+
bool ok = 1;
|
|
156
|
+
uint64 count = 2;
|
|
157
|
+
repeated EntityReply items = 3;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
message PayloadReply {
|
|
161
|
+
bool ok = 1;
|
|
162
|
+
string payload = 2;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
message OperationReply {
|
|
166
|
+
bool ok = 1;
|
|
167
|
+
string message = 2;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
message BinaryBulkInsertRequest {
|
|
171
|
+
string collection = 1;
|
|
172
|
+
repeated string field_names = 2;
|
|
173
|
+
repeated BinaryRow rows = 3;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
message BinaryRow {
|
|
177
|
+
repeated BinaryValue values = 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
message BinaryValue {
|
|
181
|
+
oneof kind {
|
|
182
|
+
string text_value = 1;
|
|
183
|
+
int64 int_value = 2;
|
|
184
|
+
double float_value = 3;
|
|
185
|
+
bool bool_value = 4;
|
|
186
|
+
bytes blob_value = 5;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
message BulkInsertReply {
|
|
191
|
+
bool ok = 1;
|
|
192
|
+
uint64 count = 2;
|
|
193
|
+
uint64 first_id = 3;
|
|
194
|
+
}
|
|
195
|
+
`;
|
package/dist/clients/reddb.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Client as ReckerClient, type ExtendedClientOptions } from '../core/client.js';
|
|
2
2
|
export type RedDbTransportMode = 'auto' | 'http' | 'grpc' | 'wire';
|
|
3
|
-
export type RedDbResolvedTransport = 'http' | 'wire';
|
|
3
|
+
export type RedDbResolvedTransport = 'http' | 'grpc' | 'wire';
|
|
4
|
+
export type RedDbBinaryValue = string | number | boolean | bigint | Buffer | Uint8Array | null;
|
|
4
5
|
export interface RedDbQueryStats {
|
|
5
6
|
nodes_scanned?: number;
|
|
6
7
|
edges_scanned?: number;
|
|
@@ -28,12 +29,14 @@ export interface RedDbQueryData {
|
|
|
28
29
|
}
|
|
29
30
|
export interface RedDbBatchQueryData {
|
|
30
31
|
results: RedDbQueryData[];
|
|
32
|
+
[key: string]: unknown;
|
|
31
33
|
}
|
|
32
34
|
export interface RedDbScanEntity {
|
|
33
35
|
id: number;
|
|
34
36
|
kind: string;
|
|
35
37
|
collection: string;
|
|
36
38
|
json: string;
|
|
39
|
+
[key: string]: unknown;
|
|
37
40
|
}
|
|
38
41
|
export interface RedDbScanData {
|
|
39
42
|
collection: string;
|
|
@@ -42,34 +45,96 @@ export interface RedDbScanData {
|
|
|
42
45
|
items: RedDbScanEntity[];
|
|
43
46
|
[key: string]: unknown;
|
|
44
47
|
}
|
|
48
|
+
export interface RedDbEntityData {
|
|
49
|
+
ok?: boolean;
|
|
50
|
+
id?: number;
|
|
51
|
+
entity?: unknown;
|
|
52
|
+
entity_json?: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
export interface RedDbBulkEntityData {
|
|
56
|
+
ok?: boolean;
|
|
57
|
+
count?: number;
|
|
58
|
+
first_id?: number;
|
|
59
|
+
items?: RedDbEntityData[];
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
45
62
|
export interface RedDbBulkInsertData {
|
|
46
63
|
ok?: boolean;
|
|
47
64
|
count?: number;
|
|
48
65
|
first_id?: number;
|
|
49
66
|
[key: string]: unknown;
|
|
50
67
|
}
|
|
68
|
+
export interface RedDbHealthData {
|
|
69
|
+
healthy?: boolean;
|
|
70
|
+
state?: string;
|
|
71
|
+
checked_at_unix_ms?: number;
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
}
|
|
74
|
+
export interface RedDbStatsData {
|
|
75
|
+
collection_count?: number;
|
|
76
|
+
total_entities?: number;
|
|
77
|
+
total_memory_bytes?: number;
|
|
78
|
+
cross_ref_count?: number;
|
|
79
|
+
active_connections?: number;
|
|
80
|
+
idle_connections?: number;
|
|
81
|
+
total_checkouts?: number;
|
|
82
|
+
paged_mode?: boolean;
|
|
83
|
+
started_at_unix_ms?: number;
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
export interface RedDbCollectionsData {
|
|
87
|
+
collections: string[];
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
}
|
|
90
|
+
export interface RedDbKvData {
|
|
91
|
+
ok?: boolean;
|
|
92
|
+
collection?: string;
|
|
93
|
+
key?: string;
|
|
94
|
+
value?: unknown;
|
|
95
|
+
id?: number;
|
|
96
|
+
[key: string]: unknown;
|
|
97
|
+
}
|
|
98
|
+
export interface RedDbKvListItem {
|
|
99
|
+
key?: string;
|
|
100
|
+
value?: unknown;
|
|
101
|
+
id?: number;
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
}
|
|
104
|
+
export interface RedDbKvListData {
|
|
105
|
+
items: RedDbKvListItem[];
|
|
106
|
+
query: RedDbQueryData;
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
51
109
|
export interface RedDbCapabilities {
|
|
52
110
|
requestedTransport: RedDbTransportMode;
|
|
53
111
|
allowTransportFallback: boolean;
|
|
54
112
|
availableTransports: {
|
|
55
113
|
http: boolean;
|
|
56
|
-
wire: boolean;
|
|
57
114
|
grpc: boolean;
|
|
115
|
+
wire: boolean;
|
|
58
116
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
117
|
+
namespaces: {
|
|
118
|
+
system: boolean;
|
|
119
|
+
sql: boolean;
|
|
120
|
+
collections: boolean;
|
|
121
|
+
indexes: boolean;
|
|
122
|
+
rows: boolean;
|
|
123
|
+
documents: boolean;
|
|
124
|
+
nodes: boolean;
|
|
125
|
+
edges: boolean;
|
|
126
|
+
vectors: boolean;
|
|
127
|
+
kv: boolean;
|
|
69
128
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
129
|
+
features: {
|
|
130
|
+
grpcNative: boolean;
|
|
131
|
+
wireSql: boolean;
|
|
132
|
+
wireBulkRows: boolean;
|
|
133
|
+
wireBinaryBulkScalars: boolean;
|
|
134
|
+
httpBinaryBulkEmulation: boolean;
|
|
135
|
+
sqlBatchEmulationOverHttp: boolean;
|
|
136
|
+
sqlBatchEmulationOverWire: boolean;
|
|
137
|
+
kvListViaSql: boolean;
|
|
73
138
|
};
|
|
74
139
|
}
|
|
75
140
|
export interface RedDbOperationMetrics {
|
|
@@ -93,67 +158,108 @@ export interface RedDbOperationEnvelope<T> {
|
|
|
93
158
|
emulated: boolean;
|
|
94
159
|
metrics: RedDbOperationMetrics;
|
|
95
160
|
}
|
|
96
|
-
export interface
|
|
97
|
-
entityTypes?: string[];
|
|
98
|
-
capabilities?: string[];
|
|
161
|
+
export interface RedDbTransportRequest {
|
|
99
162
|
transport?: RedDbTransportMode;
|
|
100
163
|
signal?: AbortSignal;
|
|
101
164
|
timeout?: number;
|
|
102
165
|
}
|
|
103
|
-
export interface
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
limit?: number;
|
|
107
|
-
transport?: RedDbTransportMode;
|
|
108
|
-
signal?: AbortSignal;
|
|
109
|
-
timeout?: number;
|
|
166
|
+
export interface RedDbQueryOptions extends RedDbTransportRequest {
|
|
167
|
+
entityTypes?: string[];
|
|
168
|
+
capabilities?: string[];
|
|
110
169
|
}
|
|
111
|
-
export interface
|
|
112
|
-
|
|
113
|
-
items: Array<{
|
|
114
|
-
fields: Record<string, unknown>;
|
|
115
|
-
}>;
|
|
116
|
-
transport?: RedDbTransportMode;
|
|
117
|
-
signal?: AbortSignal;
|
|
118
|
-
timeout?: number;
|
|
170
|
+
export interface RedDbBatchQueryOptions extends RedDbQueryOptions {
|
|
171
|
+
concurrency?: number;
|
|
119
172
|
}
|
|
120
|
-
export
|
|
121
|
-
export interface RedDbBulkInsertBinaryRequest {
|
|
173
|
+
export interface RedDbScanRequest extends RedDbTransportRequest {
|
|
122
174
|
collection: string;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
transport?: RedDbTransportMode;
|
|
126
|
-
signal?: AbortSignal;
|
|
127
|
-
timeout?: number;
|
|
175
|
+
offset?: number;
|
|
176
|
+
limit?: number;
|
|
128
177
|
}
|
|
129
|
-
export interface
|
|
178
|
+
export interface RedDbCollectionCreateOptions extends RedDbTransportRequest {
|
|
130
179
|
name: string;
|
|
131
180
|
ttl?: string | number;
|
|
132
181
|
ttlMs?: number;
|
|
133
|
-
transport?: RedDbTransportMode;
|
|
134
|
-
signal?: AbortSignal;
|
|
135
|
-
timeout?: number;
|
|
136
182
|
}
|
|
137
|
-
export interface
|
|
183
|
+
export interface RedDbCollectionRequest extends RedDbTransportRequest {
|
|
184
|
+
name: string;
|
|
185
|
+
}
|
|
186
|
+
export interface RedDbIndexListRequest extends RedDbTransportRequest {
|
|
187
|
+
collection?: string;
|
|
188
|
+
}
|
|
189
|
+
export interface RedDbIndexCreateOptions extends RedDbTransportRequest {
|
|
138
190
|
name: string;
|
|
139
191
|
collection: string;
|
|
140
192
|
columns: string[];
|
|
141
193
|
unique?: boolean;
|
|
142
194
|
method?: 'BTREE' | 'HASH' | 'BITMAP' | 'RTREE';
|
|
143
|
-
transport?: RedDbTransportMode;
|
|
144
|
-
signal?: AbortSignal;
|
|
145
|
-
timeout?: number;
|
|
146
195
|
}
|
|
147
|
-
export interface
|
|
196
|
+
export interface RedDbIndexNameRequest extends RedDbTransportRequest {
|
|
148
197
|
name: string;
|
|
149
|
-
transport?: RedDbTransportMode;
|
|
150
|
-
signal?: AbortSignal;
|
|
151
|
-
timeout?: number;
|
|
152
198
|
}
|
|
153
|
-
export interface
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
199
|
+
export interface RedDbIndexRebuildRequest extends RedDbTransportRequest {
|
|
200
|
+
collection?: string;
|
|
201
|
+
}
|
|
202
|
+
export interface RedDbRowCreateRequest extends RedDbTransportRequest {
|
|
203
|
+
collection: string;
|
|
204
|
+
payload: {
|
|
205
|
+
fields: Record<string, unknown>;
|
|
206
|
+
ttl?: string | number;
|
|
207
|
+
ttl_ms?: number;
|
|
208
|
+
metadata?: Record<string, unknown>;
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export interface RedDbRowBulkCreateRequest extends RedDbTransportRequest {
|
|
213
|
+
collection: string;
|
|
214
|
+
items: Array<{
|
|
215
|
+
fields: Record<string, unknown>;
|
|
216
|
+
ttl?: string | number;
|
|
217
|
+
ttl_ms?: number;
|
|
218
|
+
metadata?: Record<string, unknown>;
|
|
219
|
+
[key: string]: unknown;
|
|
220
|
+
}>;
|
|
221
|
+
}
|
|
222
|
+
export interface RedDbEntityCreateRequest extends RedDbTransportRequest {
|
|
223
|
+
collection: string;
|
|
224
|
+
payload: Record<string, unknown>;
|
|
225
|
+
}
|
|
226
|
+
export interface RedDbBulkEntityCreateRequest extends RedDbTransportRequest {
|
|
227
|
+
collection: string;
|
|
228
|
+
items: Record<string, unknown>[];
|
|
229
|
+
}
|
|
230
|
+
export interface RedDbPatchEntityRequest extends RedDbTransportRequest {
|
|
231
|
+
collection: string;
|
|
232
|
+
id: number;
|
|
233
|
+
payload: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
export interface RedDbDeleteEntityRequest extends RedDbTransportRequest {
|
|
236
|
+
collection: string;
|
|
237
|
+
id: number;
|
|
238
|
+
}
|
|
239
|
+
export interface RedDbVectorSearchRequest extends RedDbTransportRequest {
|
|
240
|
+
collection: string;
|
|
241
|
+
payload: Record<string, unknown>;
|
|
242
|
+
}
|
|
243
|
+
export interface RedDbBulkInsertBinaryRequest extends RedDbTransportRequest {
|
|
244
|
+
collection: string;
|
|
245
|
+
fieldNames: string[];
|
|
246
|
+
rows: RedDbBinaryValue[][];
|
|
247
|
+
}
|
|
248
|
+
export interface RedDbKvRequest extends RedDbTransportRequest {
|
|
249
|
+
collection: string;
|
|
250
|
+
key: string;
|
|
251
|
+
}
|
|
252
|
+
export interface RedDbKvPutRequest extends RedDbTransportRequest {
|
|
253
|
+
collection: string;
|
|
254
|
+
key: string;
|
|
255
|
+
value: unknown;
|
|
256
|
+
}
|
|
257
|
+
export interface RedDbKvListRequest extends RedDbQueryOptions {
|
|
258
|
+
collection: string;
|
|
259
|
+
prefix?: string;
|
|
260
|
+
limit?: number;
|
|
261
|
+
offset?: number;
|
|
262
|
+
order?: 'asc' | 'desc';
|
|
157
263
|
}
|
|
158
264
|
export interface RedDbWireTlsOptions {
|
|
159
265
|
enabled?: boolean;
|
|
@@ -161,6 +267,32 @@ export interface RedDbWireTlsOptions {
|
|
|
161
267
|
ca?: string | Buffer;
|
|
162
268
|
servername?: string;
|
|
163
269
|
}
|
|
270
|
+
export interface RedDbGrpcTlsOptions {
|
|
271
|
+
enabled?: boolean;
|
|
272
|
+
rejectUnauthorized?: boolean;
|
|
273
|
+
ca?: string | Buffer;
|
|
274
|
+
servername?: string;
|
|
275
|
+
}
|
|
276
|
+
export interface RedDbGrpcKeepaliveOptions {
|
|
277
|
+
timeMs?: number;
|
|
278
|
+
timeoutMs?: number;
|
|
279
|
+
permitWithoutCalls?: boolean;
|
|
280
|
+
maxPingsWithoutData?: number;
|
|
281
|
+
initialReconnectBackoffMs?: number;
|
|
282
|
+
maxReconnectBackoffMs?: number;
|
|
283
|
+
}
|
|
284
|
+
export interface RedDbOperationTimeouts {
|
|
285
|
+
system?: number;
|
|
286
|
+
sql?: number;
|
|
287
|
+
sqlBatch?: number;
|
|
288
|
+
scan?: number;
|
|
289
|
+
mutation?: number;
|
|
290
|
+
bulk?: number;
|
|
291
|
+
search?: number;
|
|
292
|
+
ddl?: number;
|
|
293
|
+
index?: number;
|
|
294
|
+
kv?: number;
|
|
295
|
+
}
|
|
164
296
|
export interface RedDbClientOptions {
|
|
165
297
|
baseUrl?: string;
|
|
166
298
|
client?: ReckerClient;
|
|
@@ -174,38 +306,141 @@ export interface RedDbClientOptions {
|
|
|
174
306
|
httpClientOptions?: Omit<ExtendedClientOptions, 'baseUrl' | 'headers' | 'timeout' | 'http2'>;
|
|
175
307
|
wireAddress?: string;
|
|
176
308
|
wireTls?: boolean | RedDbWireTlsOptions;
|
|
309
|
+
wirePoolSize?: number;
|
|
310
|
+
wireKeepAlive?: boolean;
|
|
311
|
+
wireKeepAliveInitialDelayMs?: number;
|
|
312
|
+
wireConnectTimeout?: number;
|
|
313
|
+
grpcAddress?: string;
|
|
314
|
+
grpcTls?: boolean | RedDbGrpcTlsOptions;
|
|
315
|
+
grpcOptions?: Record<string, string | number>;
|
|
316
|
+
grpcKeepalive?: RedDbGrpcKeepaliveOptions;
|
|
317
|
+
operationTimeouts?: RedDbOperationTimeouts;
|
|
177
318
|
batchConcurrency?: number;
|
|
178
319
|
}
|
|
320
|
+
export interface RedDbSystemNamespace {
|
|
321
|
+
health(options?: RedDbTransportRequest): Promise<RedDbOperationEnvelope<RedDbHealthData>>;
|
|
322
|
+
ready(options?: RedDbTransportRequest): Promise<RedDbOperationEnvelope<RedDbHealthData>>;
|
|
323
|
+
stats(options?: RedDbTransportRequest): Promise<RedDbOperationEnvelope<RedDbStatsData>>;
|
|
324
|
+
}
|
|
325
|
+
export interface RedDbSqlNamespace {
|
|
326
|
+
query(query: string, options?: RedDbQueryOptions): Promise<RedDbOperationEnvelope<RedDbQueryData>>;
|
|
327
|
+
explain(query: string, options?: RedDbQueryOptions): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
328
|
+
batch(queries: string[], options?: RedDbBatchQueryOptions): Promise<RedDbOperationEnvelope<RedDbBatchQueryData>>;
|
|
329
|
+
}
|
|
330
|
+
export interface RedDbCollectionsNamespace {
|
|
331
|
+
list(options?: RedDbTransportRequest): Promise<RedDbOperationEnvelope<RedDbCollectionsData>>;
|
|
332
|
+
create(options: RedDbCollectionCreateOptions): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
333
|
+
describe(options: RedDbCollectionRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
334
|
+
drop(options: RedDbCollectionRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
335
|
+
}
|
|
336
|
+
export interface RedDbIndexesNamespace {
|
|
337
|
+
list(options?: RedDbIndexListRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
338
|
+
statuses(options?: RedDbTransportRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
339
|
+
create(options: RedDbIndexCreateOptions): Promise<RedDbOperationEnvelope<RedDbQueryData>>;
|
|
340
|
+
enable(options: RedDbIndexNameRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
341
|
+
disable(options: RedDbIndexNameRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
342
|
+
warmup(options: RedDbIndexNameRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
343
|
+
rebuild(options?: RedDbIndexRebuildRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
344
|
+
}
|
|
345
|
+
export interface RedDbRowsNamespace {
|
|
346
|
+
scan(request: RedDbScanRequest): Promise<RedDbOperationEnvelope<RedDbScanData>>;
|
|
347
|
+
create(request: RedDbRowCreateRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
348
|
+
bulkCreate(request: RedDbRowBulkCreateRequest): Promise<RedDbOperationEnvelope<RedDbBulkEntityData>>;
|
|
349
|
+
patch(request: RedDbPatchEntityRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
350
|
+
delete(request: RedDbDeleteEntityRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
351
|
+
}
|
|
352
|
+
export interface RedDbDocumentsNamespace {
|
|
353
|
+
create(request: RedDbEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
354
|
+
bulkCreate(request: RedDbBulkEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbBulkEntityData>>;
|
|
355
|
+
}
|
|
356
|
+
export interface RedDbNodesNamespace {
|
|
357
|
+
create(request: RedDbEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
358
|
+
bulkCreate(request: RedDbBulkEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbBulkEntityData>>;
|
|
359
|
+
}
|
|
360
|
+
export interface RedDbEdgesNamespace {
|
|
361
|
+
create(request: RedDbEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
362
|
+
bulkCreate(request: RedDbBulkEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbBulkEntityData>>;
|
|
363
|
+
}
|
|
364
|
+
export interface RedDbVectorsNamespace {
|
|
365
|
+
create(request: RedDbEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
366
|
+
bulkCreate(request: RedDbBulkEntityCreateRequest): Promise<RedDbOperationEnvelope<RedDbBulkEntityData>>;
|
|
367
|
+
bulkInsertBinary(request: RedDbBulkInsertBinaryRequest): Promise<RedDbOperationEnvelope<RedDbBulkInsertData>>;
|
|
368
|
+
similar(request: RedDbVectorSearchRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
369
|
+
ivfSearch(request: RedDbVectorSearchRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
370
|
+
}
|
|
371
|
+
export interface RedDbKvNamespace {
|
|
372
|
+
get(request: RedDbKvRequest): Promise<RedDbOperationEnvelope<RedDbKvData>>;
|
|
373
|
+
put(request: RedDbKvPutRequest): Promise<RedDbOperationEnvelope<RedDbEntityData>>;
|
|
374
|
+
delete(request: RedDbKvRequest): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
375
|
+
list(request: RedDbKvListRequest): Promise<RedDbOperationEnvelope<RedDbKvListData>>;
|
|
376
|
+
}
|
|
179
377
|
export declare class RedDbClient {
|
|
180
378
|
private readonly baseUrl?;
|
|
181
379
|
private readonly httpClient;
|
|
380
|
+
private readonly grpcClient;
|
|
381
|
+
private readonly wireClient;
|
|
182
382
|
private readonly defaultTransport;
|
|
183
383
|
private readonly allowTransportFallback;
|
|
184
384
|
private readonly timeout;
|
|
185
385
|
private readonly batchConcurrency;
|
|
186
|
-
private readonly
|
|
386
|
+
private readonly operationTimeouts;
|
|
387
|
+
readonly system: RedDbSystemNamespace;
|
|
388
|
+
readonly sql: RedDbSqlNamespace;
|
|
389
|
+
readonly collections: RedDbCollectionsNamespace;
|
|
390
|
+
readonly indexes: RedDbIndexesNamespace;
|
|
391
|
+
readonly rows: RedDbRowsNamespace;
|
|
392
|
+
readonly documents: RedDbDocumentsNamespace;
|
|
393
|
+
readonly nodes: RedDbNodesNamespace;
|
|
394
|
+
readonly edges: RedDbEdgesNamespace;
|
|
395
|
+
readonly vectors: RedDbVectorsNamespace;
|
|
396
|
+
readonly kv: RedDbKvNamespace;
|
|
187
397
|
constructor(options?: RedDbClientOptions);
|
|
188
398
|
getCapabilities(): RedDbCapabilities;
|
|
189
|
-
query(query: string, options?: RedDbQueryOptions): Promise<RedDbOperationEnvelope<RedDbQueryData>>;
|
|
190
|
-
explainQuery(query: string, options?: RedDbQueryOptions): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
191
|
-
mutateQuery(query: string, options?: RedDbQueryOptions): Promise<RedDbOperationEnvelope<RedDbQueryData>>;
|
|
192
|
-
batchQuery(queries: string[], options?: RedDbQueryOptions): Promise<RedDbOperationEnvelope<RedDbBatchQueryData>>;
|
|
193
|
-
scan(params: RedDbScanRequest): Promise<RedDbOperationEnvelope<RedDbScanData>>;
|
|
194
|
-
bulkInsertRows(params: RedDbBulkInsertRowsRequest): Promise<RedDbOperationEnvelope<RedDbBulkInsertData>>;
|
|
195
|
-
bulkInsertBinary(params: RedDbBulkInsertBinaryRequest): Promise<RedDbOperationEnvelope<RedDbBulkInsertData>>;
|
|
196
|
-
stats(options?: RedDbStatsOptions): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
197
|
-
ensureCollection(options: RedDbEnsureCollectionOptions): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
198
|
-
ensureIndex(options: RedDbEnsureIndexOptions): Promise<RedDbOperationEnvelope<RedDbQueryData>>;
|
|
199
|
-
warmupIndex(options: RedDbWarmupIndexOptions): Promise<RedDbOperationEnvelope<Record<string, unknown>>>;
|
|
200
399
|
close(): Promise<void>;
|
|
201
|
-
private
|
|
202
|
-
private
|
|
400
|
+
private executeSystemHealth;
|
|
401
|
+
private executeSystemStats;
|
|
402
|
+
private executeSqlQuery;
|
|
403
|
+
private executeSqlExplain;
|
|
404
|
+
private executeSqlBatch;
|
|
405
|
+
private executeCollectionsList;
|
|
406
|
+
private executeCollectionCreate;
|
|
407
|
+
private executeCollectionDescribe;
|
|
408
|
+
private executeCollectionDrop;
|
|
409
|
+
private executeIndexesList;
|
|
410
|
+
private executeIndexesStatuses;
|
|
411
|
+
private executeIndexCreate;
|
|
412
|
+
private executeIndexToggle;
|
|
413
|
+
private executeIndexWarmup;
|
|
414
|
+
private executeIndexesRebuild;
|
|
415
|
+
private executeRowsScan;
|
|
416
|
+
private executeRowCreate;
|
|
417
|
+
private executeRowsBulkCreate;
|
|
418
|
+
private executeRowPatch;
|
|
419
|
+
private executeRowDelete;
|
|
420
|
+
private executeEntityCreate;
|
|
421
|
+
private executeBulkEntityCreate;
|
|
422
|
+
private executeVectorBulkInsertBinary;
|
|
423
|
+
private executeVectorSearch;
|
|
424
|
+
private executeKvGet;
|
|
425
|
+
private executeKvPut;
|
|
426
|
+
private executeKvDelete;
|
|
427
|
+
private executeKvList;
|
|
428
|
+
private resolveOperationTimeout;
|
|
429
|
+
private withResolvedTimeout;
|
|
430
|
+
private operationTimeoutBucket;
|
|
431
|
+
private resolveTransport;
|
|
432
|
+
private runHttpPost;
|
|
433
|
+
private runHttpPut;
|
|
434
|
+
private runHttpPatch;
|
|
435
|
+
private runHttpDelete;
|
|
203
436
|
private runHttpGet;
|
|
204
437
|
private parseHttpResponse;
|
|
438
|
+
private runGrpc;
|
|
205
439
|
private runWireQuery;
|
|
206
440
|
private runWireBulkInsert;
|
|
207
|
-
private
|
|
441
|
+
private runWireBulkInsertBinary;
|
|
208
442
|
private buildEnvelope;
|
|
443
|
+
private mapEnvelope;
|
|
209
444
|
}
|
|
210
445
|
export declare function createRedDbClient(options?: RedDbClientOptions): RedDbClient;
|
|
211
446
|
export declare function reddb(options?: RedDbClientOptions): RedDbClient;
|