@arbidocs/sdk 0.5.183 → 0.5.185

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
@@ -10957,6 +10957,7 @@ __export(databases_exports, {
10957
10957
  deleteDatabaseRows: () => deleteDatabaseRows,
10958
10958
  exportDatabase: () => exportDatabase,
10959
10959
  getDatabase: () => getDatabase,
10960
+ getDatabaseCapabilities: () => getDatabaseCapabilities,
10960
10961
  importDatabase: () => importDatabase,
10961
10962
  importDatabaseRows: () => importDatabaseRows,
10962
10963
  listDatabaseRows: () => listDatabaseRows,
@@ -10965,6 +10966,23 @@ __export(databases_exports, {
10965
10966
  updateDatabase: () => updateDatabase,
10966
10967
  updateDatabaseRow: () => updateDatabaseRow
10967
10968
  });
10969
+ var NO_DATABASE_CAPABILITIES = Object.freeze({
10970
+ column_types: [],
10971
+ view_layouts: []
10972
+ });
10973
+ async function getDatabaseCapabilities(arbi) {
10974
+ try {
10975
+ const { data, error } = await arbi.fetch.GET(
10976
+ "/v1/databases/capabilities"
10977
+ );
10978
+ if (error || !data || typeof data !== "object") return NO_DATABASE_CAPABILITIES;
10979
+ const { column_types, view_layouts } = data;
10980
+ const strings = (v2) => Array.isArray(v2) ? v2.filter((x2) => typeof x2 === "string") : [];
10981
+ return { column_types: strings(column_types), view_layouts: strings(view_layouts) };
10982
+ } catch {
10983
+ return NO_DATABASE_CAPABILITIES;
10984
+ }
10985
+ }
10968
10986
  var path2 = (databaseId) => ({ path: { database_id: databaseId } });
10969
10987
  function spreadsheet(file) {
10970
10988
  const form = new FormData();
@@ -14534,6 +14552,7 @@ var Arbi = class {
14534
14552
  const call = await createCall(client$1, {
14535
14553
  ...params.threadExtId ? { thread_ext_id: params.threadExtId } : {},
14536
14554
  ...params.chatExtId ? { chat_ext_id: params.chatExtId } : {},
14555
+ ...params.workspaceExtId ? { workspace_ext_id: params.workspaceExtId } : {},
14537
14556
  mode: params.mode ?? "call",
14538
14557
  ...params.joinPolicy ? { join_policy: params.joinPolicy } : {},
14539
14558
  title: title ? await client.encryptCallTitle(title, fresh) : null,
@@ -15020,6 +15039,8 @@ var Arbi = class {
15020
15039
  // ── Databases (user-defined tables of the open workspace) ──────────
15021
15040
  databases = {
15022
15041
  list: () => listDatabases(this.requireClient()),
15042
+ /** What this deployment's databases accept; any failure is the empty answer (the original types). */
15043
+ capabilities: () => getDatabaseCapabilities(this.requireClient()),
15023
15044
  get: (databaseId) => getDatabase(this.requireClient(), databaseId),
15024
15045
  /** A search of the rows (any cell), sorted and paged on the server. */
15025
15046
  rows: (databaseId, query2) => listDatabaseRows(this.requireClient(), databaseId, query2),