@arbidocs/sdk 0.3.49 → 0.3.50

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
@@ -3908,16 +3908,17 @@ function formatWorkspaceChoices(wsList) {
3908
3908
  };
3909
3909
  });
3910
3910
  }
3911
- function buildClientOptions(config, store) {
3911
+ function buildClientOptions(config, store, email) {
3912
3912
  return {
3913
3913
  baseUrl: config.baseUrl,
3914
3914
  deploymentDomain: config.deploymentDomain,
3915
3915
  credentials: "omit",
3916
- sessionStorage: store?.getSessionStorageProvider?.()
3916
+ sessionStorage: store?.getSessionStorageProvider?.(),
3917
+ userEmail: email
3917
3918
  };
3918
3919
  }
3919
3920
  async function createAuthenticatedClient(config, creds, store) {
3920
- const arbi = client.createArbiClient(buildClientOptions(config, store));
3921
+ const arbi = client.createArbiClient(buildClientOptions(config, store, creds.email));
3921
3922
  await arbi.crypto.initSodium();
3922
3923
  const signingPrivateKey = client.base64ToBytes(creds.signingPrivateKeyBase64);
3923
3924
  const loginResult = await arbi.auth.loginWithKey({
@@ -4083,7 +4084,7 @@ async function resolveWorkspace(store, workspaceOpt) {
4083
4084
  throw new ArbiError("No workspace selected. Run: arbi workspace select <id>");
4084
4085
  }
4085
4086
  if (isCachedTokenValid(creds, workspaceId)) {
4086
- const arbi2 = client.createArbiClient(buildClientOptions(config, store));
4087
+ const arbi2 = client.createArbiClient(buildClientOptions(config, store, creds.email));
4087
4088
  await arbi2.crypto.initSodium();
4088
4089
  arbi2.session.setUser(creds.email);
4089
4090
  arbi2.session.setSelectedWorkspace(workspaceId);