@calimero-network/mero-js 28.1.0 → 29.0.0

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.mjs CHANGED
@@ -1994,17 +1994,22 @@ var CalimeroClient = class _CalimeroClient {
1994
1994
  return this.json("DELETE", path, body);
1995
1995
  }
1996
1996
  // ---------------------------------------------------------------- identity
1997
- /** Create an account with a new passkey, and sign in. */
1997
+ /**
1998
+ * Create an account with a new passkey, and sign in. The node then asks the
1999
+ * new passkey to sign the account it creates (`412 CONFIRM_REQUIRED`, core
2000
+ * #proofs-at-apply-rest), so a sign-up prompts twice: create, then sign.
2001
+ */
1998
2002
  async signUp(passkey, name) {
1999
2003
  const begin = await this.post(
2000
2004
  "auth/passkey/register/begin",
2001
2005
  { name }
2002
2006
  );
2003
2007
  const registration = await passkey.create(begin.options);
2004
- const session = await this.post("auth/passkey/register/finish", {
2005
- challengeId: begin.challengeId,
2006
- registration
2007
- });
2008
+ const session = await this.postConfirmed(
2009
+ "auth/passkey/register/finish",
2010
+ { challengeId: begin.challengeId, registration },
2011
+ passkey
2012
+ );
2008
2013
  this.useSession(session);
2009
2014
  return session;
2010
2015
  }
@@ -2109,8 +2114,9 @@ var CalimeroClient = class _CalimeroClient {
2109
2114
  const { keys } = await this.get("auth/apikeys");
2110
2115
  return keys;
2111
2116
  }
2112
- async revokeApiKey(keyId) {
2113
- await this.delete(`auth/apikeys/${seg(keyId)}`);
2117
+ /** Revoke one of the account's API keys, approved with its `passkey` (`412 CONFIRM_REQUIRED`). */
2118
+ async revokeApiKey(keyId, passkey) {
2119
+ await this.deleteConfirmed(`auth/apikeys/${seg(keyId)}`, passkey);
2114
2120
  }
2115
2121
  /**
2116
2122
  * Create an API key for an agent or server, approved with the account's