@ragable/sdk 0.6.5 → 0.6.7
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 +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +230 -188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +228 -188
- 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;
|
|
@@ -880,9 +898,13 @@ declare class RagableBrowserDatabaseClient<Database extends RagableDatabase = De
|
|
|
880
898
|
constructor(options: RagableBrowserClientOptions, ragableAuth?: RagableAuth | null);
|
|
881
899
|
/** @internal Called by RagableBrowser to share the Transport instance. */
|
|
882
900
|
_setTransport(transport: Transport): void;
|
|
883
|
-
|
|
901
|
+
/**
|
|
902
|
+
* PostgREST table access. Instance field so `client.database.from` is always an own,
|
|
903
|
+
* enumerable function (avoids rare prototype/bundler issues).
|
|
904
|
+
*/
|
|
905
|
+
from: <TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string) => PostgrestTableApi<Database, TableName>;
|
|
884
906
|
private toUrl;
|
|
885
|
-
query<Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams)
|
|
907
|
+
query: <Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams) => Promise<PostgrestResult<BrowserSqlQueryResult<Row>>>;
|
|
886
908
|
private baseHeaders;
|
|
887
909
|
}
|
|
888
910
|
declare class RagableBrowserAgentsClient {
|
|
@@ -904,7 +926,7 @@ declare class RagableBrowser<Database extends RagableDatabase = DefaultRagableDa
|
|
|
904
926
|
private readonly _ragableAuth;
|
|
905
927
|
constructor(options: RagableBrowserClientOptions);
|
|
906
928
|
/** Delegates to `database.from()`. Kept for back-compat — prefer `database.from()`. */
|
|
907
|
-
from<TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string)
|
|
929
|
+
from: <TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string) => PostgrestTableApi<Database, TableName>;
|
|
908
930
|
destroy(): void;
|
|
909
931
|
}
|
|
910
932
|
declare function createBrowserClient<Database extends RagableDatabase = DefaultRagableDatabase, AuthUser extends Record<string, unknown> = Record<string, unknown>>(options: RagableBrowserClientOptions): RagableBrowser<Database, AuthUser>;
|
|
@@ -986,4 +1008,4 @@ declare function createClient(options: RagableClientOptions): Ragable;
|
|
|
986
1008
|
declare function createClient<Database extends RagableDatabase = DefaultRagableDatabase, AuthUser extends Record<string, unknown> = Record<string, unknown>>(options: RagableBrowserClientOptions): RagableBrowser<Database, AuthUser>;
|
|
987
1009
|
declare function createRagableServerClient(options: RagableClientOptions): Ragable;
|
|
988
1010
|
|
|
989
|
-
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 };
|
|
1011
|
+
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;
|
|
@@ -880,9 +898,13 @@ declare class RagableBrowserDatabaseClient<Database extends RagableDatabase = De
|
|
|
880
898
|
constructor(options: RagableBrowserClientOptions, ragableAuth?: RagableAuth | null);
|
|
881
899
|
/** @internal Called by RagableBrowser to share the Transport instance. */
|
|
882
900
|
_setTransport(transport: Transport): void;
|
|
883
|
-
|
|
901
|
+
/**
|
|
902
|
+
* PostgREST table access. Instance field so `client.database.from` is always an own,
|
|
903
|
+
* enumerable function (avoids rare prototype/bundler issues).
|
|
904
|
+
*/
|
|
905
|
+
from: <TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string) => PostgrestTableApi<Database, TableName>;
|
|
884
906
|
private toUrl;
|
|
885
|
-
query<Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams)
|
|
907
|
+
query: <Row extends Record<string, unknown> = Record<string, unknown>>(params: BrowserSqlQueryParams) => Promise<PostgrestResult<BrowserSqlQueryResult<Row>>>;
|
|
886
908
|
private baseHeaders;
|
|
887
909
|
}
|
|
888
910
|
declare class RagableBrowserAgentsClient {
|
|
@@ -904,7 +926,7 @@ declare class RagableBrowser<Database extends RagableDatabase = DefaultRagableDa
|
|
|
904
926
|
private readonly _ragableAuth;
|
|
905
927
|
constructor(options: RagableBrowserClientOptions);
|
|
906
928
|
/** Delegates to `database.from()`. Kept for back-compat — prefer `database.from()`. */
|
|
907
|
-
from<TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string)
|
|
929
|
+
from: <TableName extends RagableTableNames<Database>>(table: TableName, databaseInstanceId?: string) => PostgrestTableApi<Database, TableName>;
|
|
908
930
|
destroy(): void;
|
|
909
931
|
}
|
|
910
932
|
declare function createBrowserClient<Database extends RagableDatabase = DefaultRagableDatabase, AuthUser extends Record<string, unknown> = Record<string, unknown>>(options: RagableBrowserClientOptions): RagableBrowser<Database, AuthUser>;
|
|
@@ -986,4 +1008,4 @@ declare function createClient(options: RagableClientOptions): Ragable;
|
|
|
986
1008
|
declare function createClient<Database extends RagableDatabase = DefaultRagableDatabase, AuthUser extends Record<string, unknown> = Record<string, unknown>>(options: RagableBrowserClientOptions): RagableBrowser<Database, AuthUser>;
|
|
987
1009
|
declare function createRagableServerClient(options: RagableClientOptions): Ragable;
|
|
988
1010
|
|
|
989
|
-
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 };
|
|
1011
|
+
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 };
|