@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.js CHANGED
@@ -3899,16 +3899,17 @@ function formatWorkspaceChoices(wsList) {
3899
3899
  };
3900
3900
  });
3901
3901
  }
3902
- function buildClientOptions(config, store) {
3902
+ function buildClientOptions(config, store, email) {
3903
3903
  return {
3904
3904
  baseUrl: config.baseUrl,
3905
3905
  deploymentDomain: config.deploymentDomain,
3906
3906
  credentials: "omit",
3907
- sessionStorage: store?.getSessionStorageProvider?.()
3907
+ sessionStorage: store?.getSessionStorageProvider?.(),
3908
+ userEmail: email
3908
3909
  };
3909
3910
  }
3910
3911
  async function createAuthenticatedClient(config, creds, store) {
3911
- const arbi = createArbiClient(buildClientOptions(config, store));
3912
+ const arbi = createArbiClient(buildClientOptions(config, store, creds.email));
3912
3913
  await arbi.crypto.initSodium();
3913
3914
  const signingPrivateKey = base64ToBytes(creds.signingPrivateKeyBase64);
3914
3915
  const loginResult = await arbi.auth.loginWithKey({
@@ -4074,7 +4075,7 @@ async function resolveWorkspace(store, workspaceOpt) {
4074
4075
  throw new ArbiError("No workspace selected. Run: arbi workspace select <id>");
4075
4076
  }
4076
4077
  if (isCachedTokenValid(creds, workspaceId)) {
4077
- const arbi2 = createArbiClient(buildClientOptions(config, store));
4078
+ const arbi2 = createArbiClient(buildClientOptions(config, store, creds.email));
4078
4079
  await arbi2.crypto.initSodium();
4079
4080
  arbi2.session.setUser(creds.email);
4080
4081
  arbi2.session.setSelectedWorkspace(workspaceId);