@arbidocs/sdk 0.5.152 → 0.5.153

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
@@ -5310,6 +5310,7 @@ __export(workspaces_exports, {
5310
5310
  addWorkspaceMembers: () => addWorkspaceMembers,
5311
5311
  addWorkspaceMembersBody: () => addWorkspaceMembersBody,
5312
5312
  addWorkspaceUsers: () => addWorkspaceUsers,
5313
+ aggregateWorkspace: () => aggregateWorkspace,
5313
5314
  archiveWorkspace: () => archiveWorkspace,
5314
5315
  cancelWorkspaceTransfer: () => cancelWorkspaceTransfer,
5315
5316
  copyDocuments: () => copyDocuments,
@@ -5491,6 +5492,15 @@ async function copyDocuments(arbi, targetWorkspaceId, docIds, targetWorkspaceKey
5491
5492
  "Failed to copy documents"
5492
5493
  );
5493
5494
  }
5495
+ async function aggregateWorkspace(arbi, workspaceExtId, queries) {
5496
+ return requireData(
5497
+ await arbi.fetch.POST("/v1/workspace/{workspace_ext_id}/aggregate", {
5498
+ params: { path: { workspace_ext_id: workspaceExtId } },
5499
+ body: { queries }
5500
+ }),
5501
+ "Failed to count the workspace"
5502
+ ).results;
5503
+ }
5494
5504
  async function getWorkspaceActivity(arbi, workspaceExtId, options = {}) {
5495
5505
  return requireData(
5496
5506
  await arbi.fetch.GET("/v1/workspace/{workspace_ext_id}/activity", {
@@ -9477,6 +9487,7 @@ __export(projects_exports, {
9477
9487
  listProducts: () => listProducts,
9478
9488
  listProjectEvents: () => listProjectEvents,
9479
9489
  listProjects: () => listProjects,
9490
+ listProjectsUsage: () => listProjectsUsage,
9480
9491
  parseBudget: () => parseBudget,
9481
9492
  previewPlanChange: () => previewPlanChange,
9482
9493
  quoteAddon: () => quoteAddon,
@@ -9596,6 +9607,14 @@ async function getProjectUsage(arbi, projectExtId, monthsBack) {
9596
9607
  "Failed to fetch project usage"
9597
9608
  );
9598
9609
  }
9610
+ async function listProjectsUsage(arbi, monthsBack) {
9611
+ return requireData(
9612
+ await arbi.fetch.GET("/v1/user/projects/usage", {
9613
+ params: { query: monthsBack === void 0 ? void 0 : { months_back: monthsBack } }
9614
+ }),
9615
+ "Failed to fetch the usage of your projects"
9616
+ );
9617
+ }
9599
9618
  async function getProjectInvoices(arbi, projectExtId) {
9600
9619
  return requireData(
9601
9620
  await arbi.fetch.GET("/v1/user/projects/{project_ext_id}/invoices", {
@@ -10934,6 +10953,7 @@ __export(views_exports, {
10934
10953
  deleteTableView: () => deleteTableView,
10935
10954
  filterText: () => filterText,
10936
10955
  getTableView: () => getTableView,
10956
+ getTableViewRows: () => getTableViewRows,
10937
10957
  listTableViews: () => listTableViews,
10938
10958
  shareTableView: () => shareTableView,
10939
10959
  updateTableView: () => updateTableView
@@ -10952,6 +10972,12 @@ async function getTableView(arbi, viewId) {
10952
10972
  "Failed to read the view"
10953
10973
  );
10954
10974
  }
10975
+ async function getTableViewRows(arbi, viewId, page = {}) {
10976
+ return requireData(
10977
+ await arbi.fetch.GET("/v1/views/{view_id}/rows", { params: { ...path3(viewId), query: page } }),
10978
+ "Failed to read the view"
10979
+ );
10980
+ }
10955
10981
  async function createTableView(arbi, target, spec, options = {}) {
10956
10982
  return requireData(
10957
10983
  await arbi.fetch.POST("/v1/views", {
@@ -12958,6 +12984,8 @@ var Arbi = class {
12958
12984
  refresh: (projectExtId) => refreshProject(this.requireClient(), projectExtId),
12959
12985
  /** AI usage + spend breakdown for a project's billing period. */
12960
12986
  usage: (projectExtId, monthsBack) => getProjectUsage(this.requireClient(), projectExtId, monthsBack),
12987
+ /** The usage of every project the caller owns, in one request. */
12988
+ usageOfOwned: (monthsBack) => listProjectsUsage(this.requireClient(), monthsBack),
12961
12989
  /** Stripe invoices for a project's subscription. */
12962
12990
  invoices: (projectExtId) => getProjectInvoices(this.requireClient(), projectExtId),
12963
12991
  /** Delete a project (only when empty: no workspaces, no subscription). */
@@ -13202,6 +13230,8 @@ var Arbi = class {
13202
13230
  listUsers: () => listWorkspaceUsers(this.requireClient()),
13203
13231
  /** One page of a workspace's activity feed, newest first (see `getWorkspaceActivity`). */
13204
13232
  activity: (workspaceId, options) => getWorkspaceActivity(this.requireClient(), workspaceId, options),
13233
+ /** Count a workspace's items on the server, grouped (see `aggregateWorkspace`). */
13234
+ aggregate: (workspaceId, queries) => aggregateWorkspace(this.requireClient(), workspaceId, queries),
13205
13235
  /**
13206
13236
  * Add users to the open workspace; `confirmInvite` also invites emails not on ARBI yet. `role`
13207
13237
  * defaults to `collaborator`; `guest` makes a read-only member (shown as "Viewer").
@@ -14851,6 +14881,8 @@ var Arbi = class {
14851
14881
  /** The views the caller can see: of one table, or of every table of the open workspace. */
14852
14882
  list: (target) => listTableViews(this.requireClient(), target),
14853
14883
  get: (viewId) => getTableView(this.requireClient(), viewId),
14884
+ /** The view with its database, columns and rows (filters and sort applied), in one read. */
14885
+ rows: (viewId, page) => getTableViewRows(this.requireClient(), viewId, page),
14854
14886
  create: (target, spec, options) => createTableView(this.requireClient(), target, spec, options),
14855
14887
  update: (viewId, spec) => updateTableView(this.requireClient(), viewId, spec),
14856
14888
  /** Share with the workspace (one way: it is never made private again). */