@fluxbase/sdk 2026.1.14-rc.7 → 2026.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2405,7 +2405,7 @@ interface AIChatClientMessage {
2405
2405
  * AI chat server message
2406
2406
  */
2407
2407
  interface AIChatServerMessage {
2408
- type: "chat_started" | "progress" | "content" | "query_result" | "done" | "error" | "cancelled";
2408
+ type: "chat_started" | "progress" | "content" | "query_result" | "tool_result" | "done" | "error" | "cancelled";
2409
2409
  conversation_id?: string;
2410
2410
  message_id?: string;
2411
2411
  chatbot?: string;
@@ -9898,7 +9898,7 @@ declare class FluxbaseAdmin {
9898
9898
  /**
9899
9899
  * Event types for chat callbacks
9900
9900
  */
9901
- type AIChatEventType = "connected" | "chat_started" | "progress" | "content" | "query_result" | "done" | "error" | "cancelled" | "disconnected";
9901
+ type AIChatEventType = "connected" | "chat_started" | "progress" | "content" | "query_result" | "tool_result" | "done" | "error" | "cancelled" | "disconnected";
9902
9902
  /**
9903
9903
  * Chat event data
9904
9904
  */
@@ -10842,6 +10842,7 @@ declare class QueryBuilder<T = unknown> implements PromiseLike<PostgrestResponse
10842
10842
  private isCountAggregation;
10843
10843
  private insertData?;
10844
10844
  private updateData?;
10845
+ private truncateValue?;
10845
10846
  constructor(fetch: FluxbaseFetch, table: string, schema?: string);
10846
10847
  /**
10847
10848
  * Build the API path for this table, including schema if specified
@@ -11096,6 +11097,12 @@ declare class QueryBuilder<T = unknown> implements PromiseLike<PostgrestResponse
11096
11097
  * Skip rows
11097
11098
  */
11098
11099
  offset(count: number): this;
11100
+ /**
11101
+ * Truncate text columns to specified length
11102
+ * Useful for browsing tables with large text fields
11103
+ * @example truncate(500) // Truncate text columns to 500 characters
11104
+ */
11105
+ truncate(length: number): this;
11099
11106
  /**
11100
11107
  * Return a single row (adds limit(1))
11101
11108
  * Errors if no rows found
package/dist/index.d.ts CHANGED
@@ -2405,7 +2405,7 @@ interface AIChatClientMessage {
2405
2405
  * AI chat server message
2406
2406
  */
2407
2407
  interface AIChatServerMessage {
2408
- type: "chat_started" | "progress" | "content" | "query_result" | "done" | "error" | "cancelled";
2408
+ type: "chat_started" | "progress" | "content" | "query_result" | "tool_result" | "done" | "error" | "cancelled";
2409
2409
  conversation_id?: string;
2410
2410
  message_id?: string;
2411
2411
  chatbot?: string;
@@ -9898,7 +9898,7 @@ declare class FluxbaseAdmin {
9898
9898
  /**
9899
9899
  * Event types for chat callbacks
9900
9900
  */
9901
- type AIChatEventType = "connected" | "chat_started" | "progress" | "content" | "query_result" | "done" | "error" | "cancelled" | "disconnected";
9901
+ type AIChatEventType = "connected" | "chat_started" | "progress" | "content" | "query_result" | "tool_result" | "done" | "error" | "cancelled" | "disconnected";
9902
9902
  /**
9903
9903
  * Chat event data
9904
9904
  */
@@ -10842,6 +10842,7 @@ declare class QueryBuilder<T = unknown> implements PromiseLike<PostgrestResponse
10842
10842
  private isCountAggregation;
10843
10843
  private insertData?;
10844
10844
  private updateData?;
10845
+ private truncateValue?;
10845
10846
  constructor(fetch: FluxbaseFetch, table: string, schema?: string);
10846
10847
  /**
10847
10848
  * Build the API path for this table, including schema if specified
@@ -11096,6 +11097,12 @@ declare class QueryBuilder<T = unknown> implements PromiseLike<PostgrestResponse
11096
11097
  * Skip rows
11097
11098
  */
11098
11099
  offset(count: number): this;
11100
+ /**
11101
+ * Truncate text columns to specified length
11102
+ * Useful for browsing tables with large text fields
11103
+ * @example truncate(500) // Truncate text columns to 500 characters
11104
+ */
11105
+ truncate(length: number): this;
11099
11106
  /**
11100
11107
  * Return a single row (adds limit(1))
11101
11108
  * Errors if no rows found
package/dist/index.js CHANGED
@@ -9742,6 +9742,17 @@ var FluxbaseAIChat = class {
9742
9742
  );
9743
9743
  }
9744
9744
  break;
9745
+ case "tool_result":
9746
+ if (message.query !== void 0 && message.data !== void 0 && message.conversation_id) {
9747
+ this.options.onQueryResult?.(
9748
+ message.query,
9749
+ message.summary || "",
9750
+ message.row_count || 0,
9751
+ message.data,
9752
+ message.conversation_id
9753
+ );
9754
+ }
9755
+ break;
9745
9756
  case "done":
9746
9757
  if (message.conversation_id) {
9747
9758
  this.options.onDone?.(message.usage, message.conversation_id);
@@ -11144,6 +11155,15 @@ var QueryBuilder = class {
11144
11155
  this.offsetValue = count;
11145
11156
  return this;
11146
11157
  }
11158
+ /**
11159
+ * Truncate text columns to specified length
11160
+ * Useful for browsing tables with large text fields
11161
+ * @example truncate(500) // Truncate text columns to 500 characters
11162
+ */
11163
+ truncate(length) {
11164
+ this.truncateValue = length;
11165
+ return this;
11166
+ }
11147
11167
  /**
11148
11168
  * Return a single row (adds limit(1))
11149
11169
  * Errors if no rows found
@@ -11711,6 +11731,9 @@ var QueryBuilder = class {
11711
11731
  if (this.countType) {
11712
11732
  params.append("count", this.countType);
11713
11733
  }
11734
+ if (this.truncateValue !== void 0) {
11735
+ params.append("truncate", String(this.truncateValue));
11736
+ }
11714
11737
  const queryString = params.toString();
11715
11738
  return queryString ? `?${queryString}` : "";
11716
11739
  }