@calimero-network/mero-js 28.1.1 → 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.cjs CHANGED
@@ -2108,17 +2108,22 @@ var CalimeroClient = class _CalimeroClient {
2108
2108
  return this.json("DELETE", path, body);
2109
2109
  }
2110
2110
  // ---------------------------------------------------------------- identity
2111
- /** Create an account with a new passkey, and sign in. */
2111
+ /**
2112
+ * Create an account with a new passkey, and sign in. The node then asks the
2113
+ * new passkey to sign the account it creates (`412 CONFIRM_REQUIRED`, core
2114
+ * #proofs-at-apply-rest), so a sign-up prompts twice: create, then sign.
2115
+ */
2112
2116
  async signUp(passkey, name) {
2113
2117
  const begin = await this.post(
2114
2118
  "auth/passkey/register/begin",
2115
2119
  { name }
2116
2120
  );
2117
2121
  const registration = await passkey.create(begin.options);
2118
- const session = await this.post("auth/passkey/register/finish", {
2119
- challengeId: begin.challengeId,
2120
- registration
2121
- });
2122
+ const session = await this.postConfirmed(
2123
+ "auth/passkey/register/finish",
2124
+ { challengeId: begin.challengeId, registration },
2125
+ passkey
2126
+ );
2122
2127
  this.useSession(session);
2123
2128
  return session;
2124
2129
  }
@@ -2223,8 +2228,9 @@ var CalimeroClient = class _CalimeroClient {
2223
2228
  const { keys } = await this.get("auth/apikeys");
2224
2229
  return keys;
2225
2230
  }
2226
- async revokeApiKey(keyId) {
2227
- await this.delete(`auth/apikeys/${seg(keyId)}`);
2231
+ /** Revoke one of the account's API keys, approved with its `passkey` (`412 CONFIRM_REQUIRED`). */
2232
+ async revokeApiKey(keyId, passkey) {
2233
+ await this.deleteConfirmed(`auth/apikeys/${seg(keyId)}`, passkey);
2228
2234
  }
2229
2235
  /**
2230
2236
  * Create an API key for an agent or server, approved with the account's