@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.cjs CHANGED
@@ -1096,6 +1096,7 @@ async function logout(session) {
1096
1096
  }
1097
1097
 
1098
1098
  // src/auth/change-password.ts
1099
+ var passwordCalls = (client) => client;
1099
1100
  async function changePassword(params, deps) {
1100
1101
  const credentials = await generatePasswordChangeCredentials(
1101
1102
  params.email,
@@ -1114,7 +1115,7 @@ async function changePassword(params, deps) {
1114
1115
  secretKey: credentials.newSigningPrivateKey
1115
1116
  });
1116
1117
  const mailKeys = await rewrapMailKeys(deps.fetchClient, current.secretKey, next.publicKey);
1117
- const response = await deps.fetchClient.POST("/v1/user/change_password", {
1118
+ const response = await passwordCalls(deps.fetchClient).POST("/v1/user/change_password", {
1118
1119
  body: {
1119
1120
  ...credentials.request,
1120
1121
  ...mailKeys,
@@ -1198,7 +1199,7 @@ async function rewrapMailKeys(fetchClient, oldPrivateKey, newPublicKey) {
1198
1199
  }
1199
1200
  mailCursor = result.data.next_cursor ?? null;
1200
1201
  }
1201
- const connected = await fetchClient.GET("/v1/mail/native/rotation-credentials");
1202
+ const connected = await passwordCalls(fetchClient).GET("/v1/mail/native/rotation-credentials");
1202
1203
  if (!connected.data) throw new Error("Could not load mail connections for password change");
1203
1204
  const rewrappedMailCredentials = {};
1204
1205
  for (const [id, wrapped] of Object.entries(connected.data)) {
@@ -1263,7 +1264,7 @@ async function changePasswordWithRekey(params, deps) {
1263
1264
  }
1264
1265
  }
1265
1266
  const mailKeys = await rewrapMailKeys(deps.fetchClient, current.secretKey, next.publicKey);
1266
- const response = await deps.fetchClient.POST("/v1/user/change_password", {
1267
+ const response = await passwordCalls(deps.fetchClient).POST("/v1/user/change_password", {
1267
1268
  body: {
1268
1269
  ...request,
1269
1270
  rewrapped_workspace_keys: rewrapped,