@abraca/dabra 2.79.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.
|
@@ -11256,7 +11256,26 @@ var AbracadabraClient = class {
|
|
|
11256
11256
|
async redeemInvite(code) {
|
|
11257
11257
|
await this.request("POST", "/invites/redeem", { body: { code } });
|
|
11258
11258
|
}
|
|
11259
|
-
/**
|
|
11259
|
+
/**
|
|
11260
|
+
* Set the public_access level for a document. Pass null to inherit from parent.
|
|
11261
|
+
*
|
|
11262
|
+
* The values, and the two that are easy to confuse:
|
|
11263
|
+
*
|
|
11264
|
+
* - `"observer"` / `"viewer"` / `"editor"` — a FLOOR. Raises whoever reaches
|
|
11265
|
+
* this document to at least that role, cascading to descendants.
|
|
11266
|
+
* - `"none"` — no floor from here. Blocks anonymous, but an authenticated
|
|
11267
|
+
* principal still falls through to the server's `[access].authenticated`
|
|
11268
|
+
* default, so on a server with a floor this does NOT make a document private.
|
|
11269
|
+
* - `"private"` — no floor AND no ambient default. Only explicit grants,
|
|
11270
|
+
* ownership, Admin and Service reach a sealed document. This is what makes
|
|
11271
|
+
* a document private without reconfiguring the whole server.
|
|
11272
|
+
*
|
|
11273
|
+
* The cascade takes the NEAREST ancestor that sets a value, not the strongest,
|
|
11274
|
+
* so a descendant can re-publish itself out of a private parent.
|
|
11275
|
+
*
|
|
11276
|
+
* `"private"` requires server ≥ the release that introduced it. An older
|
|
11277
|
+
* server rejects it with 400 rather than silently storing it.
|
|
11278
|
+
*/
|
|
11260
11279
|
async setDocumentAccess(docId, publicAccess) {
|
|
11261
11280
|
await this.request("PATCH", `/docs/${encodeURIComponent(docId)}/access`, { body: { public_access: publicAccess } });
|
|
11262
11281
|
}
|
|
@@ -11337,10 +11356,14 @@ var AbracadabraClient = class {
|
|
|
11337
11356
|
* leak via a higher cascade grant.
|
|
11338
11357
|
*
|
|
11339
11358
|
* Note: when `[access].authenticated >= "viewer"` is set server-wide,
|
|
11340
|
-
* non-participants
|
|
11341
|
-
*
|
|
11342
|
-
*
|
|
11343
|
-
*
|
|
11359
|
+
* non-participants can still *read* the DM via the authenticated floor —
|
|
11360
|
+
* `public_access = "none"` removes the floor but not the ambient default.
|
|
11361
|
+
*
|
|
11362
|
+
* Servers that support `public_access = "private"` can seal it properly:
|
|
11363
|
+
* call `setDocumentAccess(dmId, "private")` after creating one. That is NOT
|
|
11364
|
+
* done here, deliberately — this SDK talks to older servers too, and they
|
|
11365
|
+
* reject the value with a 400. Callers that know their server version can
|
|
11366
|
+
* opt in; a future major may make it the default.
|
|
11344
11367
|
*
|
|
11345
11368
|
* @param otherUserPk Base64url-encoded Ed25519 public key of the other party.
|
|
11346
11369
|
* @returns The DM doc's id (existing or newly created).
|