@arbidocs/sdk 0.5.52 → 0.5.54

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.
@@ -3660,8 +3660,10 @@ interface TagListQuery {
3660
3660
  include?: 'links'[];
3661
3661
  /** With links: most documents, facts and threads per tag (newest first). Default 50. */
3662
3662
  linksLimit?: number;
3663
+ /** Another workspace's tags, without switching to it (its key must be on the session). */
3664
+ workspaceId?: string;
3663
3665
  }
3664
- /** The tags of the open workspace (oldest first, or in the order of `ids`). */
3666
+ /** The tags of the open workspace, or `workspaceId`'s (oldest first, or in the order of `ids`). */
3665
3667
  declare function listTags(arbi: ArbiClient, query?: TagListQuery): Promise<{
3666
3668
  external_id: string;
3667
3669
  workspace_ext_id: string;
@@ -3708,6 +3710,7 @@ declare function listTags(arbi: ArbiClient, query?: TagListQuery): Promise<{
3708
3710
  created_at: string;
3709
3711
  updated_at: string;
3710
3712
  }[]>;
3713
+ /** Create a tag in the open workspace, or in `workspaceId` without switching to it (its key on the session). */
3711
3714
  declare function createTag(arbi: ArbiClient, options: {
3712
3715
  name: string;
3713
3716
  workspaceId?: string;
@@ -8037,6 +8040,11 @@ declare class Arbi {
8037
8040
  * (the client's `workspaceKeys.prime`: once per server session). The current workspace is open.
8038
8041
  */
8039
8042
  private openWorkspace;
8043
+ /**
8044
+ * Create a tag in `workspaceId`, named on the request: a switch while it is sent cannot move it to the workspace
8045
+ * opened next, and a workspace other than the current one is opened for this session first.
8046
+ */
8047
+ private createTagIn;
8040
8048
  /** The workspace a call names, opened for this session; `undefined` for the current one. */
8041
8049
  private targetWorkspace;
8042
8050
  /**
@@ -12016,6 +12024,7 @@ declare class Arbi {
12016
12024
  * each tag's documents, facts and threads: `list({ kind: 'issue', include: ['links'] })` is the
12017
12025
  * issue table's rows (its columns: `tagKinds.get('issue')`).
12018
12026
  */
12027
+ /** The open workspace's tags, or `query.workspaceId`'s (opened for this session, not switched to). */
12019
12028
  list: (query?: TagListQuery) => Promise<{
12020
12029
  external_id: string;
12021
12030
  workspace_ext_id: string;
@@ -3660,8 +3660,10 @@ interface TagListQuery {
3660
3660
  include?: 'links'[];
3661
3661
  /** With links: most documents, facts and threads per tag (newest first). Default 50. */
3662
3662
  linksLimit?: number;
3663
+ /** Another workspace's tags, without switching to it (its key must be on the session). */
3664
+ workspaceId?: string;
3663
3665
  }
3664
- /** The tags of the open workspace (oldest first, or in the order of `ids`). */
3666
+ /** The tags of the open workspace, or `workspaceId`'s (oldest first, or in the order of `ids`). */
3665
3667
  declare function listTags(arbi: ArbiClient, query?: TagListQuery): Promise<{
3666
3668
  external_id: string;
3667
3669
  workspace_ext_id: string;
@@ -3708,6 +3710,7 @@ declare function listTags(arbi: ArbiClient, query?: TagListQuery): Promise<{
3708
3710
  created_at: string;
3709
3711
  updated_at: string;
3710
3712
  }[]>;
3713
+ /** Create a tag in the open workspace, or in `workspaceId` without switching to it (its key on the session). */
3711
3714
  declare function createTag(arbi: ArbiClient, options: {
3712
3715
  name: string;
3713
3716
  workspaceId?: string;
@@ -8037,6 +8040,11 @@ declare class Arbi {
8037
8040
  * (the client's `workspaceKeys.prime`: once per server session). The current workspace is open.
8038
8041
  */
8039
8042
  private openWorkspace;
8043
+ /**
8044
+ * Create a tag in `workspaceId`, named on the request: a switch while it is sent cannot move it to the workspace
8045
+ * opened next, and a workspace other than the current one is opened for this session first.
8046
+ */
8047
+ private createTagIn;
8040
8048
  /** The workspace a call names, opened for this session; `undefined` for the current one. */
8041
8049
  private targetWorkspace;
8042
8050
  /**
@@ -12016,6 +12024,7 @@ declare class Arbi {
12016
12024
  * each tag's documents, facts and threads: `list({ kind: 'issue', include: ['links'] })` is the
12017
12025
  * issue table's rows (its columns: `tagKinds.get('issue')`).
12018
12026
  */
12027
+ /** The open workspace's tags, or `query.workspaceId`'s (opened for this session, not switched to). */
12019
12028
  list: (query?: TagListQuery) => Promise<{
12020
12029
  external_id: string;
12021
12030
  workspace_ext_id: string;
package/dist/browser.cjs CHANGED
@@ -5035,9 +5035,10 @@ async function getDeploymentHouseTemplate(arbi) {
5035
5035
  const { data, error, response } = await arbi.fetch.GET("/v1/deployment/house-template", {
5036
5036
  parseAs: "arrayBuffer"
5037
5037
  });
5038
- if (response.status === 204 || response.status === 404) return null;
5038
+ const status = response.status;
5039
+ if (status === 204 || status === 404) return null;
5039
5040
  if (error || !data)
5040
- throw new ArbiApiError("Could not read the deployment house template", error, response.status);
5041
+ throw new ArbiApiError("Could not read the deployment house template", error, status);
5041
5042
  return {
5042
5043
  bytes: new Uint8Array(data),
5043
5044
  name: filenameOf(response) ?? "House template.dotx"
@@ -5929,6 +5930,7 @@ async function listTags(arbi, query2 = {}) {
5929
5930
  if (query2.ids?.length) params.ids = query2.ids;
5930
5931
  if (query2.include?.length) params.include = query2.include;
5931
5932
  if (query2.linksLimit !== void 0) params.links_limit = query2.linksLimit;
5933
+ if (query2.workspaceId) params.workspace_ext_id = query2.workspaceId;
5932
5934
  return requireData(
5933
5935
  await arbi.fetch.GET(
5934
5936
  "/v1/tag/",
@@ -5940,6 +5942,7 @@ async function listTags(arbi, query2 = {}) {
5940
5942
  async function createTag(arbi, options) {
5941
5943
  return requireData(
5942
5944
  await arbi.fetch.POST("/v1/tag/", {
5945
+ ...options.workspaceId ? { params: { query: { workspace_ext_id: options.workspaceId } } } : {},
5943
5946
  body: {
5944
5947
  name: options.name,
5945
5948
  tag_type: options.tagType ?? { type: "checkbox", options: [] },
@@ -10286,6 +10289,14 @@ var Arbi = class {
10286
10289
  this.requireLogin();
10287
10290
  return this.requireClient().workspaceKeys.prime(workspaceId);
10288
10291
  }
10292
+ /**
10293
+ * Create a tag in `workspaceId`, named on the request: a switch while it is sent cannot move it to the workspace
10294
+ * opened next, and a workspace other than the current one is opened for this session first.
10295
+ */
10296
+ async createTagIn(workspaceId, options) {
10297
+ await this.targetWorkspace(workspaceId);
10298
+ return createTag(this.requireClient(), { ...options, workspaceId });
10299
+ }
10289
10300
  /** The workspace a call names, opened for this session; `undefined` for the current one. */
10290
10301
  async targetWorkspace(workspaceId) {
10291
10302
  if (!workspaceId || workspaceId === this.currentWorkspaceId) return void 0;
@@ -11204,11 +11215,12 @@ var Arbi = class {
11204
11215
  * each tag's documents, facts and threads: `list({ kind: 'issue', include: ['links'] })` is the
11205
11216
  * issue table's rows (its columns: `tagKinds.get('issue')`).
11206
11217
  */
11207
- list: (query2) => listTags(this.requireClient(), query2),
11208
- create: (options) => createTag(this.requireClient(), {
11209
- ...options,
11210
- workspaceId: options.workspaceId ?? this.requireWorkspace()
11211
- }),
11218
+ /** The open workspace's tags, or `query.workspaceId`'s (opened for this session, not switched to). */
11219
+ list: async (query2) => {
11220
+ await this.targetWorkspace(query2?.workspaceId);
11221
+ return listTags(this.requireClient(), query2);
11222
+ },
11223
+ create: (options) => this.createTagIn(options.workspaceId ?? this.requireWorkspace(), options),
11212
11224
  delete: (tagId) => deleteTag(this.requireClient(), tagId),
11213
11225
  update: (tagId, change) => updateTag(this.requireClient(), tagId, change),
11214
11226
  /** Merge-patch a tag's values for its kind's fields (`null` clears one). */