@boltic/sdk 0.0.1 → 0.0.3

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.
@@ -9,7 +9,7 @@ declare interface ApiFilter {
9
9
  values: unknown[];
10
10
  }
11
11
 
12
- declare type ApiResponse<T> = BolticSuccessResponse<T> | BolticListResponse<T> | BolticErrorResponse;
12
+ declare type ApiResponse<T> = BolticSuccessResponse<T> | BolticListResponse<T> | BolticErrorResponse_2;
13
13
 
14
14
  declare interface AuthConfig {
15
15
  apiKey: string;
@@ -33,6 +33,8 @@ declare class AuthManager {
33
33
  validateApiKeyAsync(): Promise<boolean>;
34
34
  getTokenInfo(): TokenInfo | null;
35
35
  getMaxRetries(): number;
36
+ toString(): string;
37
+ toJSON(): object;
36
38
  }
37
39
 
38
40
  declare class BaseClient {
@@ -68,12 +70,12 @@ declare class BolticClient {
68
70
  getCurrentDatabase(): DatabaseContext | null;
69
71
  get tables(): {
70
72
  create: (data: TableCreateRequest) => Promise<BolticSuccessResponse<TableCreateResponse>>;
71
- findAll: (options?: TableQueryOptions) => Promise<ApiResponse<TableRecord[]>>;
72
- findById: (id: string) => Promise<BolticSuccessResponse<TableRecord | null>>;
73
- findByName: (name: string) => Promise<BolticSuccessResponse<TableRecord | null>>;
74
- findOne: (options: TableQueryOptions) => Promise<BolticSuccessResponse<TableRecord | null>>;
75
- update: (name: string, data: TableUpdateRequest) => Promise<BolticSuccessResponse<TableRecord>>;
76
- delete: (name: string) => Promise<BolticSuccessResponse< {
73
+ findAll: (options?: TableQueryOptions) => Promise<ApiResponse<TableRecord>>;
74
+ findById: (id: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<TableRecord | null>>;
75
+ findByName: (name: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<TableRecord | null>>;
76
+ findOne: (options: TableQueryOptions) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<TableRecord | null>>;
77
+ update: (name: string, data: TableUpdateRequest) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<TableRecord>>;
78
+ delete: (name: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
77
79
  message: string;
78
80
  }>>;
79
81
  rename: (oldName: string, newName: string) => Promise<BolticSuccessResponse<TableRecord>>;
@@ -83,13 +85,13 @@ declare class BolticClient {
83
85
  }) => Promise<BolticSuccessResponse<TableRecord>>;
84
86
  };
85
87
  get columns(): {
86
- create: (tableName: string, column: FieldDefinition) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnRecord>>;
87
- createMany: (tableName: string, columns: FieldDefinition[]) => Promise<BolticErrorResponse | BolticListResponse<ColumnRecord>>;
88
- findAll: (tableName: string, options?: ColumnQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<ColumnDetails>>;
89
- findOne: (tableName: string, columnName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
90
- findById: (tableName: string, columnId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
91
- update: (tableName: string, columnName: string, updates: ColumnUpdateRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
92
- delete: (tableName: string, columnName: string) => Promise<BolticErrorResponse | BolticSuccessResponse< {
88
+ create: (tableName: string, column: FieldDefinition) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnRecord>>;
89
+ createMany: (tableName: string, columns: FieldDefinition[]) => Promise<BolticErrorResponse_2 | BolticListResponse<ColumnRecord>>;
90
+ findAll: (tableName: string, options?: ColumnQueryOptions) => Promise<BolticErrorResponse_2 | BolticListResponse<ColumnDetails>>;
91
+ findOne: (tableName: string, columnName: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnDetails>>;
92
+ findById: (tableName: string, columnId: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnDetails>>;
93
+ update: (tableName: string, columnName: string, updates: ColumnUpdateRequest) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnDetails>>;
94
+ delete: (tableName: string, columnName: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
93
95
  success: boolean;
94
96
  message?: string | undefined;
95
97
  }>>;
@@ -97,46 +99,52 @@ declare class BolticClient {
97
99
  table(name: string): TableBuilder;
98
100
  from(tableName: string): {
99
101
  columns: () => {
100
- create: (column: FieldDefinition) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnRecord>>;
101
- findAll: (options?: ColumnQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<ColumnDetails>>;
102
- get: (columnName: string) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
103
- update: (columnName: string, updates: ColumnUpdateRequest) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnDetails>>;
104
- delete: (columnName: string) => Promise<BolticErrorResponse | BolticSuccessResponse< {
102
+ create: (column: FieldDefinition) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnRecord>>;
103
+ findAll: (options?: ColumnQueryOptions) => Promise<BolticErrorResponse_2 | BolticListResponse<ColumnDetails>>;
104
+ get: (columnName: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnDetails>>;
105
+ update: (columnName: string, updates: ColumnUpdateRequest) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<ColumnDetails>>;
106
+ delete: (columnName: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
105
107
  success: boolean;
106
108
  message?: string | undefined;
107
109
  }>>;
108
110
  };
109
111
  records: () => {
110
- insert: (data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
111
- findOne: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
112
- update: (options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
113
- updateById: (recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
114
- delete: (options: RecordDeleteOptions) => Promise<BolticErrorResponse | BolticSuccessResponse< {
112
+ insert: (data: RecordData) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<RecordWithId>>;
113
+ insertMany: (records: RecordData[], options?: {
114
+ validation?: boolean;
115
+ }) => Promise<RecordBulkInsertResponse | BolticErrorResponse_2>;
116
+ findOne: (recordId: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<RecordWithId>>;
117
+ update: (options: RecordUpdateOptions) => Promise<BolticErrorResponse_2 | BolticListResponse<RecordWithId>>;
118
+ updateById: (recordId: string, data: RecordData) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<RecordWithId>>;
119
+ delete: (options: RecordDeleteOptions) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
115
120
  message: string;
116
121
  }>>;
117
- deleteById: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse< {
122
+ deleteById: (recordId: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
118
123
  message: string;
119
124
  }>>;
120
125
  };
121
126
  record: () => RecordBuilder;
122
127
  };
123
128
  get records(): {
124
- insert: (tableName: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
125
- findAll: (tableName: string, options?: RecordQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
126
- findOne: (tableName: string, recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
127
- update: (tableName: string, options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
128
- updateById: (tableName: string, recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
129
- delete: (tableName: string, options: RecordDeleteOptions) => Promise<BolticErrorResponse | BolticSuccessResponse< {
129
+ insert: (tableName: string, data: RecordData) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<RecordWithId>>;
130
+ insertMany: (tableName: string, records: RecordData[], options?: {
131
+ validation?: boolean;
132
+ }) => Promise<RecordBulkInsertResponse | BolticErrorResponse_2>;
133
+ findAll: (tableName: string, options?: RecordQueryOptions) => Promise<BolticErrorResponse_2 | BolticListResponse<RecordWithId>>;
134
+ findOne: (tableName: string, recordId: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<RecordWithId>>;
135
+ update: (tableName: string, options: RecordUpdateOptions) => Promise<BolticErrorResponse_2 | BolticListResponse<RecordWithId>>;
136
+ updateById: (tableName: string, recordId: string, data: RecordData) => Promise<BolticErrorResponse_2 | BolticSuccessResponse<RecordWithId>>;
137
+ delete: (tableName: string, options: RecordDeleteOptions) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
130
138
  message: string;
131
139
  }>>;
132
- deleteById: (tableName: string, recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse< {
140
+ deleteById: (tableName: string, recordId: string) => Promise<BolticErrorResponse_2 | BolticSuccessResponse< {
133
141
  message: string;
134
142
  }>>;
135
143
  };
136
144
  record(tableName: string): RecordBuilder;
137
145
  get sql(): {
138
146
  textToSQL: (prompt: string, options?: TextToSQLOptions) => Promise<AsyncIterable<string>>;
139
- executeSQL: (query: string) => Promise<ExecuteSQLApiResponse_2>;
147
+ executeSQL: (query: string) => Promise<BolticErrorResponse_2 | ExecuteSQLApiResponse_2>;
140
148
  };
141
149
  getSqlResource(): SqlResource;
142
150
  updateApiKey(newApiKey: string): void;
@@ -156,10 +164,13 @@ declare class BolticClient {
156
164
  enableDebug(): void;
157
165
  disableDebug(): void;
158
166
  isDebugEnabled(): boolean;
167
+ private updateAllResourcesConfig;
168
+ toString(): string;
169
+ toJSON(): object;
159
170
  }
160
171
 
161
172
  declare interface BolticErrorResponse {
162
- data?: {};
173
+ data?: never;
163
174
  message?: string;
164
175
  error: {
165
176
  code?: string;
@@ -169,7 +180,8 @@ declare interface BolticErrorResponse {
169
180
  }
170
181
 
171
182
  declare interface BolticErrorResponse_2 {
172
- data: {};
183
+ data?: never;
184
+ message?: string;
173
185
  error: {
174
186
  code?: string;
175
187
  message?: string;
@@ -178,8 +190,7 @@ declare interface BolticErrorResponse_2 {
178
190
  }
179
191
 
180
192
  declare interface BolticErrorResponse_3 {
181
- data?: {};
182
- message?: string;
193
+ data?: never;
183
194
  error: {
184
195
  code?: string;
185
196
  message?: string;
@@ -410,6 +421,11 @@ declare interface ExecuteSQLApiResponse {
410
421
  type: string;
411
422
  };
412
423
  message?: string;
424
+ error?: {
425
+ code?: string;
426
+ message?: string;
427
+ meta?: string[];
428
+ };
413
429
  }
414
430
 
415
431
  declare interface ExecuteSQLApiResponse_2 {
@@ -425,6 +441,11 @@ declare interface ExecuteSQLApiResponse_2 {
425
441
  type: string;
426
442
  };
427
443
  message?: string;
444
+ error?: {
445
+ code?: string;
446
+ message?: string;
447
+ meta?: string[];
448
+ };
428
449
  }
429
450
 
430
451
  declare interface FieldDefinition {
@@ -557,15 +578,15 @@ declare class RecordBuilder {
557
578
  /**
558
579
  * Execute list operation (was findAll)
559
580
  */
560
- list(): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse_3>;
581
+ list(): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse>;
561
582
  /**
562
583
  * Execute findAll operation (alias for list)
563
584
  */
564
- findAll(): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse_3>;
585
+ findAll(): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse>;
565
586
  /**
566
587
  * Execute findOne operation by getting first result from list
567
588
  */
568
- findOne(): Promise<BolticSuccessResponse_3<RecordWithId | null> | BolticErrorResponse_3>;
589
+ findOne(): Promise<BolticSuccessResponse_3<RecordWithId | null> | BolticErrorResponse>;
569
590
  /**
570
591
  * Build where conditions from filters for API consumption
571
592
  */
@@ -573,29 +594,29 @@ declare class RecordBuilder {
573
594
  /**
574
595
  * Execute update operation - requires filters or record IDs
575
596
  */
576
- update(): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse_3>;
597
+ update(): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse>;
577
598
  /**
578
599
  * Execute update by ID operation
579
600
  */
580
- updateById(id: string): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse_3>;
601
+ updateById(id: string): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse>;
581
602
  /**
582
603
  * Execute delete by single ID operation
583
604
  */
584
605
  deleteById(id: string): Promise<BolticSuccessResponse_3<{
585
606
  message: string;
586
- }> | BolticErrorResponse_3>;
607
+ }> | BolticErrorResponse>;
587
608
  /**
588
609
  * Execute delete by IDs operation
589
610
  */
590
611
  deleteByIds(ids: string[]): Promise<BolticSuccessResponse_3<{
591
612
  message: string;
592
- }> | BolticErrorResponse_3>;
613
+ }> | BolticErrorResponse>;
593
614
  /**
594
615
  * Execute delete operation using filters
595
616
  */
596
617
  delete(): Promise<BolticSuccessResponse_3<{
597
618
  message: string;
598
- }> | BolticErrorResponse_3>;
619
+ }> | BolticErrorResponse>;
599
620
  /**
600
621
  * Get the built query options (for debugging)
601
622
  */
@@ -607,7 +628,7 @@ declare class RecordBuilder {
607
628
  /**
608
629
  * Execute insert operation
609
630
  */
610
- insert(data: RecordData): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse_3>;
631
+ insert(data: RecordData): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse>;
611
632
  }
612
633
 
613
634
  declare interface RecordBuilderOptions {
@@ -615,6 +636,23 @@ declare interface RecordBuilderOptions {
615
636
  recordResource: RecordResource;
616
637
  }
617
638
 
639
+ declare interface RecordBulkInsertOptions {
640
+ validation?: boolean;
641
+ }
642
+
643
+ declare interface RecordBulkInsertResponse {
644
+ data: {
645
+ records: RecordWithId[];
646
+ insert_count: number;
647
+ };
648
+ message?: string;
649
+ error?: {
650
+ code?: string;
651
+ message?: string;
652
+ meta?: string[];
653
+ };
654
+ }
655
+
618
656
  declare interface RecordData {
619
657
  [fieldName: string]: unknown;
620
658
  fields?: string[];
@@ -643,35 +681,39 @@ declare class RecordResource {
643
681
  /**
644
682
  * Insert a single record
645
683
  */
646
- insert(tableName: string, data: RecordData): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse_3>;
684
+ insert(tableName: string, data: RecordData): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse>;
685
+ /**
686
+ * Insert multiple records in bulk
687
+ */
688
+ insertMany(tableName: string, records: RecordData[], options?: RecordBulkInsertOptions): Promise<RecordBulkInsertResponse | BolticErrorResponse>;
647
689
  /**
648
690
  * Get a single record by ID
649
691
  */
650
- get(tableName: string, recordId: string): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse_3>;
692
+ get(tableName: string, recordId: string): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse>;
651
693
  /**
652
694
  * List records with filtering and pagination
653
695
  */
654
- list(tableName: string, options?: RecordQueryOptions): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse_3>;
696
+ list(tableName: string, options?: RecordQueryOptions): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse>;
655
697
  /**
656
698
  * Update records by filters
657
699
  */
658
- update(tableName: string, options: RecordUpdateOptions): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse_3>;
700
+ update(tableName: string, options: RecordUpdateOptions): Promise<BolticListResponse_3<RecordWithId> | BolticErrorResponse>;
659
701
  /**
660
702
  * Update a single record by ID
661
703
  */
662
- updateById(tableName: string, recordId: string, data: RecordData): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse_3>;
704
+ updateById(tableName: string, recordId: string, data: RecordData): Promise<BolticSuccessResponse_3<RecordWithId> | BolticErrorResponse>;
663
705
  /**
664
706
  * Unified delete method that supports both record IDs and filters
665
707
  */
666
708
  delete(tableName: string, options: RecordDeleteOptions): Promise<BolticSuccessResponse_3<{
667
709
  message: string;
668
- }> | BolticErrorResponse_3>;
710
+ }> | BolticErrorResponse>;
669
711
  /**
670
712
  * Delete a single record by ID
671
713
  */
672
714
  deleteById(tableName: string, recordId: string): Promise<BolticSuccessResponse_3<{
673
715
  message: string;
674
- }> | BolticErrorResponse_3>;
716
+ }> | BolticErrorResponse>;
675
717
  /**
676
718
  * Helper method to get table information by name
677
719
  */
@@ -721,7 +763,7 @@ declare class SqlResource {
721
763
  * @returns Promise<ExecuteSQLApiResponse> with raw API response following Boltic API Response Structure
722
764
  *
723
765
  */
724
- executeSQL(query: string): Promise<ExecuteSQLApiResponse>;
766
+ executeSQL(query: string): Promise<ExecuteSQLApiResponse | BolticErrorResponse>;
725
767
  }
726
768
 
727
769
  export declare class SqlTestClient {
@@ -735,7 +777,7 @@ export declare class SqlTestClient {
735
777
  /**
736
778
  * Test helper for SQL execution
737
779
  */
738
- executeSQL(query: string): Promise<ExecuteSQLApiResponse_2>;
780
+ executeSQL(query: string): Promise<BolticErrorResponse_2 | ExecuteSQLApiResponse_2>;
739
781
  /**
740
782
  * Utility to simulate streaming text-to-SQL for testing
741
783
  */
@@ -870,21 +912,6 @@ declare class TableBuilder {
870
912
  nullable?: boolean;
871
913
  description?: string;
872
914
  }): TableBuilder;
873
- /**
874
- /**
875
- * Add a half-precision vector field
876
- */
877
- halfVector(name: string, dimension: number, options?: {
878
- nullable?: boolean;
879
- description?: string;
880
- }): TableBuilder;
881
- /**
882
- * Add a sparse vector field
883
- */
884
- sparseVector(name: string, dimension: number, options?: {
885
- nullable?: boolean;
886
- description?: string;
887
- }): TableBuilder;
888
915
  /**
889
916
  * Add a custom field
890
917
  */
@@ -915,7 +942,7 @@ declare class TableBuilder {
915
942
  create(options?: {
916
943
  is_ai_generated_schema?: boolean;
917
944
  is_template?: boolean;
918
- }): Promise<BolticSuccessResponse_3<TableCreateResponse> | BolticErrorResponse_3>;
945
+ }): Promise<BolticSuccessResponse_3<TableCreateResponse> | BolticErrorResponse>;
919
946
  }
920
947
 
921
948
  declare interface TableBuilderOptions {
@@ -1005,17 +1032,17 @@ declare class TablesApiClient {
1005
1032
  /**
1006
1033
  * Create a new table
1007
1034
  */
1008
- createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<BolticSuccessResponse_2<TableCreateResponse> | BolticErrorResponse_2>;
1035
+ createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<BolticSuccessResponse_2<TableCreateResponse> | BolticErrorResponse_3>;
1009
1036
  /**
1010
1037
  * List tables with filtering and pagination
1011
1038
  */
1012
- listTables(options?: TableListOptions): Promise<BolticListResponse_2<TableRecord> | BolticErrorResponse_2>;
1039
+ listTables(options?: TableListOptions): Promise<BolticListResponse_2<TableRecord> | BolticErrorResponse_3>;
1013
1040
  /**
1014
1041
  * Get a specific table by ID
1015
1042
  */
1016
1043
  getTable(tableId: string, options?: {
1017
1044
  fields?: Array<keyof TableRecord>;
1018
- }): Promise<BolticSuccessResponse_2<TableRecord> | BolticErrorResponse_2>;
1045
+ }): Promise<BolticSuccessResponse_2<TableRecord> | BolticErrorResponse_3>;
1019
1046
  /**
1020
1047
  * Update an existing table
1021
1048
  */
@@ -1024,13 +1051,13 @@ declare class TablesApiClient {
1024
1051
  description?: string;
1025
1052
  is_shared?: boolean;
1026
1053
  fields?: Array<keyof TableRecord>;
1027
- }): Promise<BolticSuccessResponse_2<TableRecord> | BolticErrorResponse_2>;
1054
+ }): Promise<BolticSuccessResponse_2<TableRecord> | BolticErrorResponse_3>;
1028
1055
  /**
1029
1056
  * Delete a table
1030
1057
  */
1031
1058
  deleteTable(tableId: string): Promise<BolticSuccessResponse_2<{
1032
1059
  message: string;
1033
- }> | BolticErrorResponse_2>;
1060
+ }> | BolticErrorResponse_3>;
1034
1061
  private buildHeaders;
1035
1062
  private formatErrorResponse;
1036
1063
  }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./test-client-D-SuKCUC.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";
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./test-client-BI3VkYA6.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
@@ -1,4 +1,4 @@
1
- import { o, p, q } from "./test-client-BM9X5DH9.mjs";
1
+ import { o, p, q } from "./test-client-BffJwqJq.mjs";
2
2
  class StreamingUtils {
3
3
  /**
4
4
  * Convert Server-Sent Events to AsyncIterable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boltic/sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "TypeScript SDK for Boltic databases infrastructure",
5
5
  "main": "dist/sdk.js",
6
6
  "module": "dist/sdk.mjs",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "repository": {
35
35
  "type": "git",
36
- "url": "https://github.com/bolticio/@boltic/sdk.git"
36
+ "url": "https://github.com/bolticio/boltic-sdk.git"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "vite build && node scripts/build.js",
@@ -78,5 +78,8 @@
78
78
  "axios": {
79
79
  "optional": true
80
80
  }
81
+ },
82
+ "dependencies": {
83
+ "dotenv": "^17.2.2"
81
84
  }
82
- }
85
+ }