@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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @canopy-io/node
2
2
 
3
+ ## 0.3.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 7acdc44: Read and revoke an identity's sessions from your backend. `identities.sessions(id)` lists every live session the identity holds, newest first, with when and where it was signed in, when it expires and the organization it acts in, so you can confirm a sign-out from your own side. `identities.revokeSession(id, sessionId)` ends one of them and leaves the rest signed in, and `identities.revokeSessions(id)` ends them all. `IdentitySessionItem` types one session.
8
+
9
+ The generated types also pick up what the API added alongside: an SSO test sign-in result names the `missing_fields`, the `received_attributes`, the SAML `name_id_format` and a `hint` at the fix; a webhook subscription reports `previous_secret_expires_at` while a rotated-out secret still verifies; and the `organization.created` event carries `source: "self_signup"` when the Environment created the organization for a person who registered. No existing caller shape changed. The API's public operation count moves from 136 to 138.
10
+
3
11
  ## 0.3.11
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -609,6 +609,41 @@ var Identities = class {
609
609
  `/api/v1/identities/${encodeURIComponent(id)}/permissions`
610
610
  );
611
611
  }
612
+ /**
613
+ * Every session the identity holds that is neither revoked nor expired,
614
+ * newest first: when and where it was signed in, when it expires, and the
615
+ * organization it is acting in. Read it back after a revoke to confirm,
616
+ * from your own side, that a sign-out took.
617
+ */
618
+ sessions(id) {
619
+ return this.client.request(
620
+ "GET",
621
+ `/api/v1/identities/${encodeURIComponent(id)}/sessions`
622
+ );
623
+ }
624
+ /**
625
+ * Ends one session and leaves the identity's others signed in. `sessionId`
626
+ * is the session's `id` from `sessions`: its current refresh token, which
627
+ * changes on every refresh, so read it shortly before revoking.
628
+ */
629
+ revokeSession(id, sessionId) {
630
+ return this.client.request(
631
+ "DELETE",
632
+ `/api/v1/identities/${encodeURIComponent(id)}/sessions/${encodeURIComponent(sessionId)}`
633
+ );
634
+ }
635
+ /**
636
+ * Ends every session the identity holds, so the next refresh on any device
637
+ * fails and the person signs in again. Access tokens already issued keep
638
+ * working until their short lifetime runs out. For a suspected compromise;
639
+ * `deactivate` also refuses the next sign-in.
640
+ */
641
+ revokeSessions(id) {
642
+ return this.client.request(
643
+ "POST",
644
+ `/api/v1/identities/${encodeURIComponent(id)}/sessions/revoke`
645
+ );
646
+ }
612
647
  };
613
648
 
614
649
  // src/schema.ts