@oddington/sdk 0.1.7 → 0.1.8
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 +64 -2
- package/dist/browser.js +1965 -0
- package/dist/index.js +420 -151
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -18,9 +18,29 @@ The OS-owned browser entry point initializes the existing shared refreshing
|
|
|
18
18
|
session source before app code runs:
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
import { os } from '@oddington/sdk';
|
|
21
|
+
import { os, data, files, DataOperationError, FileOperationError } from '@oddington/sdk';
|
|
22
22
|
|
|
23
|
-
os.init({ auth });
|
|
23
|
+
os.init({ auth }); // OS-owned startup, once before app modules run.
|
|
24
|
+
|
|
25
|
+
// App code uses the installed capabilities directly.
|
|
26
|
+
const general = data.repository('general');
|
|
27
|
+
try {
|
|
28
|
+
const selected = await general.records.select({ invoices: { $: { limit: 20 } } });
|
|
29
|
+
const found = await general.records.search('acme overdue', {
|
|
30
|
+
collections: ['invoices'], limit: 20,
|
|
31
|
+
});
|
|
32
|
+
const statement = await files.create({
|
|
33
|
+
file: selectedFile, name: 'September statement.csv', path: 'HSC/2026/09',
|
|
34
|
+
});
|
|
35
|
+
const content = await files.read(statement.id);
|
|
36
|
+
// selected and found contain canonical Records and their opaque version guards.
|
|
37
|
+
// content is an unconsumed Web Response.
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (error instanceof DataOperationError || error instanceof FileOperationError) {
|
|
40
|
+
console.error(error.code, error.retryable); // Bounded public failure information.
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
24
44
|
```
|
|
25
45
|
|
|
26
46
|
This returns `void` and derives context from the current HTTPS workspace origin
|
|
@@ -113,6 +133,48 @@ input is deeply immutable; declared reports await host acceptance. Success
|
|
|
113
133
|
requires accepted finish and zero exit. Cancellation or later failure does not
|
|
114
134
|
undo already confirmed shared effects.
|
|
115
135
|
|
|
136
|
+
Browser bundlers select the standard `browser` condition at the package root.
|
|
137
|
+
Named imports retain the selected browser capabilities without Node built-ins,
|
|
138
|
+
compatibility shims or unused routine, filesystem, Inbox and connection code.
|
|
139
|
+
Use the same `@oddington/sdk` import and declarations in both environments;
|
|
140
|
+
there is no browser subpath or required alias, polyfill or consumer build define.
|
|
141
|
+
Node imports retain the complete supported routine and managed-handler runtime
|
|
142
|
+
on Node.js 22.12.0 or later. Browser operations requiring a Node working root
|
|
143
|
+
remain unsupported.
|
|
144
|
+
|
|
145
|
+
Verify the installed tarball with `bun run --filter @oddington/sdk verify:package`
|
|
146
|
+
from the repository. This checks Node runtime exports and declarations, all public
|
|
147
|
+
text for leaks, and the named browser imports in a realm without Node globals or
|
|
148
|
+
a module loader. It rejects bundler warnings, external dependencies, Node/shim
|
|
149
|
+
code, unused implementations and increases beyond the reviewed SDK byte ceiling.
|
|
150
|
+
The newer Local Host app imports are bundled and exercised separately under the
|
|
151
|
+
same strict compatibility audit, so they cannot weaken or inflate the hosted
|
|
152
|
+
Data/Files size comparison.
|
|
153
|
+
|
|
154
|
+
The browser budget uses pinned esbuild 0.28.1, browser platform, bundled ESM,
|
|
155
|
+
`es2022`, minification, default tree shaking and inline legal comments, with no
|
|
156
|
+
source map, aliases, polyfills, external modules or consumer defines. Its fixed
|
|
157
|
+
named-import fixture exercises hosted Data selection/search and Files operations.
|
|
158
|
+
SDK bytes include all emitted JavaScript except the bundler-attributed fixture
|
|
159
|
+
bytes; generated helpers count toward the SDK. Gzip is diagnostic only.
|
|
160
|
+
|
|
161
|
+
| Same named-import fixture | Legacy diagnostic | Current strict proof |
|
|
162
|
+
| --- | ---: | ---: |
|
|
163
|
+
| Total minified JavaScript bytes | 488,539 | 40,534 |
|
|
164
|
+
| Fixture-attributed bytes | 5,954 | 5,897 |
|
|
165
|
+
| SDK bytes | 482,585 | 34,637 |
|
|
166
|
+
| Total gzip bytes | 198,612 | 12,414 |
|
|
167
|
+
|
|
168
|
+
The legacy diagnostic externalized three unresolved Node built-ins and failed
|
|
169
|
+
browser compatibility. The current strict proof has no imports, shims or warnings
|
|
170
|
+
and reduces SDK bytes by 92.8%. Its literal ceiling is **40,000 SDK bytes**:
|
|
171
|
+
5,363 bytes (15.5%) of headroom for bounded client fixes. The increase from the
|
|
172
|
+
original 24,000-byte measurement accounts for the subsequently added Local Host
|
|
173
|
+
bootstrap that `os.init` must select at runtime. The verifier pins the fixture
|
|
174
|
+
hash and bundler version; changing either requires a reviewed measurement
|
|
175
|
+
comparison. Future ceiling increases require explicit review of added browser
|
|
176
|
+
capability and must never be automatically regenerated from an oversized output.
|
|
177
|
+
|
|
116
178
|
Create and recover a private immutable original through the same host context:
|
|
117
179
|
|
|
118
180
|
```ts
|