@arbidocs/sdk 0.5.142 → 0.5.144

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
@@ -9755,8 +9755,10 @@ __export(work_exports, {
9755
9755
  getPendingAuth: () => getPendingAuth,
9756
9756
  getRunProgress: () => getRunProgress,
9757
9757
  getStepAnswers: () => getStepAnswers,
9758
+ listConversationPeople: () => listConversationPeople,
9758
9759
  notifyConversation: () => notifyConversation,
9759
9760
  planWork: () => planWork,
9761
+ removeConversationPerson: () => removeConversationPerson,
9760
9762
  runConversation: () => runConversation,
9761
9763
  sendBackStep: () => sendBackStep,
9762
9764
  skipStep: () => skipStep,
@@ -9795,7 +9797,7 @@ __export(workflow_steps_exports, {
9795
9797
  waitingForDocumentsText: () => waitingForDocumentsText
9796
9798
  });
9797
9799
  var STEP_KINDS = ["form", "upload", "agent", "review", "action"];
9798
- var STEP_ACTION_TYPES = ["sign", "email_draft", "tabular_review"];
9800
+ var STEP_ACTION_TYPES = ["sign", "email_draft", "tabular_review", "approval"];
9799
9801
  var PERSON_STEP_KINDS = ["form", "upload", "review"];
9800
9802
  var STEP_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
9801
9803
  var STEP_EVENTS = {
@@ -10508,6 +10510,20 @@ async function notifyConversation(arbi, conversationId, userIds) {
10508
10510
  "Failed to notify people about the conversation"
10509
10511
  );
10510
10512
  }
10513
+ async function listConversationPeople(arbi, conversationId) {
10514
+ return requireData(
10515
+ await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/people", byId(conversationId)),
10516
+ "Failed to fetch the people of the conversation"
10517
+ );
10518
+ }
10519
+ async function removeConversationPerson(arbi, conversationId, userId) {
10520
+ requireOk(
10521
+ await arbi.fetch.DELETE("/v1/conversation/{conversation_ext_id}/people/{user_ext_id}", {
10522
+ params: { path: { conversation_ext_id: conversationId, user_ext_id: userId } }
10523
+ }),
10524
+ "Failed to remove the person from the conversation"
10525
+ );
10526
+ }
10511
10527
  async function getActivity(arbi, conversationId) {
10512
10528
  return requireData(
10513
10529
  await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/activity", byId(conversationId)),
@@ -10727,6 +10743,7 @@ __export(databases_exports, {
10727
10743
  importDatabaseRows: () => importDatabaseRows,
10728
10744
  listDatabaseRows: () => listDatabaseRows,
10729
10745
  listDatabases: () => listDatabases,
10746
+ shareDatabaseRow: () => shareDatabaseRow,
10730
10747
  updateDatabase: () => updateDatabase,
10731
10748
  updateDatabaseRow: () => updateDatabaseRow
10732
10749
  });
@@ -10780,15 +10797,25 @@ async function deleteDatabase(arbi, databaseId) {
10780
10797
  "Failed to delete the database"
10781
10798
  );
10782
10799
  }
10783
- async function addDatabaseRows(arbi, databaseId, rows) {
10800
+ async function addDatabaseRows(arbi, databaseId, rows, options = {}) {
10784
10801
  return requireData(
10785
10802
  await arbi.fetch.POST("/v1/databases/{database_id}/rows", {
10786
10803
  params: path2(databaseId),
10787
- body: { rows }
10804
+ // `shared` only for a draft: the server defaults to shared, and one without drafts refuses the field.
10805
+ body: { rows, ...options.shared === false ? { shared: false } : {} }
10788
10806
  }),
10789
10807
  "Failed to add rows"
10790
10808
  );
10791
10809
  }
10810
+ async function shareDatabaseRow(arbi, databaseId, rowId, shared = true) {
10811
+ return requireData(
10812
+ await arbi.fetch.POST("/v1/databases/{database_id}/rows/{row_id}/share", {
10813
+ params: { path: { database_id: databaseId, row_id: rowId } },
10814
+ body: { shared }
10815
+ }),
10816
+ shared ? "Failed to submit the row" : "Failed to make the row private"
10817
+ );
10818
+ }
10792
10819
  async function updateDatabaseRow(arbi, databaseId, rowId, values) {
10793
10820
  return requireData(
10794
10821
  await arbi.fetch.PATCH("/v1/databases/{database_id}/rows/{row_id}", {
@@ -13327,6 +13354,10 @@ var Arbi = class {
13327
13354
  usage: (conversationId) => getConversationUsage(this.requireClient(), conversationId),
13328
13355
  /** Notify people about a conversation (each gets a notification); resolves with who was. */
13329
13356
  notify: (conversationId, userIds) => notifyConversation(this.requireClient(), conversationId, userIds),
13357
+ /** The people a conversation is shared with by name (cc'd or @mentioned). */
13358
+ people: (conversationId) => listConversationPeople(this.requireClient(), conversationId),
13359
+ /** Take a named person off a conversation (a workspace owner only). */
13360
+ removePerson: (conversationId, userId) => removeConversationPerson(this.requireClient(), conversationId, userId),
13330
13361
  /** Draft an editable plan from an objective, in the current workspace or `options.workspaceId`. */
13331
13362
  plan: async (body, options) => planWork(
13332
13363
  this.requireClient(),
@@ -14646,7 +14677,9 @@ var Arbi = class {
14646
14677
  create: (body) => createDatabase(this.requireClient(), body),
14647
14678
  update: (databaseId, body) => updateDatabase(this.requireClient(), databaseId, body),
14648
14679
  delete: (databaseId) => deleteDatabase(this.requireClient(), databaseId),
14649
- addRows: (databaseId, rows) => addDatabaseRows(this.requireClient(), databaseId, rows),
14680
+ addRows: (databaseId, rows, options) => addDatabaseRows(this.requireClient(), databaseId, rows, options),
14681
+ /** Submit a draft row (share it), or as a workspace owner make a shared row private again. */
14682
+ shareRow: (databaseId, rowId, shared = true) => shareDatabaseRow(this.requireClient(), databaseId, rowId, shared),
14650
14683
  updateRow: (databaseId, rowId, values) => updateDatabaseRow(this.requireClient(), databaseId, rowId, values),
14651
14684
  deleteRows: (databaseId, ids) => deleteDatabaseRows(this.requireClient(), databaseId, ids),
14652
14685
  import: (file, name) => importDatabase(this.requireClient(), file, name),