@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/browser.cjs CHANGED
@@ -9154,8 +9154,10 @@ __export(work_exports, {
9154
9154
  getPendingAuth: () => getPendingAuth,
9155
9155
  getRunProgress: () => getRunProgress,
9156
9156
  getStepAnswers: () => getStepAnswers,
9157
+ listConversationPeople: () => listConversationPeople,
9157
9158
  notifyConversation: () => notifyConversation,
9158
9159
  planWork: () => planWork,
9160
+ removeConversationPerson: () => removeConversationPerson,
9159
9161
  runConversation: () => runConversation,
9160
9162
  sendBackStep: () => sendBackStep,
9161
9163
  skipStep: () => skipStep,
@@ -9194,7 +9196,7 @@ __export(workflow_steps_exports, {
9194
9196
  waitingForDocumentsText: () => waitingForDocumentsText
9195
9197
  });
9196
9198
  var STEP_KINDS = ["form", "upload", "agent", "review", "action"];
9197
- var STEP_ACTION_TYPES = ["sign", "email_draft", "tabular_review"];
9199
+ var STEP_ACTION_TYPES = ["sign", "email_draft", "tabular_review", "approval"];
9198
9200
  var PERSON_STEP_KINDS = ["form", "upload", "review"];
9199
9201
  var STEP_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
9200
9202
  var STEP_EVENTS = {
@@ -9907,6 +9909,20 @@ async function notifyConversation(arbi, conversationId, userIds) {
9907
9909
  "Failed to notify people about the conversation"
9908
9910
  );
9909
9911
  }
9912
+ async function listConversationPeople(arbi, conversationId) {
9913
+ return requireData(
9914
+ await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/people", byId(conversationId)),
9915
+ "Failed to fetch the people of the conversation"
9916
+ );
9917
+ }
9918
+ async function removeConversationPerson(arbi, conversationId, userId) {
9919
+ requireOk(
9920
+ await arbi.fetch.DELETE("/v1/conversation/{conversation_ext_id}/people/{user_ext_id}", {
9921
+ params: { path: { conversation_ext_id: conversationId, user_ext_id: userId } }
9922
+ }),
9923
+ "Failed to remove the person from the conversation"
9924
+ );
9925
+ }
9910
9926
  async function getActivity(arbi, conversationId) {
9911
9927
  return requireData(
9912
9928
  await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/activity", byId(conversationId)),
@@ -10126,6 +10142,7 @@ __export(databases_exports, {
10126
10142
  importDatabaseRows: () => importDatabaseRows,
10127
10143
  listDatabaseRows: () => listDatabaseRows,
10128
10144
  listDatabases: () => listDatabases,
10145
+ shareDatabaseRow: () => shareDatabaseRow,
10129
10146
  updateDatabase: () => updateDatabase,
10130
10147
  updateDatabaseRow: () => updateDatabaseRow
10131
10148
  });
@@ -10179,15 +10196,25 @@ async function deleteDatabase(arbi, databaseId) {
10179
10196
  "Failed to delete the database"
10180
10197
  );
10181
10198
  }
10182
- async function addDatabaseRows(arbi, databaseId, rows) {
10199
+ async function addDatabaseRows(arbi, databaseId, rows, options = {}) {
10183
10200
  return requireData(
10184
10201
  await arbi.fetch.POST("/v1/databases/{database_id}/rows", {
10185
10202
  params: path(databaseId),
10186
- body: { rows }
10203
+ // `shared` only for a draft: the server defaults to shared, and one without drafts refuses the field.
10204
+ body: { rows, ...options.shared === false ? { shared: false } : {} }
10187
10205
  }),
10188
10206
  "Failed to add rows"
10189
10207
  );
10190
10208
  }
10209
+ async function shareDatabaseRow(arbi, databaseId, rowId, shared = true) {
10210
+ return requireData(
10211
+ await arbi.fetch.POST("/v1/databases/{database_id}/rows/{row_id}/share", {
10212
+ params: { path: { database_id: databaseId, row_id: rowId } },
10213
+ body: { shared }
10214
+ }),
10215
+ shared ? "Failed to submit the row" : "Failed to make the row private"
10216
+ );
10217
+ }
10191
10218
  async function updateDatabaseRow(arbi, databaseId, rowId, values) {
10192
10219
  return requireData(
10193
10220
  await arbi.fetch.PATCH("/v1/databases/{database_id}/rows/{row_id}", {
@@ -12726,6 +12753,10 @@ var Arbi = class {
12726
12753
  usage: (conversationId) => getConversationUsage(this.requireClient(), conversationId),
12727
12754
  /** Notify people about a conversation (each gets a notification); resolves with who was. */
12728
12755
  notify: (conversationId, userIds) => notifyConversation(this.requireClient(), conversationId, userIds),
12756
+ /** The people a conversation is shared with by name (cc'd or @mentioned). */
12757
+ people: (conversationId) => listConversationPeople(this.requireClient(), conversationId),
12758
+ /** Take a named person off a conversation (a workspace owner only). */
12759
+ removePerson: (conversationId, userId) => removeConversationPerson(this.requireClient(), conversationId, userId),
12729
12760
  /** Draft an editable plan from an objective, in the current workspace or `options.workspaceId`. */
12730
12761
  plan: async (body, options) => planWork(
12731
12762
  this.requireClient(),
@@ -14045,7 +14076,9 @@ var Arbi = class {
14045
14076
  create: (body) => createDatabase(this.requireClient(), body),
14046
14077
  update: (databaseId, body) => updateDatabase(this.requireClient(), databaseId, body),
14047
14078
  delete: (databaseId) => deleteDatabase(this.requireClient(), databaseId),
14048
- addRows: (databaseId, rows) => addDatabaseRows(this.requireClient(), databaseId, rows),
14079
+ addRows: (databaseId, rows, options) => addDatabaseRows(this.requireClient(), databaseId, rows, options),
14080
+ /** Submit a draft row (share it), or as a workspace owner make a shared row private again. */
14081
+ shareRow: (databaseId, rowId, shared = true) => shareDatabaseRow(this.requireClient(), databaseId, rowId, shared),
14049
14082
  updateRow: (databaseId, rowId, values) => updateDatabaseRow(this.requireClient(), databaseId, rowId, values),
14050
14083
  deleteRows: (databaseId, ids) => deleteDatabaseRows(this.requireClient(), databaseId, ids),
14051
14084
  import: (file, name) => importDatabase(this.requireClient(), file, name),