@abraca/dabra 2.80.0 → 2.81.0
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.
|
@@ -11286,7 +11286,26 @@ var AbracadabraClient = class {
|
|
|
11286
11286
|
async redeemInvite(code) {
|
|
11287
11287
|
await this.request("POST", "/invites/redeem", { body: { code } });
|
|
11288
11288
|
}
|
|
11289
|
-
/**
|
|
11289
|
+
/**
|
|
11290
|
+
* Set the public_access level for a document. Pass null to inherit from parent.
|
|
11291
|
+
*
|
|
11292
|
+
* The values, and the two that are easy to confuse:
|
|
11293
|
+
*
|
|
11294
|
+
* - `"observer"` / `"viewer"` / `"editor"` — a FLOOR. Raises whoever reaches
|
|
11295
|
+
* this document to at least that role, cascading to descendants.
|
|
11296
|
+
* - `"none"` — no floor from here. Blocks anonymous, but an authenticated
|
|
11297
|
+
* principal still falls through to the server's `[access].authenticated`
|
|
11298
|
+
* default, so on a server with a floor this does NOT make a document private.
|
|
11299
|
+
* - `"private"` — no floor AND no ambient default. Only explicit grants,
|
|
11300
|
+
* ownership, Admin and Service reach a sealed document. This is what makes
|
|
11301
|
+
* a document private without reconfiguring the whole server.
|
|
11302
|
+
*
|
|
11303
|
+
* The cascade takes the NEAREST ancestor that sets a value, not the strongest,
|
|
11304
|
+
* so a descendant can re-publish itself out of a private parent.
|
|
11305
|
+
*
|
|
11306
|
+
* `"private"` requires server ≥ the release that introduced it. An older
|
|
11307
|
+
* server rejects it with 400 rather than silently storing it.
|
|
11308
|
+
*/
|
|
11290
11309
|
async setDocumentAccess(docId, publicAccess) {
|
|
11291
11310
|
await this.request("PATCH", `/docs/${encodeURIComponent(docId)}/access`, { body: { public_access: publicAccess } });
|
|
11292
11311
|
}
|
|
@@ -11367,10 +11386,14 @@ var AbracadabraClient = class {
|
|
|
11367
11386
|
* leak via a higher cascade grant.
|
|
11368
11387
|
*
|
|
11369
11388
|
* Note: when `[access].authenticated >= "viewer"` is set server-wide,
|
|
11370
|
-
* non-participants
|
|
11371
|
-
*
|
|
11372
|
-
*
|
|
11373
|
-
*
|
|
11389
|
+
* non-participants can still *read* the DM via the authenticated floor —
|
|
11390
|
+
* `public_access = "none"` removes the floor but not the ambient default.
|
|
11391
|
+
*
|
|
11392
|
+
* Servers that support `public_access = "private"` can seal it properly:
|
|
11393
|
+
* call `setDocumentAccess(dmId, "private")` after creating one. That is NOT
|
|
11394
|
+
* done here, deliberately — this SDK talks to older servers too, and they
|
|
11395
|
+
* reject the value with a 400. Callers that know their server version can
|
|
11396
|
+
* opt in; a future major may make it the default.
|
|
11374
11397
|
*
|
|
11375
11398
|
* @param otherUserPk Base64url-encoded Ed25519 public key of the other party.
|
|
11376
11399
|
* @returns The DM doc's id (existing or newly created).
|