@boltic/sdk 0.0.7 → 0.0.8
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/README.md +106 -0
- package/dist/databases/index.d.ts +263 -40
- package/dist/databases/index.js +1 -1
- package/dist/databases/index.js.map +1 -1
- package/dist/databases/index.mjs +2 -2
- package/dist/databases/index.mjs.map +1 -1
- package/dist/databases/test-client-BuQuW6Y-.js +2 -0
- package/dist/databases/test-client-BuQuW6Y-.js.map +1 -0
- package/dist/databases/{test-client-rQ1AmTo6.mjs → test-client-D8i2zDgI.mjs} +994 -171
- package/dist/databases/test-client-D8i2zDgI.mjs.map +1 -0
- package/dist/databases/testing.d.ts +249 -103
- package/dist/databases/testing.js +1 -1
- package/dist/databases/testing.mjs +1 -1
- package/dist/sdk.js +929 -171
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.mjs +929 -171
- package/dist/sdk.mjs.map +1 -1
- package/dist/types/index.d.ts +213 -40
- package/package.json +11 -8
- package/dist/databases/test-client-DfOmma3t.js +0 -2
- package/dist/databases/test-client-DfOmma3t.js.map +0 -1
- package/dist/databases/test-client-rQ1AmTo6.mjs.map +0 -1
|
@@ -23,7 +23,7 @@ declare interface ApiFilter {
|
|
|
23
23
|
values: unknown[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
declare type ApiResponse<T> = BolticSuccessResponse<T> | BolticListResponse<T> |
|
|
26
|
+
declare type ApiResponse<T> = BolticSuccessResponse<T> | BolticListResponse<T> | BolticErrorResponse;
|
|
27
27
|
|
|
28
28
|
declare interface AuthConfig {
|
|
29
29
|
apiKey: string;
|
|
@@ -79,19 +79,53 @@ declare class BolticClient {
|
|
|
79
79
|
private recordResource;
|
|
80
80
|
private sqlResource;
|
|
81
81
|
private indexResource;
|
|
82
|
+
private databaseResource;
|
|
82
83
|
private currentDatabase;
|
|
83
84
|
private clientOptions;
|
|
84
85
|
constructor(apiKey: string, options?: ClientOptions);
|
|
86
|
+
/**
|
|
87
|
+
* Get current database context
|
|
88
|
+
*/
|
|
85
89
|
getCurrentDatabase(): DatabaseContext | null;
|
|
90
|
+
/**
|
|
91
|
+
* Switch to a different database using its internal name (slug).
|
|
92
|
+
* All subsequent operations will use this database.
|
|
93
|
+
*
|
|
94
|
+
* If no internal name is provided, the SDK will switch back to the default database.
|
|
95
|
+
*
|
|
96
|
+
* @param dbInternalName - Database internal name/slug to switch to. If omitted or empty, default DB is used.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* // Switch to a specific database by slug
|
|
101
|
+
* await client.useDatabase('my_database_slug');
|
|
102
|
+
*
|
|
103
|
+
* // Switch back to default database
|
|
104
|
+
* await client.useDatabase();
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
useDatabase(dbInternalName?: string): Promise<void>;
|
|
108
|
+
get databases(): {
|
|
109
|
+
create: (data: DatabaseCreateRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<DatabaseRecord>>;
|
|
110
|
+
findAll: (options?: DatabaseQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<DatabaseRecord>>;
|
|
111
|
+
findOne: (dbInternalName: string, options?: {
|
|
112
|
+
fields?: string[];
|
|
113
|
+
}) => Promise<BolticErrorResponse | BolticSuccessResponse<DatabaseRecord>>;
|
|
114
|
+
getDefault: () => Promise<BolticErrorResponse | BolticSuccessResponse<DatabaseRecord>>;
|
|
115
|
+
update: (dbInternalName: string, data: DatabaseUpdateRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<DatabaseRecord>>;
|
|
116
|
+
delete: (dbInternalName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<DatabaseDeletionJobResponse>>;
|
|
117
|
+
listJobs: (options?: DatabaseJobQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<DatabaseJobRecord>>;
|
|
118
|
+
pollDeleteStatus: (jobId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<DatabaseDeletionStatusResponse>>;
|
|
119
|
+
};
|
|
86
120
|
get tables(): {
|
|
87
121
|
create: (data: TableCreateRequest) => Promise<BolticSuccessResponse<TableCreateResponse>>;
|
|
88
122
|
findAll: (options?: TableQueryOptions) => Promise<ApiResponse<TableRecord>>;
|
|
89
|
-
findById: (id: string) => Promise<
|
|
90
|
-
findByName: (name: string) => Promise<
|
|
91
|
-
findOne: (options: TableQueryOptions) => Promise<
|
|
92
|
-
update: (name: string, data: TableUpdateRequest) => Promise<
|
|
93
|
-
delete: (name: string) => Promise<
|
|
94
|
-
|
|
123
|
+
findById: (id: string) => Promise<BolticErrorResponse | BolticSuccessResponse<TableRecord | null>>;
|
|
124
|
+
findByName: (name: string) => Promise<BolticErrorResponse | BolticSuccessResponse<TableRecord | null>>;
|
|
125
|
+
findOne: (options: TableQueryOptions) => Promise<BolticErrorResponse | BolticSuccessResponse<TableRecord | null>>;
|
|
126
|
+
update: (name: string, data: TableUpdateRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<TableRecord>>;
|
|
127
|
+
delete: (name: string) => Promise<BolticErrorResponse | BolticSuccessResponse<{
|
|
128
|
+
message: string;
|
|
95
129
|
}>>;
|
|
96
130
|
rename: (oldName: string, newName: string) => Promise<BolticSuccessResponse<TableRecord>>;
|
|
97
131
|
setAccess: (request: {
|
|
@@ -100,76 +134,65 @@ declare class BolticClient {
|
|
|
100
134
|
}) => Promise<BolticSuccessResponse<TableRecord>>;
|
|
101
135
|
};
|
|
102
136
|
get columns(): {
|
|
103
|
-
create: (tableName: string, column: FieldDefinition) => Promise<
|
|
104
|
-
createMany: (tableName: string, columns: FieldDefinition[]) => Promise<
|
|
105
|
-
findAll: (tableName: string, options?: ColumnQueryOptions) => Promise<
|
|
106
|
-
findOne: (tableName: string, columnName: string) => Promise<
|
|
107
|
-
findById: (tableName: string, columnId: string) => Promise<
|
|
108
|
-
update: (tableName: string, columnName: string, updates: ColumnUpdateRequest) => Promise<
|
|
109
|
-
delete: (tableName: string, columnName: string) => Promise<
|
|
110
|
-
|
|
111
|
-
|
|
137
|
+
create: (tableName: string, column: FieldDefinition) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnRecord>>;
|
|
138
|
+
createMany: (tableName: string, columns: FieldDefinition[]) => Promise<BolticErrorResponse | BolticListResponse<ColumnRecord>>;
|
|
139
|
+
findAll: (tableName: string, options?: ColumnQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<ColumnDetails>>;
|
|
140
|
+
findOne: (tableName: string, columnName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
|
|
141
|
+
findById: (tableName: string, columnId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
|
|
142
|
+
update: (tableName: string, columnName: string, updates: ColumnUpdateRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
|
|
143
|
+
delete: (tableName: string, columnName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
message?: string | undefined;
|
|
112
146
|
}>>;
|
|
113
147
|
};
|
|
114
148
|
get indexes(): {
|
|
115
|
-
addIndex: (tableName: string, payload: AddIndexRequest) => Promise<
|
|
116
|
-
listIndexes: (tableName: string, query: ListIndexesQuery) => Promise<
|
|
117
|
-
deleteIndex: (tableName: string, indexName: string) => Promise<
|
|
149
|
+
addIndex: (tableName: string, payload: AddIndexRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<AddIndexResponse>>;
|
|
150
|
+
listIndexes: (tableName: string, query: ListIndexesQuery) => Promise<BolticErrorResponse | BolticSuccessResponse<ListIndexesResponse>>;
|
|
151
|
+
deleteIndex: (tableName: string, indexName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<DeleteIndexResponse>>;
|
|
118
152
|
};
|
|
119
153
|
table(name: string): TableBuilder;
|
|
120
154
|
from(tableName: string): {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
update: (columnName: string, updates: ColumnUpdateRequest) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnDetails>>;
|
|
126
|
-
delete: (columnName: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
|
|
127
|
-
success: boolean;
|
|
128
|
-
message?: string | undefined;
|
|
129
|
-
}>>;
|
|
155
|
+
indexes: () => {
|
|
156
|
+
addIndex: (payload: AddIndexRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<AddIndexResponse>>;
|
|
157
|
+
listIndexes: (query: ListIndexesQuery) => Promise<BolticErrorResponse | BolticSuccessResponse<ListIndexesResponse>>;
|
|
158
|
+
deleteIndex: (indexName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<DeleteIndexResponse>>;
|
|
130
159
|
};
|
|
131
160
|
records: () => {
|
|
132
|
-
insert: (data: RecordData) => Promise<
|
|
161
|
+
insert: (data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
133
162
|
insertMany: (records: RecordData[], options?: {
|
|
134
163
|
validation?: boolean;
|
|
135
|
-
}) => Promise<RecordBulkInsertResponse |
|
|
136
|
-
findOne: (recordId: string) => Promise<
|
|
137
|
-
update: (options: RecordUpdateOptions) => Promise<
|
|
138
|
-
updateById: (recordId: string, data: RecordData) => Promise<
|
|
139
|
-
delete: (options: RecordDeleteOptions) => Promise<
|
|
140
|
-
|
|
164
|
+
}) => Promise<RecordBulkInsertResponse | BolticErrorResponse>;
|
|
165
|
+
findOne: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
166
|
+
update: (options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
167
|
+
updateById: (recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
168
|
+
delete: (options: RecordDeleteOptions) => Promise<BolticErrorResponse | BolticSuccessResponse<{
|
|
169
|
+
message: string;
|
|
141
170
|
}>>;
|
|
142
|
-
deleteById: (recordId: string) => Promise<
|
|
143
|
-
|
|
171
|
+
deleteById: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<{
|
|
172
|
+
message: string;
|
|
144
173
|
}>>;
|
|
145
174
|
};
|
|
146
|
-
record: () => RecordBuilder;
|
|
147
|
-
indexes: () => {
|
|
148
|
-
addIndex: (payload: AddIndexRequest) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<AddIndexResponse>>;
|
|
149
|
-
listIndexes: (query: ListIndexesQuery) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ListIndexesResponse>>;
|
|
150
|
-
deleteIndex: (indexName: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<DeleteIndexResponse>>;
|
|
151
|
-
};
|
|
152
175
|
};
|
|
153
176
|
get records(): {
|
|
154
|
-
insert: (tableName: string, data: RecordData) => Promise<
|
|
177
|
+
insert: (tableName: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
155
178
|
insertMany: (tableName: string, records: RecordData[], options?: {
|
|
156
179
|
validation?: boolean;
|
|
157
|
-
}) => Promise<RecordBulkInsertResponse |
|
|
158
|
-
findAll: (tableName: string, options?: RecordQueryOptions) => Promise<
|
|
159
|
-
findOne: (tableName: string, recordId: string) => Promise<
|
|
160
|
-
update: (tableName: string, options: RecordUpdateOptions) => Promise<
|
|
161
|
-
updateById: (tableName: string, recordId: string, data: RecordData) => Promise<
|
|
162
|
-
delete: (tableName: string, options: RecordDeleteOptions) => Promise<
|
|
163
|
-
|
|
180
|
+
}) => Promise<RecordBulkInsertResponse | BolticErrorResponse>;
|
|
181
|
+
findAll: (tableName: string, options?: RecordQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
182
|
+
findOne: (tableName: string, recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
183
|
+
update: (tableName: string, options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
184
|
+
updateById: (tableName: string, recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
185
|
+
delete: (tableName: string, options: RecordDeleteOptions) => Promise<BolticErrorResponse | BolticSuccessResponse<{
|
|
186
|
+
message: string;
|
|
164
187
|
}>>;
|
|
165
|
-
deleteById: (tableName: string, recordId: string) => Promise<
|
|
166
|
-
|
|
188
|
+
deleteById: (tableName: string, recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<{
|
|
189
|
+
message: string;
|
|
167
190
|
}>>;
|
|
168
191
|
};
|
|
169
192
|
record(tableName: string): RecordBuilder;
|
|
170
193
|
get sql(): {
|
|
171
194
|
textToSQL: (prompt: string, options?: TextToSQLOptions) => Promise<AsyncIterable<string>>;
|
|
172
|
-
executeSQL: (query: string) => Promise<
|
|
195
|
+
executeSQL: (query: string) => Promise<BolticErrorResponse | ExecuteSQLApiResponse_2>;
|
|
173
196
|
};
|
|
174
197
|
getSqlResource(): SqlResource;
|
|
175
198
|
updateApiKey(newApiKey: string): void;
|
|
@@ -252,23 +275,6 @@ declare interface BolticListResponse_2<T = unknown> {
|
|
|
252
275
|
message?: string;
|
|
253
276
|
}
|
|
254
277
|
|
|
255
|
-
declare interface BolticListResponse_3<T> {
|
|
256
|
-
data: T[];
|
|
257
|
-
pagination?: {
|
|
258
|
-
total_count: number;
|
|
259
|
-
total_pages: number;
|
|
260
|
-
current_page: number;
|
|
261
|
-
per_page: number;
|
|
262
|
-
type: string;
|
|
263
|
-
};
|
|
264
|
-
message?: string;
|
|
265
|
-
error?: {
|
|
266
|
-
code?: string;
|
|
267
|
-
message?: string;
|
|
268
|
-
meta?: string[];
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
|
|
272
278
|
declare interface BolticSuccessResponse<T> {
|
|
273
279
|
data: T;
|
|
274
280
|
message?: string;
|
|
@@ -284,16 +290,6 @@ declare interface BolticSuccessResponse_2<T = unknown> {
|
|
|
284
290
|
message?: string;
|
|
285
291
|
}
|
|
286
292
|
|
|
287
|
-
declare interface BolticSuccessResponse_3<T> {
|
|
288
|
-
data: T;
|
|
289
|
-
message?: string;
|
|
290
|
-
error?: {
|
|
291
|
-
code?: string;
|
|
292
|
-
message?: string;
|
|
293
|
-
meta?: string[];
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
293
|
declare interface ClientConfig extends EnvironmentConfig {
|
|
298
294
|
apiKey: string;
|
|
299
295
|
environment: Environment;
|
|
@@ -404,7 +400,126 @@ export declare function createMockResponse<T>(data: T, pagination?: PaginationIn
|
|
|
404
400
|
export declare function createTestClient(options?: MockClientOptions): BolticClient;
|
|
405
401
|
|
|
406
402
|
declare interface DatabaseContext {
|
|
407
|
-
|
|
403
|
+
databaseId?: string;
|
|
404
|
+
dbInternalName?: string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Request to create a new database
|
|
409
|
+
*/
|
|
410
|
+
declare interface DatabaseCreateRequest {
|
|
411
|
+
db_name: string;
|
|
412
|
+
db_internal_name?: string;
|
|
413
|
+
resource_id?: string;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Database deletion job initial response
|
|
418
|
+
*/
|
|
419
|
+
declare interface DatabaseDeletionJobResponse {
|
|
420
|
+
job_id: string;
|
|
421
|
+
db_id: string;
|
|
422
|
+
status: 'pending';
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Database deletion status response
|
|
427
|
+
*/
|
|
428
|
+
declare interface DatabaseDeletionStatusResponse {
|
|
429
|
+
jobId: string;
|
|
430
|
+
status: DatabaseJobStatus;
|
|
431
|
+
message: string;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Database Job action enum
|
|
436
|
+
*/
|
|
437
|
+
declare type DatabaseJobAction = 'DELETE';
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Database job query options for SDK methods
|
|
441
|
+
*/
|
|
442
|
+
declare interface DatabaseJobQueryOptions {
|
|
443
|
+
deleted_by_me?: boolean;
|
|
444
|
+
page?: PaginationParams;
|
|
445
|
+
sort?: SortParams[];
|
|
446
|
+
filters?: FilterParams[];
|
|
447
|
+
fields?: string[];
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Database job record from API
|
|
452
|
+
*/
|
|
453
|
+
declare interface DatabaseJobRecord {
|
|
454
|
+
id: string;
|
|
455
|
+
account_id: string;
|
|
456
|
+
resource_id: string;
|
|
457
|
+
type: string;
|
|
458
|
+
action: DatabaseJobAction;
|
|
459
|
+
db_id: string;
|
|
460
|
+
db_internal_name: string;
|
|
461
|
+
db_username: string;
|
|
462
|
+
job_status: DatabaseJobStatus;
|
|
463
|
+
total_dbs: number;
|
|
464
|
+
successful_dbs: number;
|
|
465
|
+
failed_dbs: number;
|
|
466
|
+
error: string | null;
|
|
467
|
+
is_read: boolean;
|
|
468
|
+
created_by: string;
|
|
469
|
+
created_at: string;
|
|
470
|
+
updated_at: string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Database Job status enum
|
|
475
|
+
*/
|
|
476
|
+
declare type DatabaseJobStatus = 'pending' | 'in_progress' | 'success' | 'failed';
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Database query options for SDK methods
|
|
480
|
+
*/
|
|
481
|
+
declare interface DatabaseQueryOptions {
|
|
482
|
+
connector_id?: string;
|
|
483
|
+
add_default_if_missing?: boolean;
|
|
484
|
+
page?: PaginationParams;
|
|
485
|
+
sort?: SortParams[];
|
|
486
|
+
filters?: FilterParams[];
|
|
487
|
+
fields?: string[];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Database record from API
|
|
492
|
+
*/
|
|
493
|
+
declare interface DatabaseRecord {
|
|
494
|
+
id: string;
|
|
495
|
+
account_id: string;
|
|
496
|
+
db_name: string;
|
|
497
|
+
db_internal_name: string;
|
|
498
|
+
db_username: string;
|
|
499
|
+
resource_id: string;
|
|
500
|
+
status: DatabaseStatus;
|
|
501
|
+
is_default: boolean;
|
|
502
|
+
rank: number;
|
|
503
|
+
created_by: string;
|
|
504
|
+
updated_by: string;
|
|
505
|
+
created_at: string;
|
|
506
|
+
updated_at: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Database Management API Types
|
|
511
|
+
* Based on DATABASE_MANAGEMENT_API_CONTRACT.md
|
|
512
|
+
*/
|
|
513
|
+
/**
|
|
514
|
+
* Database status enum
|
|
515
|
+
*/
|
|
516
|
+
declare type DatabaseStatus = 'ACTIVE' | 'INACTIVE';
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Request to update a database
|
|
520
|
+
*/
|
|
521
|
+
declare interface DatabaseUpdateRequest {
|
|
522
|
+
db_name: string;
|
|
408
523
|
}
|
|
409
524
|
|
|
410
525
|
declare const DateFormatEnum: Readonly<{
|
|
@@ -504,6 +619,15 @@ declare interface FieldDefinition {
|
|
|
504
619
|
|
|
505
620
|
declare type FieldType = 'text' | 'long-text' | 'number' | 'currency' | 'checkbox' | 'dropdown' | 'email' | 'phone-number' | 'link' | 'json' | 'date-time' | 'vector' | 'halfvec' | 'sparsevec';
|
|
506
621
|
|
|
622
|
+
/**
|
|
623
|
+
* Filter parameters
|
|
624
|
+
*/
|
|
625
|
+
declare interface FilterParams {
|
|
626
|
+
field: string;
|
|
627
|
+
operator: string;
|
|
628
|
+
values: any[];
|
|
629
|
+
}
|
|
630
|
+
|
|
507
631
|
declare interface HttpRequestConfig {
|
|
508
632
|
url: string;
|
|
509
633
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -604,6 +728,14 @@ declare interface PaginationInfo {
|
|
|
604
728
|
type: string;
|
|
605
729
|
}
|
|
606
730
|
|
|
731
|
+
/**
|
|
732
|
+
* Pagination parameters
|
|
733
|
+
*/
|
|
734
|
+
declare interface PaginationParams {
|
|
735
|
+
page_no?: number;
|
|
736
|
+
page_size?: number;
|
|
737
|
+
}
|
|
738
|
+
|
|
607
739
|
declare type PhoneFormatType = '+91 123 456 7890' | '(123) 456-7890' | '+1 (123) 456-7890' | '+91 12 3456 7890';
|
|
608
740
|
|
|
609
741
|
/**
|
|
@@ -646,15 +778,15 @@ declare class RecordBuilder {
|
|
|
646
778
|
/**
|
|
647
779
|
* Execute list operation (was findAll)
|
|
648
780
|
*/
|
|
649
|
-
list(): Promise<
|
|
781
|
+
list(): Promise<BolticListResponse<RecordWithId> | BolticErrorResponse>;
|
|
650
782
|
/**
|
|
651
783
|
* Execute findAll operation (alias for list)
|
|
652
784
|
*/
|
|
653
|
-
findAll(): Promise<
|
|
785
|
+
findAll(): Promise<BolticListResponse<RecordWithId> | BolticErrorResponse>;
|
|
654
786
|
/**
|
|
655
787
|
* Execute findOne operation by getting first result from list
|
|
656
788
|
*/
|
|
657
|
-
findOne(): Promise<
|
|
789
|
+
findOne(): Promise<BolticSuccessResponse<RecordWithId | null> | BolticErrorResponse>;
|
|
658
790
|
/**
|
|
659
791
|
* Build where conditions from filters for API consumption
|
|
660
792
|
*/
|
|
@@ -662,27 +794,27 @@ declare class RecordBuilder {
|
|
|
662
794
|
/**
|
|
663
795
|
* Execute update operation - requires filters or record IDs
|
|
664
796
|
*/
|
|
665
|
-
update(): Promise<
|
|
797
|
+
update(): Promise<BolticListResponse<RecordWithId> | BolticErrorResponse>;
|
|
666
798
|
/**
|
|
667
799
|
* Execute update by ID operation
|
|
668
800
|
*/
|
|
669
|
-
updateById(id: string): Promise<
|
|
801
|
+
updateById(id: string): Promise<BolticSuccessResponse<RecordWithId> | BolticErrorResponse>;
|
|
670
802
|
/**
|
|
671
803
|
* Execute delete by single ID operation
|
|
672
804
|
*/
|
|
673
|
-
deleteById(id: string): Promise<
|
|
805
|
+
deleteById(id: string): Promise<BolticSuccessResponse<{
|
|
674
806
|
message: string;
|
|
675
807
|
}> | BolticErrorResponse>;
|
|
676
808
|
/**
|
|
677
809
|
* Execute delete by IDs operation
|
|
678
810
|
*/
|
|
679
|
-
deleteByIds(ids: string[]): Promise<
|
|
811
|
+
deleteByIds(ids: string[]): Promise<BolticSuccessResponse<{
|
|
680
812
|
message: string;
|
|
681
813
|
}> | BolticErrorResponse>;
|
|
682
814
|
/**
|
|
683
815
|
* Execute delete operation using filters
|
|
684
816
|
*/
|
|
685
|
-
delete(): Promise<
|
|
817
|
+
delete(): Promise<BolticSuccessResponse<{
|
|
686
818
|
message: string;
|
|
687
819
|
}> | BolticErrorResponse>;
|
|
688
820
|
/**
|
|
@@ -696,7 +828,7 @@ declare class RecordBuilder {
|
|
|
696
828
|
/**
|
|
697
829
|
* Execute insert operation
|
|
698
830
|
*/
|
|
699
|
-
insert(data: RecordData): Promise<
|
|
831
|
+
insert(data: RecordData): Promise<BolticSuccessResponse<RecordWithId> | BolticErrorResponse>;
|
|
700
832
|
}
|
|
701
833
|
|
|
702
834
|
declare interface RecordBuilderOptions {
|
|
@@ -749,37 +881,37 @@ declare class RecordResource {
|
|
|
749
881
|
/**
|
|
750
882
|
* Insert a single record
|
|
751
883
|
*/
|
|
752
|
-
insert(tableName: string, data: RecordData): Promise<
|
|
884
|
+
insert(tableName: string, data: RecordData, dbId?: string): Promise<BolticSuccessResponse<RecordWithId> | BolticErrorResponse>;
|
|
753
885
|
/**
|
|
754
886
|
* Insert multiple records in bulk
|
|
755
887
|
*/
|
|
756
|
-
insertMany(tableName: string, records: RecordData[], options?: RecordBulkInsertOptions): Promise<RecordBulkInsertResponse | BolticErrorResponse>;
|
|
888
|
+
insertMany(tableName: string, records: RecordData[], options?: RecordBulkInsertOptions, dbId?: string): Promise<RecordBulkInsertResponse | BolticErrorResponse>;
|
|
757
889
|
/**
|
|
758
890
|
* Get a single record by ID
|
|
759
891
|
*/
|
|
760
|
-
get(tableName: string, recordId: string): Promise<
|
|
892
|
+
get(tableName: string, recordId: string, dbId?: string): Promise<BolticSuccessResponse<RecordWithId> | BolticErrorResponse>;
|
|
761
893
|
/**
|
|
762
894
|
* List records with filtering and pagination
|
|
763
895
|
*/
|
|
764
|
-
list(tableName: string, options?: RecordQueryOptions): Promise<
|
|
896
|
+
list(tableName: string, options?: RecordQueryOptions, dbId?: string): Promise<BolticListResponse<RecordWithId> | BolticErrorResponse>;
|
|
765
897
|
/**
|
|
766
898
|
* Update records by filters
|
|
767
899
|
*/
|
|
768
|
-
update(tableName: string, options: RecordUpdateOptions): Promise<
|
|
900
|
+
update(tableName: string, options: RecordUpdateOptions, dbId?: string): Promise<BolticListResponse<RecordWithId> | BolticErrorResponse>;
|
|
769
901
|
/**
|
|
770
902
|
* Update a single record by ID
|
|
771
903
|
*/
|
|
772
|
-
updateById(tableName: string, recordId: string, data: RecordData): Promise<
|
|
904
|
+
updateById(tableName: string, recordId: string, data: RecordData, dbId?: string): Promise<BolticSuccessResponse<RecordWithId> | BolticErrorResponse>;
|
|
773
905
|
/**
|
|
774
906
|
* Unified delete method that supports both record IDs and filters
|
|
775
907
|
*/
|
|
776
|
-
delete(tableName: string, options: RecordDeleteOptions): Promise<
|
|
908
|
+
delete(tableName: string, options: RecordDeleteOptions, dbId?: string): Promise<BolticSuccessResponse<{
|
|
777
909
|
message: string;
|
|
778
910
|
}> | BolticErrorResponse>;
|
|
779
911
|
/**
|
|
780
912
|
* Delete a single record by ID
|
|
781
913
|
*/
|
|
782
|
-
deleteById(tableName: string, recordId: string): Promise<
|
|
914
|
+
deleteById(tableName: string, recordId: string, dbId?: string): Promise<BolticSuccessResponse<{
|
|
783
915
|
message: string;
|
|
784
916
|
}> | BolticErrorResponse>;
|
|
785
917
|
/**
|
|
@@ -811,6 +943,14 @@ declare type RequestInterceptor = (config: HttpRequestConfig) => HttpRequestConf
|
|
|
811
943
|
|
|
812
944
|
declare type ResponseInterceptor = (response: HttpResponse) => HttpResponse | Promise<HttpResponse>;
|
|
813
945
|
|
|
946
|
+
/**
|
|
947
|
+
* Sort parameters
|
|
948
|
+
*/
|
|
949
|
+
declare interface SortParams {
|
|
950
|
+
field: string;
|
|
951
|
+
direction: 'asc' | 'desc';
|
|
952
|
+
}
|
|
953
|
+
|
|
814
954
|
declare class SqlResource {
|
|
815
955
|
private sqlApiClient;
|
|
816
956
|
constructor(client: BaseClient);
|
|
@@ -823,7 +963,7 @@ declare class SqlResource {
|
|
|
823
963
|
* @returns AsyncIterable<string> for streaming SQL generation
|
|
824
964
|
*
|
|
825
965
|
*/
|
|
826
|
-
textToSQL(prompt: string, options?: TextToSQLOptions): Promise<AsyncIterable<string>>;
|
|
966
|
+
textToSQL(prompt: string, options?: TextToSQLOptions, dbId?: string): Promise<AsyncIterable<string>>;
|
|
827
967
|
/**
|
|
828
968
|
* Execute SQL query with built-in safety measures and performance optimization
|
|
829
969
|
*
|
|
@@ -831,7 +971,7 @@ declare class SqlResource {
|
|
|
831
971
|
* @returns Promise<ExecuteSQLApiResponse> with raw API response following Boltic API Response Structure
|
|
832
972
|
*
|
|
833
973
|
*/
|
|
834
|
-
executeSQL(query: string): Promise<ExecuteSQLApiResponse | BolticErrorResponse>;
|
|
974
|
+
executeSQL(query: string, dbId?: string): Promise<ExecuteSQLApiResponse | BolticErrorResponse>;
|
|
835
975
|
}
|
|
836
976
|
|
|
837
977
|
export declare class SqlTestClient {
|
|
@@ -1010,7 +1150,7 @@ declare class TableBuilder {
|
|
|
1010
1150
|
create(options?: {
|
|
1011
1151
|
is_ai_generated_schema?: boolean;
|
|
1012
1152
|
is_template?: boolean;
|
|
1013
|
-
}): Promise<
|
|
1153
|
+
}): Promise<BolticSuccessResponse<TableCreateResponse> | BolticErrorResponse>;
|
|
1014
1154
|
}
|
|
1015
1155
|
|
|
1016
1156
|
declare interface TableBuilderOptions {
|
|
@@ -1022,6 +1162,7 @@ declare interface TableBuilderOptions {
|
|
|
1022
1162
|
declare interface TableCreateOptions {
|
|
1023
1163
|
is_ai_generated_schema?: boolean;
|
|
1024
1164
|
is_template?: boolean;
|
|
1165
|
+
db_id?: string;
|
|
1025
1166
|
}
|
|
1026
1167
|
|
|
1027
1168
|
declare interface TableCreateRequest {
|
|
@@ -1042,6 +1183,7 @@ declare interface TableListOptions extends TableQueryOptions {
|
|
|
1042
1183
|
page?: number;
|
|
1043
1184
|
pageSize?: number;
|
|
1044
1185
|
isShared?: boolean;
|
|
1186
|
+
db_id?: string;
|
|
1045
1187
|
}
|
|
1046
1188
|
|
|
1047
1189
|
declare interface TableQueryOptions {
|
|
@@ -1110,6 +1252,7 @@ declare class TablesApiClient {
|
|
|
1110
1252
|
*/
|
|
1111
1253
|
getTable(tableId: string, options?: {
|
|
1112
1254
|
fields?: Array<keyof TableRecord>;
|
|
1255
|
+
db_id?: string;
|
|
1113
1256
|
}): Promise<BolticSuccessResponse_2<TableRecord> | BolticErrorResponse_3>;
|
|
1114
1257
|
/**
|
|
1115
1258
|
* Update an existing table
|
|
@@ -1119,11 +1262,14 @@ declare class TablesApiClient {
|
|
|
1119
1262
|
description?: string;
|
|
1120
1263
|
is_shared?: boolean;
|
|
1121
1264
|
fields?: Array<keyof TableRecord>;
|
|
1265
|
+
db_id?: string;
|
|
1122
1266
|
}): Promise<BolticSuccessResponse_2<TableRecord> | BolticErrorResponse_3>;
|
|
1123
1267
|
/**
|
|
1124
1268
|
* Delete a table
|
|
1125
1269
|
*/
|
|
1126
|
-
deleteTable(tableId: string
|
|
1270
|
+
deleteTable(tableId: string, options?: {
|
|
1271
|
+
db_id?: string;
|
|
1272
|
+
}): Promise<BolticSuccessResponse_2<{
|
|
1127
1273
|
message: string;
|
|
1128
1274
|
}> | BolticErrorResponse_3>;
|
|
1129
1275
|
private buildHeaders;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./test-client-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./test-client-BuQuW6Y-.js");class t{static async*fromSSE(e){if(!e.body)throw new Error("Response body is null");const t=e.body.getReader(),s=new TextDecoder;try{for(;;){const{done:e,value:o}=await t.read();if(e)break;const r=s.decode(o,{stream:!0}).split("\n");for(const t of r)if(t.startsWith("data: ")){const e=t.slice(6);"[DONE]"!==e&&(yield e)}}}finally{t.releaseLock()}}static async*fromChunked(e){if(!e.body)throw new Error("Response body is null");const t=e.body.getReader(),s=new TextDecoder;try{for(;;){const{done:e,value:o}=await t.read();if(e)break;const r=s.decode(o,{stream:!0});yield r}}finally{t.releaseLock()}}static async collectAll(e){let t="";for await(const s of e)t+=s;return t}static async*fromString(e,t=10){for(let s=0;s<e.length;s+=t)yield e.slice(s,s+t),await new Promise(e=>setTimeout(e,50))}static async*map(e,t){for await(const s of e)yield await t(s)}static async*filter(e,t){for await(const s of e)await t(s)&&(yield s)}static async*take(e,t){let s=0;for await(const o of e){if(s>=t)break;yield o,s++}}}exports.createErrorResponse=e.createErrorResponse,exports.createMockResponse=e.createMockResponse,exports.createTestClient=e.createTestClient,exports.SqlTestClient=class{constructor(e){this.sql=e}async generateSQL(e,s){const o=await this.sql.textToSQL(e,s);return t.collectAll(o)}async executeSQL(e){return this.sql.executeSQL(e)}async*simulateStreamingSQL(e,t=10,s=50){for(let o=0;o<e.length;o+=t)yield e.slice(o,o+t),await new Promise(e=>setTimeout(e,s))}},exports.TEST_UTILS_VERSION="1.0.0";
|
|
2
2
|
//# sourceMappingURL=testing.js.map
|