@myfield/sdk 0.9.2 → 0.9.3
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/CHANGELOG.md +7 -0
- package/README.md +30 -9
- package/dist/index.js +467 -366
- package/package.json +15 -8
- package/types/index.d.ts +395 -137
- package/docs/API.md +0 -298
- package/docs/BUCKET-SPEC.md +0 -173
- package/src/auth/authorization.ts +0 -254
- package/src/auth/flow.ts +0 -93
- package/src/auth/identifiers.ts +0 -46
- package/src/auth/index.ts +0 -17
- package/src/auth/instance.ts +0 -395
- package/src/auth/keys.ts +0 -73
- package/src/auth/proof.ts +0 -26
- package/src/auth/session.ts +0 -16
- package/src/auth/store.ts +0 -90
- package/src/auth/types.ts +0 -47
- package/src/bucket/binary.ts +0 -253
- package/src/bucket/client.ts +0 -426
- package/src/bucket/crypto.ts +0 -58
- package/src/bucket/format.ts +0 -324
- package/src/bucket/index.ts +0 -40
- package/src/bucket/keys.ts +0 -104
- package/src/bucket/store.ts +0 -190
- package/src/bucket/transport.ts +0 -249
- package/src/errors.ts +0 -40
- package/src/facade.ts +0 -698
- package/src/index.ts +0 -29
- package/src/internal/encoding.ts +0 -95
- package/src/remote/bucket.ts +0 -180
- package/src/remote/client.ts +0 -38
- package/src/remote/connection.ts +0 -529
- package/src/remote/feed.ts +0 -80
- package/src/remote/http.ts +0 -78
- package/src/remote/session.ts +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.3
|
|
4
|
+
|
|
5
|
+
- Use HTTP polling for `watchFeed()` with the existing hint format.
|
|
6
|
+
- Restore a saved bucket grant when importing its device key with `importKey()`.
|
|
7
|
+
- Generate public declarations, API review reports and the API Reference from source.
|
|
8
|
+
- Clarify the existing binary payload format in the Specification.
|
|
9
|
+
|
|
3
10
|
## 0.9.2
|
|
4
11
|
|
|
5
12
|
### Added
|
package/README.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
# @myfield/sdk
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
end-to-end-encrypted sync, and internal
|
|
3
|
+
MyField SDK for third-party web apps: local-first object storage,
|
|
4
|
+
end-to-end-encrypted sync, and internal MyField authorization.
|
|
5
5
|
|
|
6
6
|
A bucket is a local-first **end-to-end-encrypted object KV with CAS-backed sync**.
|
|
7
7
|
Local CRUD works without an account or network; `connect()` authorizes cloud access.
|
|
8
8
|
|
|
9
|
-
Status:
|
|
9
|
+
Status: 1.0 preview; public APIs may change during preview. License: Apache-2.0.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @myfield/sdk
|
|
15
|
+
```
|
|
10
16
|
|
|
11
17
|
## Quickstart
|
|
12
18
|
|
|
@@ -30,14 +36,19 @@ void instance.resume().catch(error => console.error("Connection failed:", error)
|
|
|
30
36
|
await instance.connect(); // defaults to https://myfield.one/auth/
|
|
31
37
|
```
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
- [API guide](docs/api.md): Local/Remote usage and behavioral semantics.
|
|
42
|
+
- [API Reference](docs/api/index.md): generated public types, options and methods.
|
|
43
|
+
- [Specification](docs/spec/bucket.md): encoding, encryption, merge and compatibility.
|
|
44
|
+
- [Documentation index](docs/README.md).
|
|
34
45
|
|
|
35
46
|
## Remote object access
|
|
36
47
|
|
|
37
48
|
`instance.remote.getBucket()` provides object reads, CAS commits, version history and
|
|
38
49
|
change notifications with the instance's authorization; the app owns payload encryption
|
|
39
50
|
and local storage, encrypting with `getBucketKey()`. See
|
|
40
|
-
[Remote Object API](docs/
|
|
51
|
+
[Remote Object API](docs/api.md#remote-object-api).
|
|
41
52
|
|
|
42
53
|
## What the SDK handles
|
|
43
54
|
|
|
@@ -46,7 +57,7 @@ and local storage, encrypting with `getBucketKey()`. See
|
|
|
46
57
|
the unauthorized → disconnected transition. Apps use Instance
|
|
47
58
|
`connect()` / `disconnect()` / state events only.
|
|
48
59
|
- **Pairwise identity**: apps receive app-specific aliases rather than the user's
|
|
49
|
-
primary
|
|
60
|
+
primary MyField identity.
|
|
50
61
|
- **Encryption**: Local payloads are encrypted client-side; the platform stores
|
|
51
62
|
ciphertext only. Object ids are blinded — your semantic ids
|
|
52
63
|
(`note:1`, `note:list`) never reach the wire. Remote apps encrypt their own payloads.
|
|
@@ -87,19 +98,29 @@ implementation and tests, but are not exported package subpaths in v1.
|
|
|
87
98
|
|
|
88
99
|
Compatible implementation details for SDK maintainers and future language
|
|
89
100
|
ports (payload layout, merge rules, id derivation): see
|
|
90
|
-
[
|
|
101
|
+
[Local bucket specification](docs/spec/bucket.md).
|
|
91
102
|
|
|
92
103
|
## Development
|
|
93
104
|
|
|
94
105
|
This package has no runtime dependencies and uses a standalone pnpm lockfile.
|
|
106
|
+
Use Node.js 24 in CI (minimum 22.18) and pnpm 9.15.0 for development.
|
|
95
107
|
|
|
96
108
|
```sh
|
|
97
|
-
pnpm install
|
|
109
|
+
pnpm install --frozen-lockfile
|
|
110
|
+
npm run api:check
|
|
98
111
|
npm run build
|
|
99
112
|
npm test # node --test (contract layer, mocked relay/auth)
|
|
100
113
|
npm run typecheck # tsc --noEmit
|
|
101
|
-
npm run typecheck:api # public declarations
|
|
114
|
+
npm run typecheck:api # public declarations and documentation examples
|
|
115
|
+
npm run test:docs
|
|
116
|
+
npm run test:package
|
|
102
117
|
MYFIELD_TEST_AUTH_URL="https://your-test-host/auth/" npm run verify:remote
|
|
103
118
|
```
|
|
104
119
|
|
|
105
120
|
`verify:remote` is the SDK's standalone Remote API smoke check against a test service.
|
|
121
|
+
|
|
122
|
+
Public declarations and API reference documentation are generated from source
|
|
123
|
+
and TSDoc. After an intentional change, run `npm run api:update` and review
|
|
124
|
+
`etc/sdk.api.md`, `types/` and `docs/api/`. Build and CI check these artifacts
|
|
125
|
+
without accepting baseline changes; do not hand-edit generated files.
|
|
126
|
+
API reports are review snapshots, not new release compatibility commitments.
|