@canopy-io/node 0.3.11 → 0.3.12

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.js CHANGED
@@ -607,6 +607,41 @@ var Identities = class {
607
607
  `/api/v1/identities/${encodeURIComponent(id)}/permissions`
608
608
  );
609
609
  }
610
+ /**
611
+ * Every session the identity holds that is neither revoked nor expired,
612
+ * newest first: when and where it was signed in, when it expires, and the
613
+ * organization it is acting in. Read it back after a revoke to confirm,
614
+ * from your own side, that a sign-out took.
615
+ */
616
+ sessions(id) {
617
+ return this.client.request(
618
+ "GET",
619
+ `/api/v1/identities/${encodeURIComponent(id)}/sessions`
620
+ );
621
+ }
622
+ /**
623
+ * Ends one session and leaves the identity's others signed in. `sessionId`
624
+ * is the session's `id` from `sessions`: its current refresh token, which
625
+ * changes on every refresh, so read it shortly before revoking.
626
+ */
627
+ revokeSession(id, sessionId) {
628
+ return this.client.request(
629
+ "DELETE",
630
+ `/api/v1/identities/${encodeURIComponent(id)}/sessions/${encodeURIComponent(sessionId)}`
631
+ );
632
+ }
633
+ /**
634
+ * Ends every session the identity holds, so the next refresh on any device
635
+ * fails and the person signs in again. Access tokens already issued keep
636
+ * working until their short lifetime runs out. For a suspected compromise;
637
+ * `deactivate` also refuses the next sign-in.
638
+ */
639
+ revokeSessions(id) {
640
+ return this.client.request(
641
+ "POST",
642
+ `/api/v1/identities/${encodeURIComponent(id)}/sessions/revoke`
643
+ );
644
+ }
610
645
  };
611
646
 
612
647
  // src/schema.ts