@ragable/sdk 0.6.4 → 0.6.6
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.mts +25 -9
- package/dist/index.d.ts +25 -9
- package/dist/index.js +227 -186
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +225 -186
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -359,6 +359,24 @@ declare class PostgrestSelectBuilder<Row extends Record<string, unknown> = Recor
|
|
|
359
359
|
single(): Promise<PostgrestResult<Row>>;
|
|
360
360
|
maybeSingle(): Promise<PostgrestResult<Row | null>>;
|
|
361
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Awaitable `{ data: null, error }` chain when `.insert()` is called with invalid extra
|
|
364
|
+
* arguments — matches Supabase-style result shapes without throwing.
|
|
365
|
+
*/
|
|
366
|
+
declare class PostgrestInsertSdkErrorRoot<Row extends Record<string, unknown> = Record<string, unknown>> implements PromiseLike<PostgrestResult<null>> {
|
|
367
|
+
private readonly error;
|
|
368
|
+
constructor(error: RagableError);
|
|
369
|
+
select(_columns?: string): PostgrestInsertSdkErrorReturning<Row>;
|
|
370
|
+
abortSignal(_signal: AbortSignal): this;
|
|
371
|
+
then<TResult1 = PostgrestResult<null>, TResult2 = never>(onfulfilled?: ((value: PostgrestResult<null>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
372
|
+
}
|
|
373
|
+
declare class PostgrestInsertSdkErrorReturning<Row extends Record<string, unknown> = Record<string, unknown>> implements PromiseLike<PostgrestResult<Row[]>> {
|
|
374
|
+
private readonly error;
|
|
375
|
+
constructor(error: RagableError);
|
|
376
|
+
then<TResult1 = PostgrestResult<Row[]>, TResult2 = never>(onfulfilled?: ((value: PostgrestResult<Row[]>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
377
|
+
single(): Promise<PostgrestResult<Row>>;
|
|
378
|
+
maybeSingle(): Promise<PostgrestResult<Row | null>>;
|
|
379
|
+
}
|
|
362
380
|
declare class PostgrestInsertRootBuilder<Row extends Record<string, unknown> = Record<string, unknown>> implements PromiseLike<PostgrestResult<null>> {
|
|
363
381
|
private readonly pgFetch;
|
|
364
382
|
private readonly databaseInstanceId;
|
|
@@ -875,16 +893,14 @@ interface BrowserSqlQueryResult<Row extends Record<string, unknown> = Record<str
|
|
|
875
893
|
declare class RagableBrowserDatabaseClient<Database extends RagableDatabase = DefaultRagableDatabase> {
|
|
876
894
|
private readonly options;
|
|
877
895
|
private readonly ragableAuth;
|
|
878
|
-
private readonly postgrestFrom?;
|
|
879
896
|
private readonly fetchImpl;
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
*/
|
|
897
|
+
private _transport;
|
|
898
|
+
constructor(options: RagableBrowserClientOptions, ragableAuth?: RagableAuth | null);
|
|
899
|
+
/** @internal Called by RagableBrowser to share the Transport instance. */
|
|
900
|
+
_setTransport(transport: Transport): void;
|
|
885
901
|
from<TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string): PostgrestTableApi<Database, TableName>;
|
|
886
902
|
private toUrl;
|
|
887
|
-
query<Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams): Promise<BrowserSqlQueryResult<Row
|
|
903
|
+
query<Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams): Promise<PostgrestResult<BrowserSqlQueryResult<Row>>>;
|
|
888
904
|
private baseHeaders;
|
|
889
905
|
}
|
|
890
906
|
declare class RagableBrowserAgentsClient {
|
|
@@ -903,9 +919,9 @@ declare class RagableBrowser<Database extends RagableDatabase = DefaultRagableDa
|
|
|
903
919
|
readonly auth: RagableBrowserAuthClient<AuthUser>;
|
|
904
920
|
readonly database: RagableBrowserDatabaseClient<Database>;
|
|
905
921
|
readonly transport: Transport;
|
|
906
|
-
private readonly options;
|
|
907
922
|
private readonly _ragableAuth;
|
|
908
923
|
constructor(options: RagableBrowserClientOptions);
|
|
924
|
+
/** Delegates to `database.from()`. Kept for back-compat — prefer `database.from()`. */
|
|
909
925
|
from<TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string): PostgrestTableApi<Database, TableName>;
|
|
910
926
|
destroy(): void;
|
|
911
927
|
}
|
|
@@ -988,4 +1004,4 @@ declare function createClient(options: RagableClientOptions): Ragable;
|
|
|
988
1004
|
declare function createClient<Database extends RagableDatabase = DefaultRagableDatabase, AuthUser extends Record<string, unknown> = Record<string, unknown>>(options: RagableBrowserClientOptions): RagableBrowser<Database, AuthUser>;
|
|
989
1005
|
declare function createRagableServerClient(options: RagableClientOptions): Ragable;
|
|
990
1006
|
|
|
991
|
-
export { type AgentChatMessage, type AgentChatParams, type AgentChatResult, type AgentPublicChatParams, type AgentStreamEvent, type AgentSummary, AgentsClient, AuthBroadcastChannel, type AuthBroadcastMessage, type AuthChangeEvent, type AuthOptions, type AuthSession, type BrowserAuthSession, type BrowserAuthTokens, type BrowserDataAuthMode, type BrowserSqlExecParams, type BrowserSqlExecResult, type BrowserSqlQueryParams, type BrowserSqlQueryResult, type ColumnName, type ColumnValue, CookieStorageAdapter, DEFAULT_RAGABLE_API_BASE, type DefaultRagableDatabase, type FormatContextOptions, type HttpMethod, type Json, LocalStorageAdapter, MemoryStorageAdapter, type PostgRESTFetch, type PostgRESTFetchParams, PostgrestDeleteReturningBuilder, PostgrestDeleteRootBuilder, PostgrestInsertReturningBuilder, PostgrestInsertRootBuilder, type PostgrestResult, PostgrestSelectBuilder, PostgrestTableApi, PostgrestUpdateReturningBuilder, PostgrestUpdateRootBuilder, type PostgrestUpsertOptions, PostgrestUpsertReturningBuilder, PostgrestUpsertRootBuilder, type RagClientForPipeline, type RagPipeline, type RagPipelineOptions, Ragable, RagableAbortError, RagableAuth, type RagableAuthConfig, RagableBrowser, RagableBrowserAgentsClient, RagableBrowserAuthClient, type RagableBrowserClientOptions, RagableBrowserDatabaseClient, type RagableClientOptions, type RagableDatabase, RagableError, RagableNetworkError, RagableRequestClient, RagableSdkError, type RagableTableDefinition, type RagableTableNames, RagableTimeoutError, type RequestOptions, type RetrieveParams, type RetryOptions, type RunQuery, type SessionStorage, SessionStorageAdapter, type ShiftAddDocumentParams, ShiftClient, type ShiftCreateIndexParams, type ShiftEntry, type ShiftIndex, type ShiftIngestResponse, type ShiftListEntriesParams, type ShiftListEntriesResponse, type ShiftSearchParams, type ShiftSearchResult, type ShiftUpdateIndexParams, type ShiftUploadFileParams, type ShiftUploadableFile, type SseJsonEvent, type SupabaseCompatSession, type TableInsertRow, type TableRow, type TableUpdatePatch, type Tables, type TablesInsert, type TablesUpdate, Transport, type TransportOptions, type TransportRequest, asPostgrestResponse, bindFetch, createBrowserClient, createClient, createRagPipeline, createRagableBrowserClient, createRagableServerClient, detectStorage, extractErrorMessage, formatPostgrestError, formatRetrievalContext, formatSdkError, generateIdempotencyKey, normalizeBrowserApiBase, parseSseDataLine, parseTransportResponse, readSseStream };
|
|
1007
|
+
export { type AgentChatMessage, type AgentChatParams, type AgentChatResult, type AgentPublicChatParams, type AgentStreamEvent, type AgentSummary, AgentsClient, AuthBroadcastChannel, type AuthBroadcastMessage, type AuthChangeEvent, type AuthOptions, type AuthSession, type BrowserAuthSession, type BrowserAuthTokens, type BrowserDataAuthMode, type BrowserSqlExecParams, type BrowserSqlExecResult, type BrowserSqlQueryParams, type BrowserSqlQueryResult, type ColumnName, type ColumnValue, CookieStorageAdapter, DEFAULT_RAGABLE_API_BASE, type DefaultRagableDatabase, type FormatContextOptions, type HttpMethod, type Json, LocalStorageAdapter, MemoryStorageAdapter, type PostgRESTFetch, type PostgRESTFetchParams, PostgrestDeleteReturningBuilder, PostgrestDeleteRootBuilder, PostgrestInsertReturningBuilder, PostgrestInsertRootBuilder, PostgrestInsertSdkErrorReturning, PostgrestInsertSdkErrorRoot, type PostgrestResult, PostgrestSelectBuilder, PostgrestTableApi, PostgrestUpdateReturningBuilder, PostgrestUpdateRootBuilder, type PostgrestUpsertOptions, PostgrestUpsertReturningBuilder, PostgrestUpsertRootBuilder, type RagClientForPipeline, type RagPipeline, type RagPipelineOptions, Ragable, RagableAbortError, RagableAuth, type RagableAuthConfig, RagableBrowser, RagableBrowserAgentsClient, RagableBrowserAuthClient, type RagableBrowserClientOptions, RagableBrowserDatabaseClient, type RagableClientOptions, type RagableDatabase, RagableError, RagableNetworkError, RagableRequestClient, RagableSdkError, type RagableTableDefinition, type RagableTableNames, RagableTimeoutError, type RequestOptions, type RetrieveParams, type RetryOptions, type RunQuery, type SessionStorage, SessionStorageAdapter, type ShiftAddDocumentParams, ShiftClient, type ShiftCreateIndexParams, type ShiftEntry, type ShiftIndex, type ShiftIngestResponse, type ShiftListEntriesParams, type ShiftListEntriesResponse, type ShiftSearchParams, type ShiftSearchResult, type ShiftUpdateIndexParams, type ShiftUploadFileParams, type ShiftUploadableFile, type SseJsonEvent, type SupabaseCompatSession, type TableInsertRow, type TableRow, type TableUpdatePatch, type Tables, type TablesInsert, type TablesUpdate, Transport, type TransportOptions, type TransportRequest, asPostgrestResponse, bindFetch, createBrowserClient, createClient, createRagPipeline, createRagableBrowserClient, createRagableServerClient, detectStorage, extractErrorMessage, formatPostgrestError, formatRetrievalContext, formatSdkError, generateIdempotencyKey, normalizeBrowserApiBase, parseSseDataLine, parseTransportResponse, readSseStream };
|
package/dist/index.d.ts
CHANGED
|
@@ -359,6 +359,24 @@ declare class PostgrestSelectBuilder<Row extends Record<string, unknown> = Recor
|
|
|
359
359
|
single(): Promise<PostgrestResult<Row>>;
|
|
360
360
|
maybeSingle(): Promise<PostgrestResult<Row | null>>;
|
|
361
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Awaitable `{ data: null, error }` chain when `.insert()` is called with invalid extra
|
|
364
|
+
* arguments — matches Supabase-style result shapes without throwing.
|
|
365
|
+
*/
|
|
366
|
+
declare class PostgrestInsertSdkErrorRoot<Row extends Record<string, unknown> = Record<string, unknown>> implements PromiseLike<PostgrestResult<null>> {
|
|
367
|
+
private readonly error;
|
|
368
|
+
constructor(error: RagableError);
|
|
369
|
+
select(_columns?: string): PostgrestInsertSdkErrorReturning<Row>;
|
|
370
|
+
abortSignal(_signal: AbortSignal): this;
|
|
371
|
+
then<TResult1 = PostgrestResult<null>, TResult2 = never>(onfulfilled?: ((value: PostgrestResult<null>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
372
|
+
}
|
|
373
|
+
declare class PostgrestInsertSdkErrorReturning<Row extends Record<string, unknown> = Record<string, unknown>> implements PromiseLike<PostgrestResult<Row[]>> {
|
|
374
|
+
private readonly error;
|
|
375
|
+
constructor(error: RagableError);
|
|
376
|
+
then<TResult1 = PostgrestResult<Row[]>, TResult2 = never>(onfulfilled?: ((value: PostgrestResult<Row[]>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
377
|
+
single(): Promise<PostgrestResult<Row>>;
|
|
378
|
+
maybeSingle(): Promise<PostgrestResult<Row | null>>;
|
|
379
|
+
}
|
|
362
380
|
declare class PostgrestInsertRootBuilder<Row extends Record<string, unknown> = Record<string, unknown>> implements PromiseLike<PostgrestResult<null>> {
|
|
363
381
|
private readonly pgFetch;
|
|
364
382
|
private readonly databaseInstanceId;
|
|
@@ -875,16 +893,14 @@ interface BrowserSqlQueryResult<Row extends Record<string, unknown> = Record<str
|
|
|
875
893
|
declare class RagableBrowserDatabaseClient<Database extends RagableDatabase = DefaultRagableDatabase> {
|
|
876
894
|
private readonly options;
|
|
877
895
|
private readonly ragableAuth;
|
|
878
|
-
private readonly postgrestFrom?;
|
|
879
896
|
private readonly fetchImpl;
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
*/
|
|
897
|
+
private _transport;
|
|
898
|
+
constructor(options: RagableBrowserClientOptions, ragableAuth?: RagableAuth | null);
|
|
899
|
+
/** @internal Called by RagableBrowser to share the Transport instance. */
|
|
900
|
+
_setTransport(transport: Transport): void;
|
|
885
901
|
from<TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string): PostgrestTableApi<Database, TableName>;
|
|
886
902
|
private toUrl;
|
|
887
|
-
query<Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams): Promise<BrowserSqlQueryResult<Row
|
|
903
|
+
query<Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams): Promise<PostgrestResult<BrowserSqlQueryResult<Row>>>;
|
|
888
904
|
private baseHeaders;
|
|
889
905
|
}
|
|
890
906
|
declare class RagableBrowserAgentsClient {
|
|
@@ -903,9 +919,9 @@ declare class RagableBrowser<Database extends RagableDatabase = DefaultRagableDa
|
|
|
903
919
|
readonly auth: RagableBrowserAuthClient<AuthUser>;
|
|
904
920
|
readonly database: RagableBrowserDatabaseClient<Database>;
|
|
905
921
|
readonly transport: Transport;
|
|
906
|
-
private readonly options;
|
|
907
922
|
private readonly _ragableAuth;
|
|
908
923
|
constructor(options: RagableBrowserClientOptions);
|
|
924
|
+
/** Delegates to `database.from()`. Kept for back-compat — prefer `database.from()`. */
|
|
909
925
|
from<TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string): PostgrestTableApi<Database, TableName>;
|
|
910
926
|
destroy(): void;
|
|
911
927
|
}
|
|
@@ -988,4 +1004,4 @@ declare function createClient(options: RagableClientOptions): Ragable;
|
|
|
988
1004
|
declare function createClient<Database extends RagableDatabase = DefaultRagableDatabase, AuthUser extends Record<string, unknown> = Record<string, unknown>>(options: RagableBrowserClientOptions): RagableBrowser<Database, AuthUser>;
|
|
989
1005
|
declare function createRagableServerClient(options: RagableClientOptions): Ragable;
|
|
990
1006
|
|
|
991
|
-
export { type AgentChatMessage, type AgentChatParams, type AgentChatResult, type AgentPublicChatParams, type AgentStreamEvent, type AgentSummary, AgentsClient, AuthBroadcastChannel, type AuthBroadcastMessage, type AuthChangeEvent, type AuthOptions, type AuthSession, type BrowserAuthSession, type BrowserAuthTokens, type BrowserDataAuthMode, type BrowserSqlExecParams, type BrowserSqlExecResult, type BrowserSqlQueryParams, type BrowserSqlQueryResult, type ColumnName, type ColumnValue, CookieStorageAdapter, DEFAULT_RAGABLE_API_BASE, type DefaultRagableDatabase, type FormatContextOptions, type HttpMethod, type Json, LocalStorageAdapter, MemoryStorageAdapter, type PostgRESTFetch, type PostgRESTFetchParams, PostgrestDeleteReturningBuilder, PostgrestDeleteRootBuilder, PostgrestInsertReturningBuilder, PostgrestInsertRootBuilder, type PostgrestResult, PostgrestSelectBuilder, PostgrestTableApi, PostgrestUpdateReturningBuilder, PostgrestUpdateRootBuilder, type PostgrestUpsertOptions, PostgrestUpsertReturningBuilder, PostgrestUpsertRootBuilder, type RagClientForPipeline, type RagPipeline, type RagPipelineOptions, Ragable, RagableAbortError, RagableAuth, type RagableAuthConfig, RagableBrowser, RagableBrowserAgentsClient, RagableBrowserAuthClient, type RagableBrowserClientOptions, RagableBrowserDatabaseClient, type RagableClientOptions, type RagableDatabase, RagableError, RagableNetworkError, RagableRequestClient, RagableSdkError, type RagableTableDefinition, type RagableTableNames, RagableTimeoutError, type RequestOptions, type RetrieveParams, type RetryOptions, type RunQuery, type SessionStorage, SessionStorageAdapter, type ShiftAddDocumentParams, ShiftClient, type ShiftCreateIndexParams, type ShiftEntry, type ShiftIndex, type ShiftIngestResponse, type ShiftListEntriesParams, type ShiftListEntriesResponse, type ShiftSearchParams, type ShiftSearchResult, type ShiftUpdateIndexParams, type ShiftUploadFileParams, type ShiftUploadableFile, type SseJsonEvent, type SupabaseCompatSession, type TableInsertRow, type TableRow, type TableUpdatePatch, type Tables, type TablesInsert, type TablesUpdate, Transport, type TransportOptions, type TransportRequest, asPostgrestResponse, bindFetch, createBrowserClient, createClient, createRagPipeline, createRagableBrowserClient, createRagableServerClient, detectStorage, extractErrorMessage, formatPostgrestError, formatRetrievalContext, formatSdkError, generateIdempotencyKey, normalizeBrowserApiBase, parseSseDataLine, parseTransportResponse, readSseStream };
|
|
1007
|
+
export { type AgentChatMessage, type AgentChatParams, type AgentChatResult, type AgentPublicChatParams, type AgentStreamEvent, type AgentSummary, AgentsClient, AuthBroadcastChannel, type AuthBroadcastMessage, type AuthChangeEvent, type AuthOptions, type AuthSession, type BrowserAuthSession, type BrowserAuthTokens, type BrowserDataAuthMode, type BrowserSqlExecParams, type BrowserSqlExecResult, type BrowserSqlQueryParams, type BrowserSqlQueryResult, type ColumnName, type ColumnValue, CookieStorageAdapter, DEFAULT_RAGABLE_API_BASE, type DefaultRagableDatabase, type FormatContextOptions, type HttpMethod, type Json, LocalStorageAdapter, MemoryStorageAdapter, type PostgRESTFetch, type PostgRESTFetchParams, PostgrestDeleteReturningBuilder, PostgrestDeleteRootBuilder, PostgrestInsertReturningBuilder, PostgrestInsertRootBuilder, PostgrestInsertSdkErrorReturning, PostgrestInsertSdkErrorRoot, type PostgrestResult, PostgrestSelectBuilder, PostgrestTableApi, PostgrestUpdateReturningBuilder, PostgrestUpdateRootBuilder, type PostgrestUpsertOptions, PostgrestUpsertReturningBuilder, PostgrestUpsertRootBuilder, type RagClientForPipeline, type RagPipeline, type RagPipelineOptions, Ragable, RagableAbortError, RagableAuth, type RagableAuthConfig, RagableBrowser, RagableBrowserAgentsClient, RagableBrowserAuthClient, type RagableBrowserClientOptions, RagableBrowserDatabaseClient, type RagableClientOptions, type RagableDatabase, RagableError, RagableNetworkError, RagableRequestClient, RagableSdkError, type RagableTableDefinition, type RagableTableNames, RagableTimeoutError, type RequestOptions, type RetrieveParams, type RetryOptions, type RunQuery, type SessionStorage, SessionStorageAdapter, type ShiftAddDocumentParams, ShiftClient, type ShiftCreateIndexParams, type ShiftEntry, type ShiftIndex, type ShiftIngestResponse, type ShiftListEntriesParams, type ShiftListEntriesResponse, type ShiftSearchParams, type ShiftSearchResult, type ShiftUpdateIndexParams, type ShiftUploadFileParams, type ShiftUploadableFile, type SseJsonEvent, type SupabaseCompatSession, type TableInsertRow, type TableRow, type TableUpdatePatch, type Tables, type TablesInsert, type TablesUpdate, Transport, type TransportOptions, type TransportRequest, asPostgrestResponse, bindFetch, createBrowserClient, createClient, createRagPipeline, createRagableBrowserClient, createRagableServerClient, detectStorage, extractErrorMessage, formatPostgrestError, formatRetrievalContext, formatSdkError, generateIdempotencyKey, normalizeBrowserApiBase, parseSseDataLine, parseTransportResponse, readSseStream };
|