@arbidocs/client 0.4.83 → 0.4.85

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
@@ -1089,6 +1089,7 @@ async function logout(session) {
1089
1089
  }
1090
1090
 
1091
1091
  // src/auth/change-password.ts
1092
+ var passwordCalls = (client) => client;
1092
1093
  async function changePassword(params, deps) {
1093
1094
  const credentials = await generatePasswordChangeCredentials(
1094
1095
  params.email,
@@ -1107,7 +1108,7 @@ async function changePassword(params, deps) {
1107
1108
  secretKey: credentials.newSigningPrivateKey
1108
1109
  });
1109
1110
  const mailKeys = await rewrapMailKeys(deps.fetchClient, current.secretKey, next.publicKey);
1110
- const response = await deps.fetchClient.POST("/v1/user/change_password", {
1111
+ const response = await passwordCalls(deps.fetchClient).POST("/v1/user/change_password", {
1111
1112
  body: {
1112
1113
  ...credentials.request,
1113
1114
  ...mailKeys,
@@ -1191,7 +1192,7 @@ async function rewrapMailKeys(fetchClient, oldPrivateKey, newPublicKey) {
1191
1192
  }
1192
1193
  mailCursor = result.data.next_cursor ?? null;
1193
1194
  }
1194
- const connected = await fetchClient.GET("/v1/mail/native/rotation-credentials");
1195
+ const connected = await passwordCalls(fetchClient).GET("/v1/mail/native/rotation-credentials");
1195
1196
  if (!connected.data) throw new Error("Could not load mail connections for password change");
1196
1197
  const rewrappedMailCredentials = {};
1197
1198
  for (const [id, wrapped] of Object.entries(connected.data)) {
@@ -1256,7 +1257,7 @@ async function changePasswordWithRekey(params, deps) {
1256
1257
  }
1257
1258
  }
1258
1259
  const mailKeys = await rewrapMailKeys(deps.fetchClient, current.secretKey, next.publicKey);
1259
- const response = await deps.fetchClient.POST("/v1/user/change_password", {
1260
+ const response = await passwordCalls(deps.fetchClient).POST("/v1/user/change_password", {
1260
1261
  body: {
1261
1262
  ...request,
1262
1263
  rewrapped_workspace_keys: rewrapped,