@canopy-io/node 0.3.10 → 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 +14 -0
- package/README.md +6 -1
- package/dist/index.cjs +35 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +282 -1
- package/dist/index.d.ts +282 -1
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -619,6 +619,46 @@ interface paths {
|
|
|
619
619
|
patch?: never;
|
|
620
620
|
trace?: never;
|
|
621
621
|
};
|
|
622
|
+
"/api/v1/identities/{id}/sessions": {
|
|
623
|
+
parameters: {
|
|
624
|
+
query?: never;
|
|
625
|
+
header?: never;
|
|
626
|
+
path?: never;
|
|
627
|
+
cookie?: never;
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* List an identity's active sessions (admin)
|
|
631
|
+
* @description Lists an identity's active sessions (server-to-server admin): the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. Each row is a session's current refresh token, so `id` changes on every refresh. Returns `404` when the identity has no membership in this Environment.
|
|
632
|
+
*/
|
|
633
|
+
get: operations["ApiIdentitiesController_listIdentitySessions"];
|
|
634
|
+
put?: never;
|
|
635
|
+
post?: never;
|
|
636
|
+
delete?: never;
|
|
637
|
+
options?: never;
|
|
638
|
+
head?: never;
|
|
639
|
+
patch?: never;
|
|
640
|
+
trace?: never;
|
|
641
|
+
};
|
|
642
|
+
"/api/v1/identities/{id}/sessions/{sessionId}": {
|
|
643
|
+
parameters: {
|
|
644
|
+
query?: never;
|
|
645
|
+
header?: never;
|
|
646
|
+
path?: never;
|
|
647
|
+
cookie?: never;
|
|
648
|
+
};
|
|
649
|
+
get?: never;
|
|
650
|
+
put?: never;
|
|
651
|
+
post?: never;
|
|
652
|
+
/**
|
|
653
|
+
* Revoke one of an identity's sessions (admin)
|
|
654
|
+
* @description Revokes one of an identity's sessions (server-to-server admin) by marking its refresh token revoked, so the next refresh from that device returns `401` while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's or is already revoked.
|
|
655
|
+
*/
|
|
656
|
+
delete: operations["ApiIdentitiesController_revokeIdentitySession"];
|
|
657
|
+
options?: never;
|
|
658
|
+
head?: never;
|
|
659
|
+
patch?: never;
|
|
660
|
+
trace?: never;
|
|
661
|
+
};
|
|
622
662
|
"/api/v1/identities/{id}/sessions/revoke": {
|
|
623
663
|
parameters: {
|
|
624
664
|
query?: never;
|
|
@@ -2561,6 +2601,20 @@ interface components {
|
|
|
2561
2601
|
/** @description New password. 8-64 characters. No composition rules — NIST SP 800-63B aligned. A HaveIBeenPwned breach check runs server-side. The effective policy is published on `GET /v1/identity/auth/config`, so a client can state the rules before submit rather than after. */
|
|
2562
2602
|
password: string;
|
|
2563
2603
|
};
|
|
2604
|
+
IdentitySessionResponseDto: {
|
|
2605
|
+
/** @description The session's current refresh token id: what `DELETE /identities/:id/sessions/:sessionId` takes. It changes on every refresh. */
|
|
2606
|
+
id: string;
|
|
2607
|
+
/** Format: date-time */
|
|
2608
|
+
created_at: string;
|
|
2609
|
+
/** Format: date-time */
|
|
2610
|
+
expires_at: string;
|
|
2611
|
+
/** @description The address the session was signed in from: the browser's for a hosted sign-in, or the one a trusted backend forwarded in `X-Canopy-Client-IP`. */
|
|
2612
|
+
ip_address?: string | null;
|
|
2613
|
+
/** @description The user agent the session was signed in from: the browser's for a hosted sign-in, or the one a trusted backend forwarded in `X-Canopy-Client-User-Agent`. */
|
|
2614
|
+
user_agent?: string | null;
|
|
2615
|
+
/** @description The organization the session is acting in, the source of its tokens' `org_id` claim. Null when the Environment's organizations container is off or the identity belongs to none. */
|
|
2616
|
+
active_org_node_id?: string | null;
|
|
2617
|
+
};
|
|
2564
2618
|
MfaFactorResponseDto: {
|
|
2565
2619
|
/** Format: uuid */
|
|
2566
2620
|
id: string;
|
|
@@ -2935,6 +2989,8 @@ interface components {
|
|
|
2935
2989
|
mfa_factor_allowlist: ("totp" | "webauthn" | "email_otp")[];
|
|
2936
2990
|
/** @enum {string} */
|
|
2937
2991
|
mfa_after_sso: "exempt" | "require";
|
|
2992
|
+
/** @description The sign-in methods on offer: on the Environment, the ones it has turned on; on the effective policy, those narrowed by the organization, and `["sso"]` alone while it requires SSO. */
|
|
2993
|
+
allowed_sign_in_methods: ("password" | "email_otp" | "sso")[];
|
|
2938
2994
|
require_sso: boolean;
|
|
2939
2995
|
};
|
|
2940
2996
|
OrganizationPolicyResponseDto: {
|
|
@@ -2944,6 +3000,8 @@ interface components {
|
|
|
2944
3000
|
mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[] | null;
|
|
2945
3001
|
/** @enum {string|null} */
|
|
2946
3002
|
mfa_after_sso?: "exempt" | "require" | null;
|
|
3003
|
+
/** @description The methods the organization keeps of the Environment's, or null to inherit them all. */
|
|
3004
|
+
allowed_sign_in_methods?: ("password" | "email_otp" | "sso")[] | null;
|
|
2947
3005
|
require_sso: boolean;
|
|
2948
3006
|
/** @description The Environment's own settings, the floor this organization's policy tightens from. */
|
|
2949
3007
|
environment: components["schemas"]["EffectiveOrganizationPolicyDto"];
|
|
@@ -2968,6 +3026,8 @@ interface components {
|
|
|
2968
3026
|
* @enum {string|null}
|
|
2969
3027
|
*/
|
|
2970
3028
|
mfa_after_sso?: "exempt" | "require" | null;
|
|
3029
|
+
/** @description The sign-in methods this organization's members may use. A non-empty subset of the methods the Environment offers (`password` unless the Environment turned it off, `email_otp` where the Environment turned it on, and `sso`); a method the Environment does not offer is refused with `organization.policy_loosens`. `null` inherits the Environment's. While `require_sso` is on, SSO is the only method whatever this says. */
|
|
3030
|
+
allowed_sign_in_methods?: ("password" | "email_otp" | "sso")[] | null;
|
|
2971
3031
|
/** @description Members must sign in through SSO. Password and email-code logins are refused for the organization's members and for any email whose domain routes to a connection bound to this organization. */
|
|
2972
3032
|
require_sso?: boolean;
|
|
2973
3033
|
};
|
|
@@ -3008,6 +3068,17 @@ interface components {
|
|
|
3008
3068
|
* @enum {string|null}
|
|
3009
3069
|
*/
|
|
3010
3070
|
domain_outcome: "accepted" | "no_boundary" | "unbound" | "not_listed" | "not_verified" | "unknown" | null;
|
|
3071
|
+
/** @description The required fields the provider's response did not satisfy (`email`, `federated_subject_id`); empty on a pass. */
|
|
3072
|
+
missing_fields: string[];
|
|
3073
|
+
/** @description The attribute names the response carried, sorted. Names only, never values. */
|
|
3074
|
+
received_attributes: string[];
|
|
3075
|
+
/** @description The SAML Name ID format's last segment (`unspecified`, `emailAddress`, `persistent`); null for OIDC or when none came. */
|
|
3076
|
+
name_id_format: string | null;
|
|
3077
|
+
/**
|
|
3078
|
+
* @description The one thing to change, when the test can name it: the provider's Name ID format should be the email address (`set_name_id_email`), an email attribute or scope has to be added (`add_email_attribute`), or a stable subject has to be sent (`send_name_id`). Null when the report of names is the guidance.
|
|
3079
|
+
* @enum {string|null}
|
|
3080
|
+
*/
|
|
3081
|
+
hint: "set_name_id_email" | "add_email_attribute" | "send_name_id" | null;
|
|
3011
3082
|
/** Format: date-time */
|
|
3012
3083
|
completed_at: string | null;
|
|
3013
3084
|
};
|
|
@@ -3727,6 +3798,11 @@ interface components {
|
|
|
3727
3798
|
is_active: boolean;
|
|
3728
3799
|
/** Format: date-time */
|
|
3729
3800
|
created_at: string;
|
|
3801
|
+
/**
|
|
3802
|
+
* Format: date-time
|
|
3803
|
+
* @description While a rotation window is open, when the secret the rotation replaced stops verifying; `null` once only the current secret signs.
|
|
3804
|
+
*/
|
|
3805
|
+
previous_secret_expires_at?: string | null;
|
|
3730
3806
|
/** @description HMAC secret — only shown once on creation */
|
|
3731
3807
|
secret: string;
|
|
3732
3808
|
};
|
|
@@ -3745,6 +3821,11 @@ interface components {
|
|
|
3745
3821
|
is_active: boolean;
|
|
3746
3822
|
/** Format: date-time */
|
|
3747
3823
|
created_at: string;
|
|
3824
|
+
/**
|
|
3825
|
+
* Format: date-time
|
|
3826
|
+
* @description While a rotation window is open, when the secret the rotation replaced stops verifying; `null` once only the current secret signs.
|
|
3827
|
+
*/
|
|
3828
|
+
previous_secret_expires_at?: string | null;
|
|
3748
3829
|
};
|
|
3749
3830
|
WebhookEventTypeDto: {
|
|
3750
3831
|
event_type: string;
|
|
@@ -4662,6 +4743,11 @@ interface components {
|
|
|
4662
4743
|
slug: string;
|
|
4663
4744
|
/** @description Your own identifier for the organization, when you set one. */
|
|
4664
4745
|
external_id: string | null;
|
|
4746
|
+
/**
|
|
4747
|
+
* @description How the organization came to be, when it was not created through the API: a self-signup on an Environment that creates one for every new identity.
|
|
4748
|
+
* @enum {string}
|
|
4749
|
+
*/
|
|
4750
|
+
source?: "self_signup";
|
|
4665
4751
|
};
|
|
4666
4752
|
};
|
|
4667
4753
|
};
|
|
@@ -4874,6 +4960,8 @@ interface components {
|
|
|
4874
4960
|
* @enum {string|null}
|
|
4875
4961
|
*/
|
|
4876
4962
|
mfa_after_sso: "exempt" | "require" | null;
|
|
4963
|
+
/** @description The sign-in methods members may use, or null to inherit the Environment's. */
|
|
4964
|
+
allowed_sign_in_methods: ("password" | "email_otp" | "sso")[] | null;
|
|
4877
4965
|
/** @description Whether members must sign in with SSO. */
|
|
4878
4966
|
require_sso: boolean;
|
|
4879
4967
|
};
|
|
@@ -6840,6 +6928,177 @@ interface operations {
|
|
|
6840
6928
|
};
|
|
6841
6929
|
};
|
|
6842
6930
|
};
|
|
6931
|
+
ApiIdentitiesController_listIdentitySessions: {
|
|
6932
|
+
parameters: {
|
|
6933
|
+
query?: never;
|
|
6934
|
+
header?: never;
|
|
6935
|
+
path: {
|
|
6936
|
+
id: string;
|
|
6937
|
+
};
|
|
6938
|
+
cookie?: never;
|
|
6939
|
+
};
|
|
6940
|
+
requestBody?: never;
|
|
6941
|
+
responses: {
|
|
6942
|
+
/** @description Every session the identity holds that is neither revoked nor expired, newest first: the session's current refresh token id (what the per-session revoke takes), when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in. */
|
|
6943
|
+
200: {
|
|
6944
|
+
headers: {
|
|
6945
|
+
[name: string]: unknown;
|
|
6946
|
+
};
|
|
6947
|
+
content: {
|
|
6948
|
+
"application/json": {
|
|
6949
|
+
items: components["schemas"]["IdentitySessionResponseDto"][];
|
|
6950
|
+
};
|
|
6951
|
+
};
|
|
6952
|
+
};
|
|
6953
|
+
/** @description Invalid or expired token */
|
|
6954
|
+
401: {
|
|
6955
|
+
headers: {
|
|
6956
|
+
[name: string]: unknown;
|
|
6957
|
+
};
|
|
6958
|
+
content: {
|
|
6959
|
+
/**
|
|
6960
|
+
* @example {
|
|
6961
|
+
* "error": {
|
|
6962
|
+
* "statusCode": 401,
|
|
6963
|
+
* "code": null,
|
|
6964
|
+
* "message": "Invalid or expired token",
|
|
6965
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
6966
|
+
* "path": "/api/v1/identities",
|
|
6967
|
+
* "method": "GET"
|
|
6968
|
+
* }
|
|
6969
|
+
* }
|
|
6970
|
+
*/
|
|
6971
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6972
|
+
};
|
|
6973
|
+
};
|
|
6974
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
6975
|
+
403: {
|
|
6976
|
+
headers: {
|
|
6977
|
+
[name: string]: unknown;
|
|
6978
|
+
};
|
|
6979
|
+
content: {
|
|
6980
|
+
/**
|
|
6981
|
+
* @example {
|
|
6982
|
+
* "error": {
|
|
6983
|
+
* "statusCode": 403,
|
|
6984
|
+
* "code": null,
|
|
6985
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
6986
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
6987
|
+
* "path": "/api/v1/identities",
|
|
6988
|
+
* "method": "GET"
|
|
6989
|
+
* }
|
|
6990
|
+
* }
|
|
6991
|
+
*/
|
|
6992
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6993
|
+
};
|
|
6994
|
+
};
|
|
6995
|
+
/** @description Identity not found */
|
|
6996
|
+
404: {
|
|
6997
|
+
headers: {
|
|
6998
|
+
[name: string]: unknown;
|
|
6999
|
+
};
|
|
7000
|
+
content: {
|
|
7001
|
+
/**
|
|
7002
|
+
* @example {
|
|
7003
|
+
* "error": {
|
|
7004
|
+
* "statusCode": 404,
|
|
7005
|
+
* "code": null,
|
|
7006
|
+
* "message": "Identity not found",
|
|
7007
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7008
|
+
* "path": "/api/v1/identities/{id}/sessions",
|
|
7009
|
+
* "method": "GET"
|
|
7010
|
+
* }
|
|
7011
|
+
* }
|
|
7012
|
+
*/
|
|
7013
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7014
|
+
};
|
|
7015
|
+
};
|
|
7016
|
+
};
|
|
7017
|
+
};
|
|
7018
|
+
ApiIdentitiesController_revokeIdentitySession: {
|
|
7019
|
+
parameters: {
|
|
7020
|
+
query?: never;
|
|
7021
|
+
header?: never;
|
|
7022
|
+
path: {
|
|
7023
|
+
id: string;
|
|
7024
|
+
sessionId: string;
|
|
7025
|
+
};
|
|
7026
|
+
cookie?: never;
|
|
7027
|
+
};
|
|
7028
|
+
requestBody?: never;
|
|
7029
|
+
responses: {
|
|
7030
|
+
/** @description The session's refresh token is revoked, so its next refresh returns 401 while the identity's other sessions carry on. In-flight access tokens keep working until their short TTL expires. */
|
|
7031
|
+
204: {
|
|
7032
|
+
headers: {
|
|
7033
|
+
[name: string]: unknown;
|
|
7034
|
+
};
|
|
7035
|
+
content?: never;
|
|
7036
|
+
};
|
|
7037
|
+
/** @description Invalid or expired token */
|
|
7038
|
+
401: {
|
|
7039
|
+
headers: {
|
|
7040
|
+
[name: string]: unknown;
|
|
7041
|
+
};
|
|
7042
|
+
content: {
|
|
7043
|
+
/**
|
|
7044
|
+
* @example {
|
|
7045
|
+
* "error": {
|
|
7046
|
+
* "statusCode": 401,
|
|
7047
|
+
* "code": null,
|
|
7048
|
+
* "message": "Invalid or expired token",
|
|
7049
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7050
|
+
* "path": "/api/v1/identities",
|
|
7051
|
+
* "method": "GET"
|
|
7052
|
+
* }
|
|
7053
|
+
* }
|
|
7054
|
+
*/
|
|
7055
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7056
|
+
};
|
|
7057
|
+
};
|
|
7058
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
7059
|
+
403: {
|
|
7060
|
+
headers: {
|
|
7061
|
+
[name: string]: unknown;
|
|
7062
|
+
};
|
|
7063
|
+
content: {
|
|
7064
|
+
/**
|
|
7065
|
+
* @example {
|
|
7066
|
+
* "error": {
|
|
7067
|
+
* "statusCode": 403,
|
|
7068
|
+
* "code": null,
|
|
7069
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
7070
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7071
|
+
* "path": "/api/v1/identities",
|
|
7072
|
+
* "method": "GET"
|
|
7073
|
+
* }
|
|
7074
|
+
* }
|
|
7075
|
+
*/
|
|
7076
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7077
|
+
};
|
|
7078
|
+
};
|
|
7079
|
+
/** @description The session does not belong to this identity, or is already revoked */
|
|
7080
|
+
404: {
|
|
7081
|
+
headers: {
|
|
7082
|
+
[name: string]: unknown;
|
|
7083
|
+
};
|
|
7084
|
+
content: {
|
|
7085
|
+
/**
|
|
7086
|
+
* @example {
|
|
7087
|
+
* "error": {
|
|
7088
|
+
* "statusCode": 404,
|
|
7089
|
+
* "code": null,
|
|
7090
|
+
* "message": "The session does not belong to this identity, or is already revoked",
|
|
7091
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7092
|
+
* "path": "/api/v1/identities/{id}/sessions/{sessionId}",
|
|
7093
|
+
* "method": "DELETE"
|
|
7094
|
+
* }
|
|
7095
|
+
* }
|
|
7096
|
+
*/
|
|
7097
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7098
|
+
};
|
|
7099
|
+
};
|
|
7100
|
+
};
|
|
7101
|
+
};
|
|
6843
7102
|
ApiIdentitiesController_revokeIdentitySessions: {
|
|
6844
7103
|
parameters: {
|
|
6845
7104
|
query?: never;
|
|
@@ -17637,8 +17896,30 @@ declare class Identities {
|
|
|
17637
17896
|
* someone can do.
|
|
17638
17897
|
*/
|
|
17639
17898
|
permissions(id: string): Promise<ResponseBody<"ApiIdentitiesController_getIdentityPermissions">>;
|
|
17899
|
+
/**
|
|
17900
|
+
* Every session the identity holds that is neither revoked nor expired,
|
|
17901
|
+
* newest first: when and where it was signed in, when it expires, and the
|
|
17902
|
+
* organization it is acting in. Read it back after a revoke to confirm,
|
|
17903
|
+
* from your own side, that a sign-out took.
|
|
17904
|
+
*/
|
|
17905
|
+
sessions(id: string): Promise<ResponseBody<"ApiIdentitiesController_listIdentitySessions">>;
|
|
17906
|
+
/**
|
|
17907
|
+
* Ends one session and leaves the identity's others signed in. `sessionId`
|
|
17908
|
+
* is the session's `id` from `sessions`: its current refresh token, which
|
|
17909
|
+
* changes on every refresh, so read it shortly before revoking.
|
|
17910
|
+
*/
|
|
17911
|
+
revokeSession(id: string, sessionId: string): Promise<void>;
|
|
17912
|
+
/**
|
|
17913
|
+
* Ends every session the identity holds, so the next refresh on any device
|
|
17914
|
+
* fails and the person signs in again. Access tokens already issued keep
|
|
17915
|
+
* working until their short lifetime runs out. For a suspected compromise;
|
|
17916
|
+
* `deactivate` also refuses the next sign-in.
|
|
17917
|
+
*/
|
|
17918
|
+
revokeSessions(id: string): Promise<void>;
|
|
17640
17919
|
}
|
|
17641
17920
|
type IdentityItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentities">>;
|
|
17921
|
+
/** One live session from an identity's sessions. */
|
|
17922
|
+
type IdentitySessionItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentitySessions">>;
|
|
17642
17923
|
/** One role grant from an identity's assignments collection. */
|
|
17643
17924
|
type IdentityAssignmentItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_getIdentityAssignments">>;
|
|
17644
17925
|
type ItemOf$3<T> = T extends {
|
|
@@ -18372,4 +18653,4 @@ type WebhookEventData<Name extends WebhookEventName> = WebhookEvent<Name>["data"
|
|
|
18372
18653
|
*/
|
|
18373
18654
|
declare function isWebhookEvent<Name extends WebhookEventName>(delivery: WebhookDelivery, name: Name): delivery is WebhookEvent<Name>;
|
|
18374
18655
|
|
|
18375
|
-
export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type WebhookDelivery, type WebhookEvent, type WebhookEventData, type WebhookEventName, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, isWebhookEvent, type operations, orgContext, paginate, type paths, withConcurrency };
|
|
18656
|
+
export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type IdentitySessionItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type WebhookDelivery, type WebhookEvent, type WebhookEventData, type WebhookEventName, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, isWebhookEvent, type operations, orgContext, paginate, type paths, withConcurrency };
|
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
|