@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/cloud-v2/client.d.ts +7 -2
- package/dist/cloud-v2/client.js +9 -7
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +13 -7
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +2 -2
- package/package.json +20 -2
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
|
-
/**
|
|
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.
|
|
2119
|
-
|
|
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
|
-
|
|
2227
|
-
|
|
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
|