@spooky-sync/client-solid2 0.0.1-canary.200
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/LICENSE +21 -0
- package/QUICK_START.md +126 -0
- package/README.md +19 -0
- package/dist/index.cjs +903 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +498 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +498 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +884 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
- package/skills/sp00ky-solid2/SKILL.md +68 -0
- package/src/index.ts +365 -0
- package/src/lib/Sp00kyProvider.ts +104 -0
- package/src/lib/__tests__/conflate.test.ts +120 -0
- package/src/lib/__tests__/create-query.test.ts +284 -0
- package/src/lib/__tests__/rc-semantics.test.ts +389 -0
- package/src/lib/conflate.ts +74 -0
- package/src/lib/context.ts +28 -0
- package/src/lib/create-preload.ts +115 -0
- package/src/lib/create-query.ts +285 -0
- package/src/lib/create-submission.ts +57 -0
- package/src/lib/from-subscription.ts +32 -0
- package/src/lib/models.ts +8 -0
- package/src/lib/use-app-release.ts +89 -0
- package/src/lib/use-crdt-field.ts +57 -0
- package/src/lib/use-download-file.ts +181 -0
- package/src/lib/use-feature-flag.ts +43 -0
- package/src/lib/use-file-upload.ts +146 -0
- package/src/lib/use-storage-status.ts +44 -0
- package/src/lib/use-sync-status.ts +63 -0
- package/src/types/index.ts +83 -0
- package/tsconfig.json +27 -0
- package/tsdown.config.ts +18 -0
- package/vitest.config.ts +14 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { AppReleaseOptions, AuthService, BucketHandle, BucketPutOptions, BucketPutResult, ConnectionState, ConnectionState as ConnectionState$1, CrdtField, FeatureFlagOptions, PreloadOptions, PreloadOptions as PreloadOptions$1, PreloadRefresh, ReconnectConfig, RunOptions, Sp00kyClient, Sp00kyConfig, Sp00kyQueryResultPromise, StorageHealth, StorageHealth as StorageHealth$1, StorageHealthStatus, StorageHealthStatus as StorageHealthStatus$1, SyncHealth, SyncHealth as SyncHealth$1, SyncHealthConfig, SyncHealthStatus, SyncHealthStatus as SyncHealthStatus$1, UpdateOptions } from "@spooky-sync/core";
|
|
2
|
+
import { RecordId, RecordId as RecordId$1, Surreal, Uuid } from "surrealdb";
|
|
3
|
+
import { Accessor, Element } from "solid-js";
|
|
4
|
+
import { BackendNames, BackendRoutes, BucketDefinitionSchema, BucketNames, ColumnSchema, FinalQuery, GenericModel, GenericSchema, GetCardinality, GetRelationship, GetTable, GetTable as GetTable$1, InferRelatedModelFromMetadata, InnerQuery, QueryBuilder, QueryInfo, QueryModifier, QueryModifierBuilder, QueryResult, QueryResult as QueryResult$1, RelatedFieldMapEntry, RelatedFieldsMap, RelationshipDefinition, RelationshipFieldsFromSchema, RelationshipsMetadata, RoutePayload, SchemaStructure, TableModel, TableModel as TableModel$1, TableNames, TableNames as TableNames$1 } from "@spooky-sync/query-builder";
|
|
5
|
+
|
|
6
|
+
//#region src/lib/models.d.ts
|
|
7
|
+
type Model<T> = T;
|
|
8
|
+
type ModelPayload<T> = T & {
|
|
9
|
+
id: RecordId$1;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=models.d.ts.map
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/types/index.d.ts
|
|
14
|
+
/**
|
|
15
|
+
* Options for database provisioning
|
|
16
|
+
*/
|
|
17
|
+
interface ProvisionOptions {
|
|
18
|
+
/** Force re-provision even if schema already exists */
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}
|
|
21
|
+
sideEffect();
|
|
22
|
+
type CacheStrategy = 'memory' | 'indexeddb';
|
|
23
|
+
/**
|
|
24
|
+
* Infer Schema type (Record<TableName, Model>) from schema const
|
|
25
|
+
*/
|
|
26
|
+
type InferSchemaFromConst<S extends SchemaStructure> = { [K in TableNames$1<S>]: TableModel$1<GetTable$1<S, K>> };
|
|
27
|
+
/**
|
|
28
|
+
* Infer Relationships type from schema const's relationships array
|
|
29
|
+
* Converts from array format to nested object format
|
|
30
|
+
*/
|
|
31
|
+
type InferRelationshipsFromConst<S extends SchemaStructure, Schema extends GenericSchema> = { [TableName in TableNames$1<S>]: { [Rel in Extract<S['relationships'][number], {
|
|
32
|
+
from: TableName;
|
|
33
|
+
}> as Rel['field']]: {
|
|
34
|
+
model: Rel['to'] extends keyof Schema ? Schema[Rel['to']] : any;
|
|
35
|
+
table: Rel['to'];
|
|
36
|
+
cardinality: Rel['cardinality'];
|
|
37
|
+
} } };
|
|
38
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
39
|
+
type SyncedDbConfig<S extends SchemaStructure> = Prettify<Sp00kyConfig<S>>;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/lib/create-query.d.ts
|
|
42
|
+
type QueryArg<S extends SchemaStructure, TableName extends TableNames$1<S>, T extends {
|
|
43
|
+
columns: Record<string, ColumnSchema>;
|
|
44
|
+
}, RelatedFields extends Record<string, any>, IsOne extends boolean> = FinalQuery<S, TableName, T, RelatedFields, IsOne, Sp00kyQueryResultPromise> | (() => FinalQuery<S, TableName, T, RelatedFields, IsOne, Sp00kyQueryResultPromise> | null | undefined);
|
|
45
|
+
type QueryOptions = {
|
|
46
|
+
enabled?: () => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Tear down the query (remote `_00_query` view + local WASM view) when this
|
|
49
|
+
* hook is disposed and no other subscriber remains, instead of keeping it
|
|
50
|
+
* resident for cheap re-subscription. Use for viewport-windowed lists that
|
|
51
|
+
* mount/unmount a query per scroll window and want off-screen windows
|
|
52
|
+
* cancelled. Trade-off: scrolling back to a torn-down window re-registers it.
|
|
53
|
+
*/
|
|
54
|
+
deregisterOnCleanup?: boolean;
|
|
55
|
+
};
|
|
56
|
+
type CreateQueryResult<TData> = {
|
|
57
|
+
/**
|
|
58
|
+
* Reactive result. Never suspends and never throws: born as an empty
|
|
59
|
+
* committed value (`[]` / `null`) and reconciled in place (keyed by `id`) on
|
|
60
|
+
* every live emission — unchanged rows keep identity, and coarse readers
|
|
61
|
+
* (`<For>`) are notified on add/remove/reorder.
|
|
62
|
+
*/
|
|
63
|
+
data: Accessor<TData>;
|
|
64
|
+
/**
|
|
65
|
+
* Suspending read of the same result for `<Loading>` users: throws Solid's
|
|
66
|
+
* not-ready protocol until the query has delivered its first real result
|
|
67
|
+
* (or errored, in which case it returns the empty value and `error()` is
|
|
68
|
+
* set). Read this inside a `<Loading>` boundary.
|
|
69
|
+
*/
|
|
70
|
+
ready: Accessor<TData>;
|
|
71
|
+
error: Accessor<Error | undefined>;
|
|
72
|
+
isLoading: Accessor<boolean>;
|
|
73
|
+
isFetching: Accessor<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* True once the query has delivered a result AND no fetch cycle is in
|
|
76
|
+
* flight (registration + initial sync included). While settled, results are
|
|
77
|
+
* authoritative: a windowed query returning fewer rows than its LIMIT
|
|
78
|
+
* really is the end of the list. Resets when the query identity changes.
|
|
79
|
+
*/
|
|
80
|
+
isSettled: Accessor<boolean>;
|
|
81
|
+
};
|
|
82
|
+
declare function createQuery<S extends SchemaStructure, TableName extends TableNames$1<S>, T extends {
|
|
83
|
+
columns: Record<string, ColumnSchema>;
|
|
84
|
+
}, RelatedFields extends Record<string, any>, IsOne extends boolean, TData = QueryResult$1<S, TableName, RelatedFields, IsOne> | null>(finalQuery: QueryArg<S, TableName, T, RelatedFields, IsOne>, options?: QueryOptions): CreateQueryResult<TData>;
|
|
85
|
+
declare function createQuery<S extends SchemaStructure, TableName extends TableNames$1<S>, T extends {
|
|
86
|
+
columns: Record<string, ColumnSchema>;
|
|
87
|
+
}, RelatedFields extends Record<string, any>, IsOne extends boolean, TData = QueryResult$1<S, TableName, RelatedFields, IsOne> | null>(db: SyncedDb<S>, finalQuery: QueryArg<S, TableName, T, RelatedFields, IsOne>, options?: QueryOptions): CreateQueryResult<TData>;
|
|
88
|
+
/** @deprecated Renamed `createQuery` in the Solid 2 binding. */
|
|
89
|
+
declare const useQuery: typeof createQuery;
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/lib/create-preload.d.ts
|
|
92
|
+
type PreloadArg<S extends SchemaStructure, TableName extends TableNames$1<S>, T extends {
|
|
93
|
+
columns: Record<string, ColumnSchema>;
|
|
94
|
+
}, RelatedFields extends Record<string, any>, IsOne extends boolean> = FinalQuery<S, TableName, T, RelatedFields, IsOne, Sp00kyQueryResultPromise> | (() => FinalQuery<S, TableName, T, RelatedFields, IsOne, Sp00kyQueryResultPromise> | null | undefined);
|
|
95
|
+
type PreloadOptions$2 = PreloadOptions$1 & {
|
|
96
|
+
/** Only preload while this returns true (defaults to always). */
|
|
97
|
+
enabled?: () => boolean;
|
|
98
|
+
};
|
|
99
|
+
declare function createPreload<S extends SchemaStructure, TableName extends TableNames$1<S>, T extends {
|
|
100
|
+
columns: Record<string, ColumnSchema>;
|
|
101
|
+
}, RelatedFields extends Record<string, any>, IsOne extends boolean>(finalQuery: PreloadArg<S, TableName, T, RelatedFields, IsOne>, options?: PreloadOptions$2): void;
|
|
102
|
+
declare function createPreload<S extends SchemaStructure, TableName extends TableNames$1<S>, T extends {
|
|
103
|
+
columns: Record<string, ColumnSchema>;
|
|
104
|
+
}, RelatedFields extends Record<string, any>, IsOne extends boolean>(db: SyncedDb<S>, finalQuery: PreloadArg<S, TableName, T, RelatedFields, IsOne>, options?: PreloadOptions$2): void;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/lib/use-sync-status.d.ts
|
|
107
|
+
interface UseSyncStatus {
|
|
108
|
+
/** Full health snapshot; updates reactively on every transition. */
|
|
109
|
+
health: Accessor<SyncHealth$1>;
|
|
110
|
+
/** `'healthy'` | `'degraded'`. */
|
|
111
|
+
status: Accessor<SyncHealthStatus$1>;
|
|
112
|
+
isHealthy: Accessor<boolean>;
|
|
113
|
+
/** `true` once sync has failed for a sustained run — drive a banner off this. */
|
|
114
|
+
isDegraded: Accessor<boolean>;
|
|
115
|
+
/** `true` once at least one sync round has succeeded this session. */
|
|
116
|
+
everConnected: Accessor<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* `true` only for a real lost connection: degraded AFTER a first successful
|
|
119
|
+
* sync. Stays `false` during the initial "connecting" phase (degraded but
|
|
120
|
+
* never reached the server yet), so an indicator can show nothing until the
|
|
121
|
+
* app has actually connected once.
|
|
122
|
+
*/
|
|
123
|
+
isOffline: Accessor<boolean>;
|
|
124
|
+
/**
|
|
125
|
+
* Transport state of the remote WebSocket. Flips the instant the socket
|
|
126
|
+
* drops, unlike `status`, which only degrades after a sustained run of failed
|
|
127
|
+
* sync rounds — so this is what to drive a "reconnecting…" affordance off.
|
|
128
|
+
*/
|
|
129
|
+
connection: Accessor<ConnectionState$1>;
|
|
130
|
+
/**
|
|
131
|
+
* `true` while the connection is being re-established. Usually still
|
|
132
|
+
* `isHealthy()`: a short reconnect is invisible to sync, and writes made
|
|
133
|
+
* during it are queued locally and pushed once the socket is back.
|
|
134
|
+
*/
|
|
135
|
+
isReconnecting: Accessor<boolean>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Observe sync health for a "can't reach the server" banner / indicator.
|
|
139
|
+
*
|
|
140
|
+
* Backed by `db.subscribeToSyncHealth`. Individual sync failures (a transient
|
|
141
|
+
* remote 500 on query registration, a dropped socket) are absorbed by the
|
|
142
|
+
* retry and never flip this; `isDegraded()` only goes true once failures
|
|
143
|
+
* persist for the configured number of consecutive rounds (sp00ky core config
|
|
144
|
+
* `syncHealth.degradeAfterConsecutiveFailures`, default 3), and flips back on
|
|
145
|
+
* the next successful round. Must be used within a `<Sp00kyProvider>`.
|
|
146
|
+
*/
|
|
147
|
+
declare function useSyncStatus(): UseSyncStatus;
|
|
148
|
+
//# sourceMappingURL=use-sync-status.d.ts.map
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/lib/use-storage-status.d.ts
|
|
151
|
+
interface UseStorageStatus {
|
|
152
|
+
/** Full durability snapshot; updates reactively. */
|
|
153
|
+
health: Accessor<StorageHealth$1>;
|
|
154
|
+
/** `'unknown'` | `'persistent'` | `'memory'`. */
|
|
155
|
+
status: Accessor<StorageHealthStatus$1>;
|
|
156
|
+
/** `true` when the local store survives a reload. */
|
|
157
|
+
isPersistent: Accessor<boolean>;
|
|
158
|
+
/**
|
|
159
|
+
* `true` only when durable storage was requested and could NOT be opened, so
|
|
160
|
+
* the dataset is sitting in RAM and local writes die on reload. Drive a
|
|
161
|
+
* warning off this, not off `status`: a store configured as in-memory reports
|
|
162
|
+
* `'memory'` too, and that is a choice rather than a problem.
|
|
163
|
+
*/
|
|
164
|
+
isMemoryFallback: Accessor<boolean>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Observe how durable the LOCAL cache is, for a "no local storage" warning.
|
|
168
|
+
*
|
|
169
|
+
* Under `localEngine: 'sqlite'` with `store: 'indexeddb'` the durable store is
|
|
170
|
+
* the OPFS SAHPool VFS, and only ONE client per bucket can hold it open: a
|
|
171
|
+
* second tab of the same app cannot get it and runs in memory instead (the
|
|
172
|
+
* engine retries first, so a closing tab's lock is usually waited out). Must be
|
|
173
|
+
* used within a `<Sp00kyProvider>`.
|
|
174
|
+
*/
|
|
175
|
+
declare function useStorageStatus(): UseStorageStatus;
|
|
176
|
+
//# sourceMappingURL=use-storage-status.d.ts.map
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/lib/use-crdt-field.d.ts
|
|
179
|
+
declare function useCrdtField(table: string, recordId: () => string | undefined, field: string, fallbackText?: () => string | undefined): Accessor<CrdtField | null>;
|
|
180
|
+
//# sourceMappingURL=use-crdt-field.d.ts.map
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/lib/use-feature-flag.d.ts
|
|
183
|
+
interface UseFeatureFlag {
|
|
184
|
+
variant: Accessor<string | undefined>;
|
|
185
|
+
payload: Accessor<unknown | undefined>;
|
|
186
|
+
enabled: Accessor<boolean>;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Subscribe to a feature flag for the currently authenticated user.
|
|
190
|
+
*
|
|
191
|
+
* Returns three Solid accessors that update reactively whenever the
|
|
192
|
+
* server-materialized assignment in `_00_user_feature` changes. Backed by
|
|
193
|
+
* the same SSP + sync pipeline that powers `createQuery`, so toggling a flag
|
|
194
|
+
* via `spky flag enable <key>` propagates to the UI without a refresh.
|
|
195
|
+
*
|
|
196
|
+
* `enabled()` is `true` when the resolved variant exists and is not 'off'.
|
|
197
|
+
* For multi-variant flags, prefer `variant()` directly.
|
|
198
|
+
*/
|
|
199
|
+
declare function useFeatureFlag(key: string, options?: FeatureFlagOptions): UseFeatureFlag;
|
|
200
|
+
//# sourceMappingURL=use-feature-flag.d.ts.map
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/lib/use-app-release.d.ts
|
|
203
|
+
interface UseAppReleaseOptions extends AppReleaseOptions {
|
|
204
|
+
/** App name from sp00ky.yml, e.g. `web`. */
|
|
205
|
+
app: string;
|
|
206
|
+
/**
|
|
207
|
+
* The running build's version (X.Y.Z), typically baked in at build time
|
|
208
|
+
* (e.g. a vite `define` from package.json). `updateAvailable()` is true when
|
|
209
|
+
* the announced release is semver-newer than this.
|
|
210
|
+
*/
|
|
211
|
+
currentVersion: string;
|
|
212
|
+
}
|
|
213
|
+
interface UseAppRelease {
|
|
214
|
+
/** Latest announced version for the app, or undefined when no row exists. */
|
|
215
|
+
latestVersion: Accessor<string | undefined>;
|
|
216
|
+
/** Announced version is semver-newer than the running build. */
|
|
217
|
+
updateAvailable: Accessor<boolean>;
|
|
218
|
+
/** The newer release asks clients to update/reload without prompting. */
|
|
219
|
+
mandatory: Accessor<boolean>;
|
|
220
|
+
/** The newer release asks reloads to clear service-worker caches first. */
|
|
221
|
+
cacheBust: Accessor<boolean>;
|
|
222
|
+
/**
|
|
223
|
+
* Reload onto the announced release. Plain `location.reload()` normally;
|
|
224
|
+
* when the release is flagged cache-bust, CacheStorage is cleared, the
|
|
225
|
+
* service-worker registration is nudged to update, and navigation carries a
|
|
226
|
+
* `?cb=` token to punch through intermediary caches. The service worker is
|
|
227
|
+
* deliberately NOT unregistered: navigating while still controlled by a
|
|
228
|
+
* just-unregistered worker strands subresource fetches on the dead worker
|
|
229
|
+
* and the page hangs until a manual reload.
|
|
230
|
+
*/
|
|
231
|
+
reload: () => Promise<void>;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Observe the app's announced release (`_00_app_release:<app>`, written by
|
|
235
|
+
* `spky deploy` / `spky release`) and compare it against the running build.
|
|
236
|
+
*
|
|
237
|
+
* Typical use: mount a small "new version available — Reload" notification
|
|
238
|
+
* gated on `updateAvailable()`, auto-invoking `reload()` when `mandatory()`
|
|
239
|
+
* (guard the auto path against reload loops with a per-version marker, since
|
|
240
|
+
* a client can reload while the deploy is still rolling out and land on the
|
|
241
|
+
* old bundle again).
|
|
242
|
+
*/
|
|
243
|
+
declare function useAppRelease(options: UseAppReleaseOptions): UseAppRelease;
|
|
244
|
+
//# sourceMappingURL=use-app-release.d.ts.map
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/lib/use-file-upload.d.ts
|
|
247
|
+
interface FileUploadResult {
|
|
248
|
+
isUploading: () => boolean;
|
|
249
|
+
error: () => Error | null;
|
|
250
|
+
clearError: () => void;
|
|
251
|
+
upload: (path: string, file: File | Blob, options?: BucketPutOptions) => Promise<BucketPutResult | void>;
|
|
252
|
+
download: (path: string) => Promise<string | null>;
|
|
253
|
+
remove: (path: string) => Promise<void>;
|
|
254
|
+
exists: (path: string) => Promise<boolean>;
|
|
255
|
+
}
|
|
256
|
+
declare function useFileUpload<S extends SchemaStructure>(bucketName: BucketNames<S>): FileUploadResult;
|
|
257
|
+
declare function useFileUpload<S extends SchemaStructure>(db: SyncedDb<S>, bucketName: BucketNames<S>): FileUploadResult;
|
|
258
|
+
//# sourceMappingURL=use-file-upload.d.ts.map
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/lib/use-download-file.d.ts
|
|
261
|
+
interface UseDownloadFileOptions {
|
|
262
|
+
/**
|
|
263
|
+
* Master switch, default `true`. `false` gives every hook instance its own
|
|
264
|
+
* private object URL fetched fresh from the bucket and revoked on unmount —
|
|
265
|
+
* no sharing, no persistence, no reuse.
|
|
266
|
+
*/
|
|
267
|
+
cache?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Keep the bytes in OPFS so they survive a reload and are available offline.
|
|
270
|
+
* Default `true`. Turn off for one-shot or sensitive files; the in-tab object
|
|
271
|
+
* URL is still shared between components rendering the same path.
|
|
272
|
+
*/
|
|
273
|
+
persist?: boolean;
|
|
274
|
+
/** Exempt this file from pressure eviction. Pinned bytes never expire. */
|
|
275
|
+
pin?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* `'never'` (default) treats a bucket path as immutable, which is how paths
|
|
278
|
+
* are written (`crypto.randomUUID() + ext`). `'head'` spends a remote `head()`
|
|
279
|
+
* to compare sizes before trusting the cached copy — for paths the app
|
|
280
|
+
* overwrites in place.
|
|
281
|
+
*/
|
|
282
|
+
revalidate?: 'never' | 'head';
|
|
283
|
+
}
|
|
284
|
+
interface UseDownloadFileResult {
|
|
285
|
+
url: Accessor<string | null>;
|
|
286
|
+
isLoading: Accessor<boolean>;
|
|
287
|
+
error: Accessor<Error | null>;
|
|
288
|
+
refetch: () => void;
|
|
289
|
+
}
|
|
290
|
+
declare function useDownloadFile<S extends SchemaStructure>(bucketName: BucketNames<S>, path: Accessor<string | null | undefined>, options?: UseDownloadFileOptions): UseDownloadFileResult;
|
|
291
|
+
declare function useDownloadFile<S extends SchemaStructure>(db: SyncedDb<S>, bucketName: BucketNames<S>, path: Accessor<string | null | undefined>, options?: UseDownloadFileOptions): UseDownloadFileResult;
|
|
292
|
+
//# sourceMappingURL=use-download-file.d.ts.map
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/lib/Sp00kyProvider.d.ts
|
|
295
|
+
interface Sp00kyProviderProps<S extends SchemaStructure> {
|
|
296
|
+
config: SyncedDbConfig<S>;
|
|
297
|
+
fallback?: Element;
|
|
298
|
+
onError?: (error: Error) => void;
|
|
299
|
+
onReady?: (db: SyncedDb<S>) => void;
|
|
300
|
+
/**
|
|
301
|
+
* Prewarm data into the local cache before revealing the UI. Runs after
|
|
302
|
+
* `init()`; the `fallback` stays visible until it resolves. Use awaitable
|
|
303
|
+
* `db.preload(...)` calls here to gate first-load on essential data (e.g.
|
|
304
|
+
* config). On warm loads preload returns instantly, so there's no perceptible
|
|
305
|
+
* gate after the first run. Best-effort: a rejection is caught and the UI is
|
|
306
|
+
* revealed anyway.
|
|
307
|
+
*/
|
|
308
|
+
preload?: (db: SyncedDb<S>) => Promise<void>;
|
|
309
|
+
children: Element;
|
|
310
|
+
}
|
|
311
|
+
declare function Sp00kyProvider<S extends SchemaStructure>(props: Sp00kyProviderProps<S>): Element;
|
|
312
|
+
//# sourceMappingURL=Sp00kyProvider.d.ts.map
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/lib/context.d.ts
|
|
315
|
+
declare function useDb<S extends SchemaStructure>(): SyncedDb<S>;
|
|
316
|
+
/**
|
|
317
|
+
* Count of locally-committed mutations not yet acknowledged by the server.
|
|
318
|
+
* Drive an "unsaved changes" indicator off this.
|
|
319
|
+
*/
|
|
320
|
+
declare function usePendingMutations(): Accessor<number>;
|
|
321
|
+
//# sourceMappingURL=context.d.ts.map
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region src/lib/create-submission.d.ts
|
|
324
|
+
interface Submission<Args extends unknown[], R> {
|
|
325
|
+
/** Run the wrapped async fn. Concurrent submits share the pending flag. */
|
|
326
|
+
submit: (...args: Args) => Promise<R | undefined>;
|
|
327
|
+
/** True while at least one submit is in flight. */
|
|
328
|
+
pending: Accessor<boolean>;
|
|
329
|
+
/** Error from the most recent settled submit, cleared on the next submit. */
|
|
330
|
+
error: Accessor<Error | undefined>;
|
|
331
|
+
/** Result of the most recent successful submit. */
|
|
332
|
+
result: Accessor<R | undefined>;
|
|
333
|
+
clearError: () => void;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Thin submission-state wrapper for mutations — button spinner/disable state
|
|
337
|
+
* around `db.create/update/delete/run` calls.
|
|
338
|
+
*
|
|
339
|
+
* Deliberately NOT built on Solid 2's `action()`/`createOptimisticStore`: the
|
|
340
|
+
* spooky engine is already optimistic local-first (writes commit to the local
|
|
341
|
+
* DB and re-render through live queries before sync; `run()` is an outbox
|
|
342
|
+
* CREATE), so a transaction/revert layer on top buys nothing and `action()`'s
|
|
343
|
+
* await-vs-yield transaction escape is a real footgun. Errors here mean the
|
|
344
|
+
* LOCAL commit failed — sync/push failures surface through `useSyncStatus`
|
|
345
|
+
* and `usePendingMutations` instead.
|
|
346
|
+
*/
|
|
347
|
+
declare function createSubmission<Args extends unknown[], R>(fn: (...args: Args) => Promise<R>): Submission<Args, R>;
|
|
348
|
+
//# sourceMappingURL=create-submission.d.ts.map
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/lib/conflate.d.ts
|
|
351
|
+
/**
|
|
352
|
+
* Latest-wins async iterable over a subscribe-callback source.
|
|
353
|
+
*
|
|
354
|
+
* Bridges spooky's push-callback subscriptions into the AsyncIterable shape
|
|
355
|
+
* Solid 2 computations consume natively. Each spooky emission is a full result
|
|
356
|
+
* set, so intermediate values are droppable: only the newest unconsumed value
|
|
357
|
+
* is buffered, and a pending pull resolves with it immediately.
|
|
358
|
+
*
|
|
359
|
+
* Teardown contract (probed in rc-semantics.test.ts): Solid 2 does NOT
|
|
360
|
+
* terminate a superseded/disposed computation's async generator — no
|
|
361
|
+
* `return()`, no `finally`. Consumers MUST call `it.return()` themselves from
|
|
362
|
+
* an `onCleanup` registered synchronously in the compute scope. `return()`
|
|
363
|
+
* unsubscribes (awaiting the unsubscribe if the subscribe returned a promise,
|
|
364
|
+
* as `sp00ky.subscribe` does) and resolves any parked pull as done.
|
|
365
|
+
*/
|
|
366
|
+
declare function conflate<T>(subscribe: (cb: (v: T) => void) => (() => void) | Promise<() => void>): AsyncIterable<T>;
|
|
367
|
+
//# sourceMappingURL=conflate.d.ts.map
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/lib/from-subscription.d.ts
|
|
370
|
+
/**
|
|
371
|
+
* Reactive view over a spooky subscribe-callback API.
|
|
372
|
+
*
|
|
373
|
+
* The memo's async generator pulls from a conflated (latest-wins) iterator;
|
|
374
|
+
* `initial` is committed as the memo's `loadingValue`, so the accessor is
|
|
375
|
+
* readable synchronously from birth and never suspends. Spooky's subscribe
|
|
376
|
+
* APIs fire immediately with the current value, so the real value lands within
|
|
377
|
+
* a tick of the first read.
|
|
378
|
+
*
|
|
379
|
+
* Teardown is manual by contract (see conflate.ts): onCleanup terminates the
|
|
380
|
+
* iterator, which unsubscribes.
|
|
381
|
+
*/
|
|
382
|
+
declare function fromSubscription<T>(subscribe: (cb: (v: T) => void) => (() => void) | Promise<() => void>, initial: T): Accessor<T>;
|
|
383
|
+
//# sourceMappingURL=from-subscription.d.ts.map
|
|
384
|
+
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region src/index.d.ts
|
|
387
|
+
type RelationshipField<Schema extends SchemaStructure, TableName extends TableNames<Schema>, Field extends RelationshipFieldsFromSchema<Schema, TableName>> = GetRelationship<Schema, TableName, Field>;
|
|
388
|
+
type RelatedFieldsTableScoped<Schema extends SchemaStructure, TableName extends TableNames<Schema>, RelatedFields extends RelationshipFieldsFromSchema<Schema, TableName> = RelationshipFieldsFromSchema<Schema, TableName>> = { [K in RelatedFields]: {
|
|
389
|
+
to: RelationshipField<Schema, TableName, K>['to'];
|
|
390
|
+
relatedFields: RelatedFieldsMap;
|
|
391
|
+
cardinality: RelationshipField<Schema, TableName, K>['cardinality'];
|
|
392
|
+
} };
|
|
393
|
+
type InferModel<Schema extends SchemaStructure, TableName extends TableNames<Schema>, RelatedFields extends RelatedFieldsTableScoped<Schema, TableName>> = QueryResult<Schema, TableName, RelatedFields, true>;
|
|
394
|
+
type WithRelated<Field extends string, RelatedFields extends RelatedFieldsMap = {}> = { [K in Field]: Omit<RelatedFieldMapEntry, 'relatedFields'> & {
|
|
395
|
+
relatedFields: RelatedFields;
|
|
396
|
+
} };
|
|
397
|
+
type WithRelatedMany<Field extends string, RelatedFields extends RelatedFieldsMap = {}> = { [K in Field]: {
|
|
398
|
+
to: Field;
|
|
399
|
+
relatedFields: RelatedFields;
|
|
400
|
+
cardinality: 'many';
|
|
401
|
+
} };
|
|
402
|
+
/**
|
|
403
|
+
* SyncedDb - A thin wrapper around sp00ky-ts for Solid.js integration.
|
|
404
|
+
* Delegates all logic to the underlying sp00ky-ts instance.
|
|
405
|
+
*
|
|
406
|
+
* NOTE: keep in sync with packages/client-solid/src/index.ts (SyncedDb).
|
|
407
|
+
* Copied rather than shared so this package's dependency graph never pulls
|
|
408
|
+
* in solid-js 1.x; fold the two together once client-solid moves to Solid 2.
|
|
409
|
+
*/
|
|
410
|
+
declare class SyncedDb<S extends SchemaStructure> {
|
|
411
|
+
private config;
|
|
412
|
+
private sp00ky;
|
|
413
|
+
private _initialized;
|
|
414
|
+
constructor(config: SyncedDbConfig<S>);
|
|
415
|
+
getSp00ky(): Sp00kyClient<S>;
|
|
416
|
+
/**
|
|
417
|
+
* Initialize the sp00ky-ts instance
|
|
418
|
+
*/
|
|
419
|
+
init(): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Tear down the client: leaves the tabs broker, closes the local store and
|
|
422
|
+
* remote socket, and frees the wasm circuit. Without this a remounted provider
|
|
423
|
+
* (or an HMR reload) strands a whole client, and the abandoned wasm heaps stay
|
|
424
|
+
* resident because V8 cannot see how much wasm memory a dropped wrapper holds.
|
|
425
|
+
*/
|
|
426
|
+
close(): Promise<void>;
|
|
427
|
+
/**
|
|
428
|
+
* Create a new record in the database
|
|
429
|
+
*/
|
|
430
|
+
create(id: string, payload: Record<string, unknown>): Promise<void>;
|
|
431
|
+
/**
|
|
432
|
+
* Update an existing record in the database
|
|
433
|
+
*/
|
|
434
|
+
update<TName extends TableNames<S>>(tableName: TName, recordId: string, payload: Partial<TableModel<GetTable<S, TName>>>, options?: UpdateOptions): Promise<void>;
|
|
435
|
+
/**
|
|
436
|
+
* Delete an existing record in the database
|
|
437
|
+
*/
|
|
438
|
+
delete<TName extends TableNames<S>>(tableName: TName, selector: string | RecordId | InnerQuery<GetTable<S, TName>, boolean>): Promise<void>;
|
|
439
|
+
/**
|
|
440
|
+
* Preload/prewarm a built query into the local cache without registering a
|
|
441
|
+
* live view. Fetches once and stores the rows (+ embedded related children)
|
|
442
|
+
* locally so a later `createQuery` for the same data paints instantly. Best-effort.
|
|
443
|
+
*/
|
|
444
|
+
preload(finalQuery: FinalQuery<S, any, any, any, any, Sp00kyQueryResultPromise>, options?: PreloadOptions$1): Promise<void>;
|
|
445
|
+
/**
|
|
446
|
+
* Query data from the database
|
|
447
|
+
*/
|
|
448
|
+
query<TName extends TableNames<S>>(table: TName): QueryBuilder<S, TName, Sp00kyQueryResultPromise, {}, false>;
|
|
449
|
+
/**
|
|
450
|
+
* Run a backend operation
|
|
451
|
+
*/
|
|
452
|
+
run<B extends BackendNames<S>, R extends BackendRoutes<S, B>>(backend: B, path: R, payload: RoutePayload<S, B, R>, options?: RunOptions): Promise<void>;
|
|
453
|
+
/**
|
|
454
|
+
* Sign out, clear session and local storage
|
|
455
|
+
*/
|
|
456
|
+
signOut(): Promise<void>;
|
|
457
|
+
/**
|
|
458
|
+
* Execute a function with direct access to the remote database connection
|
|
459
|
+
*/
|
|
460
|
+
useRemote<T>(fn: (db: Surreal) => T | Promise<T>): Promise<T>;
|
|
461
|
+
/**
|
|
462
|
+
* Access the remote database service directly
|
|
463
|
+
*/
|
|
464
|
+
get remote(): Sp00kyClient<S>['remoteClient'];
|
|
465
|
+
/**
|
|
466
|
+
* Access the local database service directly
|
|
467
|
+
*/
|
|
468
|
+
get local(): Sp00kyClient<S>['localClient'];
|
|
469
|
+
/**
|
|
470
|
+
* Access the auth service
|
|
471
|
+
*/
|
|
472
|
+
get auth(): AuthService<S>;
|
|
473
|
+
get pendingMutationCount(): number;
|
|
474
|
+
/** Diagnostic — see `Sp00kyClient.liveRetryCount`. */
|
|
475
|
+
get liveRetryCount(): number;
|
|
476
|
+
subscribeToPendingMutations(cb: (count: number) => void): () => void;
|
|
477
|
+
/** Current sync-health snapshot. See {@link useSyncStatus}. */
|
|
478
|
+
get syncHealth(): SyncHealth$1;
|
|
479
|
+
/**
|
|
480
|
+
* Observe sync health. Fires immediately with the current status and again
|
|
481
|
+
* on every healthy↔degraded transition. Prefer the `useSyncStatus` hook in
|
|
482
|
+
* components; this is the imperative escape hatch.
|
|
483
|
+
*/
|
|
484
|
+
subscribeToSyncHealth(cb: (health: SyncHealth$1) => void): () => void;
|
|
485
|
+
/** Current local-store durability snapshot. See {@link useStorageStatus}. */
|
|
486
|
+
get storageHealth(): StorageHealth$1;
|
|
487
|
+
/**
|
|
488
|
+
* Observe local-store durability. Fires immediately with the current snapshot
|
|
489
|
+
* and again on change. Prefer the `useStorageStatus` hook in components; this
|
|
490
|
+
* is the imperative escape hatch.
|
|
491
|
+
*/
|
|
492
|
+
subscribeToStorageHealth(cb: (health: StorageHealth$1) => void): () => void;
|
|
493
|
+
bucket<B extends BucketNames<S>>(name: B): BucketHandle;
|
|
494
|
+
getBucketConfig(name: string): BucketDefinitionSchema | undefined;
|
|
495
|
+
}
|
|
496
|
+
//#endregion
|
|
497
|
+
export { CacheStrategy, type ConnectionState, type CreateQueryResult, type FileUploadResult, type GenericModel, type GenericSchema, type GetCardinality, type GetTable, InferModel, type InferRelatedModelFromMetadata, InferRelationshipsFromConst, InferSchemaFromConst, type Model, type ModelPayload, type PreloadOptions, type PreloadRefresh, ProvisionOptions, type QueryInfo, type QueryModifier, type QueryModifierBuilder, type QueryOptions, type QueryResult, type ReconnectConfig, RecordId, RelatedFieldsTableScoped, type RelationshipDefinition, RelationshipField, type RelationshipsMetadata, Sp00kyProvider, type Sp00kyProviderProps, type StorageHealth, type StorageHealthStatus, type Submission, type SyncHealth, type SyncHealthConfig, type SyncHealthStatus, SyncedDb, SyncedDbConfig, type TableModel, type TableNames, type UseAppRelease, type UseAppReleaseOptions, type UseDownloadFileOptions, type UseDownloadFileResult, type UseFeatureFlag, type UseStorageStatus, type UseSyncStatus, Uuid, WithRelated, WithRelatedMany, conflate, createPreload, createQuery, createSubmission, fromSubscription, useAppRelease, useCrdtField, useDb, useDownloadFile, useFeatureFlag, useFileUpload, usePendingMutations, useQuery, useStorageStatus, useSyncStatus };
|
|
498
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/lib/models.ts","../../../src/types/index.ts","../../../src/lib/create-query.ts","../../../src/lib/create-preload.ts","../../../src/lib/use-sync-status.ts","../../../src/lib/use-storage-status.ts","../../../src/lib/use-crdt-field.ts","../../../src/lib/use-feature-flag.ts","../../../src/lib/use-app-release.ts","../../../src/lib/use-file-upload.ts","../../../src/lib/use-download-file.ts","../../../src/lib/Sp00kyProvider.ts","../../../src/lib/context.ts","../../../src/lib/create-submission.ts","../../../src/lib/conflate.ts","../../../src/lib/from-subscription.ts","../../../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;KAMY,WAAW;KACX,kBAAkB;MAAU;;AADxC;;;;;AAAA;AACY,UCCK,gBAAA,CDDO;EAAA;OAAM,CAAA,EAAA,OAAA;;ACQb,UAAA,CAAA,CAAA;AAAA,KAIL,aAAA,GAJK,QAAA,GAAA,WAAA;AAIjB;AAKA;;AAA2C,KAA/B,oBAA+B,CAAA,UAAA,eAAA,CAAA,GAAA,QACnC,YAAW,CAAA,CAAA,CAAA,GAAK,YAAL,CAAgB,UAAhB,CAAyB,CAAzB,EAA4B,CAA5B,CAAA,CAAA;;;;;AAAe,KAOtB,2BAPsB,CAAA,UAOgB,eAPhB,EAAA,eAOgD,aAPhD,CAAA,GAAA,gBAQlB,YADJ,CACe,CADf,CAAA,GAA2B,UAE3B,OAF2B,CAEnB,CAFmB,CAAA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