@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/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). The owner approves with `passkey`.
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);
@@ -3171,6 +3197,8 @@ var CalimeroClient = class _CalimeroClient {
3171
3197
  * Give apps their own access lists in one step (owner or admin): find or
3172
3198
  * make each package's app team, add everyone who reaches its instances now,
3173
3199
  * and move those instances onto it; with `shared`, close every app team.
3200
+ * A package's own `join` opens or closes its team alone, a close keeping
3201
+ * everyone who reaches it or only the leads and `keep`.
3174
3202
  * Idempotent per package. Approved with the caller's `passkey`
3175
3203
  * (`__scope_apps { apps, shared }`); a refusal is `400 REJECTED` with the
3176
3204
  * node's reason. For a fresh standalone install pass