@mdbase-dev/connect 0.1.0-beta.93 → 0.1.0-beta.94
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 +11 -8
- package/dist/application-session.js +16 -3
- package/dist/browser/integrity.json +1 -1
- package/dist/browser/mdbase-connect.min.js +3 -3
- package/dist/browser/mdbase-connect.min.js.sha384 +1 -1
- package/dist/capabilities.js +10 -16
- package/dist/connect.js +20 -10
- package/dist/connection-transport-internals.d.ts +1 -1
- package/dist/connection-transport.js +1 -1
- package/dist/operation-types.d.ts +4 -3
- package/dist/outcomes.d.ts +3 -3
- package/dist/outcomes.js +1 -0
- package/dist/runtime-utils.d.ts +3 -0
- package/dist/runtime-utils.js +5 -0
- package/dist/session.d.ts +1 -1
- package/dist/stored-token.d.ts +1 -1
- package/dist/stored-token.js +8 -4
- package/dist/token-response.js +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -349,8 +349,8 @@ connection through `onConnectionChange()`. A subsequent
|
|
|
349
349
|
`requestOperations()` call therefore starts authorization instead of trusting
|
|
350
350
|
the stale cached capability list.
|
|
351
351
|
|
|
352
|
-
Applications
|
|
353
|
-
|
|
352
|
+
Applications can register and maintain type definitions when their
|
|
353
|
+
collection-wide grant includes the corresponding operations. Type source is returned with a revision token so updates cannot
|
|
354
354
|
silently overwrite a definition changed by another application:
|
|
355
355
|
|
|
356
356
|
```ts
|
|
@@ -379,7 +379,8 @@ if (!updatedType.ok) renderProblem(updatedType.problem);
|
|
|
379
379
|
```
|
|
380
380
|
|
|
381
381
|
Request `read_type`, `create_type`, and `update_type` during authorization.
|
|
382
|
-
|
|
382
|
+
A legacy contract-scoped grant is inactive and must be reauthorized; contracts
|
|
383
|
+
themselves never confer type-management permission.
|
|
383
384
|
|
|
384
385
|
To install a complete catalog pack without exposing its individual collection
|
|
385
386
|
paths, request `assess_type_pack` and `apply_type_pack`, fetch and verify the
|
|
@@ -501,6 +502,7 @@ export const manifest = {
|
|
|
501
502
|
homepage: "https://worklog.example",
|
|
502
503
|
redirect_uris: ["https://worklog.example/auth/mdbase/callback"],
|
|
503
504
|
requirements: {
|
|
505
|
+
access: "full_collection",
|
|
504
506
|
contracts: workItemPack.provides
|
|
505
507
|
},
|
|
506
508
|
provisions: {
|
|
@@ -513,10 +515,11 @@ Set `collection_kind` to `hosted` when the application needs a durable
|
|
|
513
515
|
provider-backed collection and the offline sync transport returned by
|
|
514
516
|
`sync()`. Connect then offers and accepts collections with replication capability.
|
|
515
517
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
and
|
|
518
|
+
Every SDK manifest must explicitly set `requirements.access` to the N-1 wire
|
|
519
|
+
spelling `full_collection`. An active grant covers the entire selected
|
|
520
|
+
collection; omission and legacy `contract` scope never satisfy application
|
|
521
|
+
access and require reauthorization. Required contracts remain separate
|
|
522
|
+
compatibility, setup, validation, and semantic-adapter evidence.
|
|
520
523
|
|
|
521
524
|
`listViews()` returns each named view's selected result properties in display
|
|
522
525
|
order. Property descriptors retain source labels for projected and computed
|
|
@@ -524,7 +527,7 @@ values. `executeView()` returns their values on each result row.
|
|
|
524
527
|
|
|
525
528
|
Provisioning is part of the approval flow. The connector validates and
|
|
526
529
|
installs each missing type pack transactionally, verifies its exact contracts
|
|
527
|
-
and implementations, and creates the
|
|
530
|
+
and implementations, and creates the collection grant afterward. The application
|
|
528
531
|
is not granted collection-wide type-management access.
|
|
529
532
|
|
|
530
533
|
The SDK returns typed outcomes, carries successful mdbase diagnostics alongside
|
|
@@ -132,7 +132,19 @@ export class MdbaseApplicationSession {
|
|
|
132
132
|
const manifest = await this.connect.manifest(options);
|
|
133
133
|
if (!manifest.ok)
|
|
134
134
|
return this.startFailure(manifest.problem, generation);
|
|
135
|
-
|
|
135
|
+
if (manifest.value.requirements?.access !== "full_collection") {
|
|
136
|
+
return this.startFailure(connectProblem("invalid_application_manifest", "Application sessions require explicit full_collection access.", {
|
|
137
|
+
details: {
|
|
138
|
+
issues: [{
|
|
139
|
+
path: "/requirements/access",
|
|
140
|
+
keyword: "const",
|
|
141
|
+
message: "must be full_collection",
|
|
142
|
+
params: { allowedValue: "full_collection" }
|
|
143
|
+
}]
|
|
144
|
+
}
|
|
145
|
+
}), generation);
|
|
146
|
+
}
|
|
147
|
+
const capabilities = manifest.value.requirements.capabilities;
|
|
136
148
|
if (!capabilities) {
|
|
137
149
|
return this.startFailure(connectProblem("invalid_application_manifest", "Application sessions require a versioned semantic capability contract.", {
|
|
138
150
|
details: {
|
|
@@ -658,8 +670,9 @@ function verificationValue(manifest) {
|
|
|
658
670
|
});
|
|
659
671
|
}
|
|
660
672
|
function accessRequirementSatisfied(manifest, connection) {
|
|
661
|
-
return manifest.requirements?.access
|
|
662
|
-
|
|
673
|
+
return manifest.requirements?.access === "full_collection"
|
|
674
|
+
&& connection.scope.access === "full_collection"
|
|
675
|
+
&& connection.scope.contracts.length === 0;
|
|
663
676
|
}
|
|
664
677
|
function declarationIdFromFamilyIdentity(familyIdentity) {
|
|
665
678
|
const prefix = "bundle:";
|