@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/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 +22 -3
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
|
-
/**
|
|
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.
|
|
2005
|
-
|
|
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
|
-
|
|
2113
|
-
|
|
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
|