@meshagent/meshagent 0.38.4 → 0.39.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/CHANGELOG.md +14 -2
- package/dist/browser/datasets-client.d.ts +415 -0
- package/dist/{node/database-client.js → browser/datasets-client.js} +480 -234
- package/dist/browser/entrypoint.js +9 -17
- package/dist/browser/index.d.ts +1 -2
- package/dist/browser/index.js +1 -2
- package/dist/browser/meshagent-client.d.ts +179 -3
- package/dist/browser/meshagent-client.js +333 -25
- package/dist/browser/participant-token.d.ts +5 -5
- package/dist/browser/participant-token.js +14 -13
- package/dist/browser/room-client.d.ts +5 -3
- package/dist/browser/room-client.js +70 -4
- package/dist/esm/datasets-client.d.ts +415 -0
- package/dist/esm/{database-client.js → datasets-client.js} +473 -227
- package/dist/esm/entrypoint.js +6 -12
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/meshagent-client.d.ts +179 -3
- package/dist/esm/meshagent-client.js +333 -25
- package/dist/esm/participant-token.d.ts +5 -5
- package/dist/esm/participant-token.js +12 -11
- package/dist/esm/room-client.d.ts +5 -3
- package/dist/esm/room-client.js +70 -4
- package/dist/node/datasets-client.d.ts +415 -0
- package/dist/{browser/database-client.js → node/datasets-client.js} +480 -234
- package/dist/node/entrypoint.js +6 -12
- package/dist/node/index.d.ts +1 -2
- package/dist/node/index.js +1 -2
- package/dist/node/meshagent-client.d.ts +179 -3
- package/dist/node/meshagent-client.js +333 -25
- package/dist/node/participant-token.d.ts +5 -5
- package/dist/node/participant-token.js +14 -13
- package/dist/node/room-client.d.ts +5 -3
- package/dist/node/room-client.js +70 -4
- package/package.json +3 -2
- package/dist/browser/data-types.d.ts +0 -67
- package/dist/browser/data-types.js +0 -192
- package/dist/browser/database-client.d.ts +0 -281
- package/dist/esm/data-types.d.ts +0 -67
- package/dist/esm/data-types.js +0 -179
- package/dist/esm/database-client.d.ts +0 -281
- package/dist/node/data-types.d.ts +0 -67
- package/dist/node/data-types.js +0 -192
- package/dist/node/database-client.d.ts +0 -281
package/dist/node/room-client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RoomClient = exports.RoomProtocolProxy = void 0;
|
|
4
4
|
const completer_1 = require("./completer");
|
|
5
|
-
const
|
|
5
|
+
const datasets_client_1 = require("./datasets-client");
|
|
6
6
|
const developer_client_1 = require("./developer-client");
|
|
7
7
|
const event_emitter_1 = require("./event-emitter");
|
|
8
8
|
const messaging_client_1 = require("./messaging-client");
|
|
@@ -248,7 +248,7 @@ class RoomClient {
|
|
|
248
248
|
this.developer = new developer_client_1.DeveloperClient({ room: this });
|
|
249
249
|
this.messaging = new messaging_client_1.MessagingClient({ room: this });
|
|
250
250
|
this.queues = new queues_client_1.QueuesClient({ room: this });
|
|
251
|
-
this.
|
|
251
|
+
this.datasets = new datasets_client_1.DatasetsClient({ room: this });
|
|
252
252
|
this.agents = new agent_client_1.AgentsClient({ room: this });
|
|
253
253
|
this.secrets = new secrets_client_1.SecretsClient({
|
|
254
254
|
room: this,
|
|
@@ -302,8 +302,74 @@ class RoomClient {
|
|
|
302
302
|
this._eventsController.add(event);
|
|
303
303
|
this._eventEmitter.emit(event.name, event);
|
|
304
304
|
}
|
|
305
|
-
listen() {
|
|
306
|
-
|
|
305
|
+
listen({ abortSignal } = {}) {
|
|
306
|
+
if (abortSignal === undefined || abortSignal === null) {
|
|
307
|
+
return this._eventsController.stream;
|
|
308
|
+
}
|
|
309
|
+
const source = this._eventsController.stream;
|
|
310
|
+
return {
|
|
311
|
+
[Symbol.asyncIterator]() {
|
|
312
|
+
const eventIterator = source[Symbol.asyncIterator]();
|
|
313
|
+
let abortReject = null;
|
|
314
|
+
let cleanedUp = false;
|
|
315
|
+
const abortError = () => {
|
|
316
|
+
if (abortSignal.reason != null) {
|
|
317
|
+
return abortSignal.reason;
|
|
318
|
+
}
|
|
319
|
+
const error = new Error("Aborted");
|
|
320
|
+
error.name = "AbortError";
|
|
321
|
+
return error;
|
|
322
|
+
};
|
|
323
|
+
const cleanup = async () => {
|
|
324
|
+
if (cleanedUp) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
cleanedUp = true;
|
|
328
|
+
abortSignal.removeEventListener("abort", onAbort);
|
|
329
|
+
await eventIterator.return?.();
|
|
330
|
+
};
|
|
331
|
+
const onAbort = () => {
|
|
332
|
+
const reject = abortReject;
|
|
333
|
+
abortReject = null;
|
|
334
|
+
reject?.(abortError());
|
|
335
|
+
void cleanup();
|
|
336
|
+
};
|
|
337
|
+
abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
338
|
+
return {
|
|
339
|
+
async next() {
|
|
340
|
+
if (abortSignal.aborted) {
|
|
341
|
+
await cleanup();
|
|
342
|
+
return Promise.reject(abortError());
|
|
343
|
+
}
|
|
344
|
+
const abortPromise = new Promise((_, reject) => {
|
|
345
|
+
abortReject = reject;
|
|
346
|
+
});
|
|
347
|
+
try {
|
|
348
|
+
const result = await Promise.race([eventIterator.next(), abortPromise]);
|
|
349
|
+
if (result.done) {
|
|
350
|
+
await cleanup();
|
|
351
|
+
}
|
|
352
|
+
return result;
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
await cleanup();
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
abortReject = null;
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
async return() {
|
|
363
|
+
await cleanup();
|
|
364
|
+
return { done: true, value: undefined };
|
|
365
|
+
},
|
|
366
|
+
async throw(e) {
|
|
367
|
+
await cleanup();
|
|
368
|
+
return Promise.reject(e);
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
},
|
|
372
|
+
};
|
|
307
373
|
}
|
|
308
374
|
async waitForClose() {
|
|
309
375
|
await this._roomClosed.fut;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshagent/meshagent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.1",
|
|
4
4
|
"description": "Meshagent Client",
|
|
5
5
|
"homepage": "https://github.com/meshagent/meshagent-ts",
|
|
6
6
|
"scripts": {
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@kayahr/text-encoding": "^2.0.0",
|
|
48
|
+
"apache-arrow": "^21.0.0",
|
|
48
49
|
"base-64": "^1.0.0",
|
|
49
50
|
"isomorphic-ws": "^5.0.0",
|
|
50
51
|
"jose": "^6.0.8",
|
|
51
52
|
"livekit-client": "^2.15.5",
|
|
52
|
-
"uuid": "^
|
|
53
|
+
"uuid": "^14.0.0",
|
|
53
54
|
"ws": "^8.18.0",
|
|
54
55
|
"yjs": "^13.6.28"
|
|
55
56
|
},
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare const _dataTypes: Record<string, typeof DataType>;
|
|
2
|
-
export declare abstract class DataType {
|
|
3
|
-
constructor(_?: any);
|
|
4
|
-
abstract toJson(): Record<string, unknown>;
|
|
5
|
-
static fromJson(data: any): DataType;
|
|
6
|
-
static int(): IntDataType;
|
|
7
|
-
static date(): DateDataType;
|
|
8
|
-
static float(): FloatDataType;
|
|
9
|
-
static vector({ size, elementType }: {
|
|
10
|
-
size: number;
|
|
11
|
-
elementType: DataType;
|
|
12
|
-
}): VectorDataType;
|
|
13
|
-
static text(): TextDataType;
|
|
14
|
-
static json(): JsonDataType;
|
|
15
|
-
static uuid(): UuidDataType;
|
|
16
|
-
static binary(): BinaryDataType;
|
|
17
|
-
}
|
|
18
|
-
export declare class BoolDataType extends DataType {
|
|
19
|
-
constructor();
|
|
20
|
-
static fromJson(data: any): IntDataType;
|
|
21
|
-
toJson(): Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
export declare class IntDataType extends DataType {
|
|
24
|
-
constructor();
|
|
25
|
-
static fromJson(data: any): IntDataType;
|
|
26
|
-
toJson(): Record<string, unknown>;
|
|
27
|
-
}
|
|
28
|
-
export declare class DateDataType extends DataType {
|
|
29
|
-
constructor();
|
|
30
|
-
static fromJson(data: any): DateDataType;
|
|
31
|
-
toJson(): Record<string, unknown>;
|
|
32
|
-
}
|
|
33
|
-
export declare class FloatDataType extends DataType {
|
|
34
|
-
constructor();
|
|
35
|
-
static fromJson(data: any): FloatDataType;
|
|
36
|
-
toJson(): Record<string, unknown>;
|
|
37
|
-
}
|
|
38
|
-
export declare class VectorDataType extends DataType {
|
|
39
|
-
size: number;
|
|
40
|
-
elementType: DataType;
|
|
41
|
-
constructor({ size, elementType }: {
|
|
42
|
-
size: number;
|
|
43
|
-
elementType: DataType;
|
|
44
|
-
});
|
|
45
|
-
static fromJson(data: any): VectorDataType;
|
|
46
|
-
toJson(): Record<string, unknown>;
|
|
47
|
-
}
|
|
48
|
-
export declare class TextDataType extends DataType {
|
|
49
|
-
constructor();
|
|
50
|
-
static fromJson(data: any): TextDataType;
|
|
51
|
-
toJson(): Record<string, unknown>;
|
|
52
|
-
}
|
|
53
|
-
export declare class JsonDataType extends DataType {
|
|
54
|
-
constructor();
|
|
55
|
-
static fromJson(data: any): JsonDataType;
|
|
56
|
-
toJson(): Record<string, unknown>;
|
|
57
|
-
}
|
|
58
|
-
export declare class UuidDataType extends DataType {
|
|
59
|
-
constructor();
|
|
60
|
-
static fromJson(data: any): UuidDataType;
|
|
61
|
-
toJson(): Record<string, unknown>;
|
|
62
|
-
}
|
|
63
|
-
export declare class BinaryDataType extends DataType {
|
|
64
|
-
constructor();
|
|
65
|
-
static fromJson(data: any): BinaryDataType;
|
|
66
|
-
toJson(): Record<string, unknown>;
|
|
67
|
-
}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BinaryDataType = exports.UuidDataType = exports.JsonDataType = exports.TextDataType = exports.VectorDataType = exports.FloatDataType = exports.DateDataType = exports.IntDataType = exports.BoolDataType = exports.DataType = exports._dataTypes = void 0;
|
|
4
|
-
exports._dataTypes = {};
|
|
5
|
-
class DataType {
|
|
6
|
-
constructor(_) { }
|
|
7
|
-
static fromJson(data) {
|
|
8
|
-
const ctor = exports._dataTypes[data.type];
|
|
9
|
-
if (!ctor) {
|
|
10
|
-
throw new Error(`Unknown data type: ${data.type}`);
|
|
11
|
-
}
|
|
12
|
-
return ctor.fromJson(data);
|
|
13
|
-
}
|
|
14
|
-
static int() {
|
|
15
|
-
return new IntDataType();
|
|
16
|
-
}
|
|
17
|
-
static date() {
|
|
18
|
-
return new DateDataType();
|
|
19
|
-
}
|
|
20
|
-
static float() {
|
|
21
|
-
return new FloatDataType();
|
|
22
|
-
}
|
|
23
|
-
static vector({ size, elementType }) {
|
|
24
|
-
return new VectorDataType({ size, elementType });
|
|
25
|
-
}
|
|
26
|
-
static text() {
|
|
27
|
-
return new TextDataType();
|
|
28
|
-
}
|
|
29
|
-
static json() {
|
|
30
|
-
return new JsonDataType();
|
|
31
|
-
}
|
|
32
|
-
static uuid() {
|
|
33
|
-
return new UuidDataType();
|
|
34
|
-
}
|
|
35
|
-
static binary() {
|
|
36
|
-
return new BinaryDataType();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.DataType = DataType;
|
|
40
|
-
class BoolDataType extends DataType {
|
|
41
|
-
constructor() {
|
|
42
|
-
super();
|
|
43
|
-
}
|
|
44
|
-
static fromJson(data) {
|
|
45
|
-
if (data.type !== "bool") {
|
|
46
|
-
throw new Error(`Expected type 'bool', got '${data.type}'`);
|
|
47
|
-
}
|
|
48
|
-
return new BoolDataType();
|
|
49
|
-
}
|
|
50
|
-
toJson() {
|
|
51
|
-
return { type: "bool" };
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.BoolDataType = BoolDataType;
|
|
55
|
-
exports._dataTypes["bool"] = BoolDataType;
|
|
56
|
-
class IntDataType extends DataType {
|
|
57
|
-
constructor() {
|
|
58
|
-
super();
|
|
59
|
-
}
|
|
60
|
-
static fromJson(data) {
|
|
61
|
-
if (data.type !== "int") {
|
|
62
|
-
throw new Error(`Expected type 'int', got '${data.type}'`);
|
|
63
|
-
}
|
|
64
|
-
return new IntDataType();
|
|
65
|
-
}
|
|
66
|
-
toJson() {
|
|
67
|
-
return { type: "int" };
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.IntDataType = IntDataType;
|
|
71
|
-
exports._dataTypes["int"] = IntDataType;
|
|
72
|
-
class DateDataType extends DataType {
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
}
|
|
76
|
-
static fromJson(data) {
|
|
77
|
-
if (data.type !== "date") {
|
|
78
|
-
throw new Error(`Expected type 'date', got '${data.type}'`);
|
|
79
|
-
}
|
|
80
|
-
return new DateDataType();
|
|
81
|
-
}
|
|
82
|
-
toJson() {
|
|
83
|
-
return { type: "date" };
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.DateDataType = DateDataType;
|
|
87
|
-
exports._dataTypes["date"] = DateDataType;
|
|
88
|
-
class FloatDataType extends DataType {
|
|
89
|
-
constructor() {
|
|
90
|
-
super();
|
|
91
|
-
}
|
|
92
|
-
static fromJson(data) {
|
|
93
|
-
if (data.type !== "float") {
|
|
94
|
-
throw new Error(`Expected type 'float', got '${data.type}'`);
|
|
95
|
-
}
|
|
96
|
-
return new FloatDataType();
|
|
97
|
-
}
|
|
98
|
-
toJson() {
|
|
99
|
-
return { type: "float" };
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.FloatDataType = FloatDataType;
|
|
103
|
-
exports._dataTypes["float"] = FloatDataType;
|
|
104
|
-
class VectorDataType extends DataType {
|
|
105
|
-
constructor({ size, elementType }) {
|
|
106
|
-
super();
|
|
107
|
-
this.size = size;
|
|
108
|
-
this.elementType = elementType;
|
|
109
|
-
}
|
|
110
|
-
static fromJson(data) {
|
|
111
|
-
if (data.type !== "vector") {
|
|
112
|
-
throw new Error(`Expected type 'vector', got '${data.type}'`);
|
|
113
|
-
}
|
|
114
|
-
return new VectorDataType({
|
|
115
|
-
size: data.size,
|
|
116
|
-
elementType: DataType.fromJson(data.element_type),
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
toJson() {
|
|
120
|
-
return {
|
|
121
|
-
type: "vector",
|
|
122
|
-
size: this.size,
|
|
123
|
-
element_type: this.elementType.toJson(),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
exports.VectorDataType = VectorDataType;
|
|
128
|
-
exports._dataTypes["vector"] = VectorDataType;
|
|
129
|
-
class TextDataType extends DataType {
|
|
130
|
-
constructor() {
|
|
131
|
-
super();
|
|
132
|
-
}
|
|
133
|
-
static fromJson(data) {
|
|
134
|
-
if (data.type !== "text") {
|
|
135
|
-
throw new Error(`Expected type 'text', got '${data.type}'`);
|
|
136
|
-
}
|
|
137
|
-
return new TextDataType();
|
|
138
|
-
}
|
|
139
|
-
toJson() {
|
|
140
|
-
return { type: "text" };
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.TextDataType = TextDataType;
|
|
144
|
-
exports._dataTypes["text"] = TextDataType;
|
|
145
|
-
class JsonDataType extends DataType {
|
|
146
|
-
constructor() {
|
|
147
|
-
super();
|
|
148
|
-
}
|
|
149
|
-
static fromJson(data) {
|
|
150
|
-
if (data.type !== "json") {
|
|
151
|
-
throw new Error(`Expected type 'json', got '${data.type}'`);
|
|
152
|
-
}
|
|
153
|
-
return new JsonDataType();
|
|
154
|
-
}
|
|
155
|
-
toJson() {
|
|
156
|
-
return { type: "json" };
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.JsonDataType = JsonDataType;
|
|
160
|
-
exports._dataTypes["json"] = JsonDataType;
|
|
161
|
-
class UuidDataType extends DataType {
|
|
162
|
-
constructor() {
|
|
163
|
-
super();
|
|
164
|
-
}
|
|
165
|
-
static fromJson(data) {
|
|
166
|
-
if (data.type !== "uuid") {
|
|
167
|
-
throw new Error(`Expected type 'uuid', got '${data.type}'`);
|
|
168
|
-
}
|
|
169
|
-
return new UuidDataType();
|
|
170
|
-
}
|
|
171
|
-
toJson() {
|
|
172
|
-
return { type: "uuid" };
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
exports.UuidDataType = UuidDataType;
|
|
176
|
-
exports._dataTypes["uuid"] = UuidDataType;
|
|
177
|
-
class BinaryDataType extends DataType {
|
|
178
|
-
constructor() {
|
|
179
|
-
super();
|
|
180
|
-
}
|
|
181
|
-
static fromJson(data) {
|
|
182
|
-
if (data.type !== "binary") {
|
|
183
|
-
throw new Error(`Expected type 'binary', got '${data.type}'`);
|
|
184
|
-
}
|
|
185
|
-
return new BinaryDataType();
|
|
186
|
-
}
|
|
187
|
-
toJson() {
|
|
188
|
-
return { type: "binary" };
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
exports.BinaryDataType = BinaryDataType;
|
|
192
|
-
exports._dataTypes["binary"] = BinaryDataType;
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { DataType } from "./data-types";
|
|
2
|
-
import { RoomClient } from "./room-client";
|
|
3
|
-
export type CreateMode = "create" | "overwrite" | "create_if_not_exists";
|
|
4
|
-
export interface TableRef {
|
|
5
|
-
name: string;
|
|
6
|
-
namespace?: string[];
|
|
7
|
-
alias?: string;
|
|
8
|
-
branch?: string;
|
|
9
|
-
version?: number;
|
|
10
|
-
}
|
|
11
|
-
export interface TableVersion {
|
|
12
|
-
version: number;
|
|
13
|
-
timestamp: Date;
|
|
14
|
-
metadata: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
export interface TableIndex {
|
|
17
|
-
name: string;
|
|
18
|
-
columns: string[];
|
|
19
|
-
type: string;
|
|
20
|
-
}
|
|
21
|
-
export interface TableBranch {
|
|
22
|
-
name: string;
|
|
23
|
-
parentBranch: string | null;
|
|
24
|
-
parentVersion: number | null;
|
|
25
|
-
createdAt: Date | null;
|
|
26
|
-
manifestSize: number | null;
|
|
27
|
-
}
|
|
28
|
-
export declare abstract class DatabaseValueEncoder {
|
|
29
|
-
abstract encodeDatabaseValue(): unknown;
|
|
30
|
-
}
|
|
31
|
-
export declare class DatabaseExpression extends DatabaseValueEncoder {
|
|
32
|
-
readonly expression: string;
|
|
33
|
-
constructor(expression: string);
|
|
34
|
-
encodeDatabaseValue(): Record<string, string>;
|
|
35
|
-
toString(): string;
|
|
36
|
-
}
|
|
37
|
-
export declare class DatabaseDate extends DatabaseValueEncoder {
|
|
38
|
-
readonly value: string;
|
|
39
|
-
constructor(value: string);
|
|
40
|
-
encodeDatabaseValue(): Record<string, string>;
|
|
41
|
-
toString(): string;
|
|
42
|
-
}
|
|
43
|
-
export type DatabaseJsonScalarValue = null | boolean | number | string;
|
|
44
|
-
export type DatabaseJsonValue = DatabaseJsonScalarValue | DatabaseJsonValue[] | {
|
|
45
|
-
[key: string]: DatabaseJsonValue;
|
|
46
|
-
};
|
|
47
|
-
export declare class DatabaseStruct extends DatabaseValueEncoder {
|
|
48
|
-
readonly fields: Record<string, DatabaseValue>;
|
|
49
|
-
constructor(fields: Record<string, DatabaseValue>);
|
|
50
|
-
toJson(): Record<string, unknown>;
|
|
51
|
-
encodeDatabaseValue(): Record<string, Record<string, unknown>>;
|
|
52
|
-
}
|
|
53
|
-
export declare class DatabaseJson extends DatabaseValueEncoder {
|
|
54
|
-
readonly value: DatabaseJsonValue;
|
|
55
|
-
constructor(value: DatabaseJsonValue);
|
|
56
|
-
toJson(): DatabaseJsonValue;
|
|
57
|
-
encodeDatabaseValue(): Record<string, DatabaseJsonValue>;
|
|
58
|
-
}
|
|
59
|
-
export type DatabaseScalarValue = null | boolean | number | string | Uint8Array | DatabaseUuid | Date;
|
|
60
|
-
export type DatabaseValue = DatabaseScalarValue | DatabaseValueEncoder | DatabaseValue[];
|
|
61
|
-
export type DatabaseRecord = Record<string, DatabaseValue>;
|
|
62
|
-
export type DatabaseRows = DatabaseRecord[];
|
|
63
|
-
export type DatabaseRowChunks = AsyncIterable<DatabaseRows> | Iterable<DatabaseRows>;
|
|
64
|
-
export type DatabaseWhere = string | Record<string, DatabaseValue>;
|
|
65
|
-
type DatabaseRoomInvoker = Pick<RoomClient, "invoke" | "invokeStream">;
|
|
66
|
-
export declare class DatabaseUuid {
|
|
67
|
-
readonly value: string;
|
|
68
|
-
constructor(value: string);
|
|
69
|
-
toString(): string;
|
|
70
|
-
}
|
|
71
|
-
export declare class DatabaseClient {
|
|
72
|
-
private room;
|
|
73
|
-
constructor({ room }: {
|
|
74
|
-
room: DatabaseRoomInvoker;
|
|
75
|
-
});
|
|
76
|
-
private _unexpectedResponseError;
|
|
77
|
-
private invoke;
|
|
78
|
-
private invokeStream;
|
|
79
|
-
private drainWriteStream;
|
|
80
|
-
private streamRows;
|
|
81
|
-
listTables({ namespace, branch }?: {
|
|
82
|
-
namespace?: string[];
|
|
83
|
-
branch?: string;
|
|
84
|
-
}): Promise<string[]>;
|
|
85
|
-
private createTable;
|
|
86
|
-
createTableWithSchema({ name, schema, data, mode, namespace, branch, metadata }: {
|
|
87
|
-
name: string;
|
|
88
|
-
schema?: Record<string, DataType>;
|
|
89
|
-
data?: DatabaseRows;
|
|
90
|
-
mode?: CreateMode;
|
|
91
|
-
namespace?: string[];
|
|
92
|
-
branch?: string;
|
|
93
|
-
metadata?: Record<string, unknown>;
|
|
94
|
-
}): Promise<void>;
|
|
95
|
-
createTableFromData({ name, data, mode, namespace, branch, metadata }: {
|
|
96
|
-
name: string;
|
|
97
|
-
data?: DatabaseRows;
|
|
98
|
-
mode?: CreateMode;
|
|
99
|
-
namespace?: string[];
|
|
100
|
-
branch?: string;
|
|
101
|
-
metadata?: Record<string, unknown>;
|
|
102
|
-
}): Promise<void>;
|
|
103
|
-
createTableFromDataStream({ name, chunks, schema, mode, namespace, branch, metadata }: {
|
|
104
|
-
name: string;
|
|
105
|
-
chunks: DatabaseRowChunks;
|
|
106
|
-
schema?: Record<string, DataType>;
|
|
107
|
-
mode?: CreateMode;
|
|
108
|
-
namespace?: string[];
|
|
109
|
-
branch?: string;
|
|
110
|
-
metadata?: Record<string, unknown>;
|
|
111
|
-
}): Promise<void>;
|
|
112
|
-
dropTable({ name, ignoreMissing, namespace, branch }: {
|
|
113
|
-
name: string;
|
|
114
|
-
ignoreMissing?: boolean;
|
|
115
|
-
namespace?: string[];
|
|
116
|
-
branch?: string;
|
|
117
|
-
}): Promise<void>;
|
|
118
|
-
dropIndex({ table, name, namespace, branch }: {
|
|
119
|
-
table: string;
|
|
120
|
-
name: string;
|
|
121
|
-
namespace?: string[];
|
|
122
|
-
branch?: string;
|
|
123
|
-
}): Promise<void>;
|
|
124
|
-
addColumns({ table, newColumns, namespace, branch }: {
|
|
125
|
-
table: string;
|
|
126
|
-
newColumns: Record<string, string | DataType>;
|
|
127
|
-
namespace?: string[];
|
|
128
|
-
branch?: string;
|
|
129
|
-
}): Promise<void>;
|
|
130
|
-
dropColumns({ table, columns, namespace, branch }: {
|
|
131
|
-
table: string;
|
|
132
|
-
columns: string[];
|
|
133
|
-
namespace?: string[];
|
|
134
|
-
branch?: string;
|
|
135
|
-
}): Promise<void>;
|
|
136
|
-
insert({ table, records, namespace, branch }: {
|
|
137
|
-
table: string;
|
|
138
|
-
records: DatabaseRows;
|
|
139
|
-
namespace?: string[];
|
|
140
|
-
branch?: string;
|
|
141
|
-
}): Promise<void>;
|
|
142
|
-
insertStream({ table, chunks, namespace, branch }: {
|
|
143
|
-
table: string;
|
|
144
|
-
chunks: DatabaseRowChunks;
|
|
145
|
-
namespace?: string[];
|
|
146
|
-
branch?: string;
|
|
147
|
-
}): Promise<void>;
|
|
148
|
-
update({ table, where, values, namespace, branch }: {
|
|
149
|
-
table: string;
|
|
150
|
-
where: string;
|
|
151
|
-
values: DatabaseRecord;
|
|
152
|
-
namespace?: string[];
|
|
153
|
-
branch?: string;
|
|
154
|
-
}): Promise<void>;
|
|
155
|
-
delete({ table, where, namespace, branch }: {
|
|
156
|
-
table: string;
|
|
157
|
-
where: string;
|
|
158
|
-
namespace?: string[];
|
|
159
|
-
branch?: string;
|
|
160
|
-
}): Promise<void>;
|
|
161
|
-
merge({ table, on, records, namespace, branch }: {
|
|
162
|
-
table: string;
|
|
163
|
-
on: string;
|
|
164
|
-
records: DatabaseRows;
|
|
165
|
-
namespace?: string[];
|
|
166
|
-
branch?: string;
|
|
167
|
-
}): Promise<void>;
|
|
168
|
-
mergeStream({ table, on, chunks, namespace, branch }: {
|
|
169
|
-
table: string;
|
|
170
|
-
on: string;
|
|
171
|
-
chunks: DatabaseRowChunks;
|
|
172
|
-
namespace?: string[];
|
|
173
|
-
branch?: string;
|
|
174
|
-
}): Promise<void>;
|
|
175
|
-
sql({ query, tables, params }: {
|
|
176
|
-
query: string;
|
|
177
|
-
tables: Array<TableRef | string>;
|
|
178
|
-
params?: DatabaseRecord;
|
|
179
|
-
}): Promise<DatabaseRows>;
|
|
180
|
-
sqlStream({ query, tables, params }: {
|
|
181
|
-
query: string;
|
|
182
|
-
tables: Array<TableRef | string>;
|
|
183
|
-
params?: DatabaseRecord;
|
|
184
|
-
}): AsyncIterable<DatabaseRows>;
|
|
185
|
-
search({ table, text, vector, where, offset, limit, select, namespace, branch, version }: {
|
|
186
|
-
table: string;
|
|
187
|
-
text?: string;
|
|
188
|
-
vector?: number[];
|
|
189
|
-
where?: DatabaseWhere;
|
|
190
|
-
offset?: number;
|
|
191
|
-
limit?: number;
|
|
192
|
-
select?: string[];
|
|
193
|
-
namespace?: string[];
|
|
194
|
-
branch?: string;
|
|
195
|
-
version?: number;
|
|
196
|
-
}): Promise<DatabaseRows>;
|
|
197
|
-
searchStream({ table, text, vector, where, offset, limit, select, namespace, branch, version }: {
|
|
198
|
-
table: string;
|
|
199
|
-
text?: string;
|
|
200
|
-
vector?: number[];
|
|
201
|
-
where?: DatabaseWhere;
|
|
202
|
-
offset?: number;
|
|
203
|
-
limit?: number;
|
|
204
|
-
select?: string[];
|
|
205
|
-
namespace?: string[];
|
|
206
|
-
branch?: string;
|
|
207
|
-
version?: number;
|
|
208
|
-
}): AsyncIterable<DatabaseRows>;
|
|
209
|
-
count({ table, text, vector, where, namespace, branch, version }: {
|
|
210
|
-
table: string;
|
|
211
|
-
text?: string;
|
|
212
|
-
vector?: number[];
|
|
213
|
-
where?: DatabaseWhere;
|
|
214
|
-
namespace?: string[];
|
|
215
|
-
branch?: string;
|
|
216
|
-
version?: number;
|
|
217
|
-
}): Promise<number>;
|
|
218
|
-
inspect({ table, namespace, branch, version }: {
|
|
219
|
-
table: string;
|
|
220
|
-
namespace?: string[];
|
|
221
|
-
branch?: string;
|
|
222
|
-
version?: number;
|
|
223
|
-
}): Promise<Record<string, DataType>>;
|
|
224
|
-
optimize(table: string): Promise<void>;
|
|
225
|
-
optimize(params: {
|
|
226
|
-
table: string;
|
|
227
|
-
namespace?: string[];
|
|
228
|
-
branch?: string;
|
|
229
|
-
}): Promise<void>;
|
|
230
|
-
restore({ table, version, namespace, branch }: {
|
|
231
|
-
table: string;
|
|
232
|
-
version: number;
|
|
233
|
-
namespace?: string[];
|
|
234
|
-
branch?: string;
|
|
235
|
-
}): Promise<void>;
|
|
236
|
-
listVersions({ table, namespace, branch }: {
|
|
237
|
-
table: string;
|
|
238
|
-
namespace?: string[];
|
|
239
|
-
branch?: string;
|
|
240
|
-
}): Promise<TableVersion[]>;
|
|
241
|
-
createVectorIndex({ table, column, replace, namespace, branch }: {
|
|
242
|
-
table: string;
|
|
243
|
-
column: string;
|
|
244
|
-
replace?: boolean;
|
|
245
|
-
namespace?: string[];
|
|
246
|
-
branch?: string;
|
|
247
|
-
}): Promise<void>;
|
|
248
|
-
createScalarIndex({ table, column, replace, namespace, branch }: {
|
|
249
|
-
table: string;
|
|
250
|
-
column: string;
|
|
251
|
-
replace?: boolean;
|
|
252
|
-
namespace?: string[];
|
|
253
|
-
branch?: string;
|
|
254
|
-
}): Promise<void>;
|
|
255
|
-
createFullTextSearchIndex({ table, column, replace, namespace, branch }: {
|
|
256
|
-
table: string;
|
|
257
|
-
column: string;
|
|
258
|
-
replace?: boolean;
|
|
259
|
-
namespace?: string[];
|
|
260
|
-
branch?: string;
|
|
261
|
-
}): Promise<void>;
|
|
262
|
-
listIndexes({ table, namespace, branch, version }: {
|
|
263
|
-
table: string;
|
|
264
|
-
namespace?: string[];
|
|
265
|
-
branch?: string;
|
|
266
|
-
version?: number;
|
|
267
|
-
}): Promise<TableIndex[]>;
|
|
268
|
-
listBranches({ namespace }?: {
|
|
269
|
-
namespace?: string[];
|
|
270
|
-
}): Promise<TableBranch[]>;
|
|
271
|
-
createBranch({ branch, fromBranch, namespace }: {
|
|
272
|
-
branch: string;
|
|
273
|
-
fromBranch?: string;
|
|
274
|
-
namespace?: string[];
|
|
275
|
-
}): Promise<void>;
|
|
276
|
-
deleteBranch({ branch, namespace }: {
|
|
277
|
-
branch: string;
|
|
278
|
-
namespace?: string[];
|
|
279
|
-
}): Promise<void>;
|
|
280
|
-
}
|
|
281
|
-
export {};
|