@arbidocs/sdk 0.4.145 → 0.4.146

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
@@ -5585,15 +5585,17 @@ async function updateWorkspace(arbi, body) {
5585
5585
  async function listWorkspaceUsers(arbi) {
5586
5586
  return requireData(await arbi.fetch.GET("/v1/workspace/users"), "Failed to fetch workspace users");
5587
5587
  }
5588
- async function addWorkspaceUsers(arbi, emails, role = "collaborator", target) {
5588
+ async function addWorkspaceUsers(arbi, emails, role = "collaborator", target, confirmInvite = false) {
5589
+ const invite = confirmInvite ? { confirm_invite: true } : {};
5589
5590
  return requireData(
5590
5591
  await arbi.fetch.POST("/v1/workspace/users", {
5591
5592
  body: target ? {
5592
5593
  emails,
5593
5594
  role,
5594
5595
  workspace_ext_id: target.workspaceExtId,
5595
- workspace_key: target.workspaceKey
5596
- } : { emails, role }
5596
+ workspace_key: target.workspaceKey,
5597
+ ...invite
5598
+ } : { emails, role, ...invite }
5597
5599
  }),
5598
5600
  "Failed to add users"
5599
5601
  );
@@ -9473,7 +9475,14 @@ var Arbi = class {
9473
9475
  listUsers: () => listWorkspaceUsers(this.requireClient()),
9474
9476
  /** One page of a workspace's activity feed, newest first (see `getWorkspaceActivity`). */
9475
9477
  activity: (workspaceId, options) => getWorkspaceActivity(this.requireClient(), workspaceId, options),
9476
- addUsers: (emails, role) => addWorkspaceUsers(this.requireClient(), emails, role),
9478
+ /** Add users to the open workspace; `confirmInvite` also invites emails not on ARBI yet. */
9479
+ addUsers: (emails, role, options) => addWorkspaceUsers(
9480
+ this.requireClient(),
9481
+ emails,
9482
+ role,
9483
+ void 0,
9484
+ options?.confirmInvite
9485
+ ),
9477
9486
  /**
9478
9487
  * Grant users a temporary key scoped to ONE session (identified by its public key), for
9479
9488
  * example an agent's run session minted by `agents.authorize()`. Nothing standing is created: