@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.
@@ -8115,7 +8115,11 @@ declare class Arbi {
8115
8115
  * opened next, and a workspace other than the current one is opened for this session first.
8116
8116
  */
8117
8117
  private createTagIn;
8118
- /** The workspace a call names, opened for this session; `undefined` for the current one. */
8118
+ /**
8119
+ * The workspace a call acts on, captured when it is called: the one it names (opened for this session, not
8120
+ * switched to), else the current one. The request names it, so a switch while it is in flight cannot move it.
8121
+ * `undefined` only when no workspace is known here (the server's open one then applies, as before).
8122
+ */
8119
8123
  private targetWorkspace;
8120
8124
  /**
8121
8125
  * Make a workspace the CURRENT one: decrypt its key, open it on the server (which makes it the
@@ -8115,7 +8115,11 @@ declare class Arbi {
8115
8115
  * opened next, and a workspace other than the current one is opened for this session first.
8116
8116
  */
8117
8117
  private createTagIn;
8118
- /** The workspace a call names, opened for this session; `undefined` for the current one. */
8118
+ /**
8119
+ * The workspace a call acts on, captured when it is called: the one it names (opened for this session, not
8120
+ * switched to), else the current one. The request names it, so a switch while it is in flight cannot move it.
8121
+ * `undefined` only when no workspace is known here (the server's open one then applies, as before).
8122
+ */
8119
8123
  private targetWorkspace;
8120
8124
  /**
8121
8125
  * Make a workspace the CURRENT one: decrypt its key, open it on the server (which makes it the
package/dist/browser.cjs CHANGED
@@ -10822,11 +10822,15 @@ var Arbi = class {
10822
10822
  await this.targetWorkspace(workspaceId);
10823
10823
  return createTag(this.requireClient(), { ...options, workspaceId });
10824
10824
  }
10825
- /** The workspace a call names, opened for this session; `undefined` for the current one. */
10825
+ /**
10826
+ * The workspace a call acts on, captured when it is called: the one it names (opened for this session, not
10827
+ * switched to), else the current one. The request names it, so a switch while it is in flight cannot move it.
10828
+ * `undefined` only when no workspace is known here (the server's open one then applies, as before).
10829
+ */
10826
10830
  async targetWorkspace(workspaceId) {
10827
- if (!workspaceId || workspaceId === this.currentWorkspaceId) return void 0;
10828
- await this.openWorkspace(workspaceId);
10829
- return workspaceId;
10831
+ const target = workspaceId ?? this.currentWorkspaceId ?? void 0;
10832
+ if (target) await this.openWorkspace(target);
10833
+ return target;
10830
10834
  }
10831
10835
  /**
10832
10836
  * Make a workspace the CURRENT one: decrypt its key, open it on the server (which makes it the
@@ -11795,8 +11799,8 @@ var Arbi = class {
11795
11799
  */
11796
11800
  /** The open workspace's tags, or `query.workspaceId`'s (opened for this session, not switched to). */
11797
11801
  list: async (query2) => {
11798
- await this.targetWorkspace(query2?.workspaceId);
11799
- return listTags(this.requireClient(), query2);
11802
+ const workspaceId = await this.targetWorkspace(query2?.workspaceId);
11803
+ return listTags(this.requireClient(), { ...query2, workspaceId });
11800
11804
  },
11801
11805
  create: (options) => this.createTagIn(options.workspaceId ?? this.requireWorkspace(), options),
11802
11806
  delete: (tagId) => deleteTag(this.requireClient(), tagId),