@bounded-sh/core 0.0.17 → 0.0.18
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/client/config.d.ts +0 -4
- package/dist/client/live.d.ts +2 -5
- package/dist/client/operations.d.ts +8 -4
- package/dist/client/realtime-store.d.ts +6 -0
- package/dist/client/subscription-v2.d.ts +0 -13
- package/dist/index.d.ts +1 -3
- package/dist/index.js +488 -1309
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +489 -1302
- package/dist/index.mjs.map +1 -1
- package/dist/realtime-store-CDLQdh7S.js +21 -0
- package/dist/realtime-store-CDLQdh7S.js.map +1 -0
- package/dist/realtime-store-DVnh5nQ8.mjs +19 -0
- package/dist/realtime-store-DVnh5nQ8.mjs.map +1 -0
- package/dist/types.d.ts +9 -6
- package/dist/utils/auth-api.d.ts +6 -2
- package/dist/utils/utils.d.ts +2 -4
- package/package.json +2 -2
package/dist/client/config.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { AuthProvider } from '../types';
|
|
|
2
2
|
export interface ClientConfig {
|
|
3
3
|
name: string;
|
|
4
4
|
logoUrl: string;
|
|
5
|
-
apiKey: string;
|
|
6
5
|
/** Auth method. 'email' = Bounded Auth human login (email OTP, inline) —
|
|
7
6
|
* the default for most apps. OAuth/social uses loginWithRedirect/
|
|
8
7
|
* loginWithPopup rather than authMethod. Text OTP uses hosted/headless OTP
|
|
@@ -52,9 +51,6 @@ export interface ClientConfig {
|
|
|
52
51
|
modalTitle?: string;
|
|
53
52
|
/** Custom subtitle shown below the title in the login modal. */
|
|
54
53
|
modalSubtitle?: string;
|
|
55
|
-
/** When true, the Phantom login modal offers a Privy (email/social) fallback
|
|
56
|
-
* route, hot-swapping to the Privy provider on demand. Web only. */
|
|
57
|
-
enablePrivyFallback?: boolean;
|
|
58
54
|
};
|
|
59
55
|
/** Privy (web) configuration — the @privy-io/react-auth app id + its config
|
|
60
56
|
* object. Used when authMethod is 'privy' (a co-equal login route alongside
|
package/dist/client/live.d.ts
CHANGED
|
@@ -75,8 +75,6 @@ export declare function status(roomPath: string, opts?: LiveStatusOptions): Prom
|
|
|
75
75
|
export type SubscribeViewOptions = {
|
|
76
76
|
/** User id whose view to read. Defaults to the logged-in user's @user.id. */
|
|
77
77
|
userId?: string;
|
|
78
|
-
/** Legacy alias for wallet-address keyed view docs. Prefer userId for new rooms. */
|
|
79
|
-
address?: string;
|
|
80
78
|
/** Called with the latest per-player view document. */
|
|
81
79
|
onData: (view: any) => void;
|
|
82
80
|
/** Called on subscription error. */
|
|
@@ -88,9 +86,8 @@ export type SubscribeViewOptions = {
|
|
|
88
86
|
* subscribe('<roomPath>/view/<myUserId>', { onData, onError })
|
|
89
87
|
*
|
|
90
88
|
* The view id defaults to the logged-in user's @user.id (from the session token
|
|
91
|
-
* claims); pass `opts.userId` to override.
|
|
92
|
-
*
|
|
93
|
-
* function (a Promise<() => Promise<void>>, same as `subscribe`).
|
|
89
|
+
* claims); pass `opts.userId` to override. Returns the unsubscribe function
|
|
90
|
+
* (a Promise<() => Promise<void>>, same as `subscribe`).
|
|
94
91
|
*
|
|
95
92
|
* Note: this is a browser-first helper (the WS subscription manager is
|
|
96
93
|
* browser-oriented). Server consumers should use `live.intent`.
|
|
@@ -52,7 +52,12 @@ export type GetOptions = {
|
|
|
52
52
|
sort?: Record<string, number>;
|
|
53
53
|
/** Natural language prompt for AI-powered queries (collections only) */
|
|
54
54
|
prompt?: string | undefined;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Opt into the short-lived local read cache. Cache entries are scoped to the
|
|
57
|
+
* opaque authenticated principal. Reads without auth material are never cached.
|
|
58
|
+
*/
|
|
59
|
+
cache?: boolean;
|
|
60
|
+
/** Force a fresh read even when `cache: true` is set */
|
|
56
61
|
bypassCache?: boolean;
|
|
57
62
|
/** Include documents from sub-paths (nested collections) */
|
|
58
63
|
includeSubPaths?: boolean;
|
|
@@ -217,10 +222,9 @@ export type GetManyResult = {
|
|
|
217
222
|
};
|
|
218
223
|
};
|
|
219
224
|
export declare function getMany(paths: string[], opts?: {
|
|
225
|
+
cache?: boolean;
|
|
220
226
|
bypassCache?: boolean;
|
|
221
|
-
_overrides?:
|
|
222
|
-
headers?: Record<string, string>;
|
|
223
|
-
};
|
|
227
|
+
_overrides?: RequestOverrides;
|
|
224
228
|
}): Promise<GetManyResult[]>;
|
|
225
229
|
export type RunExpressionOptions = {
|
|
226
230
|
returnType?: 'Bool' | 'String' | 'Int' | 'UInt';
|
|
@@ -9,6 +9,11 @@ export interface SubscriptionState<T = any> {
|
|
|
9
9
|
}
|
|
10
10
|
export interface SubscribeOptions {
|
|
11
11
|
tier?: StorageTier;
|
|
12
|
+
/**
|
|
13
|
+
* Opt into IndexedDB-backed stale snapshot delivery for this legacy store
|
|
14
|
+
* subscription. Anonymous/no-auth subscriptions never use persisted snapshots.
|
|
15
|
+
*/
|
|
16
|
+
cache?: boolean;
|
|
12
17
|
filter?: Record<string, any>;
|
|
13
18
|
prompt?: string;
|
|
14
19
|
includeSubPaths?: boolean;
|
|
@@ -84,6 +89,7 @@ export declare class RealtimeStore {
|
|
|
84
89
|
private getCollectionPath;
|
|
85
90
|
private getSubKey;
|
|
86
91
|
private idbKey;
|
|
92
|
+
private shouldUseIdb;
|
|
87
93
|
private markIdbDirty;
|
|
88
94
|
private flushIdb;
|
|
89
95
|
private createUnsubscribe;
|
|
@@ -53,7 +53,6 @@ export declare function forceReconnectV2(): Promise<void>;
|
|
|
53
53
|
* Returns true if there is an active v2 WebSocket connection open.
|
|
54
54
|
*/
|
|
55
55
|
export declare function hasActiveConnection(): boolean;
|
|
56
|
-
export declare function wsGet(path: string): Promise<any>;
|
|
57
56
|
/**
|
|
58
57
|
* Send a live-room intent over the EXISTING per-room socket (fire-and-forget).
|
|
59
58
|
* Returns true if it was sent over an open connection, false if there is no
|
|
@@ -73,15 +72,3 @@ export declare function wsIntent(appId: string, roomRoutePath: string, intent: u
|
|
|
73
72
|
export declare function wsIntentReliable(appId: string, roomRoutePath: string, intent: unknown): Promise<{
|
|
74
73
|
ok: true;
|
|
75
74
|
}> | undefined;
|
|
76
|
-
export declare function wsSet(documents: Array<{
|
|
77
|
-
destinationPath: string;
|
|
78
|
-
document: any;
|
|
79
|
-
}>): Promise<any>;
|
|
80
|
-
export declare function wsQuery(path: string, opts?: {
|
|
81
|
-
filter?: any;
|
|
82
|
-
sort?: any;
|
|
83
|
-
limit?: number;
|
|
84
|
-
includeSubPaths?: boolean;
|
|
85
|
-
}): Promise<any>;
|
|
86
|
-
export declare function wsDelete(path: string): Promise<any>;
|
|
87
|
-
export declare function wsGetMany(paths: string[]): Promise<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { getConfig, ClientConfig } from './client/config';
|
|
|
3
3
|
export { getWebhookKeysUrl } from './client/config';
|
|
4
4
|
export { get, getMany, docId, set, setMany, setFile, getFiles, search, queryAggregate, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, signAndSubmitTransaction, count, aggregate, RequestOverrides, SetOptions, GetOptions, SearchOptions, RunQueryOptions, CountOptions, AggregateOptions, AggregateOperation, AggregateResult, AggregateSpec, AggregateRow, QueryAggregateOptions, RunExpressionOptions, RunExpressionResult, InsufficientBalanceError, GetManyResult } from './client/operations';
|
|
5
5
|
export { subscribe, closeAllSubscriptions, clearCache, getCachedData, reconnectWithNewAuth } from './client/subscription';
|
|
6
|
-
export { hasActiveConnection
|
|
6
|
+
export { hasActiveConnection } from './client/subscription-v2';
|
|
7
7
|
export * from './types';
|
|
8
8
|
export { increment, serverTimestamp } from './client/field-values';
|
|
9
9
|
export type { FieldOperation } from './client/field-values';
|
|
@@ -20,8 +20,6 @@ export { createSessionWithSignature, refreshSession, revokeSession, signSessionC
|
|
|
20
20
|
export { Tarobase as Bounded6 } from './utils/sol/taro6CvKqwrYrDc16ufYgzQ2NZcyyVKStffbtudrhRuDevnet-program';
|
|
21
21
|
export { Tarobase as BoundedPoof } from './utils/sol/poof4b5pk1L9tmThvBmaABjcyjfhFGbMbQP5BXk2QZpMainnet-program';
|
|
22
22
|
export { buildSetDocumentsTransaction, convertRemainingAccounts, RemainingAccount, genSolanaMessage } from './utils/sol/sol-utils';
|
|
23
|
-
export { RealtimeStore, getRealtimeStore, resetRealtimeStore } from './client/realtime-store';
|
|
24
|
-
export type { StorageTier, SubscriptionStatus, SubscriptionState, SubscribeOptions, DeltaChange } from './client/realtime-store';
|
|
25
23
|
export { functions, invoke as invokeFunction, FunctionInvokeError } from './client/functions';
|
|
26
24
|
export type { InvokeOptions } from './client/functions';
|
|
27
25
|
export { live, intent as liveIntent, status as liveStatus, subscribeView as subscribeLiveView, LiveIntentError } from './client/live';
|