@calimero-network/mero-js 29.8.1 → 29.9.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/README.md +1 -1
- package/dist/cloud-v2/client.d.ts +82 -2
- package/dist/cloud-v2/client.js +27 -1
- package/dist/cloud-v2/index.d.ts +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +27 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +27 -1
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2369,6 +2369,29 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2369
2369
|
async signOutEverywhere() {
|
|
2370
2370
|
await this.signingOut("auth/logout-all");
|
|
2371
2371
|
}
|
|
2372
|
+
/**
|
|
2373
|
+
* The signed-in account's live sessions, latest active first (at most 256,
|
|
2374
|
+
* `GET /auth/sessions`); `current` marks this one. The account holder's own
|
|
2375
|
+
* session on the cluster's origin only: an API key or a package-bound
|
|
2376
|
+
* session is refused (`403`). A node before core #4894 has no such route
|
|
2377
|
+
* ({@link NotFound}).
|
|
2378
|
+
*/
|
|
2379
|
+
async listSessions() {
|
|
2380
|
+
const { sessions } = await this.get("auth/sessions");
|
|
2381
|
+
return sessions;
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* End one of the signed-in account's sessions (`DELETE
|
|
2385
|
+
* /auth/sessions/{session}`), say a lost phone's, from another; no passkey
|
|
2386
|
+
* is asked. A session the account does not hold live (ended already, or
|
|
2387
|
+
* another account's) is {@link NotFound}; gated as {@link listSessions}.
|
|
2388
|
+
* To end this client's own session ({@link AccountSession.current}) use
|
|
2389
|
+
* {@link signOut}, which also drops its tokens: ended here, they stay
|
|
2390
|
+
* held and the next request or refresh is {@link LoginRequired}.
|
|
2391
|
+
*/
|
|
2392
|
+
async revokeSession(session) {
|
|
2393
|
+
await this.delete(`auth/sessions/${seg(session)}`);
|
|
2394
|
+
}
|
|
2372
2395
|
async signingOut(path) {
|
|
2373
2396
|
try {
|
|
2374
2397
|
await this.post(path);
|
|
@@ -2628,7 +2651,10 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2628
2651
|
}
|
|
2629
2652
|
/**
|
|
2630
2653
|
* Hand the app to another account (an organization's app only to one of its
|
|
2631
|
-
* members)
|
|
2654
|
+
* members), approved with `passkey`. The app's owner may; for an
|
|
2655
|
+
* organization's app, its owner only while a member of the organization
|
|
2656
|
+
* (`member` or above), and the organization's admins (`admin`, `owner`)
|
|
2657
|
+
* too, so an organization can hand on an app whose owner left (core #4893).
|
|
2632
2658
|
*/
|
|
2633
2659
|
async transferApp(app, to, passkey) {
|
|
2634
2660
|
await this.postConfirmed(`apps/${seg(app)}/transfer`, { to }, passkey);
|