@calimero-network/mero-js 29.8.1 → 29.10.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 +103 -3
- package/dist/cloud-v2/client.js +29 -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 +29 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +29 -1
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2502,6 +2502,29 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2502
2502
|
async signOutEverywhere() {
|
|
2503
2503
|
await this.signingOut("auth/logout-all");
|
|
2504
2504
|
}
|
|
2505
|
+
/**
|
|
2506
|
+
* The signed-in account's live sessions, latest active first (at most 256,
|
|
2507
|
+
* `GET /auth/sessions`); `current` marks this one. The account holder's own
|
|
2508
|
+
* session on the cluster's origin only: an API key or a package-bound
|
|
2509
|
+
* session is refused (`403`). A node before core #4894 has no such route
|
|
2510
|
+
* ({@link NotFound}).
|
|
2511
|
+
*/
|
|
2512
|
+
async listSessions() {
|
|
2513
|
+
const { sessions } = await this.get("auth/sessions");
|
|
2514
|
+
return sessions;
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* End one of the signed-in account's sessions (`DELETE
|
|
2518
|
+
* /auth/sessions/{session}`), say a lost phone's, from another; no passkey
|
|
2519
|
+
* is asked. A session the account does not hold live (ended already, or
|
|
2520
|
+
* another account's) is {@link NotFound}; gated as {@link listSessions}.
|
|
2521
|
+
* To end this client's own session ({@link AccountSession.current}) use
|
|
2522
|
+
* {@link signOut}, which also drops its tokens: ended here, they stay
|
|
2523
|
+
* held and the next request or refresh is {@link LoginRequired}.
|
|
2524
|
+
*/
|
|
2525
|
+
async revokeSession(session) {
|
|
2526
|
+
await this.delete(`auth/sessions/${seg(session)}`);
|
|
2527
|
+
}
|
|
2505
2528
|
async signingOut(path) {
|
|
2506
2529
|
try {
|
|
2507
2530
|
await this.post(path);
|
|
@@ -2761,7 +2784,10 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2761
2784
|
}
|
|
2762
2785
|
/**
|
|
2763
2786
|
* Hand the app to another account (an organization's app only to one of its
|
|
2764
|
-
* members)
|
|
2787
|
+
* members), approved with `passkey`. The app's owner may; for an
|
|
2788
|
+
* organization's app, its owner only while a member of the organization
|
|
2789
|
+
* (`member` or above), and the organization's admins (`admin`, `owner`)
|
|
2790
|
+
* too, so an organization can hand on an app whose owner left (core #4893).
|
|
2765
2791
|
*/
|
|
2766
2792
|
async transferApp(app, to, passkey) {
|
|
2767
2793
|
await this.postConfirmed(`apps/${seg(app)}/transfer`, { to }, passkey);
|
|
@@ -3304,6 +3330,8 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
3304
3330
|
* Give apps their own access lists in one step (owner or admin): find or
|
|
3305
3331
|
* make each package's app team, add everyone who reaches its instances now,
|
|
3306
3332
|
* and move those instances onto it; with `shared`, close every app team.
|
|
3333
|
+
* A package's own `join` opens or closes its team alone, a close keeping
|
|
3334
|
+
* everyone who reaches it or only the leads and `keep`.
|
|
3307
3335
|
* Idempotent per package. Approved with the caller's `passkey`
|
|
3308
3336
|
* (`__scope_apps { apps, shared }`); a refusal is `400 REJECTED` with the
|
|
3309
3337
|
* node's reason. For a fresh standalone install pass
|