@synapcores/sdk 0.1.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/LICENSE +21 -0
- package/README.md +1011 -0
- package/dist/index.d.mts +2473 -0
- package/dist/index.d.ts +2473 -0
- package/dist/index.js +3109 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3055 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +78 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2473 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
export { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Type definitions for collections
|
|
7
|
+
*/
|
|
8
|
+
interface Document {
|
|
9
|
+
id?: string;
|
|
10
|
+
data: Record<string, any>;
|
|
11
|
+
score?: number;
|
|
12
|
+
metadata?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
interface SearchResult {
|
|
15
|
+
documents: Document[];
|
|
16
|
+
total: number;
|
|
17
|
+
tookMs: number;
|
|
18
|
+
nextOffset?: number;
|
|
19
|
+
}
|
|
20
|
+
interface SearchOptions {
|
|
21
|
+
query?: string;
|
|
22
|
+
topK?: number;
|
|
23
|
+
filter?: Record<string, any>;
|
|
24
|
+
includeMetadata?: boolean;
|
|
25
|
+
offset?: number;
|
|
26
|
+
}
|
|
27
|
+
interface VectorSearchOptions$1 {
|
|
28
|
+
vector: number[];
|
|
29
|
+
field?: string;
|
|
30
|
+
topK?: number;
|
|
31
|
+
filter?: Record<string, any>;
|
|
32
|
+
distanceMetric?: 'cosine' | 'euclidean' | 'dot_product';
|
|
33
|
+
includeMetadata?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface QueryOptions {
|
|
36
|
+
filter?: Record<string, any>;
|
|
37
|
+
limit?: number;
|
|
38
|
+
offset?: number;
|
|
39
|
+
sort?: Array<{
|
|
40
|
+
field: string;
|
|
41
|
+
order: 'asc' | 'desc';
|
|
42
|
+
}>;
|
|
43
|
+
projection?: string[];
|
|
44
|
+
}
|
|
45
|
+
interface InsertResult {
|
|
46
|
+
ids: string[];
|
|
47
|
+
inserted: number;
|
|
48
|
+
}
|
|
49
|
+
interface UpdateOptions {
|
|
50
|
+
merge?: boolean;
|
|
51
|
+
}
|
|
52
|
+
type FieldType = 'string' | 'integer' | 'float' | 'boolean' | 'date' | 'datetime' | 'json' | 'vector' | 'text' | 'binary';
|
|
53
|
+
interface SchemaField {
|
|
54
|
+
name: string;
|
|
55
|
+
type: FieldType | `vector[${number}]`;
|
|
56
|
+
indexed?: boolean;
|
|
57
|
+
required?: boolean;
|
|
58
|
+
unique?: boolean;
|
|
59
|
+
default?: any;
|
|
60
|
+
description?: string;
|
|
61
|
+
}
|
|
62
|
+
interface CollectionSchema {
|
|
63
|
+
fields: SchemaField[];
|
|
64
|
+
primaryKey?: string;
|
|
65
|
+
vectorFields?: string[];
|
|
66
|
+
}
|
|
67
|
+
interface CollectionStats {
|
|
68
|
+
name: string;
|
|
69
|
+
documentCount: number;
|
|
70
|
+
sizeBytes: number;
|
|
71
|
+
indexCount: number;
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
updatedAt: Date;
|
|
74
|
+
}
|
|
75
|
+
interface IndexOptions {
|
|
76
|
+
field: string;
|
|
77
|
+
type?: 'btree' | 'hash' | 'vector';
|
|
78
|
+
options?: Record<string, any>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Type definitions for real-time subscriptions
|
|
83
|
+
*/
|
|
84
|
+
type ChangeOperation = 'insert' | 'update' | 'delete';
|
|
85
|
+
interface SubscriptionEvent {
|
|
86
|
+
operation: ChangeOperation;
|
|
87
|
+
collection: string;
|
|
88
|
+
document: Document;
|
|
89
|
+
timestamp: Date;
|
|
90
|
+
sequence: number;
|
|
91
|
+
}
|
|
92
|
+
interface SubscriptionOptions {
|
|
93
|
+
filter?: Record<string, any>;
|
|
94
|
+
onChange?: (event: SubscriptionEvent) => void | Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Real-time subscription support for SynapCores SDK
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
declare class Subscription extends EventEmitter {
|
|
102
|
+
private readonly collection;
|
|
103
|
+
private readonly options;
|
|
104
|
+
private ws?;
|
|
105
|
+
private running;
|
|
106
|
+
private reconnectTimeout?;
|
|
107
|
+
private reconnectAttempts;
|
|
108
|
+
private readonly maxReconnectAttempts;
|
|
109
|
+
private readonly reconnectDelay;
|
|
110
|
+
constructor(collection: Collection, options?: SubscriptionOptions);
|
|
111
|
+
connect(): Promise<void>;
|
|
112
|
+
private createConnection;
|
|
113
|
+
private subscribe;
|
|
114
|
+
private handleMessage;
|
|
115
|
+
private scheduleReconnect;
|
|
116
|
+
close(): Promise<void>;
|
|
117
|
+
[Symbol.asyncIterator](): AsyncIterator<SubscriptionEvent>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Collection class for SynapCores SDK
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
declare class Collection {
|
|
125
|
+
private readonly client;
|
|
126
|
+
readonly name: string;
|
|
127
|
+
readonly schema?: Record<string, any> | undefined;
|
|
128
|
+
constructor(client: SynapCores, name: string, schema?: Record<string, any> | undefined);
|
|
129
|
+
private get basePath();
|
|
130
|
+
insert(documents: Record<string, any> | Record<string, any>[], _autoEmbed?: boolean): Promise<InsertResult>;
|
|
131
|
+
get(documentId: string): Promise<Document | null>;
|
|
132
|
+
update(documentId: string, data: Record<string, any>, options?: UpdateOptions): Promise<Document>;
|
|
133
|
+
delete(documentId: string | string[]): Promise<{
|
|
134
|
+
deleted: number;
|
|
135
|
+
}>;
|
|
136
|
+
search(options: SearchOptions): Promise<SearchResult>;
|
|
137
|
+
vectorSearch(options: VectorSearchOptions$1): Promise<SearchResult>;
|
|
138
|
+
query(options?: QueryOptions): Promise<SearchResult>;
|
|
139
|
+
count(filter?: Record<string, any>): Promise<number>;
|
|
140
|
+
stats(): Promise<CollectionStats>;
|
|
141
|
+
createIndex(options: IndexOptions): Promise<{
|
|
142
|
+
created: boolean;
|
|
143
|
+
}>;
|
|
144
|
+
dropIndex(field: string): Promise<{
|
|
145
|
+
dropped: boolean;
|
|
146
|
+
}>;
|
|
147
|
+
subscribe(options?: SubscriptionOptions): Promise<Subscription>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Type definitions for AutoML
|
|
152
|
+
*/
|
|
153
|
+
interface ModelInfo {
|
|
154
|
+
id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
task: 'regression' | 'classification' | 'clustering';
|
|
157
|
+
status: 'training' | 'ready' | 'failed';
|
|
158
|
+
accuracy?: number;
|
|
159
|
+
createdAt: Date;
|
|
160
|
+
updatedAt?: Date;
|
|
161
|
+
config: Record<string, any>;
|
|
162
|
+
}
|
|
163
|
+
interface TrainOptions {
|
|
164
|
+
collection: string;
|
|
165
|
+
target: string;
|
|
166
|
+
features?: string[];
|
|
167
|
+
task?: 'auto' | 'regression' | 'classification';
|
|
168
|
+
name?: string;
|
|
169
|
+
config?: Record<string, any>;
|
|
170
|
+
validationSplit?: number;
|
|
171
|
+
maxTrials?: number;
|
|
172
|
+
timeoutMinutes?: number;
|
|
173
|
+
}
|
|
174
|
+
interface PredictResult {
|
|
175
|
+
predictions: any[];
|
|
176
|
+
confidence?: number[];
|
|
177
|
+
}
|
|
178
|
+
interface EvaluationResult {
|
|
179
|
+
accuracy?: number;
|
|
180
|
+
precision?: number;
|
|
181
|
+
recall?: number;
|
|
182
|
+
f1Score?: number;
|
|
183
|
+
mse?: number;
|
|
184
|
+
rmse?: number;
|
|
185
|
+
mae?: number;
|
|
186
|
+
r2?: number;
|
|
187
|
+
confusionMatrix?: number[][];
|
|
188
|
+
}
|
|
189
|
+
interface AsyncTrainOptions extends TrainOptions {
|
|
190
|
+
/** Enable async training */
|
|
191
|
+
async?: boolean;
|
|
192
|
+
/** Callback URL for completion notification */
|
|
193
|
+
callback_url?: string;
|
|
194
|
+
/** Webhook for progress updates */
|
|
195
|
+
webhook_url?: string;
|
|
196
|
+
}
|
|
197
|
+
interface TrainingJob {
|
|
198
|
+
/** Job ID */
|
|
199
|
+
id: string;
|
|
200
|
+
/** Model name */
|
|
201
|
+
name: string;
|
|
202
|
+
/** Training status */
|
|
203
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
204
|
+
/** Progress percentage (0-100) */
|
|
205
|
+
progress: number;
|
|
206
|
+
/** Current phase */
|
|
207
|
+
phase?: string;
|
|
208
|
+
/** Model task type */
|
|
209
|
+
task: 'regression' | 'classification' | 'clustering' | 'auto';
|
|
210
|
+
/** Current trial number */
|
|
211
|
+
current_trial?: number;
|
|
212
|
+
/** Total trials */
|
|
213
|
+
total_trials?: number;
|
|
214
|
+
/** Best accuracy so far */
|
|
215
|
+
best_accuracy?: number;
|
|
216
|
+
/** Estimated time remaining (ms) */
|
|
217
|
+
eta_ms?: number;
|
|
218
|
+
/** Error message if failed */
|
|
219
|
+
error?: string;
|
|
220
|
+
/** Started timestamp */
|
|
221
|
+
started_at: Date;
|
|
222
|
+
/** Completed timestamp */
|
|
223
|
+
completed_at?: Date;
|
|
224
|
+
/** Model ID (when completed) */
|
|
225
|
+
model_id?: string;
|
|
226
|
+
}
|
|
227
|
+
interface TrainingMetrics {
|
|
228
|
+
/** Trial number */
|
|
229
|
+
trial: number;
|
|
230
|
+
/** Accuracy */
|
|
231
|
+
accuracy?: number;
|
|
232
|
+
/** Loss */
|
|
233
|
+
loss?: number;
|
|
234
|
+
/** Additional metrics */
|
|
235
|
+
metrics?: Record<string, number>;
|
|
236
|
+
/** Timestamp */
|
|
237
|
+
timestamp: Date;
|
|
238
|
+
}
|
|
239
|
+
interface ListTrainingJobsOptions {
|
|
240
|
+
/** Filter by status */
|
|
241
|
+
status?: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
242
|
+
/** Page number */
|
|
243
|
+
page?: number;
|
|
244
|
+
/** Page size */
|
|
245
|
+
page_size?: number;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* AutoML client for SynapCores SDK
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
declare class AutoMLModel {
|
|
253
|
+
private readonly client;
|
|
254
|
+
readonly info: ModelInfo;
|
|
255
|
+
constructor(client: AutoMLClient, info: ModelInfo);
|
|
256
|
+
get id(): string;
|
|
257
|
+
get name(): string;
|
|
258
|
+
predict(data: Record<string, any> | Record<string, any>[]): Promise<any | any[]>;
|
|
259
|
+
evaluate(testData: string | Record<string, any>[], target?: string): Promise<EvaluationResult>;
|
|
260
|
+
delete(): Promise<void>;
|
|
261
|
+
}
|
|
262
|
+
declare class AutoMLClient {
|
|
263
|
+
readonly synapCores: SynapCores;
|
|
264
|
+
constructor(synapCores: SynapCores);
|
|
265
|
+
train(options: TrainOptions): Promise<AutoMLModel>;
|
|
266
|
+
getModel(modelId: string): Promise<AutoMLModel>;
|
|
267
|
+
listModels(filters?: {
|
|
268
|
+
task?: string;
|
|
269
|
+
status?: string;
|
|
270
|
+
}): Promise<ModelInfo[]>;
|
|
271
|
+
/**
|
|
272
|
+
* Start async training job
|
|
273
|
+
*/
|
|
274
|
+
trainAsync(options: AsyncTrainOptions): Promise<TrainingJob>;
|
|
275
|
+
/**
|
|
276
|
+
* Get training job status
|
|
277
|
+
*/
|
|
278
|
+
getTrainingJob(jobId: string): Promise<TrainingJob>;
|
|
279
|
+
/**
|
|
280
|
+
* List training jobs
|
|
281
|
+
*/
|
|
282
|
+
listTrainingJobs(options?: ListTrainingJobsOptions): Promise<TrainingJob[]>;
|
|
283
|
+
/**
|
|
284
|
+
* Cancel a training job
|
|
285
|
+
*/
|
|
286
|
+
cancelTrainingJob(jobId: string): Promise<void>;
|
|
287
|
+
/**
|
|
288
|
+
* Get training metrics for a job
|
|
289
|
+
*/
|
|
290
|
+
getTrainingMetrics(jobId: string): Promise<TrainingMetrics[]>;
|
|
291
|
+
/**
|
|
292
|
+
* Wait for training job to complete
|
|
293
|
+
*/
|
|
294
|
+
waitForTrainingJob(jobId: string, options?: {
|
|
295
|
+
pollInterval?: number;
|
|
296
|
+
timeout?: number;
|
|
297
|
+
onProgress?: (job: TrainingJob) => void;
|
|
298
|
+
}): Promise<AutoMLModel>;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Type definitions for NLP operations
|
|
303
|
+
*/
|
|
304
|
+
interface Sentiment {
|
|
305
|
+
label: 'positive' | 'negative' | 'neutral';
|
|
306
|
+
score: number;
|
|
307
|
+
confidence: number;
|
|
308
|
+
}
|
|
309
|
+
interface Entity {
|
|
310
|
+
text: string;
|
|
311
|
+
type: string;
|
|
312
|
+
start: number;
|
|
313
|
+
end: number;
|
|
314
|
+
score: number;
|
|
315
|
+
}
|
|
316
|
+
interface NLPAnalysis {
|
|
317
|
+
sentiment?: Sentiment;
|
|
318
|
+
entities?: Entity[];
|
|
319
|
+
summary?: string;
|
|
320
|
+
keywords?: string[];
|
|
321
|
+
language?: string;
|
|
322
|
+
}
|
|
323
|
+
interface AnalyzeOptions {
|
|
324
|
+
text: string | string[];
|
|
325
|
+
tasks?: Array<'sentiment' | 'entities' | 'summary' | 'keywords'>;
|
|
326
|
+
language?: string;
|
|
327
|
+
}
|
|
328
|
+
interface SummarizeOptions {
|
|
329
|
+
text: string;
|
|
330
|
+
maxLength?: number;
|
|
331
|
+
minLength?: number;
|
|
332
|
+
}
|
|
333
|
+
interface ClassifyOptions {
|
|
334
|
+
text: string | string[];
|
|
335
|
+
categories: string[];
|
|
336
|
+
multiLabel?: boolean;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* NLP client for SynapCores SDK
|
|
341
|
+
*/
|
|
342
|
+
|
|
343
|
+
declare class NLPClient {
|
|
344
|
+
private readonly synapCores;
|
|
345
|
+
constructor(synapCores: SynapCores);
|
|
346
|
+
analyze(options: AnalyzeOptions): Promise<NLPAnalysis | NLPAnalysis[]>;
|
|
347
|
+
summarize(options: SummarizeOptions): Promise<string>;
|
|
348
|
+
extractEntities(text: string, entityTypes?: string[]): Promise<Entity[]>;
|
|
349
|
+
sentiment(text: string | string[]): Promise<Sentiment | Sentiment[]>;
|
|
350
|
+
classify(options: ClassifyOptions): Promise<Record<string, number> | Record<string, number>[]>;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Recipe Management Types
|
|
355
|
+
*/
|
|
356
|
+
interface RecipeInfo {
|
|
357
|
+
/** Recipe ID */
|
|
358
|
+
id: string;
|
|
359
|
+
/** Recipe name */
|
|
360
|
+
name: string;
|
|
361
|
+
/** Recipe description */
|
|
362
|
+
description: string;
|
|
363
|
+
/** Recipe category */
|
|
364
|
+
category: string;
|
|
365
|
+
/** Recipe tags */
|
|
366
|
+
tags: string[];
|
|
367
|
+
/** Creation timestamp */
|
|
368
|
+
created_at: Date;
|
|
369
|
+
/** Last update timestamp */
|
|
370
|
+
updated_at: Date;
|
|
371
|
+
/** Author/creator */
|
|
372
|
+
author?: string;
|
|
373
|
+
/** Execution count */
|
|
374
|
+
execution_count?: number;
|
|
375
|
+
}
|
|
376
|
+
interface Recipe extends RecipeInfo {
|
|
377
|
+
/** Recipe content (markdown) */
|
|
378
|
+
content: string;
|
|
379
|
+
/** Recipe parameters */
|
|
380
|
+
parameters?: RecipeParameter[];
|
|
381
|
+
/** Recipe version */
|
|
382
|
+
version?: string;
|
|
383
|
+
}
|
|
384
|
+
interface RecipeParameter {
|
|
385
|
+
/** Parameter name */
|
|
386
|
+
name: string;
|
|
387
|
+
/** Parameter type */
|
|
388
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
389
|
+
/** Parameter description */
|
|
390
|
+
description?: string;
|
|
391
|
+
/** Whether parameter is required */
|
|
392
|
+
required?: boolean;
|
|
393
|
+
/** Default value */
|
|
394
|
+
default?: any;
|
|
395
|
+
/** Validation pattern (for strings) */
|
|
396
|
+
pattern?: string;
|
|
397
|
+
}
|
|
398
|
+
interface CreateRecipeOptions {
|
|
399
|
+
/** Recipe name */
|
|
400
|
+
name: string;
|
|
401
|
+
/** Recipe description */
|
|
402
|
+
description: string;
|
|
403
|
+
/** Recipe category */
|
|
404
|
+
category: string;
|
|
405
|
+
/** Recipe content (markdown) */
|
|
406
|
+
content: string;
|
|
407
|
+
/** Recipe tags */
|
|
408
|
+
tags?: string[];
|
|
409
|
+
/** Recipe parameters */
|
|
410
|
+
parameters?: RecipeParameter[];
|
|
411
|
+
}
|
|
412
|
+
interface ListRecipesOptions {
|
|
413
|
+
/** Filter by category */
|
|
414
|
+
category?: string;
|
|
415
|
+
/** Filter by tags */
|
|
416
|
+
tags?: string[];
|
|
417
|
+
/** Search query */
|
|
418
|
+
search?: string;
|
|
419
|
+
/** Page number */
|
|
420
|
+
page?: number;
|
|
421
|
+
/** Page size */
|
|
422
|
+
page_size?: number;
|
|
423
|
+
}
|
|
424
|
+
interface ExecuteRecipeOptions {
|
|
425
|
+
/** Recipe ID or name */
|
|
426
|
+
recipe: string;
|
|
427
|
+
/** Recipe parameters */
|
|
428
|
+
parameters?: Record<string, any>;
|
|
429
|
+
/** Dry run (don't execute, just validate) */
|
|
430
|
+
dry_run?: boolean;
|
|
431
|
+
}
|
|
432
|
+
interface RecipeExecutionResult {
|
|
433
|
+
/** Execution ID */
|
|
434
|
+
id: string;
|
|
435
|
+
/** Whether execution succeeded */
|
|
436
|
+
success: boolean;
|
|
437
|
+
/** Results from SQL execution */
|
|
438
|
+
results?: any[];
|
|
439
|
+
/** Error message if failed */
|
|
440
|
+
error?: string;
|
|
441
|
+
/** Execution time in milliseconds */
|
|
442
|
+
execution_time_ms: number;
|
|
443
|
+
/** Number of statements executed */
|
|
444
|
+
statements_executed: number;
|
|
445
|
+
}
|
|
446
|
+
interface GenerateRecipeOptions {
|
|
447
|
+
/** User's intent/description */
|
|
448
|
+
intent: string;
|
|
449
|
+
/** Recipe category */
|
|
450
|
+
category: string;
|
|
451
|
+
/** Optional context about database schema */
|
|
452
|
+
context?: string;
|
|
453
|
+
}
|
|
454
|
+
interface GeneratedRecipe {
|
|
455
|
+
/** Generated recipe name */
|
|
456
|
+
name: string;
|
|
457
|
+
/** Generated recipe description */
|
|
458
|
+
description: string;
|
|
459
|
+
/** Generated recipe content (markdown) */
|
|
460
|
+
content: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Recipe Management Client for SynapCores SDK
|
|
465
|
+
*/
|
|
466
|
+
|
|
467
|
+
declare class RecipeClient {
|
|
468
|
+
private readonly synapCores;
|
|
469
|
+
constructor(synapCores: SynapCores);
|
|
470
|
+
/**
|
|
471
|
+
* Create a new recipe
|
|
472
|
+
*/
|
|
473
|
+
create(options: CreateRecipeOptions): Promise<Recipe>;
|
|
474
|
+
/**
|
|
475
|
+
* List recipes with optional filters
|
|
476
|
+
*/
|
|
477
|
+
list(options?: ListRecipesOptions): Promise<RecipeInfo[]>;
|
|
478
|
+
/**
|
|
479
|
+
* Get a specific recipe by ID
|
|
480
|
+
*/
|
|
481
|
+
get(id: string): Promise<Recipe>;
|
|
482
|
+
/**
|
|
483
|
+
* Update an existing recipe
|
|
484
|
+
*/
|
|
485
|
+
update(id: string, updates: Partial<CreateRecipeOptions>): Promise<Recipe>;
|
|
486
|
+
/**
|
|
487
|
+
* Delete a recipe
|
|
488
|
+
*/
|
|
489
|
+
delete(id: string): Promise<void>;
|
|
490
|
+
/**
|
|
491
|
+
* Execute a recipe
|
|
492
|
+
*/
|
|
493
|
+
execute(options: ExecuteRecipeOptions): Promise<RecipeExecutionResult>;
|
|
494
|
+
/**
|
|
495
|
+
* Generate a recipe using AI
|
|
496
|
+
*/
|
|
497
|
+
generate(options: GenerateRecipeOptions): Promise<GeneratedRecipe>;
|
|
498
|
+
/**
|
|
499
|
+
* List available recipe categories
|
|
500
|
+
*/
|
|
501
|
+
listCategories(): Promise<string[]>;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Schema Introspection Types
|
|
506
|
+
*/
|
|
507
|
+
interface TableInfo$1 {
|
|
508
|
+
/** Table name */
|
|
509
|
+
name: string;
|
|
510
|
+
/** Table type */
|
|
511
|
+
type: 'table' | 'view' | 'system';
|
|
512
|
+
/** Number of columns */
|
|
513
|
+
column_count: number;
|
|
514
|
+
/** Number of rows (approximate) */
|
|
515
|
+
row_count?: number;
|
|
516
|
+
/** Table size in bytes */
|
|
517
|
+
size_bytes?: number;
|
|
518
|
+
/** Creation timestamp */
|
|
519
|
+
created_at?: Date;
|
|
520
|
+
/** Last update timestamp */
|
|
521
|
+
updated_at?: Date;
|
|
522
|
+
/** Table comment/description */
|
|
523
|
+
comment?: string;
|
|
524
|
+
}
|
|
525
|
+
interface ColumnInfo {
|
|
526
|
+
/** Column name */
|
|
527
|
+
name: string;
|
|
528
|
+
/** Data type */
|
|
529
|
+
data_type: string;
|
|
530
|
+
/** Whether nullable */
|
|
531
|
+
nullable: boolean;
|
|
532
|
+
/** Default value */
|
|
533
|
+
default_value?: any;
|
|
534
|
+
/** Whether primary key */
|
|
535
|
+
is_primary_key?: boolean;
|
|
536
|
+
/** Whether unique */
|
|
537
|
+
is_unique?: boolean;
|
|
538
|
+
/** Whether indexed */
|
|
539
|
+
is_indexed?: boolean;
|
|
540
|
+
/** Foreign key reference */
|
|
541
|
+
foreign_key?: ForeignKeyReference;
|
|
542
|
+
/** Column comment/description */
|
|
543
|
+
comment?: string;
|
|
544
|
+
/** Column position */
|
|
545
|
+
ordinal_position?: number;
|
|
546
|
+
}
|
|
547
|
+
interface ForeignKeyReference {
|
|
548
|
+
/** Referenced table */
|
|
549
|
+
table: string;
|
|
550
|
+
/** Referenced column */
|
|
551
|
+
column: string;
|
|
552
|
+
/** On delete action */
|
|
553
|
+
on_delete?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
|
|
554
|
+
/** On update action */
|
|
555
|
+
on_update?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
|
|
556
|
+
}
|
|
557
|
+
interface IndexInfo {
|
|
558
|
+
/** Index name */
|
|
559
|
+
name: string;
|
|
560
|
+
/** Table name */
|
|
561
|
+
table: string;
|
|
562
|
+
/** Index type */
|
|
563
|
+
type: 'btree' | 'hash' | 'vector' | 'text';
|
|
564
|
+
/** Indexed columns */
|
|
565
|
+
columns: string[];
|
|
566
|
+
/** Whether unique */
|
|
567
|
+
is_unique: boolean;
|
|
568
|
+
/** Whether primary key */
|
|
569
|
+
is_primary: boolean;
|
|
570
|
+
/** Index size in bytes */
|
|
571
|
+
size_bytes?: number;
|
|
572
|
+
/** Creation timestamp */
|
|
573
|
+
created_at?: Date;
|
|
574
|
+
}
|
|
575
|
+
interface TableSchema {
|
|
576
|
+
/** Table info */
|
|
577
|
+
table: TableInfo$1;
|
|
578
|
+
/** Column definitions */
|
|
579
|
+
columns: ColumnInfo[];
|
|
580
|
+
/** Indexes */
|
|
581
|
+
indexes: IndexInfo[];
|
|
582
|
+
/** Constraints */
|
|
583
|
+
constraints: ConstraintInfo[];
|
|
584
|
+
/** Relationships */
|
|
585
|
+
relationships: RelationshipInfo[];
|
|
586
|
+
}
|
|
587
|
+
interface ConstraintInfo {
|
|
588
|
+
/** Constraint name */
|
|
589
|
+
name: string;
|
|
590
|
+
/** Constraint type */
|
|
591
|
+
type: 'PRIMARY KEY' | 'FOREIGN KEY' | 'UNIQUE' | 'CHECK' | 'NOT NULL';
|
|
592
|
+
/** Columns involved */
|
|
593
|
+
columns: string[];
|
|
594
|
+
/** Check expression (for CHECK constraints) */
|
|
595
|
+
expression?: string;
|
|
596
|
+
/** Referenced table (for FOREIGN KEY) */
|
|
597
|
+
referenced_table?: string;
|
|
598
|
+
/** Referenced columns (for FOREIGN KEY) */
|
|
599
|
+
referenced_columns?: string[];
|
|
600
|
+
}
|
|
601
|
+
interface RelationshipInfo {
|
|
602
|
+
/** Relationship type */
|
|
603
|
+
type: 'one-to-one' | 'one-to-many' | 'many-to-many';
|
|
604
|
+
/** Source table */
|
|
605
|
+
from_table: string;
|
|
606
|
+
/** Source column */
|
|
607
|
+
from_column: string;
|
|
608
|
+
/** Target table */
|
|
609
|
+
to_table: string;
|
|
610
|
+
/** Target column */
|
|
611
|
+
to_column: string;
|
|
612
|
+
/** Relationship name */
|
|
613
|
+
name?: string;
|
|
614
|
+
}
|
|
615
|
+
interface SchemaStatistics {
|
|
616
|
+
/** Total number of tables */
|
|
617
|
+
table_count: number;
|
|
618
|
+
/** Total number of views */
|
|
619
|
+
view_count: number;
|
|
620
|
+
/** Total number of indexes */
|
|
621
|
+
index_count: number;
|
|
622
|
+
/** Total number of relationships */
|
|
623
|
+
relationship_count: number;
|
|
624
|
+
/** Total database size in bytes */
|
|
625
|
+
total_size_bytes: number;
|
|
626
|
+
/** Total row count across all tables */
|
|
627
|
+
total_rows: number;
|
|
628
|
+
/** Database version */
|
|
629
|
+
version?: string;
|
|
630
|
+
/** Last analyzed timestamp */
|
|
631
|
+
analyzed_at?: Date;
|
|
632
|
+
}
|
|
633
|
+
interface ValidationResult {
|
|
634
|
+
/** Whether valid */
|
|
635
|
+
is_valid: boolean;
|
|
636
|
+
/** Validation errors */
|
|
637
|
+
errors: ValidationError$2[];
|
|
638
|
+
/** Validation warnings */
|
|
639
|
+
warnings: ValidationWarning$1[];
|
|
640
|
+
}
|
|
641
|
+
interface ValidationError$2 {
|
|
642
|
+
/** Error type */
|
|
643
|
+
type: string;
|
|
644
|
+
/** Error message */
|
|
645
|
+
message: string;
|
|
646
|
+
/** Location (table.column) */
|
|
647
|
+
location?: string;
|
|
648
|
+
}
|
|
649
|
+
interface ValidationWarning$1 {
|
|
650
|
+
/** Warning type */
|
|
651
|
+
type: string;
|
|
652
|
+
/** Warning message */
|
|
653
|
+
message: string;
|
|
654
|
+
/** Location (table.column) */
|
|
655
|
+
location?: string;
|
|
656
|
+
/** Suggested fix */
|
|
657
|
+
suggestion?: string;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Schema Introspection Client for SynapCores SDK
|
|
662
|
+
*/
|
|
663
|
+
|
|
664
|
+
declare class SchemaClient {
|
|
665
|
+
private readonly synapCores;
|
|
666
|
+
constructor(synapCores: SynapCores);
|
|
667
|
+
/**
|
|
668
|
+
* List all tables in the database
|
|
669
|
+
*/
|
|
670
|
+
listTables(options?: {
|
|
671
|
+
includeSystem?: boolean;
|
|
672
|
+
}): Promise<TableInfo$1[]>;
|
|
673
|
+
/**
|
|
674
|
+
* Get complete schema for a specific table
|
|
675
|
+
*/
|
|
676
|
+
getTable(tableName: string): Promise<TableSchema>;
|
|
677
|
+
/**
|
|
678
|
+
* Get columns for a specific table
|
|
679
|
+
*/
|
|
680
|
+
getColumns(tableName: string): Promise<ColumnInfo[]>;
|
|
681
|
+
/**
|
|
682
|
+
* Get indexes for a specific table
|
|
683
|
+
*/
|
|
684
|
+
getIndexes(tableName: string): Promise<IndexInfo[]>;
|
|
685
|
+
/**
|
|
686
|
+
* Get all relationships in the database
|
|
687
|
+
*/
|
|
688
|
+
getRelationships(): Promise<RelationshipInfo[]>;
|
|
689
|
+
/**
|
|
690
|
+
* Get schema statistics
|
|
691
|
+
*/
|
|
692
|
+
getStatistics(): Promise<SchemaStatistics>;
|
|
693
|
+
/**
|
|
694
|
+
* Validate a schema definition
|
|
695
|
+
*/
|
|
696
|
+
validateSchema(schema: object): Promise<ValidationResult>;
|
|
697
|
+
/**
|
|
698
|
+
* Compare two schemas
|
|
699
|
+
*/
|
|
700
|
+
compareSchemas(schema1: string | object, schema2: string | object): Promise<{
|
|
701
|
+
differences: any[];
|
|
702
|
+
added: string[];
|
|
703
|
+
removed: string[];
|
|
704
|
+
modified: string[];
|
|
705
|
+
}>;
|
|
706
|
+
/**
|
|
707
|
+
* Generate SQL DDL for a table
|
|
708
|
+
*/
|
|
709
|
+
generateDDL(tableName: string): Promise<string>;
|
|
710
|
+
/**
|
|
711
|
+
* Analyze table and update statistics
|
|
712
|
+
*/
|
|
713
|
+
analyzeTable(tableName: string): Promise<void>;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Data Import/Export Types
|
|
718
|
+
*/
|
|
719
|
+
interface ImportOptions {
|
|
720
|
+
/** Target table name */
|
|
721
|
+
table: string;
|
|
722
|
+
/** Data format */
|
|
723
|
+
format: 'csv' | 'json' | 'ndjson';
|
|
724
|
+
/** File path or data content */
|
|
725
|
+
data: string | Buffer;
|
|
726
|
+
/** Import mode */
|
|
727
|
+
mode?: 'insert' | 'upsert' | 'replace';
|
|
728
|
+
/** Column mapping (source -> target) */
|
|
729
|
+
column_mapping?: Record<string, string>;
|
|
730
|
+
/** Skip header row (CSV only) */
|
|
731
|
+
skip_header?: boolean;
|
|
732
|
+
/** CSV delimiter (default: comma) */
|
|
733
|
+
delimiter?: string;
|
|
734
|
+
/** Batch size for inserts */
|
|
735
|
+
batch_size?: number;
|
|
736
|
+
/** Continue on error */
|
|
737
|
+
continue_on_error?: boolean;
|
|
738
|
+
/** Primary key columns for upsert mode */
|
|
739
|
+
primary_keys?: string[];
|
|
740
|
+
}
|
|
741
|
+
interface ImportResult {
|
|
742
|
+
/** Import job ID */
|
|
743
|
+
id: string;
|
|
744
|
+
/** Whether import succeeded */
|
|
745
|
+
success: boolean;
|
|
746
|
+
/** Number of rows processed */
|
|
747
|
+
rows_processed: number;
|
|
748
|
+
/** Number of rows imported */
|
|
749
|
+
rows_imported: number;
|
|
750
|
+
/** Number of rows failed */
|
|
751
|
+
rows_failed: number;
|
|
752
|
+
/** Import duration in milliseconds */
|
|
753
|
+
duration_ms: number;
|
|
754
|
+
/** Errors encountered */
|
|
755
|
+
errors?: ImportError[];
|
|
756
|
+
/** Warnings */
|
|
757
|
+
warnings?: string[];
|
|
758
|
+
}
|
|
759
|
+
interface ImportError {
|
|
760
|
+
/** Row number (1-based) */
|
|
761
|
+
row: number;
|
|
762
|
+
/** Error message */
|
|
763
|
+
message: string;
|
|
764
|
+
/** Raw row data */
|
|
765
|
+
data?: any;
|
|
766
|
+
}
|
|
767
|
+
interface ExportOptions {
|
|
768
|
+
/** Source table or query */
|
|
769
|
+
source: string;
|
|
770
|
+
/** Export format */
|
|
771
|
+
format: 'csv' | 'json' | 'ndjson';
|
|
772
|
+
/** Output destination */
|
|
773
|
+
destination?: 'file' | 'response';
|
|
774
|
+
/** Columns to export (default: all) */
|
|
775
|
+
columns?: string[];
|
|
776
|
+
/** WHERE clause filter */
|
|
777
|
+
filter?: string;
|
|
778
|
+
/** ORDER BY clause */
|
|
779
|
+
order_by?: string;
|
|
780
|
+
/** Limit number of rows */
|
|
781
|
+
limit?: number;
|
|
782
|
+
/** Include header row (CSV only) */
|
|
783
|
+
include_header?: boolean;
|
|
784
|
+
/** CSV delimiter (default: comma) */
|
|
785
|
+
delimiter?: string;
|
|
786
|
+
/** Compression (gzip) */
|
|
787
|
+
compress?: boolean;
|
|
788
|
+
}
|
|
789
|
+
interface ExportResult {
|
|
790
|
+
/** Export job ID */
|
|
791
|
+
id: string;
|
|
792
|
+
/** Whether export succeeded */
|
|
793
|
+
success: boolean;
|
|
794
|
+
/** Number of rows exported */
|
|
795
|
+
rows_exported: number;
|
|
796
|
+
/** Export duration in milliseconds */
|
|
797
|
+
duration_ms: number;
|
|
798
|
+
/** File path (if destination=file) */
|
|
799
|
+
file_path?: string;
|
|
800
|
+
/** Exported data (if destination=response) */
|
|
801
|
+
data?: string | Buffer;
|
|
802
|
+
/** File size in bytes */
|
|
803
|
+
size_bytes?: number;
|
|
804
|
+
/** Download URL (if applicable) */
|
|
805
|
+
download_url?: string;
|
|
806
|
+
/** Expiration time for download URL */
|
|
807
|
+
expires_at?: Date;
|
|
808
|
+
}
|
|
809
|
+
interface ImportJobStatus {
|
|
810
|
+
/** Job ID */
|
|
811
|
+
id: string;
|
|
812
|
+
/** Job status */
|
|
813
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
814
|
+
/** Progress percentage (0-100) */
|
|
815
|
+
progress: number;
|
|
816
|
+
/** Current phase */
|
|
817
|
+
phase?: string;
|
|
818
|
+
/** Rows processed so far */
|
|
819
|
+
rows_processed?: number;
|
|
820
|
+
/** Estimated time remaining (ms) */
|
|
821
|
+
eta_ms?: number;
|
|
822
|
+
/** Error message if failed */
|
|
823
|
+
error?: string;
|
|
824
|
+
/** Started timestamp */
|
|
825
|
+
started_at?: Date;
|
|
826
|
+
/** Completed timestamp */
|
|
827
|
+
completed_at?: Date;
|
|
828
|
+
}
|
|
829
|
+
interface ExportJobStatus {
|
|
830
|
+
/** Job ID */
|
|
831
|
+
id: string;
|
|
832
|
+
/** Job status */
|
|
833
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
834
|
+
/** Progress percentage (0-100) */
|
|
835
|
+
progress: number;
|
|
836
|
+
/** Current phase */
|
|
837
|
+
phase?: string;
|
|
838
|
+
/** Rows exported so far */
|
|
839
|
+
rows_exported?: number;
|
|
840
|
+
/** Estimated time remaining (ms) */
|
|
841
|
+
eta_ms?: number;
|
|
842
|
+
/** Error message if failed */
|
|
843
|
+
error?: string;
|
|
844
|
+
/** Started timestamp */
|
|
845
|
+
started_at?: Date;
|
|
846
|
+
/** Completed timestamp */
|
|
847
|
+
completed_at?: Date;
|
|
848
|
+
}
|
|
849
|
+
interface BulkImportOptions {
|
|
850
|
+
/** Import jobs to execute */
|
|
851
|
+
jobs: ImportOptions[];
|
|
852
|
+
/** Execute jobs in parallel */
|
|
853
|
+
parallel?: boolean;
|
|
854
|
+
/** Stop all on first error */
|
|
855
|
+
stop_on_error?: boolean;
|
|
856
|
+
}
|
|
857
|
+
interface BulkImportResult {
|
|
858
|
+
/** Bulk operation ID */
|
|
859
|
+
id: string;
|
|
860
|
+
/** Whether all imports succeeded */
|
|
861
|
+
success: boolean;
|
|
862
|
+
/** Individual job results */
|
|
863
|
+
results: ImportResult[];
|
|
864
|
+
/** Total rows imported across all jobs */
|
|
865
|
+
total_rows_imported: number;
|
|
866
|
+
/** Total duration in milliseconds */
|
|
867
|
+
total_duration_ms: number;
|
|
868
|
+
}
|
|
869
|
+
interface DataValidationOptions {
|
|
870
|
+
/** Target table */
|
|
871
|
+
table: string;
|
|
872
|
+
/** Data to validate */
|
|
873
|
+
data: any[];
|
|
874
|
+
/** Validation mode */
|
|
875
|
+
mode?: 'strict' | 'lenient';
|
|
876
|
+
/** Check foreign keys */
|
|
877
|
+
check_foreign_keys?: boolean;
|
|
878
|
+
/** Check unique constraints */
|
|
879
|
+
check_unique?: boolean;
|
|
880
|
+
}
|
|
881
|
+
interface DataValidationResult {
|
|
882
|
+
/** Whether data is valid */
|
|
883
|
+
is_valid: boolean;
|
|
884
|
+
/** Validation errors */
|
|
885
|
+
errors: ValidationError$1[];
|
|
886
|
+
/** Validation warnings */
|
|
887
|
+
warnings: ValidationWarning[];
|
|
888
|
+
/** Number of rows validated */
|
|
889
|
+
rows_validated: number;
|
|
890
|
+
}
|
|
891
|
+
interface ValidationError$1 {
|
|
892
|
+
/** Row number */
|
|
893
|
+
row: number;
|
|
894
|
+
/** Column name */
|
|
895
|
+
column?: string;
|
|
896
|
+
/** Error type */
|
|
897
|
+
type: 'type_mismatch' | 'constraint_violation' | 'foreign_key' | 'null_violation' | 'duplicate';
|
|
898
|
+
/** Error message */
|
|
899
|
+
message: string;
|
|
900
|
+
/** Actual value */
|
|
901
|
+
value?: any;
|
|
902
|
+
}
|
|
903
|
+
interface ValidationWarning {
|
|
904
|
+
/** Row number */
|
|
905
|
+
row: number;
|
|
906
|
+
/** Column name */
|
|
907
|
+
column?: string;
|
|
908
|
+
/** Warning type */
|
|
909
|
+
type: string;
|
|
910
|
+
/** Warning message */
|
|
911
|
+
message: string;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Data Import/Export Client for SynapCores SDK
|
|
916
|
+
*/
|
|
917
|
+
|
|
918
|
+
declare class ImportExportClient {
|
|
919
|
+
private readonly synapCores;
|
|
920
|
+
constructor(synapCores: SynapCores);
|
|
921
|
+
/**
|
|
922
|
+
* Import data into a table
|
|
923
|
+
*/
|
|
924
|
+
import(options: ImportOptions): Promise<ImportResult>;
|
|
925
|
+
/**
|
|
926
|
+
* Export data from a table or query
|
|
927
|
+
*/
|
|
928
|
+
export(options: ExportOptions): Promise<ExportResult>;
|
|
929
|
+
/**
|
|
930
|
+
* Get import job status
|
|
931
|
+
*/
|
|
932
|
+
getImportStatus(jobId: string): Promise<ImportJobStatus>;
|
|
933
|
+
/**
|
|
934
|
+
* Get export job status
|
|
935
|
+
*/
|
|
936
|
+
getExportStatus(jobId: string): Promise<ExportJobStatus>;
|
|
937
|
+
/**
|
|
938
|
+
* Cancel an import job
|
|
939
|
+
*/
|
|
940
|
+
cancelImport(jobId: string): Promise<void>;
|
|
941
|
+
/**
|
|
942
|
+
* Cancel an export job
|
|
943
|
+
*/
|
|
944
|
+
cancelExport(jobId: string): Promise<void>;
|
|
945
|
+
/**
|
|
946
|
+
* Import data from multiple sources in bulk
|
|
947
|
+
*/
|
|
948
|
+
bulkImport(options: BulkImportOptions): Promise<BulkImportResult>;
|
|
949
|
+
/**
|
|
950
|
+
* Validate data before import
|
|
951
|
+
*/
|
|
952
|
+
validateData(options: DataValidationOptions): Promise<DataValidationResult>;
|
|
953
|
+
/**
|
|
954
|
+
* Get import template for a table
|
|
955
|
+
*/
|
|
956
|
+
getImportTemplate(tableName: string, format?: 'csv' | 'json'): Promise<string>;
|
|
957
|
+
/**
|
|
958
|
+
* List import/export jobs
|
|
959
|
+
*/
|
|
960
|
+
listJobs(options?: {
|
|
961
|
+
type?: 'import' | 'export';
|
|
962
|
+
status?: string;
|
|
963
|
+
limit?: number;
|
|
964
|
+
}): Promise<Array<ImportJobStatus | ExportJobStatus>>;
|
|
965
|
+
/**
|
|
966
|
+
* Download exported data
|
|
967
|
+
*/
|
|
968
|
+
downloadExport(jobId: string): Promise<Buffer>;
|
|
969
|
+
/**
|
|
970
|
+
* Stream import data (for large files)
|
|
971
|
+
*/
|
|
972
|
+
streamImport(options: ImportOptions, onProgress?: (progress: ImportJobStatus) => void): Promise<ImportResult>;
|
|
973
|
+
/**
|
|
974
|
+
* Stream export data (for large datasets)
|
|
975
|
+
*/
|
|
976
|
+
streamExport(options: ExportOptions, onProgress?: (progress: ExportJobStatus) => void): Promise<ExportResult>;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Integration Management Types
|
|
981
|
+
*/
|
|
982
|
+
interface Integration {
|
|
983
|
+
/** Integration ID */
|
|
984
|
+
id: string;
|
|
985
|
+
/** Integration name */
|
|
986
|
+
name: string;
|
|
987
|
+
/** Integration type */
|
|
988
|
+
type: 'webhook' | 'api' | 'database' | 'messaging' | 'storage' | 'custom';
|
|
989
|
+
/** Integration status */
|
|
990
|
+
status: 'active' | 'inactive' | 'error';
|
|
991
|
+
/** Configuration */
|
|
992
|
+
config: IntegrationConfig;
|
|
993
|
+
/** Description */
|
|
994
|
+
description?: string;
|
|
995
|
+
/** Tags */
|
|
996
|
+
tags?: string[];
|
|
997
|
+
/** Creation timestamp */
|
|
998
|
+
created_at: Date;
|
|
999
|
+
/** Last update timestamp */
|
|
1000
|
+
updated_at: Date;
|
|
1001
|
+
/** Last successful execution */
|
|
1002
|
+
last_success_at?: Date;
|
|
1003
|
+
/** Last error */
|
|
1004
|
+
last_error?: string;
|
|
1005
|
+
/** Execution count */
|
|
1006
|
+
execution_count?: number;
|
|
1007
|
+
}
|
|
1008
|
+
interface IntegrationConfig {
|
|
1009
|
+
/** Endpoint URL (for webhook/api) */
|
|
1010
|
+
url?: string;
|
|
1011
|
+
/** HTTP method (for webhook/api) */
|
|
1012
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1013
|
+
/** Headers */
|
|
1014
|
+
headers?: Record<string, string>;
|
|
1015
|
+
/** Authentication */
|
|
1016
|
+
auth?: AuthConfig;
|
|
1017
|
+
/** Connection string (for database) */
|
|
1018
|
+
connection_string?: string;
|
|
1019
|
+
/** Custom configuration */
|
|
1020
|
+
custom?: Record<string, any>;
|
|
1021
|
+
/** Retry configuration */
|
|
1022
|
+
retry?: RetryConfig;
|
|
1023
|
+
/** Timeout in milliseconds */
|
|
1024
|
+
timeout_ms?: number;
|
|
1025
|
+
}
|
|
1026
|
+
interface AuthConfig {
|
|
1027
|
+
/** Auth type */
|
|
1028
|
+
type: 'none' | 'basic' | 'bearer' | 'api_key' | 'oauth2' | 'custom';
|
|
1029
|
+
/** Username (basic auth) */
|
|
1030
|
+
username?: string;
|
|
1031
|
+
/** Password (basic auth) */
|
|
1032
|
+
password?: string;
|
|
1033
|
+
/** Token (bearer auth) */
|
|
1034
|
+
token?: string;
|
|
1035
|
+
/** API key */
|
|
1036
|
+
api_key?: string;
|
|
1037
|
+
/** API key header name */
|
|
1038
|
+
api_key_header?: string;
|
|
1039
|
+
/** OAuth2 configuration */
|
|
1040
|
+
oauth2?: OAuth2Config;
|
|
1041
|
+
/** Custom auth data */
|
|
1042
|
+
custom?: Record<string, any>;
|
|
1043
|
+
}
|
|
1044
|
+
interface OAuth2Config {
|
|
1045
|
+
/** Client ID */
|
|
1046
|
+
client_id: string;
|
|
1047
|
+
/** Client secret */
|
|
1048
|
+
client_secret: string;
|
|
1049
|
+
/** Token URL */
|
|
1050
|
+
token_url: string;
|
|
1051
|
+
/** Scopes */
|
|
1052
|
+
scopes?: string[];
|
|
1053
|
+
/** Additional parameters */
|
|
1054
|
+
params?: Record<string, string>;
|
|
1055
|
+
}
|
|
1056
|
+
interface RetryConfig {
|
|
1057
|
+
/** Maximum retry attempts */
|
|
1058
|
+
max_attempts: number;
|
|
1059
|
+
/** Initial delay in milliseconds */
|
|
1060
|
+
initial_delay_ms: number;
|
|
1061
|
+
/** Maximum delay in milliseconds */
|
|
1062
|
+
max_delay_ms: number;
|
|
1063
|
+
/** Backoff multiplier */
|
|
1064
|
+
backoff_multiplier?: number;
|
|
1065
|
+
/** Retry on status codes */
|
|
1066
|
+
retry_on_status?: number[];
|
|
1067
|
+
}
|
|
1068
|
+
interface CreateIntegrationOptions {
|
|
1069
|
+
/** Integration name */
|
|
1070
|
+
name: string;
|
|
1071
|
+
/** Integration type */
|
|
1072
|
+
type: 'webhook' | 'api' | 'database' | 'messaging' | 'storage' | 'custom';
|
|
1073
|
+
/** Configuration */
|
|
1074
|
+
config: IntegrationConfig;
|
|
1075
|
+
/** Description */
|
|
1076
|
+
description?: string;
|
|
1077
|
+
/** Tags */
|
|
1078
|
+
tags?: string[];
|
|
1079
|
+
/** Auto-activate */
|
|
1080
|
+
activate?: boolean;
|
|
1081
|
+
}
|
|
1082
|
+
interface ListIntegrationsOptions {
|
|
1083
|
+
/** Filter by type */
|
|
1084
|
+
type?: string;
|
|
1085
|
+
/** Filter by status */
|
|
1086
|
+
status?: 'active' | 'inactive' | 'error';
|
|
1087
|
+
/** Filter by tags */
|
|
1088
|
+
tags?: string[];
|
|
1089
|
+
/** Search query */
|
|
1090
|
+
search?: string;
|
|
1091
|
+
/** Page number */
|
|
1092
|
+
page?: number;
|
|
1093
|
+
/** Page size */
|
|
1094
|
+
page_size?: number;
|
|
1095
|
+
}
|
|
1096
|
+
interface ExecuteIntegrationOptions {
|
|
1097
|
+
/** Integration ID or name */
|
|
1098
|
+
integration: string;
|
|
1099
|
+
/** Payload data */
|
|
1100
|
+
payload?: any;
|
|
1101
|
+
/** Override configuration */
|
|
1102
|
+
config_override?: Partial<IntegrationConfig>;
|
|
1103
|
+
/** Synchronous execution (wait for response) */
|
|
1104
|
+
sync?: boolean;
|
|
1105
|
+
}
|
|
1106
|
+
interface IntegrationExecutionResult {
|
|
1107
|
+
/** Execution ID */
|
|
1108
|
+
id: string;
|
|
1109
|
+
/** Whether execution succeeded */
|
|
1110
|
+
success: boolean;
|
|
1111
|
+
/** Response data */
|
|
1112
|
+
response?: any;
|
|
1113
|
+
/** HTTP status code (for webhooks/APIs) */
|
|
1114
|
+
status_code?: number;
|
|
1115
|
+
/** Error message if failed */
|
|
1116
|
+
error?: string;
|
|
1117
|
+
/** Execution time in milliseconds */
|
|
1118
|
+
execution_time_ms: number;
|
|
1119
|
+
/** Retry count */
|
|
1120
|
+
retry_count?: number;
|
|
1121
|
+
/** Executed timestamp */
|
|
1122
|
+
executed_at: Date;
|
|
1123
|
+
}
|
|
1124
|
+
interface IntegrationWebhook {
|
|
1125
|
+
/** Webhook ID */
|
|
1126
|
+
id: string;
|
|
1127
|
+
/** Integration ID */
|
|
1128
|
+
integration_id: string;
|
|
1129
|
+
/** Event type */
|
|
1130
|
+
event: string;
|
|
1131
|
+
/** Webhook URL */
|
|
1132
|
+
url: string;
|
|
1133
|
+
/** Active status */
|
|
1134
|
+
active: boolean;
|
|
1135
|
+
/** Secret for signature verification */
|
|
1136
|
+
secret?: string;
|
|
1137
|
+
/** Created timestamp */
|
|
1138
|
+
created_at: Date;
|
|
1139
|
+
}
|
|
1140
|
+
interface CreateWebhookOptions {
|
|
1141
|
+
/** Integration ID */
|
|
1142
|
+
integration_id: string;
|
|
1143
|
+
/** Event type to trigger on */
|
|
1144
|
+
event: string;
|
|
1145
|
+
/** Webhook URL */
|
|
1146
|
+
url: string;
|
|
1147
|
+
/** Secret for signature verification */
|
|
1148
|
+
secret?: string;
|
|
1149
|
+
/** Auto-activate */
|
|
1150
|
+
activate?: boolean;
|
|
1151
|
+
}
|
|
1152
|
+
interface IntegrationEvent {
|
|
1153
|
+
/** Event ID */
|
|
1154
|
+
id: string;
|
|
1155
|
+
/** Integration ID */
|
|
1156
|
+
integration_id: string;
|
|
1157
|
+
/** Event type */
|
|
1158
|
+
event: string;
|
|
1159
|
+
/** Event data */
|
|
1160
|
+
data: any;
|
|
1161
|
+
/** Event timestamp */
|
|
1162
|
+
timestamp: Date;
|
|
1163
|
+
/** Status */
|
|
1164
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
1165
|
+
/** Error message if failed */
|
|
1166
|
+
error?: string;
|
|
1167
|
+
}
|
|
1168
|
+
interface IntegrationLog {
|
|
1169
|
+
/** Log ID */
|
|
1170
|
+
id: string;
|
|
1171
|
+
/** Integration ID */
|
|
1172
|
+
integration_id: string;
|
|
1173
|
+
/** Log level */
|
|
1174
|
+
level: 'info' | 'warning' | 'error' | 'debug';
|
|
1175
|
+
/** Log message */
|
|
1176
|
+
message: string;
|
|
1177
|
+
/** Additional data */
|
|
1178
|
+
data?: any;
|
|
1179
|
+
/** Timestamp */
|
|
1180
|
+
timestamp: Date;
|
|
1181
|
+
}
|
|
1182
|
+
interface IntegrationStats {
|
|
1183
|
+
/** Integration ID */
|
|
1184
|
+
integration_id: string;
|
|
1185
|
+
/** Total executions */
|
|
1186
|
+
total_executions: number;
|
|
1187
|
+
/** Successful executions */
|
|
1188
|
+
successful_executions: number;
|
|
1189
|
+
/** Failed executions */
|
|
1190
|
+
failed_executions: number;
|
|
1191
|
+
/** Average execution time (ms) */
|
|
1192
|
+
avg_execution_time_ms: number;
|
|
1193
|
+
/** Last 24h executions */
|
|
1194
|
+
executions_24h: number;
|
|
1195
|
+
/** Uptime percentage */
|
|
1196
|
+
uptime_percentage: number;
|
|
1197
|
+
/** Last success timestamp */
|
|
1198
|
+
last_success_at?: Date;
|
|
1199
|
+
/** Last error timestamp */
|
|
1200
|
+
last_error_at?: Date;
|
|
1201
|
+
}
|
|
1202
|
+
interface TestIntegrationOptions {
|
|
1203
|
+
/** Integration ID or name */
|
|
1204
|
+
integration: string;
|
|
1205
|
+
/** Test payload */
|
|
1206
|
+
payload?: any;
|
|
1207
|
+
/** Validate only (don't execute) */
|
|
1208
|
+
validate_only?: boolean;
|
|
1209
|
+
}
|
|
1210
|
+
interface TestIntegrationResult {
|
|
1211
|
+
/** Whether test succeeded */
|
|
1212
|
+
success: boolean;
|
|
1213
|
+
/** Validation errors */
|
|
1214
|
+
validation_errors?: string[];
|
|
1215
|
+
/** Test response */
|
|
1216
|
+
response?: any;
|
|
1217
|
+
/** Error message */
|
|
1218
|
+
error?: string;
|
|
1219
|
+
/** Latency in milliseconds */
|
|
1220
|
+
latency_ms?: number;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* Integration Management Client for SynapCores SDK
|
|
1225
|
+
*/
|
|
1226
|
+
|
|
1227
|
+
declare class IntegrationClient {
|
|
1228
|
+
private readonly synapCores;
|
|
1229
|
+
constructor(synapCores: SynapCores);
|
|
1230
|
+
/**
|
|
1231
|
+
* Create a new integration
|
|
1232
|
+
*/
|
|
1233
|
+
create(options: CreateIntegrationOptions): Promise<Integration>;
|
|
1234
|
+
/**
|
|
1235
|
+
* List integrations with optional filters
|
|
1236
|
+
*/
|
|
1237
|
+
list(options?: ListIntegrationsOptions): Promise<Integration[]>;
|
|
1238
|
+
/**
|
|
1239
|
+
* Get a specific integration by ID
|
|
1240
|
+
*/
|
|
1241
|
+
get(id: string): Promise<Integration>;
|
|
1242
|
+
/**
|
|
1243
|
+
* Update an existing integration
|
|
1244
|
+
*/
|
|
1245
|
+
update(id: string, updates: Partial<CreateIntegrationOptions>): Promise<Integration>;
|
|
1246
|
+
/**
|
|
1247
|
+
* Delete an integration
|
|
1248
|
+
*/
|
|
1249
|
+
delete(id: string): Promise<void>;
|
|
1250
|
+
/**
|
|
1251
|
+
* Activate an integration
|
|
1252
|
+
*/
|
|
1253
|
+
activate(id: string): Promise<Integration>;
|
|
1254
|
+
/**
|
|
1255
|
+
* Deactivate an integration
|
|
1256
|
+
*/
|
|
1257
|
+
deactivate(id: string): Promise<Integration>;
|
|
1258
|
+
/**
|
|
1259
|
+
* Execute an integration
|
|
1260
|
+
*/
|
|
1261
|
+
execute(options: ExecuteIntegrationOptions): Promise<IntegrationExecutionResult>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Test an integration without executing
|
|
1264
|
+
*/
|
|
1265
|
+
test(options: TestIntegrationOptions): Promise<TestIntegrationResult>;
|
|
1266
|
+
/**
|
|
1267
|
+
* Get integration execution history
|
|
1268
|
+
*/
|
|
1269
|
+
getExecutionHistory(integrationId: string, options?: {
|
|
1270
|
+
limit?: number;
|
|
1271
|
+
offset?: number;
|
|
1272
|
+
}): Promise<IntegrationExecutionResult[]>;
|
|
1273
|
+
/**
|
|
1274
|
+
* Get integration statistics
|
|
1275
|
+
*/
|
|
1276
|
+
getStats(integrationId: string): Promise<IntegrationStats>;
|
|
1277
|
+
/**
|
|
1278
|
+
* Create a webhook for an integration
|
|
1279
|
+
*/
|
|
1280
|
+
createWebhook(options: CreateWebhookOptions): Promise<IntegrationWebhook>;
|
|
1281
|
+
/**
|
|
1282
|
+
* List webhooks for an integration
|
|
1283
|
+
*/
|
|
1284
|
+
listWebhooks(integrationId: string): Promise<IntegrationWebhook[]>;
|
|
1285
|
+
/**
|
|
1286
|
+
* Delete a webhook
|
|
1287
|
+
*/
|
|
1288
|
+
deleteWebhook(webhookId: string): Promise<void>;
|
|
1289
|
+
/**
|
|
1290
|
+
* Get integration events
|
|
1291
|
+
*/
|
|
1292
|
+
getEvents(integrationId: string, options?: {
|
|
1293
|
+
limit?: number;
|
|
1294
|
+
status?: string;
|
|
1295
|
+
}): Promise<IntegrationEvent[]>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Get integration logs
|
|
1298
|
+
*/
|
|
1299
|
+
getLogs(integrationId: string, options?: {
|
|
1300
|
+
limit?: number;
|
|
1301
|
+
level?: string;
|
|
1302
|
+
}): Promise<IntegrationLog[]>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Retry a failed execution
|
|
1305
|
+
*/
|
|
1306
|
+
retryExecution(executionId: string): Promise<IntegrationExecutionResult>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Map raw integration data to Integration type
|
|
1309
|
+
*/
|
|
1310
|
+
private mapIntegration;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Backup/Restore Types
|
|
1315
|
+
*/
|
|
1316
|
+
interface BackupOptions {
|
|
1317
|
+
/** Backup name */
|
|
1318
|
+
name?: string;
|
|
1319
|
+
/** Description */
|
|
1320
|
+
description?: string;
|
|
1321
|
+
/** Backup type */
|
|
1322
|
+
type?: 'full' | 'incremental' | 'differential';
|
|
1323
|
+
/** Tables to include (default: all) */
|
|
1324
|
+
tables?: string[];
|
|
1325
|
+
/** Include indexes */
|
|
1326
|
+
include_indexes?: boolean;
|
|
1327
|
+
/** Include procedures/triggers */
|
|
1328
|
+
include_procedures?: boolean;
|
|
1329
|
+
/** Compression level (0-9, default: 6) */
|
|
1330
|
+
compression?: number;
|
|
1331
|
+
/** Encryption enabled */
|
|
1332
|
+
encrypt?: boolean;
|
|
1333
|
+
/** Encryption key (if encrypt=true) */
|
|
1334
|
+
encryption_key?: string;
|
|
1335
|
+
/** Storage location */
|
|
1336
|
+
storage?: 'local' | 's3' | 'gcs' | 'azure';
|
|
1337
|
+
/** Storage configuration */
|
|
1338
|
+
storage_config?: StorageConfig;
|
|
1339
|
+
/** Tags */
|
|
1340
|
+
tags?: string[];
|
|
1341
|
+
}
|
|
1342
|
+
interface StorageConfig {
|
|
1343
|
+
/** S3 bucket name */
|
|
1344
|
+
bucket?: string;
|
|
1345
|
+
/** Storage region */
|
|
1346
|
+
region?: string;
|
|
1347
|
+
/** Access key ID */
|
|
1348
|
+
access_key_id?: string;
|
|
1349
|
+
/** Secret access key */
|
|
1350
|
+
secret_access_key?: string;
|
|
1351
|
+
/** Storage path prefix */
|
|
1352
|
+
path_prefix?: string;
|
|
1353
|
+
/** Custom endpoint URL */
|
|
1354
|
+
endpoint?: string;
|
|
1355
|
+
/** Additional configuration */
|
|
1356
|
+
custom?: Record<string, any>;
|
|
1357
|
+
}
|
|
1358
|
+
interface Backup {
|
|
1359
|
+
/** Backup ID */
|
|
1360
|
+
id: string;
|
|
1361
|
+
/** Backup name */
|
|
1362
|
+
name: string;
|
|
1363
|
+
/** Description */
|
|
1364
|
+
description?: string;
|
|
1365
|
+
/** Backup type */
|
|
1366
|
+
type: 'full' | 'incremental' | 'differential';
|
|
1367
|
+
/** Backup status */
|
|
1368
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
|
|
1369
|
+
/** Size in bytes */
|
|
1370
|
+
size_bytes?: number;
|
|
1371
|
+
/** Compressed size in bytes */
|
|
1372
|
+
compressed_size_bytes?: number;
|
|
1373
|
+
/** Number of tables backed up */
|
|
1374
|
+
table_count?: number;
|
|
1375
|
+
/** Creation timestamp */
|
|
1376
|
+
created_at: Date;
|
|
1377
|
+
/** Completion timestamp */
|
|
1378
|
+
completed_at?: Date;
|
|
1379
|
+
/** Duration in milliseconds */
|
|
1380
|
+
duration_ms?: number;
|
|
1381
|
+
/** Storage location */
|
|
1382
|
+
storage?: string;
|
|
1383
|
+
/** Storage path */
|
|
1384
|
+
storage_path?: string;
|
|
1385
|
+
/** Encrypted */
|
|
1386
|
+
encrypted: boolean;
|
|
1387
|
+
/** Tags */
|
|
1388
|
+
tags?: string[];
|
|
1389
|
+
/** Parent backup ID (for incremental) */
|
|
1390
|
+
parent_backup_id?: string;
|
|
1391
|
+
/** Error message if failed */
|
|
1392
|
+
error?: string;
|
|
1393
|
+
}
|
|
1394
|
+
interface RestoreOptions {
|
|
1395
|
+
/** Backup ID to restore from */
|
|
1396
|
+
backup_id: string;
|
|
1397
|
+
/** Restore mode */
|
|
1398
|
+
mode?: 'full' | 'partial';
|
|
1399
|
+
/** Tables to restore (for partial restore) */
|
|
1400
|
+
tables?: string[];
|
|
1401
|
+
/** Target database name (if different) */
|
|
1402
|
+
target_database?: string;
|
|
1403
|
+
/** Overwrite existing data */
|
|
1404
|
+
overwrite?: boolean;
|
|
1405
|
+
/** Skip indexes */
|
|
1406
|
+
skip_indexes?: boolean;
|
|
1407
|
+
/** Skip procedures/triggers */
|
|
1408
|
+
skip_procedures?: boolean;
|
|
1409
|
+
/** Decryption key (if backup is encrypted) */
|
|
1410
|
+
decryption_key?: string;
|
|
1411
|
+
/** Point-in-time restore timestamp */
|
|
1412
|
+
point_in_time?: Date;
|
|
1413
|
+
/** Dry run (validate only) */
|
|
1414
|
+
dry_run?: boolean;
|
|
1415
|
+
}
|
|
1416
|
+
interface RestoreResult {
|
|
1417
|
+
/** Restore job ID */
|
|
1418
|
+
id: string;
|
|
1419
|
+
/** Whether restore succeeded */
|
|
1420
|
+
success: boolean;
|
|
1421
|
+
/** Tables restored */
|
|
1422
|
+
tables_restored?: string[];
|
|
1423
|
+
/** Rows restored */
|
|
1424
|
+
rows_restored?: number;
|
|
1425
|
+
/** Duration in milliseconds */
|
|
1426
|
+
duration_ms: number;
|
|
1427
|
+
/** Error message if failed */
|
|
1428
|
+
error?: string;
|
|
1429
|
+
/** Warnings */
|
|
1430
|
+
warnings?: string[];
|
|
1431
|
+
}
|
|
1432
|
+
interface BackupStatus {
|
|
1433
|
+
/** Backup ID */
|
|
1434
|
+
id: string;
|
|
1435
|
+
/** Status */
|
|
1436
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
|
|
1437
|
+
/** Progress percentage (0-100) */
|
|
1438
|
+
progress: number;
|
|
1439
|
+
/** Current phase */
|
|
1440
|
+
phase?: string;
|
|
1441
|
+
/** Tables processed */
|
|
1442
|
+
tables_processed?: number;
|
|
1443
|
+
/** Total tables */
|
|
1444
|
+
total_tables?: number;
|
|
1445
|
+
/** Bytes processed */
|
|
1446
|
+
bytes_processed?: number;
|
|
1447
|
+
/** Estimated time remaining (ms) */
|
|
1448
|
+
eta_ms?: number;
|
|
1449
|
+
/** Error message if failed */
|
|
1450
|
+
error?: string;
|
|
1451
|
+
/** Started timestamp */
|
|
1452
|
+
started_at?: Date;
|
|
1453
|
+
/** Completed timestamp */
|
|
1454
|
+
completed_at?: Date;
|
|
1455
|
+
}
|
|
1456
|
+
interface RestoreStatus {
|
|
1457
|
+
/** Restore job ID */
|
|
1458
|
+
id: string;
|
|
1459
|
+
/** Status */
|
|
1460
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
|
|
1461
|
+
/** Progress percentage (0-100) */
|
|
1462
|
+
progress: number;
|
|
1463
|
+
/** Current phase */
|
|
1464
|
+
phase?: string;
|
|
1465
|
+
/** Tables processed */
|
|
1466
|
+
tables_processed?: number;
|
|
1467
|
+
/** Total tables */
|
|
1468
|
+
total_tables?: number;
|
|
1469
|
+
/** Rows processed */
|
|
1470
|
+
rows_processed?: number;
|
|
1471
|
+
/** Estimated time remaining (ms) */
|
|
1472
|
+
eta_ms?: number;
|
|
1473
|
+
/** Error message if failed */
|
|
1474
|
+
error?: string;
|
|
1475
|
+
/** Started timestamp */
|
|
1476
|
+
started_at?: Date;
|
|
1477
|
+
/** Completed timestamp */
|
|
1478
|
+
completed_at?: Date;
|
|
1479
|
+
}
|
|
1480
|
+
interface ListBackupsOptions {
|
|
1481
|
+
/** Filter by type */
|
|
1482
|
+
type?: 'full' | 'incremental' | 'differential';
|
|
1483
|
+
/** Filter by status */
|
|
1484
|
+
status?: string;
|
|
1485
|
+
/** Filter by tags */
|
|
1486
|
+
tags?: string[];
|
|
1487
|
+
/** Sort order */
|
|
1488
|
+
sort?: 'created_at' | 'size' | 'name';
|
|
1489
|
+
/** Sort direction */
|
|
1490
|
+
order?: 'asc' | 'desc';
|
|
1491
|
+
/** Page number */
|
|
1492
|
+
page?: number;
|
|
1493
|
+
/** Page size */
|
|
1494
|
+
page_size?: number;
|
|
1495
|
+
}
|
|
1496
|
+
interface BackupSchedule {
|
|
1497
|
+
/** Schedule ID */
|
|
1498
|
+
id: string;
|
|
1499
|
+
/** Schedule name */
|
|
1500
|
+
name: string;
|
|
1501
|
+
/** Cron expression */
|
|
1502
|
+
cron: string;
|
|
1503
|
+
/** Backup options */
|
|
1504
|
+
backup_options: BackupOptions;
|
|
1505
|
+
/** Active status */
|
|
1506
|
+
active: boolean;
|
|
1507
|
+
/** Last run timestamp */
|
|
1508
|
+
last_run_at?: Date;
|
|
1509
|
+
/** Next run timestamp */
|
|
1510
|
+
next_run_at?: Date;
|
|
1511
|
+
/** Creation timestamp */
|
|
1512
|
+
created_at: Date;
|
|
1513
|
+
/** Tags */
|
|
1514
|
+
tags?: string[];
|
|
1515
|
+
}
|
|
1516
|
+
interface CreateScheduleOptions {
|
|
1517
|
+
/** Schedule name */
|
|
1518
|
+
name: string;
|
|
1519
|
+
/** Cron expression */
|
|
1520
|
+
cron: string;
|
|
1521
|
+
/** Backup options */
|
|
1522
|
+
backup_options: BackupOptions;
|
|
1523
|
+
/** Auto-activate */
|
|
1524
|
+
activate?: boolean;
|
|
1525
|
+
/** Tags */
|
|
1526
|
+
tags?: string[];
|
|
1527
|
+
}
|
|
1528
|
+
interface BackupVerificationResult {
|
|
1529
|
+
/** Whether backup is valid */
|
|
1530
|
+
is_valid: boolean;
|
|
1531
|
+
/** Integrity check passed */
|
|
1532
|
+
integrity_ok: boolean;
|
|
1533
|
+
/** Checksum match */
|
|
1534
|
+
checksum_match?: boolean;
|
|
1535
|
+
/** Tables verified */
|
|
1536
|
+
tables_verified?: number;
|
|
1537
|
+
/** Errors found */
|
|
1538
|
+
errors?: string[];
|
|
1539
|
+
/** Warnings */
|
|
1540
|
+
warnings?: string[];
|
|
1541
|
+
/** Verification timestamp */
|
|
1542
|
+
verified_at: Date;
|
|
1543
|
+
}
|
|
1544
|
+
interface BackupMetrics {
|
|
1545
|
+
/** Total backups */
|
|
1546
|
+
total_backups: number;
|
|
1547
|
+
/** Total size (bytes) */
|
|
1548
|
+
total_size_bytes: number;
|
|
1549
|
+
/** Successful backups */
|
|
1550
|
+
successful_backups: number;
|
|
1551
|
+
/** Failed backups */
|
|
1552
|
+
failed_backups: number;
|
|
1553
|
+
/** Average backup size (bytes) */
|
|
1554
|
+
avg_backup_size_bytes: number;
|
|
1555
|
+
/** Average backup duration (ms) */
|
|
1556
|
+
avg_duration_ms: number;
|
|
1557
|
+
/** Last backup timestamp */
|
|
1558
|
+
last_backup_at?: Date;
|
|
1559
|
+
/** Next scheduled backup */
|
|
1560
|
+
next_scheduled_at?: Date;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* Backup/Restore Client for SynapCores SDK
|
|
1565
|
+
*/
|
|
1566
|
+
|
|
1567
|
+
declare class BackupClient {
|
|
1568
|
+
private readonly synapCores;
|
|
1569
|
+
constructor(synapCores: SynapCores);
|
|
1570
|
+
/**
|
|
1571
|
+
* Create a new backup
|
|
1572
|
+
*/
|
|
1573
|
+
create(options?: BackupOptions): Promise<Backup>;
|
|
1574
|
+
/**
|
|
1575
|
+
* List backups with optional filters
|
|
1576
|
+
*/
|
|
1577
|
+
list(options?: ListBackupsOptions): Promise<Backup[]>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Get a specific backup by ID
|
|
1580
|
+
*/
|
|
1581
|
+
get(id: string): Promise<Backup>;
|
|
1582
|
+
/**
|
|
1583
|
+
* Delete a backup
|
|
1584
|
+
*/
|
|
1585
|
+
delete(id: string): Promise<void>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Restore from a backup
|
|
1588
|
+
*/
|
|
1589
|
+
restore(options: RestoreOptions): Promise<RestoreResult>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Get backup status
|
|
1592
|
+
*/
|
|
1593
|
+
getBackupStatus(backupId: string): Promise<BackupStatus>;
|
|
1594
|
+
/**
|
|
1595
|
+
* Get restore status
|
|
1596
|
+
*/
|
|
1597
|
+
getRestoreStatus(restoreId: string): Promise<RestoreStatus>;
|
|
1598
|
+
/**
|
|
1599
|
+
* Cancel a backup in progress
|
|
1600
|
+
*/
|
|
1601
|
+
cancelBackup(backupId: string): Promise<void>;
|
|
1602
|
+
/**
|
|
1603
|
+
* Cancel a restore in progress
|
|
1604
|
+
*/
|
|
1605
|
+
cancelRestore(restoreId: string): Promise<void>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Download a backup file
|
|
1608
|
+
*/
|
|
1609
|
+
download(backupId: string): Promise<Buffer>;
|
|
1610
|
+
/**
|
|
1611
|
+
* Verify backup integrity
|
|
1612
|
+
*/
|
|
1613
|
+
verify(backupId: string): Promise<BackupVerificationResult>;
|
|
1614
|
+
/**
|
|
1615
|
+
* Create a backup schedule
|
|
1616
|
+
*/
|
|
1617
|
+
createSchedule(options: CreateScheduleOptions): Promise<BackupSchedule>;
|
|
1618
|
+
/**
|
|
1619
|
+
* List backup schedules
|
|
1620
|
+
*/
|
|
1621
|
+
listSchedules(): Promise<BackupSchedule[]>;
|
|
1622
|
+
/**
|
|
1623
|
+
* Get a specific schedule
|
|
1624
|
+
*/
|
|
1625
|
+
getSchedule(scheduleId: string): Promise<BackupSchedule>;
|
|
1626
|
+
/**
|
|
1627
|
+
* Update a backup schedule
|
|
1628
|
+
*/
|
|
1629
|
+
updateSchedule(scheduleId: string, updates: Partial<CreateScheduleOptions>): Promise<BackupSchedule>;
|
|
1630
|
+
/**
|
|
1631
|
+
* Delete a backup schedule
|
|
1632
|
+
*/
|
|
1633
|
+
deleteSchedule(scheduleId: string): Promise<void>;
|
|
1634
|
+
/**
|
|
1635
|
+
* Activate a schedule
|
|
1636
|
+
*/
|
|
1637
|
+
activateSchedule(scheduleId: string): Promise<BackupSchedule>;
|
|
1638
|
+
/**
|
|
1639
|
+
* Deactivate a schedule
|
|
1640
|
+
*/
|
|
1641
|
+
deactivateSchedule(scheduleId: string): Promise<BackupSchedule>;
|
|
1642
|
+
/**
|
|
1643
|
+
* Get backup metrics
|
|
1644
|
+
*/
|
|
1645
|
+
getMetrics(): Promise<BackupMetrics>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Map raw backup data to Backup type
|
|
1648
|
+
*/
|
|
1649
|
+
private mapBackup;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
/**
|
|
1653
|
+
* Type definitions for SynapCores client
|
|
1654
|
+
*/
|
|
1655
|
+
interface SynapCoresConfig {
|
|
1656
|
+
host?: string;
|
|
1657
|
+
port?: number;
|
|
1658
|
+
apiKey?: string;
|
|
1659
|
+
jwtToken?: string;
|
|
1660
|
+
useHttps?: boolean;
|
|
1661
|
+
timeout?: number;
|
|
1662
|
+
maxRetries?: number;
|
|
1663
|
+
rejectUnauthorized?: boolean;
|
|
1664
|
+
}
|
|
1665
|
+
interface QueryColumn {
|
|
1666
|
+
name: string;
|
|
1667
|
+
data_type: string;
|
|
1668
|
+
nullable: boolean;
|
|
1669
|
+
}
|
|
1670
|
+
interface QueryResult {
|
|
1671
|
+
columns: QueryColumn[];
|
|
1672
|
+
rows: any[][];
|
|
1673
|
+
rows_affected?: number;
|
|
1674
|
+
execution_time_ms: number;
|
|
1675
|
+
queryPlan?: Record<string, any>;
|
|
1676
|
+
}
|
|
1677
|
+
interface EmbedOptions {
|
|
1678
|
+
model?: string;
|
|
1679
|
+
}
|
|
1680
|
+
interface ColumnDefinition {
|
|
1681
|
+
name: string;
|
|
1682
|
+
dataType: string;
|
|
1683
|
+
constraints?: ColumnConstraint[];
|
|
1684
|
+
defaultValue?: any;
|
|
1685
|
+
}
|
|
1686
|
+
interface ColumnConstraint {
|
|
1687
|
+
type: 'PRIMARY_KEY' | 'UNIQUE' | 'NOT_NULL' | 'CHECK' | 'FOREIGN_KEY' | 'DEFAULT';
|
|
1688
|
+
expression?: string;
|
|
1689
|
+
referencedTable?: string;
|
|
1690
|
+
referencedColumn?: string;
|
|
1691
|
+
}
|
|
1692
|
+
interface TableConstraint {
|
|
1693
|
+
type: 'PRIMARY_KEY' | 'UNIQUE' | 'CHECK' | 'FOREIGN_KEY';
|
|
1694
|
+
columns: string[];
|
|
1695
|
+
expression?: string;
|
|
1696
|
+
referencedTable?: string;
|
|
1697
|
+
referencedColumns?: string[];
|
|
1698
|
+
}
|
|
1699
|
+
interface CreateTableOptions {
|
|
1700
|
+
ifNotExists?: boolean;
|
|
1701
|
+
constraints?: TableConstraint[];
|
|
1702
|
+
partitionBy?: {
|
|
1703
|
+
type: 'RANGE' | 'LIST' | 'HASH';
|
|
1704
|
+
column: string;
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
interface AlterTableOptions {
|
|
1708
|
+
action: 'ADD_COLUMN' | 'DROP_COLUMN' | 'RENAME_COLUMN' | 'ALTER_COLUMN' | 'ADD_CONSTRAINT' | 'DROP_CONSTRAINT';
|
|
1709
|
+
columnName?: string;
|
|
1710
|
+
newColumnName?: string;
|
|
1711
|
+
columnDefinition?: ColumnDefinition;
|
|
1712
|
+
newDataType?: string;
|
|
1713
|
+
constraint?: TableConstraint;
|
|
1714
|
+
constraintName?: string;
|
|
1715
|
+
}
|
|
1716
|
+
interface IndexDefinition {
|
|
1717
|
+
name: string;
|
|
1718
|
+
tableName: string;
|
|
1719
|
+
columns: Array<{
|
|
1720
|
+
name: string;
|
|
1721
|
+
order?: 'ASC' | 'DESC';
|
|
1722
|
+
}>;
|
|
1723
|
+
unique?: boolean;
|
|
1724
|
+
ifNotExists?: boolean;
|
|
1725
|
+
}
|
|
1726
|
+
interface TableInfo {
|
|
1727
|
+
name: string;
|
|
1728
|
+
columns: Array<{
|
|
1729
|
+
name: string;
|
|
1730
|
+
type: string;
|
|
1731
|
+
nullable: boolean;
|
|
1732
|
+
defaultValue?: any;
|
|
1733
|
+
isPrimaryKey: boolean;
|
|
1734
|
+
isUnique: boolean;
|
|
1735
|
+
}>;
|
|
1736
|
+
constraints: TableConstraint[];
|
|
1737
|
+
indexes: Array<{
|
|
1738
|
+
name: string;
|
|
1739
|
+
columns: string[];
|
|
1740
|
+
unique: boolean;
|
|
1741
|
+
}>;
|
|
1742
|
+
}
|
|
1743
|
+
interface TransactionOptions {
|
|
1744
|
+
isolationLevel?: 'READ_UNCOMMITTED' | 'READ_COMMITTED' | 'REPEATABLE_READ' | 'SERIALIZABLE';
|
|
1745
|
+
readOnly?: boolean;
|
|
1746
|
+
timeout?: number;
|
|
1747
|
+
}
|
|
1748
|
+
interface TransactionContext {
|
|
1749
|
+
id: string;
|
|
1750
|
+
startTime: Date;
|
|
1751
|
+
isolationLevel: string;
|
|
1752
|
+
readOnly: boolean;
|
|
1753
|
+
}
|
|
1754
|
+
interface BatchInsertOptions {
|
|
1755
|
+
tableName: string;
|
|
1756
|
+
columns?: string[];
|
|
1757
|
+
rows: Record<string, any>[];
|
|
1758
|
+
onConflict?: 'IGNORE' | 'REPLACE' | 'UPDATE';
|
|
1759
|
+
batchSize?: number;
|
|
1760
|
+
}
|
|
1761
|
+
interface BatchUpdateOptions {
|
|
1762
|
+
tableName: string;
|
|
1763
|
+
updates: Array<{
|
|
1764
|
+
set: Record<string, any>;
|
|
1765
|
+
where: Record<string, any>;
|
|
1766
|
+
}>;
|
|
1767
|
+
batchSize?: number;
|
|
1768
|
+
}
|
|
1769
|
+
interface BatchDeleteOptions {
|
|
1770
|
+
tableName: string;
|
|
1771
|
+
whereConditions: Record<string, any>[];
|
|
1772
|
+
batchSize?: number;
|
|
1773
|
+
}
|
|
1774
|
+
interface BatchResult {
|
|
1775
|
+
totalProcessed: number;
|
|
1776
|
+
successful: number;
|
|
1777
|
+
failed: number;
|
|
1778
|
+
errors?: Array<{
|
|
1779
|
+
index: number;
|
|
1780
|
+
error: string;
|
|
1781
|
+
}>;
|
|
1782
|
+
tookMs: number;
|
|
1783
|
+
}
|
|
1784
|
+
interface PreparedStatement {
|
|
1785
|
+
id: string;
|
|
1786
|
+
sql: string;
|
|
1787
|
+
parameterCount: number;
|
|
1788
|
+
}
|
|
1789
|
+
interface PreparedStatementOptions {
|
|
1790
|
+
name?: string;
|
|
1791
|
+
parameterTypes?: string[];
|
|
1792
|
+
}
|
|
1793
|
+
interface CTEDefinition {
|
|
1794
|
+
name: string;
|
|
1795
|
+
columns?: string[];
|
|
1796
|
+
query: string;
|
|
1797
|
+
}
|
|
1798
|
+
interface WindowFunctionOptions {
|
|
1799
|
+
partitionBy?: string[];
|
|
1800
|
+
orderBy?: Array<{
|
|
1801
|
+
column: string;
|
|
1802
|
+
direction: 'ASC' | 'DESC';
|
|
1803
|
+
}>;
|
|
1804
|
+
frame?: {
|
|
1805
|
+
type: 'ROWS' | 'RANGE';
|
|
1806
|
+
start: string;
|
|
1807
|
+
end?: string;
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
interface Vector {
|
|
1811
|
+
values: number[];
|
|
1812
|
+
dimensions: number;
|
|
1813
|
+
}
|
|
1814
|
+
interface VectorArithmeticResult {
|
|
1815
|
+
result: Vector;
|
|
1816
|
+
operation: string;
|
|
1817
|
+
tookMs: number;
|
|
1818
|
+
}
|
|
1819
|
+
interface VectorSimilarityResult {
|
|
1820
|
+
similarity: number;
|
|
1821
|
+
distance?: number;
|
|
1822
|
+
function: 'cosine' | 'euclidean' | 'inner_product' | 'l2';
|
|
1823
|
+
tookMs: number;
|
|
1824
|
+
}
|
|
1825
|
+
interface VectorSearchOptions {
|
|
1826
|
+
vector: number[];
|
|
1827
|
+
k?: number;
|
|
1828
|
+
threshold?: number;
|
|
1829
|
+
metric?: 'cosine' | 'euclidean' | 'inner_product' | 'l2';
|
|
1830
|
+
filter?: Record<string, any>;
|
|
1831
|
+
}
|
|
1832
|
+
interface VectorSearchResult {
|
|
1833
|
+
id: string;
|
|
1834
|
+
vector: number[];
|
|
1835
|
+
similarity: number;
|
|
1836
|
+
distance: number;
|
|
1837
|
+
metadata?: Record<string, any>;
|
|
1838
|
+
}
|
|
1839
|
+
interface HybridSearchOptions extends VectorSearchOptions {
|
|
1840
|
+
textQuery?: string;
|
|
1841
|
+
sqlFilter?: string;
|
|
1842
|
+
weights?: {
|
|
1843
|
+
vector: number;
|
|
1844
|
+
text: number;
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
interface KNNSearchOptions {
|
|
1848
|
+
queryVector: number[];
|
|
1849
|
+
k: number;
|
|
1850
|
+
tableName: string;
|
|
1851
|
+
vectorColumn: string;
|
|
1852
|
+
metadataColumns?: string[];
|
|
1853
|
+
filter?: Record<string, any>;
|
|
1854
|
+
}
|
|
1855
|
+
interface RangeSearchOptions {
|
|
1856
|
+
queryVector: number[];
|
|
1857
|
+
threshold: number;
|
|
1858
|
+
tableName: string;
|
|
1859
|
+
vectorColumn: string;
|
|
1860
|
+
metadataColumns?: string[];
|
|
1861
|
+
filter?: Record<string, any>;
|
|
1862
|
+
maxResults?: number;
|
|
1863
|
+
}
|
|
1864
|
+
interface QueryPerformance {
|
|
1865
|
+
queryId: string;
|
|
1866
|
+
sql: string;
|
|
1867
|
+
executionTimeMs: number;
|
|
1868
|
+
rowsAffected: number;
|
|
1869
|
+
memoryUsageMB: number;
|
|
1870
|
+
indexesUsed: string[];
|
|
1871
|
+
partitionsPruned?: number;
|
|
1872
|
+
}
|
|
1873
|
+
interface ConnectionPool {
|
|
1874
|
+
active: number;
|
|
1875
|
+
idle: number;
|
|
1876
|
+
total: number;
|
|
1877
|
+
maxConnections: number;
|
|
1878
|
+
waitingRequests: number;
|
|
1879
|
+
}
|
|
1880
|
+
interface RegisterRequest {
|
|
1881
|
+
username: string;
|
|
1882
|
+
email: string;
|
|
1883
|
+
password: string;
|
|
1884
|
+
}
|
|
1885
|
+
interface RegisterResponse {
|
|
1886
|
+
id: string;
|
|
1887
|
+
username: string;
|
|
1888
|
+
email: string;
|
|
1889
|
+
is_active: boolean;
|
|
1890
|
+
is_verified: boolean;
|
|
1891
|
+
roles: string[];
|
|
1892
|
+
created_at: string;
|
|
1893
|
+
last_login: string | null;
|
|
1894
|
+
}
|
|
1895
|
+
interface LoginRequest {
|
|
1896
|
+
username: string;
|
|
1897
|
+
password: string;
|
|
1898
|
+
}
|
|
1899
|
+
interface LoginResponse {
|
|
1900
|
+
access_token: string;
|
|
1901
|
+
token_type: string;
|
|
1902
|
+
expires_in: number;
|
|
1903
|
+
}
|
|
1904
|
+
interface RefreshResponse {
|
|
1905
|
+
access_token: string;
|
|
1906
|
+
token_type: string;
|
|
1907
|
+
expires_in: number;
|
|
1908
|
+
}
|
|
1909
|
+
interface CreateAPIKeyRequest {
|
|
1910
|
+
name: string;
|
|
1911
|
+
permission: 'ReadOnly' | 'FullAccess';
|
|
1912
|
+
expires_in_days?: number;
|
|
1913
|
+
}
|
|
1914
|
+
interface APIKeyInfo {
|
|
1915
|
+
id: string;
|
|
1916
|
+
name: string;
|
|
1917
|
+
key_preview: string;
|
|
1918
|
+
permission: 'ReadOnly' | 'FullAccess';
|
|
1919
|
+
is_active: boolean;
|
|
1920
|
+
expires_at: string | null;
|
|
1921
|
+
created_at: string;
|
|
1922
|
+
last_used: string | null;
|
|
1923
|
+
usage_count: number;
|
|
1924
|
+
}
|
|
1925
|
+
interface CreateAPIKeyResponse {
|
|
1926
|
+
api_key: APIKeyInfo;
|
|
1927
|
+
raw_key: string;
|
|
1928
|
+
}
|
|
1929
|
+
interface ListAPIKeysResponse {
|
|
1930
|
+
keys: APIKeyInfo[];
|
|
1931
|
+
total: number;
|
|
1932
|
+
}
|
|
1933
|
+
interface APIKeyStats {
|
|
1934
|
+
total_requests: number;
|
|
1935
|
+
requests_last_24h: number;
|
|
1936
|
+
requests_last_7d: number;
|
|
1937
|
+
requests_last_30d: number;
|
|
1938
|
+
last_request_at: string | null;
|
|
1939
|
+
most_used_endpoints: Array<{
|
|
1940
|
+
endpoint: string;
|
|
1941
|
+
method: string;
|
|
1942
|
+
count: number;
|
|
1943
|
+
percentage: number;
|
|
1944
|
+
}>;
|
|
1945
|
+
}
|
|
1946
|
+
interface ExecuteQueryRequest {
|
|
1947
|
+
sql: string;
|
|
1948
|
+
parameters?: any[];
|
|
1949
|
+
max_rows?: number;
|
|
1950
|
+
timeout_secs?: number;
|
|
1951
|
+
}
|
|
1952
|
+
interface BatchQueryRequest {
|
|
1953
|
+
queries: Array<{
|
|
1954
|
+
sql: string;
|
|
1955
|
+
parameters?: any[];
|
|
1956
|
+
}>;
|
|
1957
|
+
transactional?: boolean;
|
|
1958
|
+
}
|
|
1959
|
+
interface BatchQueryResult {
|
|
1960
|
+
type: 'success' | 'error';
|
|
1961
|
+
data?: QueryResult;
|
|
1962
|
+
error?: {
|
|
1963
|
+
message: string;
|
|
1964
|
+
code: string;
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
interface BatchQueryResponse {
|
|
1968
|
+
results: BatchQueryResult[];
|
|
1969
|
+
total_execution_time_ms: number;
|
|
1970
|
+
}
|
|
1971
|
+
interface CollectionFieldDefinition {
|
|
1972
|
+
name: string;
|
|
1973
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array' | 'vector' | 'image' | 'audio' | 'video';
|
|
1974
|
+
required: boolean;
|
|
1975
|
+
description?: string;
|
|
1976
|
+
}
|
|
1977
|
+
interface CollectionIndexDefinition {
|
|
1978
|
+
name: string;
|
|
1979
|
+
fields: string[];
|
|
1980
|
+
type: 'btree' | 'hash' | 'vector' | 'text';
|
|
1981
|
+
unique?: boolean;
|
|
1982
|
+
}
|
|
1983
|
+
interface CollectionSchemaDefinition {
|
|
1984
|
+
fields: CollectionFieldDefinition[];
|
|
1985
|
+
indexes?: CollectionIndexDefinition[];
|
|
1986
|
+
}
|
|
1987
|
+
interface CreateCollectionRequest {
|
|
1988
|
+
name: string;
|
|
1989
|
+
description?: string;
|
|
1990
|
+
schema?: CollectionSchemaDefinition;
|
|
1991
|
+
}
|
|
1992
|
+
interface CollectionInfo {
|
|
1993
|
+
id: string;
|
|
1994
|
+
name: string;
|
|
1995
|
+
description?: string;
|
|
1996
|
+
schema?: CollectionSchemaDefinition;
|
|
1997
|
+
documentCount: number;
|
|
1998
|
+
createdAt: string;
|
|
1999
|
+
updatedAt: string;
|
|
2000
|
+
}
|
|
2001
|
+
interface CreateCollectionResponse {
|
|
2002
|
+
collection: CollectionInfo;
|
|
2003
|
+
}
|
|
2004
|
+
interface ListCollectionsResponse {
|
|
2005
|
+
collections: CollectionInfo[];
|
|
2006
|
+
total: number;
|
|
2007
|
+
page: number;
|
|
2008
|
+
pageSize: number;
|
|
2009
|
+
}
|
|
2010
|
+
interface UploadMultimediaRequest {
|
|
2011
|
+
file: File | Blob | Buffer;
|
|
2012
|
+
metadata?: Record<string, any>;
|
|
2013
|
+
}
|
|
2014
|
+
interface MultimediaInfo {
|
|
2015
|
+
id: string;
|
|
2016
|
+
file_name: string;
|
|
2017
|
+
file_type: string;
|
|
2018
|
+
file_size: number;
|
|
2019
|
+
content_type: string;
|
|
2020
|
+
document_id: string;
|
|
2021
|
+
collection: string;
|
|
2022
|
+
storage_path: string;
|
|
2023
|
+
uploaded_at: string;
|
|
2024
|
+
metadata?: Record<string, any>;
|
|
2025
|
+
extracted_text?: string | null;
|
|
2026
|
+
thumbnail_url?: string;
|
|
2027
|
+
}
|
|
2028
|
+
interface ListMultimediaResponse {
|
|
2029
|
+
items: Array<{
|
|
2030
|
+
id: string;
|
|
2031
|
+
file_name: string;
|
|
2032
|
+
file_type: string;
|
|
2033
|
+
file_size: number;
|
|
2034
|
+
uploaded_at: string;
|
|
2035
|
+
}>;
|
|
2036
|
+
total: number;
|
|
2037
|
+
limit: number;
|
|
2038
|
+
offset: number;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Main client for SynapCores SDK
|
|
2043
|
+
*/
|
|
2044
|
+
|
|
2045
|
+
declare class SynapCores {
|
|
2046
|
+
private readonly config;
|
|
2047
|
+
private readonly httpClient;
|
|
2048
|
+
private readonly collectionsCache;
|
|
2049
|
+
private currentTransaction;
|
|
2050
|
+
private preparedStatements;
|
|
2051
|
+
readonly automl: AutoMLClient;
|
|
2052
|
+
readonly nlp: NLPClient;
|
|
2053
|
+
readonly recipes: RecipeClient;
|
|
2054
|
+
readonly schema: SchemaClient;
|
|
2055
|
+
readonly import: ImportExportClient;
|
|
2056
|
+
readonly integrations: IntegrationClient;
|
|
2057
|
+
readonly backup: BackupClient;
|
|
2058
|
+
constructor(config?: SynapCoresConfig);
|
|
2059
|
+
private handleError;
|
|
2060
|
+
/**
|
|
2061
|
+
* Create collection (legacy method for backward compatibility)
|
|
2062
|
+
*/
|
|
2063
|
+
createCollection(options: {
|
|
2064
|
+
name: string;
|
|
2065
|
+
schema?: Record<string, any>;
|
|
2066
|
+
[key: string]: any;
|
|
2067
|
+
}): Promise<Collection>;
|
|
2068
|
+
/**
|
|
2069
|
+
* Create collection matching the database integration guide format
|
|
2070
|
+
*/
|
|
2071
|
+
createCollectionWithSchema(request: CreateCollectionRequest): Promise<Collection>;
|
|
2072
|
+
getCollection(name: string): Promise<Collection>;
|
|
2073
|
+
/**
|
|
2074
|
+
* List collections (legacy method for backward compatibility)
|
|
2075
|
+
*/
|
|
2076
|
+
listCollections(): Promise<string[]>;
|
|
2077
|
+
/**
|
|
2078
|
+
* List collections with detailed information matching the database integration guide format
|
|
2079
|
+
*/
|
|
2080
|
+
listCollectionsDetailed(options?: {
|
|
2081
|
+
page?: number;
|
|
2082
|
+
pageSize?: number;
|
|
2083
|
+
search?: string;
|
|
2084
|
+
sortBy?: string;
|
|
2085
|
+
sortOrder?: 'asc' | 'desc';
|
|
2086
|
+
}): Promise<ListCollectionsResponse>;
|
|
2087
|
+
getDocuments(collectionName: string, page: number, pageSize: number): Promise<Document[]>;
|
|
2088
|
+
deleteCollection(name: string): Promise<void>;
|
|
2089
|
+
/**
|
|
2090
|
+
* Execute SQL query (legacy method for backward compatibility)
|
|
2091
|
+
* @deprecated Use executeQuery for new code
|
|
2092
|
+
*/
|
|
2093
|
+
sql(query: string, params?: Record<string, any>): Promise<QueryResult>;
|
|
2094
|
+
/**
|
|
2095
|
+
* Execute SQL query matching the database integration guide format
|
|
2096
|
+
*/
|
|
2097
|
+
executeQuery(request: ExecuteQueryRequest): Promise<QueryResult>;
|
|
2098
|
+
/**
|
|
2099
|
+
* Execute batch queries
|
|
2100
|
+
*/
|
|
2101
|
+
executeBatchQueries(request: BatchQueryRequest): Promise<BatchQueryResponse>;
|
|
2102
|
+
embed(text: string | string[], options?: EmbedOptions): Promise<number[] | number[][]>;
|
|
2103
|
+
_getHttpClient(): AxiosInstance;
|
|
2104
|
+
/**
|
|
2105
|
+
* Creates a new table with the specified columns and constraints
|
|
2106
|
+
* @param tableName - Name of the table to create
|
|
2107
|
+
* @param columns - Column definitions for the table
|
|
2108
|
+
* @param options - Additional table creation options
|
|
2109
|
+
* @returns Promise resolving to table creation result
|
|
2110
|
+
*/
|
|
2111
|
+
createTable(tableName: string, columns: ColumnDefinition[], options?: CreateTableOptions): Promise<QueryResult>;
|
|
2112
|
+
/**
|
|
2113
|
+
* Alters an existing table structure
|
|
2114
|
+
* @param tableName - Name of the table to alter
|
|
2115
|
+
* @param alterOptions - Alteration options and parameters
|
|
2116
|
+
* @returns Promise resolving to alteration result
|
|
2117
|
+
*/
|
|
2118
|
+
alterTable(tableName: string, alterOptions: AlterTableOptions): Promise<QueryResult>;
|
|
2119
|
+
/**
|
|
2120
|
+
* Drops an existing table
|
|
2121
|
+
* @param tableName - Name of the table to drop
|
|
2122
|
+
* @param options - Drop options
|
|
2123
|
+
* @returns Promise resolving to drop result
|
|
2124
|
+
*/
|
|
2125
|
+
dropTable(tableName: string, options?: {
|
|
2126
|
+
ifExists?: boolean;
|
|
2127
|
+
cascade?: boolean;
|
|
2128
|
+
}): Promise<QueryResult>;
|
|
2129
|
+
/**
|
|
2130
|
+
* Describes a table structure including columns, constraints, and indexes
|
|
2131
|
+
* @param tableName - Name of the table to describe
|
|
2132
|
+
* @returns Promise resolving to table information
|
|
2133
|
+
*/
|
|
2134
|
+
describeTable(tableName: string): Promise<TableInfo>;
|
|
2135
|
+
/**
|
|
2136
|
+
* Lists all tables in the current database
|
|
2137
|
+
* @param pattern - Optional pattern to filter table names
|
|
2138
|
+
* @returns Promise resolving to array of table names
|
|
2139
|
+
*/
|
|
2140
|
+
showTables(pattern?: string): Promise<string[]>;
|
|
2141
|
+
/**
|
|
2142
|
+
* Creates an index on a table
|
|
2143
|
+
* @param indexDef - Index definition with name, table, columns, and options
|
|
2144
|
+
* @returns Promise resolving to index creation result
|
|
2145
|
+
*/
|
|
2146
|
+
createIndex(indexDef: IndexDefinition): Promise<QueryResult>;
|
|
2147
|
+
/**
|
|
2148
|
+
* Drops an existing index
|
|
2149
|
+
* @param indexName - Name of the index to drop
|
|
2150
|
+
* @param options - Drop options
|
|
2151
|
+
* @returns Promise resolving to drop result
|
|
2152
|
+
*/
|
|
2153
|
+
dropIndex(indexName: string, options?: {
|
|
2154
|
+
ifExists?: boolean;
|
|
2155
|
+
}): Promise<QueryResult>;
|
|
2156
|
+
/**
|
|
2157
|
+
* Lists all indexes, optionally filtered by table name
|
|
2158
|
+
* @param tableName - Optional table name to filter indexes
|
|
2159
|
+
* @returns Promise resolving to array of index information
|
|
2160
|
+
*/
|
|
2161
|
+
showIndexes(tableName?: string): Promise<Array<{
|
|
2162
|
+
name: string;
|
|
2163
|
+
table: string;
|
|
2164
|
+
columns: string[];
|
|
2165
|
+
unique: boolean;
|
|
2166
|
+
}>>;
|
|
2167
|
+
/**
|
|
2168
|
+
* Begins a new transaction
|
|
2169
|
+
* @param options - Transaction options including isolation level
|
|
2170
|
+
* @returns Promise resolving to transaction context
|
|
2171
|
+
*/
|
|
2172
|
+
beginTransaction(options?: TransactionOptions): Promise<TransactionContext>;
|
|
2173
|
+
/**
|
|
2174
|
+
* Commits the current transaction
|
|
2175
|
+
* @returns Promise resolving when transaction is committed
|
|
2176
|
+
*/
|
|
2177
|
+
commitTransaction(): Promise<void>;
|
|
2178
|
+
/**
|
|
2179
|
+
* Rolls back the current transaction
|
|
2180
|
+
* @returns Promise resolving when transaction is rolled back
|
|
2181
|
+
*/
|
|
2182
|
+
rollbackTransaction(): Promise<void>;
|
|
2183
|
+
/**
|
|
2184
|
+
* Gets the current transaction context
|
|
2185
|
+
* @returns Current transaction context or null if no transaction
|
|
2186
|
+
*/
|
|
2187
|
+
getCurrentTransaction(): TransactionContext | null;
|
|
2188
|
+
/**
|
|
2189
|
+
* Performs batch insert operations
|
|
2190
|
+
* @param options - Batch insert options with table, columns, and rows
|
|
2191
|
+
* @returns Promise resolving to batch operation result
|
|
2192
|
+
*/
|
|
2193
|
+
batchInsert(options: BatchInsertOptions): Promise<BatchResult>;
|
|
2194
|
+
/**
|
|
2195
|
+
* Performs batch update operations
|
|
2196
|
+
* @param options - Batch update options with table and update conditions
|
|
2197
|
+
* @returns Promise resolving to batch operation result
|
|
2198
|
+
*/
|
|
2199
|
+
batchUpdate(options: BatchUpdateOptions): Promise<BatchResult>;
|
|
2200
|
+
/**
|
|
2201
|
+
* Performs batch delete operations
|
|
2202
|
+
* @param options - Batch delete options with table and where conditions
|
|
2203
|
+
* @returns Promise resolving to batch operation result
|
|
2204
|
+
*/
|
|
2205
|
+
batchDelete(options: BatchDeleteOptions): Promise<BatchResult>;
|
|
2206
|
+
/**
|
|
2207
|
+
* Prepares a SQL statement for repeated execution
|
|
2208
|
+
* @param sql - SQL statement to prepare
|
|
2209
|
+
* @param options - Preparation options
|
|
2210
|
+
* @returns Promise resolving to prepared statement
|
|
2211
|
+
*/
|
|
2212
|
+
prepareStatement(sql: string, options?: PreparedStatementOptions): Promise<PreparedStatement>;
|
|
2213
|
+
/**
|
|
2214
|
+
* Executes a prepared statement with parameters
|
|
2215
|
+
* @param statementId - ID of the prepared statement or statement name
|
|
2216
|
+
* @param params - Parameters for the prepared statement
|
|
2217
|
+
* @returns Promise resolving to query result
|
|
2218
|
+
*/
|
|
2219
|
+
executePrepared(statementId: string, params?: any[]): Promise<QueryResult>;
|
|
2220
|
+
/**
|
|
2221
|
+
* Deallocates a prepared statement
|
|
2222
|
+
* @param statementId - ID of the prepared statement or statement name
|
|
2223
|
+
* @returns Promise resolving when statement is deallocated
|
|
2224
|
+
*/
|
|
2225
|
+
deallocatePrepared(statementId: string): Promise<void>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Executes a query with Common Table Expressions (CTEs)
|
|
2228
|
+
* @param ctes - Array of CTE definitions
|
|
2229
|
+
* @param mainQuery - Main query that uses the CTEs
|
|
2230
|
+
* @param params - Optional parameters for the query
|
|
2231
|
+
* @returns Promise resolving to query result
|
|
2232
|
+
*/
|
|
2233
|
+
queryWithCTEs(ctes: CTEDefinition[], mainQuery: string, params?: Record<string, any>): Promise<QueryResult>;
|
|
2234
|
+
/**
|
|
2235
|
+
* Executes a query with window functions
|
|
2236
|
+
* @param selectQuery - Base SELECT query
|
|
2237
|
+
* @param windowFunctions - Array of window function definitions
|
|
2238
|
+
* @param params - Optional parameters for the query
|
|
2239
|
+
* @returns Promise resolving to query result
|
|
2240
|
+
*/
|
|
2241
|
+
queryWithWindowFunctions(selectQuery: string, windowFunctions: Array<{
|
|
2242
|
+
alias: string;
|
|
2243
|
+
function: string;
|
|
2244
|
+
options: WindowFunctionOptions;
|
|
2245
|
+
}>, params?: Record<string, any>): Promise<QueryResult>;
|
|
2246
|
+
/**
|
|
2247
|
+
* Performs JSON operations on JSON/JSONB columns
|
|
2248
|
+
* @param tableName - Table containing JSON data
|
|
2249
|
+
* @param jsonColumn - Name of the JSON column
|
|
2250
|
+
* @param operation - JSON operation to perform
|
|
2251
|
+
* @param path - JSON path for the operation
|
|
2252
|
+
* @param value - Value for update operations
|
|
2253
|
+
* @param whereClause - Optional WHERE clause
|
|
2254
|
+
* @returns Promise resolving to query result
|
|
2255
|
+
*/
|
|
2256
|
+
jsonQuery(tableName: string, jsonColumn: string, operation: 'extract' | 'update' | 'delete' | 'contains', path: string, value?: any, whereClause?: string): Promise<QueryResult>;
|
|
2257
|
+
/**
|
|
2258
|
+
* Performs vector addition
|
|
2259
|
+
* @param vector1 - First vector
|
|
2260
|
+
* @param vector2 - Second vector
|
|
2261
|
+
* @returns Promise resolving to vector addition result
|
|
2262
|
+
*/
|
|
2263
|
+
vectorAdd(vector1: number[], vector2: number[]): Promise<VectorArithmeticResult>;
|
|
2264
|
+
/**
|
|
2265
|
+
* Performs vector subtraction
|
|
2266
|
+
* @param vector1 - First vector (minuend)
|
|
2267
|
+
* @param vector2 - Second vector (subtrahend)
|
|
2268
|
+
* @returns Promise resolving to vector subtraction result
|
|
2269
|
+
*/
|
|
2270
|
+
vectorSubtract(vector1: number[], vector2: number[]): Promise<VectorArithmeticResult>;
|
|
2271
|
+
/**
|
|
2272
|
+
* Performs scalar multiplication on a vector
|
|
2273
|
+
* @param vector - Input vector
|
|
2274
|
+
* @param scalar - Scalar value to multiply by
|
|
2275
|
+
* @returns Promise resolving to scalar multiplication result
|
|
2276
|
+
*/
|
|
2277
|
+
vectorScalarMultiply(vector: number[], scalar: number): Promise<VectorArithmeticResult>;
|
|
2278
|
+
/**
|
|
2279
|
+
* Calculates the dot product of two vectors
|
|
2280
|
+
* @param vector1 - First vector
|
|
2281
|
+
* @param vector2 - Second vector
|
|
2282
|
+
* @returns Promise resolving to dot product result
|
|
2283
|
+
*/
|
|
2284
|
+
vectorDotProduct(vector1: number[], vector2: number[]): Promise<{
|
|
2285
|
+
dotProduct: number;
|
|
2286
|
+
tookMs: number;
|
|
2287
|
+
}>;
|
|
2288
|
+
/**
|
|
2289
|
+
* Calculates cosine similarity between two vectors
|
|
2290
|
+
* @param vector1 - First vector
|
|
2291
|
+
* @param vector2 - Second vector
|
|
2292
|
+
* @returns Promise resolving to cosine similarity result
|
|
2293
|
+
*/
|
|
2294
|
+
cosineSimilarity(vector1: number[], vector2: number[]): Promise<VectorSimilarityResult>;
|
|
2295
|
+
/**
|
|
2296
|
+
* Calculates L2 (Euclidean) distance between two vectors
|
|
2297
|
+
* @param vector1 - First vector
|
|
2298
|
+
* @param vector2 - Second vector
|
|
2299
|
+
* @returns Promise resolving to L2 distance result
|
|
2300
|
+
*/
|
|
2301
|
+
l2Distance(vector1: number[], vector2: number[]): Promise<VectorSimilarityResult>;
|
|
2302
|
+
/**
|
|
2303
|
+
* Calculates inner product between two vectors
|
|
2304
|
+
* @param vector1 - First vector
|
|
2305
|
+
* @param vector2 - Second vector
|
|
2306
|
+
* @returns Promise resolving to inner product result
|
|
2307
|
+
*/
|
|
2308
|
+
innerProduct(vector1: number[], vector2: number[]): Promise<VectorSimilarityResult>;
|
|
2309
|
+
/**
|
|
2310
|
+
* Performs K-nearest neighbors vector search
|
|
2311
|
+
* @param options - KNN search options
|
|
2312
|
+
* @returns Promise resolving to KNN search results
|
|
2313
|
+
*/
|
|
2314
|
+
knnSearch(options: KNNSearchOptions): Promise<VectorSearchResult[]>;
|
|
2315
|
+
/**
|
|
2316
|
+
* Performs range-based vector similarity search
|
|
2317
|
+
* @param options - Range search options
|
|
2318
|
+
* @returns Promise resolving to range search results
|
|
2319
|
+
*/
|
|
2320
|
+
rangeSearch(options: RangeSearchOptions): Promise<VectorSearchResult[]>;
|
|
2321
|
+
/**
|
|
2322
|
+
* Performs hybrid search combining vector similarity and SQL filtering
|
|
2323
|
+
* @param options - Hybrid search options
|
|
2324
|
+
* @returns Promise resolving to hybrid search results
|
|
2325
|
+
*/
|
|
2326
|
+
hybridSearch(options: HybridSearchOptions): Promise<VectorSearchResult[]>;
|
|
2327
|
+
/**
|
|
2328
|
+
* Normalizes a vector to unit length
|
|
2329
|
+
* @param vector - Input vector to normalize
|
|
2330
|
+
* @returns Promise resolving to normalized vector
|
|
2331
|
+
*/
|
|
2332
|
+
normalizeVector(vector: number[]): Promise<VectorArithmeticResult>;
|
|
2333
|
+
/**
|
|
2334
|
+
* Calculates the magnitude (length) of a vector
|
|
2335
|
+
* @param vector - Input vector
|
|
2336
|
+
* @returns Promise resolving to vector magnitude
|
|
2337
|
+
*/
|
|
2338
|
+
vectorMagnitude(vector: number[]): Promise<{
|
|
2339
|
+
magnitude: number;
|
|
2340
|
+
tookMs: number;
|
|
2341
|
+
}>;
|
|
2342
|
+
/**
|
|
2343
|
+
* Register a new user
|
|
2344
|
+
*/
|
|
2345
|
+
registerUser(request: RegisterRequest): Promise<RegisterResponse>;
|
|
2346
|
+
/**
|
|
2347
|
+
* Login with username and password
|
|
2348
|
+
*/
|
|
2349
|
+
login(request: LoginRequest): Promise<LoginResponse>;
|
|
2350
|
+
/**
|
|
2351
|
+
* Refresh JWT token
|
|
2352
|
+
*/
|
|
2353
|
+
refreshToken(): Promise<RefreshResponse>;
|
|
2354
|
+
/**
|
|
2355
|
+
* Set JWT token manually (useful after login)
|
|
2356
|
+
*/
|
|
2357
|
+
setJWTToken(token: string): void;
|
|
2358
|
+
/**
|
|
2359
|
+
* Clear authentication (logout)
|
|
2360
|
+
*/
|
|
2361
|
+
logout(): void;
|
|
2362
|
+
/**
|
|
2363
|
+
* Create a new API key
|
|
2364
|
+
*/
|
|
2365
|
+
createAPIKey(request: CreateAPIKeyRequest): Promise<CreateAPIKeyResponse>;
|
|
2366
|
+
/**
|
|
2367
|
+
* List all API keys
|
|
2368
|
+
*/
|
|
2369
|
+
listAPIKeys(): Promise<ListAPIKeysResponse>;
|
|
2370
|
+
/**
|
|
2371
|
+
* Get API key statistics
|
|
2372
|
+
*/
|
|
2373
|
+
getAPIKeyStats(keyId: string): Promise<APIKeyStats>;
|
|
2374
|
+
/**
|
|
2375
|
+
* Revoke (delete) an API key
|
|
2376
|
+
*/
|
|
2377
|
+
revokeAPIKey(keyId: string): Promise<void>;
|
|
2378
|
+
/**
|
|
2379
|
+
* Upload multimedia file to a document
|
|
2380
|
+
*/
|
|
2381
|
+
uploadMultimedia(collection: string, documentId: string, file: File | Blob | Buffer, metadata?: Record<string, any>): Promise<MultimediaInfo>;
|
|
2382
|
+
/**
|
|
2383
|
+
* Get multimedia file URL (for viewing/downloading)
|
|
2384
|
+
*/
|
|
2385
|
+
getMultimediaUrl(collection: string, documentId: string, multimediaId: string, download?: boolean): string;
|
|
2386
|
+
/**
|
|
2387
|
+
* Get multimedia thumbnail URL
|
|
2388
|
+
*/
|
|
2389
|
+
getMultimediaThumbnailUrl(collection: string, documentId: string, multimediaId: string): string;
|
|
2390
|
+
/**
|
|
2391
|
+
* List multimedia files in a document
|
|
2392
|
+
*/
|
|
2393
|
+
listMultimedia(collection: string, documentId: string, limit?: number, offset?: number): Promise<ListMultimediaResponse>;
|
|
2394
|
+
/**
|
|
2395
|
+
* Get multimedia file information
|
|
2396
|
+
*/
|
|
2397
|
+
getMultimedia(collection: string, documentId: string, multimediaId: string): Promise<MultimediaInfo>;
|
|
2398
|
+
/**
|
|
2399
|
+
* Delete multimedia file
|
|
2400
|
+
*/
|
|
2401
|
+
deleteMultimedia(collection: string, documentId: string, multimediaId: string): Promise<void>;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
/**
|
|
2405
|
+
* Error classes for SynapCores SDK
|
|
2406
|
+
*/
|
|
2407
|
+
declare class SynapCoresError extends Error {
|
|
2408
|
+
readonly code?: string;
|
|
2409
|
+
readonly details?: Record<string, any>;
|
|
2410
|
+
constructor(message: string, code?: string, details?: Record<string, any>);
|
|
2411
|
+
}
|
|
2412
|
+
declare class ConnectionError extends SynapCoresError {
|
|
2413
|
+
constructor(message: string, details?: Record<string, any>);
|
|
2414
|
+
}
|
|
2415
|
+
declare class AuthenticationError extends SynapCoresError {
|
|
2416
|
+
constructor(message: string, details?: Record<string, any>);
|
|
2417
|
+
}
|
|
2418
|
+
declare class ValidationError extends SynapCoresError {
|
|
2419
|
+
constructor(message: string, details?: Record<string, any>);
|
|
2420
|
+
}
|
|
2421
|
+
declare class NotFoundError extends SynapCoresError {
|
|
2422
|
+
constructor(message: string, details?: Record<string, any>);
|
|
2423
|
+
}
|
|
2424
|
+
declare class ServerError extends SynapCoresError {
|
|
2425
|
+
constructor(message: string, details?: Record<string, any>);
|
|
2426
|
+
}
|
|
2427
|
+
declare class TimeoutError extends SynapCoresError {
|
|
2428
|
+
constructor(message: string, details?: Record<string, any>);
|
|
2429
|
+
}
|
|
2430
|
+
declare class RateLimitError extends SynapCoresError {
|
|
2431
|
+
readonly retryAfter?: number;
|
|
2432
|
+
constructor(message: string, retryAfter?: number, details?: Record<string, any>);
|
|
2433
|
+
}
|
|
2434
|
+
declare class SQLError extends SynapCoresError {
|
|
2435
|
+
readonly severity: 'ERROR' | 'WARNING' | 'INFO';
|
|
2436
|
+
readonly position?: number;
|
|
2437
|
+
readonly hint?: string;
|
|
2438
|
+
readonly detail?: string;
|
|
2439
|
+
constructor(message: string, code: string, severity?: 'ERROR' | 'WARNING' | 'INFO', position?: number, hint?: string, detail?: string, details?: Record<string, any>);
|
|
2440
|
+
}
|
|
2441
|
+
declare class VectorError extends SynapCoresError {
|
|
2442
|
+
readonly vectorDimensions?: number;
|
|
2443
|
+
readonly expectedDimensions?: number;
|
|
2444
|
+
readonly operation?: string;
|
|
2445
|
+
constructor(message: string, code: string, vectorDimensions?: number, expectedDimensions?: number, operation?: string, details?: Record<string, any>);
|
|
2446
|
+
}
|
|
2447
|
+
declare class TransactionError extends SynapCoresError {
|
|
2448
|
+
readonly transactionId?: string;
|
|
2449
|
+
readonly transactionState?: string;
|
|
2450
|
+
constructor(message: string, code: string, transactionId?: string, transactionState?: string, details?: Record<string, any>);
|
|
2451
|
+
}
|
|
2452
|
+
declare class BatchOperationError extends SynapCoresError {
|
|
2453
|
+
readonly failedItems?: Array<{
|
|
2454
|
+
index: number;
|
|
2455
|
+
error: string;
|
|
2456
|
+
}>;
|
|
2457
|
+
readonly totalProcessed?: number;
|
|
2458
|
+
readonly successfulCount?: number;
|
|
2459
|
+
constructor(message: string, code: string, failedItems?: Array<{
|
|
2460
|
+
index: number;
|
|
2461
|
+
error: string;
|
|
2462
|
+
}>, totalProcessed?: number, successfulCount?: number, details?: Record<string, any>);
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* SynapCores Node.js/TypeScript SDK
|
|
2467
|
+
*
|
|
2468
|
+
* Official SDK for SynapCores AI-Native Database Management System.
|
|
2469
|
+
*/
|
|
2470
|
+
|
|
2471
|
+
declare const VERSION = "0.1.0";
|
|
2472
|
+
|
|
2473
|
+
export { type APIKeyInfo, type APIKeyStats, type AlterTableOptions, type AnalyzeOptions, type AsyncTrainOptions, type AuthConfig, AuthenticationError, AutoMLClient, AutoMLModel, type Backup, BackupClient, type BackupMetrics, type BackupOptions, type BackupSchedule, type BackupStatus, type BackupVerificationResult, type BatchDeleteOptions, type BatchInsertOptions, BatchOperationError, type BatchQueryRequest, type BatchQueryResponse, type BatchQueryResult, type BatchResult, type BatchUpdateOptions, type BulkImportOptions, type BulkImportResult, type CTEDefinition, type ChangeOperation, Collection, type CollectionFieldDefinition, type CollectionIndexDefinition, type CollectionInfo, type CollectionSchema, type CollectionSchemaDefinition, type CollectionStats, type ColumnConstraint, type ColumnDefinition, type ColumnInfo, ConnectionError, type ConnectionPool, type ConstraintInfo, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateCollectionRequest, type CreateCollectionResponse, type CreateIntegrationOptions, type CreateRecipeOptions, type CreateScheduleOptions, type CreateTableOptions, type CreateWebhookOptions, type DataValidationOptions, type DataValidationResult, type Document, type EmbedOptions, type Entity, type EvaluationResult, type ExecuteIntegrationOptions, type ExecuteQueryRequest, type ExecuteRecipeOptions, type ExportJobStatus, type ExportOptions, type ExportResult, type ForeignKeyReference, type GenerateRecipeOptions, type GeneratedRecipe, type HybridSearchOptions, type ImportError, ImportExportClient, type ImportJobStatus, type ImportOptions, type ImportResult, type ValidationError$1 as ImportValidationError, type ValidationWarning as ImportValidationWarning, type IndexDefinition, type IndexInfo, type InsertResult, type Integration, IntegrationClient, type IntegrationConfig, type IntegrationEvent, type IntegrationExecutionResult, type IntegrationLog, type IntegrationStats, type IntegrationWebhook, type KNNSearchOptions, type ListAPIKeysResponse, type ListBackupsOptions, type ListCollectionsResponse, type ListIntegrationsOptions, type ListMultimediaResponse, type ListRecipesOptions, type ListTrainingJobsOptions, type LoginRequest, type LoginResponse, type ModelInfo, type MultimediaInfo, type NLPAnalysis, NLPClient, NotFoundError, type OAuth2Config, type PredictResult, type PreparedStatement, type PreparedStatementOptions, type QueryColumn, type QueryOptions, type QueryPerformance, type QueryResult, type RangeSearchOptions, RateLimitError, type Recipe, RecipeClient, type RecipeExecutionResult, type RecipeInfo, type RecipeParameter, type RefreshResponse, type RegisterRequest, type RegisterResponse, type RelationshipInfo, type RestoreOptions, type RestoreResult, type RestoreStatus, type RetryConfig, SQLError, SchemaClient, type SchemaStatistics, type ValidationError$2 as SchemaValidationError, type SearchOptions, type SearchResult, type Sentiment, ServerError, type StorageConfig, Subscription, type SubscriptionEvent, type SubscriptionOptions, type SummarizeOptions, SynapCores, type SynapCoresConfig, SynapCoresError, type TableConstraint, type TableInfo, type TableSchema, type TestIntegrationOptions, type TestIntegrationResult, TimeoutError, type TrainOptions, type TrainingJob, type TrainingMetrics, type TransactionContext, TransactionError, type TransactionOptions, type UpdateOptions, type UploadMultimediaRequest, VERSION, ValidationError, type ValidationResult, type ValidationWarning$1 as ValidationWarning, type Vector, type VectorArithmeticResult, VectorError, type VectorSearchOptions, type VectorSearchResult, type VectorSimilarityResult, type WindowFunctionOptions };
|