@mdbase-dev/sdk 0.1.37 → 0.1.40
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 +20 -0
- package/dist/application/asset-pins.json +4 -4
- package/dist/application/worker.js +4 -4
- package/dist/browser/mdbase-sdk.js +4 -4
- package/dist/browser/mdbase-sdk.min.js +1 -1
- package/dist/describe-error.d.ts +1 -1
- package/dist/describe-error.js +2 -0
- package/dist/describe-error.js.map +1 -1
- package/dist/direct-credential.d.ts +15 -0
- package/dist/direct-credential.js +66 -0
- package/dist/direct-credential.js.map +1 -0
- package/dist/direct-grant-store.d.ts +11 -0
- package/dist/direct-grant-store.js +67 -0
- package/dist/direct-grant-store.js.map +1 -0
- package/dist/direct-messages.d.ts +18 -0
- package/dist/direct-messages.js +203 -0
- package/dist/direct-messages.js.map +1 -0
- package/dist/direct-origin.d.ts +2 -0
- package/dist/direct-origin.js +35 -0
- package/dist/direct-origin.js.map +1 -0
- package/dist/direct.d.ts +24 -0
- package/dist/direct.js +159 -0
- package/dist/direct.js.map +1 -0
- package/dist/native/provenance.json +5 -5
- package/dist/native/runtime.wasm +0 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -22,6 +22,26 @@ Pin an exact version, not a range. The npm package trusts the production
|
|
|
22
22
|
service only. Staging and LAB builds use separate packages; see
|
|
23
23
|
[SDK publication](../../../docs/sdk-publication.md).
|
|
24
24
|
|
|
25
|
+
## Pair a self-hosted browser client
|
|
26
|
+
|
|
27
|
+
With `@mdbase-dev/sdk/direct`, pass the operator’s exact server descriptor and
|
|
28
|
+
single-use code to `pairDirect({ server, code })`. Save `{ server, token }` in
|
|
29
|
+
`createDirectGrantStore`, where `token` is the opaque string returned by pairing.
|
|
30
|
+
Pass both values back to `connectDirect({ server, token, app })`. Keep the
|
|
31
|
+
grant out of URLs and logs.
|
|
32
|
+
|
|
33
|
+
For a pinned WebTransport invitation, the SDK uses the invitation’s single
|
|
34
|
+
certificate hash to redeem the code. That authenticated reply authorizes 32
|
|
35
|
+
consecutive 12-day UTC slots. Reconnects use the local clock to select adjacent
|
|
36
|
+
authorized certificates within that calendar. A clock outside the calendar
|
|
37
|
+
causes an `unavailable` error and preserves the saved grant. After the final
|
|
38
|
+
slot, or to change the server descriptor, pair again with a trusted invitation.
|
|
39
|
+
Pairing and reconnecting to an ordinary HTTPS origin use WSS.
|
|
40
|
+
|
|
41
|
+
A `pairDirect` failure with `reason === "code_not_sent"` happened before
|
|
42
|
+
the code left the browser, so the same code can be entered again. Any other
|
|
43
|
+
`unavailable` pairing failure may have redeemed the code.
|
|
44
|
+
|
|
25
45
|
## Quick start
|
|
26
46
|
|
|
27
47
|
An app declares itself with its manifest, the `mdbase-app.json` it serves at
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"runtime": {
|
|
3
|
-
"sha256": "
|
|
4
|
-
"bytes":
|
|
5
|
-
"maxBytes":
|
|
3
|
+
"sha256": "1b70aad8903a333cbe422e6b57e8677929c6b556651e69f2a0e7bff1f1ddb52c",
|
|
4
|
+
"bytes": 4004324,
|
|
5
|
+
"maxBytes": 4004324,
|
|
6
6
|
"source": {
|
|
7
7
|
"repository": "mdbase-dev/mdbase-connect",
|
|
8
|
-
"commit": "
|
|
8
|
+
"commit": "74f2d1018b66ab3ae99bc0afb5fb3a8009b25e23"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"sqlite": {
|
|
@@ -15693,12 +15693,12 @@ function appReleaseTrust() {
|
|
|
15693
15693
|
// src/application/asset-pins.json
|
|
15694
15694
|
var asset_pins_default = {
|
|
15695
15695
|
runtime: {
|
|
15696
|
-
sha256: "
|
|
15697
|
-
bytes:
|
|
15698
|
-
maxBytes:
|
|
15696
|
+
sha256: "1b70aad8903a333cbe422e6b57e8677929c6b556651e69f2a0e7bff1f1ddb52c",
|
|
15697
|
+
bytes: 4004324,
|
|
15698
|
+
maxBytes: 4004324,
|
|
15699
15699
|
source: {
|
|
15700
15700
|
repository: "mdbase-dev/mdbase-connect",
|
|
15701
|
-
commit: "
|
|
15701
|
+
commit: "74f2d1018b66ab3ae99bc0afb5fb3a8009b25e23"
|
|
15702
15702
|
}
|
|
15703
15703
|
},
|
|
15704
15704
|
sqlite: {
|
|
@@ -50795,12 +50795,12 @@ ${end.comment}` : end.comment;
|
|
|
50795
50795
|
// src/application/asset-pins.json
|
|
50796
50796
|
var asset_pins_default = {
|
|
50797
50797
|
runtime: {
|
|
50798
|
-
sha256: "
|
|
50799
|
-
bytes:
|
|
50800
|
-
maxBytes:
|
|
50798
|
+
sha256: "1b70aad8903a333cbe422e6b57e8677929c6b556651e69f2a0e7bff1f1ddb52c",
|
|
50799
|
+
bytes: 4004324,
|
|
50800
|
+
maxBytes: 4004324,
|
|
50801
50801
|
source: {
|
|
50802
50802
|
repository: "mdbase-dev/mdbase-connect",
|
|
50803
|
-
commit: "
|
|
50803
|
+
commit: "74f2d1018b66ab3ae99bc0afb5fb3a8009b25e23"
|
|
50804
50804
|
}
|
|
50805
50805
|
},
|
|
50806
50806
|
sqlite: {
|