@oddington/sdk 0.1.54 → 0.1.56
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/README.md +26 -0
- package/dist/browser.js +1240 -354
- package/dist/index.js +5 -5
- package/dist/types/packages/sdk/src/public.d.ts +13 -1
- package/dist/types/shared/data-contract.d.ts +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -375,6 +375,32 @@ session subscription. Workspace existence and member access are checked by the
|
|
|
375
375
|
OS service. App modules use capability namespaces; routines and handlers receive
|
|
376
376
|
runtime context without calling `os.init`.
|
|
377
377
|
|
|
378
|
+
Hosted browser apps can initialize an existing named Data snapshot for local,
|
|
379
|
+
read-only queries after host startup has installed that context:
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
const accounting = await data.init({ repository: 'general', snapshot: 'buchhaltung' });
|
|
383
|
+
const month = await accounting.records.query({
|
|
384
|
+
transactions: { $: { where: { date: { $gte: '2026-10-01', $lt: '2026-11-01' } } } },
|
|
385
|
+
});
|
|
386
|
+
const transaction = await accounting.records.read('transactions/example');
|
|
387
|
+
const changes = await accounting.changes.list();
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Initialization confirms current access and the available artifact, reuses an
|
|
391
|
+
exact complete artifact-and-Changes installation or installs the validated
|
|
392
|
+
download and relevant Changes together. Published Changes are materialized before
|
|
393
|
+
querying or exact reads. Stored Changes without publication information remain
|
|
394
|
+
in the read-only `changes.list()` result and never alter Records.
|
|
395
|
+
`records.query`, `records.pages` and `records.all(query, { maxRecords })` use the existing query language and generated-schema inference.
|
|
396
|
+
They read locally and expose the initialized version in `$meta.version`. The
|
|
397
|
+
handle stays on that version; explicitly call `data.init` again to observe
|
|
398
|
+
later published Changes or an operator-built snapshot. Single-ref `records.read(ref)`
|
|
399
|
+
returns the complete structured Record or `null` from that same pinned state.
|
|
400
|
+
Initialization never refreshes the hosted artifact. Sign-out, context replacement and expiry invalidate local reads.
|
|
401
|
+
Snapshot initialization requires a hosted browser app; Node, routines and local
|
|
402
|
+
app contexts receive `DataOperationError` with `context_unavailable`.
|
|
403
|
+
|
|
378
404
|
First-party Auth uses the handle without initializing workspace context. Its
|
|
379
405
|
bounded `browserAuth.authorization.get(id)`, `approve(id)` and `deny(id)` actions
|
|
380
406
|
support only the OS CLI request and fixed callback. Inspection/restoration never
|