@arbidocs/sdk 0.5.56 → 0.5.57

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/dist/index.cjs CHANGED
@@ -11421,11 +11421,15 @@ var Arbi = class {
11421
11421
  await this.targetWorkspace(workspaceId);
11422
11422
  return createTag(this.requireClient(), { ...options, workspaceId });
11423
11423
  }
11424
- /** The workspace a call names, opened for this session; `undefined` for the current one. */
11424
+ /**
11425
+ * The workspace a call acts on, captured when it is called: the one it names (opened for this session, not
11426
+ * switched to), else the current one. The request names it, so a switch while it is in flight cannot move it.
11427
+ * `undefined` only when no workspace is known here (the server's open one then applies, as before).
11428
+ */
11425
11429
  async targetWorkspace(workspaceId) {
11426
- if (!workspaceId || workspaceId === this.currentWorkspaceId) return void 0;
11427
- await this.openWorkspace(workspaceId);
11428
- return workspaceId;
11430
+ const target = workspaceId ?? this.currentWorkspaceId ?? void 0;
11431
+ if (target) await this.openWorkspace(target);
11432
+ return target;
11429
11433
  }
11430
11434
  /**
11431
11435
  * Make a workspace the CURRENT one: decrypt its key, open it on the server (which makes it the
@@ -12394,8 +12398,8 @@ var Arbi = class {
12394
12398
  */
12395
12399
  /** The open workspace's tags, or `query.workspaceId`'s (opened for this session, not switched to). */
12396
12400
  list: async (query2) => {
12397
- await this.targetWorkspace(query2?.workspaceId);
12398
- return listTags(this.requireClient(), query2);
12401
+ const workspaceId = await this.targetWorkspace(query2?.workspaceId);
12402
+ return listTags(this.requireClient(), { ...query2, workspaceId });
12399
12403
  },
12400
12404
  create: (options) => this.createTagIn(options.workspaceId ?? this.requireWorkspace(), options),
12401
12405
  delete: (tagId) => deleteTag(this.requireClient(), tagId),