@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 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 with full collection access can also register and maintain type
353
- definitions. Type source is returned with a revision token so updates cannot
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
- Contract-scoped applications cannot manage collection-wide type definitions.
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
- Access defaults to the record types supplied by `requirements.contracts`.
517
- Set `access` to `full_collection` when the application needs collection-level
518
- features such as saved views. Required contracts still determine compatibility
519
- and are provisioned during approval.
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 scoped grant afterward. The application
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
- const capabilities = manifest.value.requirements?.capabilities;
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 !== "full_collection"
662
- || connection.scope.access === "full_collection";
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:";
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "file": "mdbase-connect.min.js",
3
- "integrity": "sha384-G9S7H692RFcmy7JJ8CrePVKzJb4fvERv7ZfJfsbaNMtdu0ffE1SRdTgZAyhrMtJk"
3
+ "integrity": "sha384-kDjazWo3W17cBn4WByvZ0jGGc1aqQxNTWglefSAMrEoEzGRgo8YNzRYSI3sQb8tx"
4
4
  }