@abraca/dabra 1.1.0 → 1.1.2

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.
@@ -3411,27 +3411,65 @@ var AbracadabraClient = class {
3411
3411
  async redeemInvite(code) {
3412
3412
  await this.request("POST", "/invites/redeem", { body: { code } });
3413
3413
  }
3414
- /** List spaces visible to the caller. No auth required for public spaces. */
3414
+ /** List root documents (replaces listSpaces for new code). */
3415
+ async listRootDocuments() {
3416
+ return (await this.request("GET", "/docs?root=true")).documents;
3417
+ }
3418
+ /** Get the hub document, or null if none is configured. */
3419
+ async getHubDocument() {
3420
+ return this.requestOrNull("GET", "/docs/hub");
3421
+ }
3422
+ /** Set the public_access level for a document. Pass null to inherit from parent. */
3423
+ async setDocumentAccess(docId, publicAccess) {
3424
+ await this.request("PATCH", `/docs/${encodeURIComponent(docId)}/access`, { body: { public_access: publicAccess } });
3425
+ }
3426
+ /** Get the public_access info for a document. */
3427
+ async getDocumentAccess(docId) {
3428
+ return this.request("GET", `/docs/${encodeURIComponent(docId)}/access`);
3429
+ }
3430
+ /** Update document metadata (label, description, is_hub). Requires manage permission. */
3431
+ async updateDocumentMeta(docId, opts) {
3432
+ await this.request("PATCH", `/docs/${encodeURIComponent(docId)}`, { body: opts });
3433
+ }
3434
+ /**
3435
+ * List spaces visible to the caller. No auth required for public spaces.
3436
+ * @deprecated Use {@link listRootDocuments} instead.
3437
+ */
3415
3438
  async listSpaces() {
3416
3439
  return (await this.request("GET", "/spaces", { auth: false })).spaces;
3417
3440
  }
3418
- /** Get a single space by ID. */
3441
+ /**
3442
+ * Get a single space by ID.
3443
+ * @deprecated Use {@link getDoc} instead.
3444
+ */
3419
3445
  async getSpace(spaceId) {
3420
3446
  return this.request("GET", `/spaces/${encodeURIComponent(spaceId)}`, { auth: false });
3421
3447
  }
3422
- /** Get the hub space, or null if none is configured. */
3448
+ /**
3449
+ * Get the hub space, or null if none is configured.
3450
+ * @deprecated Use {@link getHubDocument} instead.
3451
+ */
3423
3452
  async getHubSpace() {
3424
3453
  return this.requestOrNull("GET", "/spaces/hub", { auth: false });
3425
3454
  }
3426
- /** Create a new space (auth required). */
3455
+ /**
3456
+ * Create a new space (auth required).
3457
+ * @deprecated Use {@link createDoc} + {@link updateDocumentMeta} instead.
3458
+ */
3427
3459
  async createSpace(opts) {
3428
3460
  return this.request("POST", "/spaces", { body: opts });
3429
3461
  }
3430
- /** Update an existing space (Owner or admin required). */
3462
+ /**
3463
+ * Update an existing space (Owner or admin required).
3464
+ * @deprecated Use {@link updateDocumentMeta} + {@link setDocumentAccess} instead.
3465
+ */
3431
3466
  async updateSpace(spaceId, opts) {
3432
3467
  return this.request("PATCH", `/spaces/${encodeURIComponent(spaceId)}`, { body: opts });
3433
3468
  }
3434
- /** Delete a space and its root document (Owner or admin required). */
3469
+ /**
3470
+ * Delete a space and its root document (Owner or admin required).
3471
+ * @deprecated Use {@link deleteDoc} instead.
3472
+ */
3435
3473
  async deleteSpace(spaceId) {
3436
3474
  await this.request("DELETE", `/spaces/${encodeURIComponent(spaceId)}`);
3437
3475
  }