@canopy-io/node 0.23.2 → 0.23.3

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,11 @@
1
1
  # @canopy-io/node
2
2
 
3
+ ## 0.23.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 9f196bc: Follows Canopy's November 12 release. The generated types add `POST /api/v1/scim-tokens/{id}/rotate`, which replaces a directory token and keeps the old one working for seven days, and carry the fields and error codes earlier releases added. The agent skill teaches that allowed web origins are each Environment's own list: a browser app's site listed only on another Environment is refused with `403 auth.origin_not_allowed` on the Direct API, and a public client's token request with `403 access_denied` (`@canopy-io/browser` raises `CanopyAuthError` with that code). It also says a backend calling Canopy for its browser sends no `Origin` of its own, forwarding one only with the Environment's secret API key, and gives the passkey calls' `{ data }` answers in full. No caller changes are needed.
8
+
3
9
  ## 0.23.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.cts CHANGED
@@ -3851,13 +3851,13 @@ interface paths {
3851
3851
  };
3852
3852
  /**
3853
3853
  * List active SCIM tokens for the Environment
3854
- * @description Lists the active SCIM tokens for the current Environment, newest first, with secrets masked to a `token_preview` (revoked tokens are excluded). The response is an unpaginated `{ items }` array.
3854
+ * @description Lists the active SCIM tokens for the current Environment, newest first, with secrets masked to a `token_preview` and each one's `expires_at` (revoked and expired tokens are excluded). The response is an unpaginated `{ items }` array.
3855
3855
  */
3856
3856
  get: operations["ApiScimTokensController_list"];
3857
3857
  put?: never;
3858
3858
  /**
3859
3859
  * Mint a SCIM bearer token for the Environment
3860
- * @description Mints a new SCIM bearer token for the current Environment, returning the raw `token` exactly once alongside its `id`, `token_preview`, and the SCIM `base_url` the IdP admin pastes into Okta/Entra. The raw value is bcrypt-hashed for storage (with a SHA-256 lookup hash) and is never recoverable afterwards. Accepts an optional human `name` label and returns `201`.
3860
+ * @description Mints a new SCIM bearer token for the current Environment, returning the raw `token` exactly once alongside its `id`, `token_preview`, and the SCIM `base_url` the IdP admin pastes into Okta/Entra. The raw value is bcrypt-hashed for storage (with a SHA-256 lookup hash) and is never recoverable afterwards. Accepts an optional human `name` label and returns `201`. The token expires 365 days after minting (`expires_at`); once it has, the provider's requests are refused with `401`, so replace it before then.
3861
3861
  */
3862
3862
  post: operations["ApiScimTokensController_create"];
3863
3863
  delete?: never;
@@ -3886,6 +3886,26 @@ interface paths {
3886
3886
  patch?: never;
3887
3887
  trace?: never;
3888
3888
  };
3889
+ "/api/v1/scim-tokens/{id}/rotate": {
3890
+ parameters: {
3891
+ query?: never;
3892
+ header?: never;
3893
+ path?: never;
3894
+ cookie?: never;
3895
+ };
3896
+ get?: never;
3897
+ put?: never;
3898
+ /**
3899
+ * Replace a SCIM token without an outage
3900
+ * @description Mints a replacement for the SCIM token `id` in the current Environment and shortens the current token's life to 7 days rather than revoking it, so the identity provider can be moved to the new token before the old one stops working. Returns the replacement's raw `token` exactly once, with its `id`, `token_preview`, `expires_at` (365 days out) and the SCIM `base_url`. The replacement counts toward the directory's 10 live tokens, and so does the old token until its 7 days end.
3901
+ */
3902
+ post: operations["ApiScimTokensController_rotate"];
3903
+ delete?: never;
3904
+ options?: never;
3905
+ head?: never;
3906
+ patch?: never;
3907
+ trace?: never;
3908
+ };
3889
3909
  "/api/v1/scim-tokens/{id}": {
3890
3910
  parameters: {
3891
3911
  query?: never;
@@ -4187,7 +4207,7 @@ interface paths {
4187
4207
  };
4188
4208
  /**
4189
4209
  * List delivery attempts for a webhook
4190
- * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), scoped to the active Application's current Environment. Each delivery includes its `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to this Environment; requires the `webhook.view` permission.
4210
+ * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), scoped to the active Application's current Environment. Each delivery includes its `id` (sent as `X-Canopy-Webhook-Id`), `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to this Environment; requires the `webhook.view` permission.
4191
4211
  */
4192
4212
  get: operations["ApiWebhooksController_listDeliveries"];
4193
4213
  put?: never;
@@ -4571,7 +4591,7 @@ interface paths {
4571
4591
  };
4572
4592
  /**
4573
4593
  * List delivery attempts for a webhook
4574
- * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), in the Account. Each delivery includes its `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to the Account; requires the `account_webhook.view` scope.
4594
+ * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), in the Account. Each delivery includes its `id` (sent as `X-Canopy-Webhook-Id`), `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to the Account; requires the `account_webhook.view` scope.
4575
4595
  */
4576
4596
  get: operations["ApiAccountWebhooksController_listDeliveries"];
4577
4597
  put?: never;
@@ -4810,6 +4830,8 @@ interface components {
4810
4830
  is_active: boolean;
4811
4831
  /** @description Number of distinct identities assigned this role, across all nodes. */
4812
4832
  member_count: number;
4833
+ /** @description The name of the organization this role belongs to; null for an Environment role. */
4834
+ organization_name?: string | null;
4813
4835
  };
4814
4836
  PermissionUsageDto: {
4815
4837
  permission_id: string;
@@ -5871,7 +5893,7 @@ interface components {
5871
5893
  UpdateOrganizationPolicyDto: {
5872
5894
  /** @description Require MFA for this organization's members. `true` tightens an Environment that leaves MFA optional; `false` is only accepted where the Environment does not require MFA; `null` inherits. */
5873
5895
  mfa_required?: boolean | null;
5874
- /** @description Factors this organization's members may enroll and use. Must be a non-empty subset of the Environment's allowlist; `null` inherits. */
5896
+ /** @description Factors this organization's members may enroll and use. Must be a non-empty subset of the Environment's allowlist; `null` inherits. A member holding only a factor of a kind left out is treated on the way into this organization as holding none. */
5875
5897
  mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[] | null;
5876
5898
  /**
5877
5899
  * @description Whether an SSO login still owes an MFA challenge. `require` tightens an Environment that exempts SSO; `exempt` is only accepted where the Environment exempts; `null` inherits.
@@ -7259,6 +7281,8 @@ interface components {
7259
7281
  source_client_id: string;
7260
7282
  /** @description Freshly-minted client_id in the new env */
7261
7283
  client_id: string;
7284
+ /** @description The client's name, the same in the source and the target Environment */
7285
+ name: string;
7262
7286
  /** @description Raw client_secret — shown once, never returned again. Persist on receipt. Null for a public client, which has no secret; its entry still maps the source client_id to the new one. */
7263
7287
  client_secret: string | null;
7264
7288
  };
@@ -7296,7 +7320,7 @@ interface components {
7296
7320
  mfa_grace_period_days?: number;
7297
7321
  /** @description Number of days a 'remember this device' cookie remains valid. 0 disables the option entirely. Range 0..90. */
7298
7322
  mfa_trusted_device_days?: number;
7299
- /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. */
7323
+ /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. Dropping `totp` or `webauthn` keeps the factors people already enrolled of that kind, but they stop counting: they answer no sign-in challenge and prove no step-up, and a person left with no allowed factor is treated as holding none, so where MFA is required their next sign-in asks them to enrol an allowed one. A list of `email_otp` alone names nothing to enrol, so both kinds stay open under it and are offered at a challenge. */
7300
7324
  mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[];
7301
7325
  /**
7302
7326
  * @description What an SSO login owes the MFA gate. `require` (the default) challenges an SSO login like any other when MFA is required; `exempt` trusts the identity provider's own second factor and skips the challenge for logins that arrived through SSO.
@@ -7418,6 +7442,7 @@ interface components {
7418
7442
  organization_integrations_enabled: boolean;
7419
7443
  /** @description The roles an organization's administrators may give its integrations, by id. Empty when none are chosen. */
7420
7444
  organization_integration_role_ids: string[];
7445
+ /** @description The sites whose browsers may call this Environment, each a bare origin. A browser on any other site is refused. */
7421
7446
  allowed_web_origins?: string[];
7422
7447
  sso_return_urls?: string[];
7423
7448
  /** @description The roles a customer's identity provider may grant and the one arrivals get, inherited by every organization without a list of its own. `null` when unset, which keeps directory sync closed for those organizations. */
@@ -7440,7 +7465,7 @@ interface components {
7440
7465
  mfa_grace_period_days?: number;
7441
7466
  /** @description Number of days a 'remember this device' cookie remains valid. 0 disables the option entirely. Range 0..90. */
7442
7467
  mfa_trusted_device_days?: number;
7443
- /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. */
7468
+ /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. Dropping `totp` or `webauthn` keeps the factors people already enrolled of that kind, but they stop counting: they answer no sign-in challenge and prove no step-up, and a person left with no allowed factor is treated as holding none, so where MFA is required their next sign-in asks them to enrol an allowed one. A list of `email_otp` alone names nothing to enrol, so both kinds stay open under it and are offered at a challenge. */
7444
7469
  mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[];
7445
7470
  /**
7446
7471
  * @description What an SSO login owes the MFA gate. `require` (the default) challenges an SSO login like any other when MFA is required; `exempt` trusts the identity provider's own second factor and skips the challenge for logins that arrived through SSO.
@@ -7500,7 +7525,7 @@ interface components {
7500
7525
  organization_integrations_enabled?: boolean;
7501
7526
  /** @description The roles an organization's administrators may give its integrations, by id: active roles of this Environment, shared by every organization (not one organization's own), carrying neither `canopy:organization.manage` nor `canopy:access.manage`; anything else is refused with `400 environment.integration_role_invalid`. Separate from `idp_arrival_roles`. Replaces the list. While `organization_integrations_enabled` is on the list cannot be empty (`400 environment.integrations_roles_required`). Removing a role leaves integrations already holding it unchanged; a deleted role leaves the list. */
7502
7527
  organization_integration_role_ids?: string[];
7503
- /** @description Browser Origins allowed to call this Environment's public identity-auth API cross-origin (CORS), e.g. `https://app.example.com`. Needed to use the Direct API from a browser SPA. While the list is set, self-service sign-up refuses a browser `Origin` that is not on it; a request with no `Origin`, as from a backend, is not affected. Persisted under `env.settings.allowed_web_origins`. */
7528
+ /** @description The sites whose browsers may call this Environment, each a bare origin such as `https://app.example.com`. A browser on a site that is not listed is refused with `403` (`auth.origin_not_allowed`) wherever its request names this Environment, and an empty list admits no other site. The origin in `auth_links_base_url` and the Environment's active custom auth domain are admitted without being listed. A request with no `Origin`, as from a backend or a mobile app, is not affected. Persisted under `env.settings.allowed_web_origins`. */
7504
7529
  allowed_web_origins?: string[];
7505
7530
  /** @description Allowlist of return URLs for publishable-key (Direct-API) SSO. After the IdP round-trip, `/v1/identity/auth/sso/*` redirects back to one of these with a single-use `sso_token`; an unregistered return URL is rejected (exact match — no open redirect). Persisted under `env.settings.sso_return_urls`. */
7506
7531
  sso_return_urls?: string[];
@@ -8053,6 +8078,7 @@ interface components {
8053
8078
  secret: string;
8054
8079
  };
8055
8080
  CreateWebhookDto: {
8081
+ /** @description Where Canopy POSTs each signed event. An https address on a public host, with no credentials or fragment: Canopy's servers call it directly, so loopback, private-range and link-local addresses are refused (`webhook.url_refused`). While developing, expose your local receiver through a tunnel and register the tunnel's https address. */
8056
8082
  url: string;
8057
8083
  event_types: string[];
8058
8084
  description?: string;
@@ -8106,6 +8132,7 @@ interface components {
8106
8132
  created_at: string;
8107
8133
  };
8108
8134
  UpdateWebhookDto: {
8135
+ /** @description Where Canopy POSTs each signed event. An https address on a public host, with no credentials or fragment: Canopy's servers call it directly, so loopback, private-range and link-local addresses are refused (`webhook.url_refused`). While developing, expose your local receiver through a tunnel and register the tunnel's https address. */
8109
8136
  url?: string;
8110
8137
  event_types?: string[];
8111
8138
  description?: string | null;
@@ -28734,7 +28761,7 @@ interface operations {
28734
28761
  "application/json": components["schemas"]["ErrorResponseDto"];
28735
28762
  };
28736
28763
  };
28737
- /** @description The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment */
28764
+ /** @description The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment */
28738
28765
  403: {
28739
28766
  headers: {
28740
28767
  [name: string]: unknown;
@@ -28745,7 +28772,7 @@ interface operations {
28745
28772
  * "error": {
28746
28773
  * "statusCode": 403,
28747
28774
  * "code": "auth.forbidden",
28748
- * "message": "The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment",
28775
+ * "message": "The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment",
28749
28776
  * "timestamp": "2026-04-20T12:00:00.000Z",
28750
28777
  * "path": "/api/v1/access-previews/{previewId}/people",
28751
28778
  * "method": "GET"
@@ -28864,7 +28891,7 @@ interface operations {
28864
28891
  "application/json": components["schemas"]["ErrorResponseDto"];
28865
28892
  };
28866
28893
  };
28867
- /** @description The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment */
28894
+ /** @description The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment */
28868
28895
  403: {
28869
28896
  headers: {
28870
28897
  [name: string]: unknown;
@@ -28875,7 +28902,7 @@ interface operations {
28875
28902
  * "error": {
28876
28903
  * "statusCode": 403,
28877
28904
  * "code": "auth.forbidden",
28878
- * "message": "The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment",
28905
+ * "message": "The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment",
28879
28906
  * "timestamp": "2026-04-20T12:00:00.000Z",
28880
28907
  * "path": "/api/v1/access-previews/{previewId}/people",
28881
28908
  * "method": "GET"
@@ -38029,6 +38056,142 @@ interface operations {
38029
38056
  };
38030
38057
  };
38031
38058
  };
38059
+ ApiScimTokensController_rotate: {
38060
+ parameters: {
38061
+ query?: never;
38062
+ header?: {
38063
+ /** @description The id of the Environment this request acts in. Required with an account API key, which belongs to the Account and names its Environment per request; an Environment key may send it only to name its own Environment. A missing header for an account key answers `400` (`api_key.environment_required`), one naming no Environment of the key's Account `400` (`api_key.environment_not_found`), and one naming another Environment than an Environment key's own `400` (`api_key.environment_mismatch`). */
38064
+ "X-Canopy-Environment"?: string;
38065
+ };
38066
+ path: {
38067
+ id: string;
38068
+ };
38069
+ cookie?: never;
38070
+ };
38071
+ requestBody: {
38072
+ content: {
38073
+ "application/json": components["schemas"]["CreateScimTokenDto"];
38074
+ };
38075
+ };
38076
+ responses: {
38077
+ /** @description Replacement token created — the raw value is shown only once, with the base URL. The token it replaces keeps working for 7 days */
38078
+ 201: {
38079
+ headers: {
38080
+ [name: string]: unknown;
38081
+ };
38082
+ content: {
38083
+ "application/json": {
38084
+ data: components["schemas"]["ScimTokenCreatedResponseDto"];
38085
+ };
38086
+ };
38087
+ };
38088
+ /** @description The request failed validation: a body field, a query parameter or an id in the path is missing, malformed or out of range; or the request sent both an `X-API-Key` and an `Authorization` header, or its `X-Canopy-Environment` header is missing for an account key, names no Environment of the key's Account, or names another Environment than an Environment key's own */
38089
+ 400: {
38090
+ headers: {
38091
+ [name: string]: unknown;
38092
+ };
38093
+ content: {
38094
+ /**
38095
+ * @example {
38096
+ * "error": {
38097
+ * "statusCode": 400,
38098
+ * "code": "request.validation_failed",
38099
+ * "message": "The request failed validation: a body field, a query parameter or an id in the path is missing, malformed or out of range; or the request sent both an `X-API-Key` and an `Authorization` header, or its `X-Canopy-Environment` header is missing for an account key, names no Environment of the key's Account, or names another Environment than an Environment key's own",
38100
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38101
+ * "path": "/api/v1/scim-tokens/{id}/rotate",
38102
+ * "method": "POST"
38103
+ * }
38104
+ * }
38105
+ */
38106
+ "application/json": components["schemas"]["ErrorResponseDto"];
38107
+ };
38108
+ };
38109
+ /** @description Invalid or expired token */
38110
+ 401: {
38111
+ headers: {
38112
+ [name: string]: unknown;
38113
+ };
38114
+ content: {
38115
+ /**
38116
+ * @example {
38117
+ * "error": {
38118
+ * "statusCode": 401,
38119
+ * "code": "auth.invalid_token",
38120
+ * "message": "Invalid or expired token",
38121
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38122
+ * "path": "/api/v1/scim-tokens",
38123
+ * "method": "GET"
38124
+ * }
38125
+ * }
38126
+ */
38127
+ "application/json": components["schemas"]["ErrorResponseDto"];
38128
+ };
38129
+ };
38130
+ /** @description The caller lacks the permission this operation checks: an account API key without that `sso` scope, an Environment API key (`sso.*` is an account scope, which no Environment key holds), or an administrator without the Account capability that covers it; or the Account's plan does not include SCIM (`plan_feature_unavailable`) */
38131
+ 403: {
38132
+ headers: {
38133
+ [name: string]: unknown;
38134
+ };
38135
+ content: {
38136
+ /**
38137
+ * @example {
38138
+ * "error": {
38139
+ * "statusCode": 403,
38140
+ * "code": "auth.forbidden",
38141
+ * "message": "The caller lacks the permission this operation checks: an account API key without that `sso` scope, an Environment API key (`sso.*` is an account scope, which no Environment key holds), or an administrator without the Account capability that covers it; or the Account's plan does not include SCIM (`plan_feature_unavailable`)",
38142
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38143
+ * "path": "/api/v1/scim-tokens",
38144
+ * "method": "GET"
38145
+ * }
38146
+ * }
38147
+ */
38148
+ "application/json": components["schemas"]["ErrorResponseDto"];
38149
+ };
38150
+ };
38151
+ /** @description The Environment's directory has no live SCIM token with that id (`scim.token_not_found`) */
38152
+ 404: {
38153
+ headers: {
38154
+ [name: string]: unknown;
38155
+ };
38156
+ content: {
38157
+ /**
38158
+ * @example {
38159
+ * "error": {
38160
+ * "statusCode": 404,
38161
+ * "code": "request.not_found",
38162
+ * "message": "The Environment's directory has no live SCIM token with that id (`scim.token_not_found`)",
38163
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38164
+ * "path": "/api/v1/scim-tokens/{id}/rotate",
38165
+ * "method": "POST"
38166
+ * }
38167
+ * }
38168
+ */
38169
+ "application/json": components["schemas"]["ErrorResponseDto"];
38170
+ };
38171
+ };
38172
+ /** @description The directory already holds 10 live tokens, the most it may (`scim.token_limit`, `data.limit` naming the limit); revoke one first. A rotation counts, since the old token stays live for its overlap */
38173
+ 409: {
38174
+ headers: {
38175
+ [name: string]: unknown;
38176
+ };
38177
+ content: {
38178
+ /**
38179
+ * @example {
38180
+ * "error": {
38181
+ * "statusCode": 409,
38182
+ * "code": "request.conflict",
38183
+ * "message": "The directory already holds 10 live tokens, the most it may (`scim.token_limit`, `data.limit` naming the limit); revoke one first. A rotation counts, since the old token stays live for its overlap",
38184
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38185
+ * "path": "/api/v1/scim-tokens/{id}/rotate",
38186
+ * "method": "POST"
38187
+ * }
38188
+ * }
38189
+ */
38190
+ "application/json": components["schemas"]["ErrorResponseDto"];
38191
+ };
38192
+ };
38193
+ };
38194
+ };
38032
38195
  ApiScimTokensController_revoke: {
38033
38196
  parameters: {
38034
38197
  query?: never;
package/dist/index.d.ts CHANGED
@@ -3851,13 +3851,13 @@ interface paths {
3851
3851
  };
3852
3852
  /**
3853
3853
  * List active SCIM tokens for the Environment
3854
- * @description Lists the active SCIM tokens for the current Environment, newest first, with secrets masked to a `token_preview` (revoked tokens are excluded). The response is an unpaginated `{ items }` array.
3854
+ * @description Lists the active SCIM tokens for the current Environment, newest first, with secrets masked to a `token_preview` and each one's `expires_at` (revoked and expired tokens are excluded). The response is an unpaginated `{ items }` array.
3855
3855
  */
3856
3856
  get: operations["ApiScimTokensController_list"];
3857
3857
  put?: never;
3858
3858
  /**
3859
3859
  * Mint a SCIM bearer token for the Environment
3860
- * @description Mints a new SCIM bearer token for the current Environment, returning the raw `token` exactly once alongside its `id`, `token_preview`, and the SCIM `base_url` the IdP admin pastes into Okta/Entra. The raw value is bcrypt-hashed for storage (with a SHA-256 lookup hash) and is never recoverable afterwards. Accepts an optional human `name` label and returns `201`.
3860
+ * @description Mints a new SCIM bearer token for the current Environment, returning the raw `token` exactly once alongside its `id`, `token_preview`, and the SCIM `base_url` the IdP admin pastes into Okta/Entra. The raw value is bcrypt-hashed for storage (with a SHA-256 lookup hash) and is never recoverable afterwards. Accepts an optional human `name` label and returns `201`. The token expires 365 days after minting (`expires_at`); once it has, the provider's requests are refused with `401`, so replace it before then.
3861
3861
  */
3862
3862
  post: operations["ApiScimTokensController_create"];
3863
3863
  delete?: never;
@@ -3886,6 +3886,26 @@ interface paths {
3886
3886
  patch?: never;
3887
3887
  trace?: never;
3888
3888
  };
3889
+ "/api/v1/scim-tokens/{id}/rotate": {
3890
+ parameters: {
3891
+ query?: never;
3892
+ header?: never;
3893
+ path?: never;
3894
+ cookie?: never;
3895
+ };
3896
+ get?: never;
3897
+ put?: never;
3898
+ /**
3899
+ * Replace a SCIM token without an outage
3900
+ * @description Mints a replacement for the SCIM token `id` in the current Environment and shortens the current token's life to 7 days rather than revoking it, so the identity provider can be moved to the new token before the old one stops working. Returns the replacement's raw `token` exactly once, with its `id`, `token_preview`, `expires_at` (365 days out) and the SCIM `base_url`. The replacement counts toward the directory's 10 live tokens, and so does the old token until its 7 days end.
3901
+ */
3902
+ post: operations["ApiScimTokensController_rotate"];
3903
+ delete?: never;
3904
+ options?: never;
3905
+ head?: never;
3906
+ patch?: never;
3907
+ trace?: never;
3908
+ };
3889
3909
  "/api/v1/scim-tokens/{id}": {
3890
3910
  parameters: {
3891
3911
  query?: never;
@@ -4187,7 +4207,7 @@ interface paths {
4187
4207
  };
4188
4208
  /**
4189
4209
  * List delivery attempts for a webhook
4190
- * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), scoped to the active Application's current Environment. Each delivery includes its `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to this Environment; requires the `webhook.view` permission.
4210
+ * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), scoped to the active Application's current Environment. Each delivery includes its `id` (sent as `X-Canopy-Webhook-Id`), `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to this Environment; requires the `webhook.view` permission.
4191
4211
  */
4192
4212
  get: operations["ApiWebhooksController_listDeliveries"];
4193
4213
  put?: never;
@@ -4571,7 +4591,7 @@ interface paths {
4571
4591
  };
4572
4592
  /**
4573
4593
  * List delivery attempts for a webhook
4574
- * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), in the Account. Each delivery includes its `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to the Account; requires the `account_webhook.view` scope.
4594
+ * @description Returns a paginated, newest-first history of delivery attempts for one webhook subscription (`id`), in the Account. Each delivery includes its `id` (sent as `X-Canopy-Webhook-Id`), `event_type`, `status`, `response_status`, `response_body`, `attempts` count, and `next_retry_at`. Returns `404` when the subscription does not belong to the Account; requires the `account_webhook.view` scope.
4575
4595
  */
4576
4596
  get: operations["ApiAccountWebhooksController_listDeliveries"];
4577
4597
  put?: never;
@@ -4810,6 +4830,8 @@ interface components {
4810
4830
  is_active: boolean;
4811
4831
  /** @description Number of distinct identities assigned this role, across all nodes. */
4812
4832
  member_count: number;
4833
+ /** @description The name of the organization this role belongs to; null for an Environment role. */
4834
+ organization_name?: string | null;
4813
4835
  };
4814
4836
  PermissionUsageDto: {
4815
4837
  permission_id: string;
@@ -5871,7 +5893,7 @@ interface components {
5871
5893
  UpdateOrganizationPolicyDto: {
5872
5894
  /** @description Require MFA for this organization's members. `true` tightens an Environment that leaves MFA optional; `false` is only accepted where the Environment does not require MFA; `null` inherits. */
5873
5895
  mfa_required?: boolean | null;
5874
- /** @description Factors this organization's members may enroll and use. Must be a non-empty subset of the Environment's allowlist; `null` inherits. */
5896
+ /** @description Factors this organization's members may enroll and use. Must be a non-empty subset of the Environment's allowlist; `null` inherits. A member holding only a factor of a kind left out is treated on the way into this organization as holding none. */
5875
5897
  mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[] | null;
5876
5898
  /**
5877
5899
  * @description Whether an SSO login still owes an MFA challenge. `require` tightens an Environment that exempts SSO; `exempt` is only accepted where the Environment exempts; `null` inherits.
@@ -7259,6 +7281,8 @@ interface components {
7259
7281
  source_client_id: string;
7260
7282
  /** @description Freshly-minted client_id in the new env */
7261
7283
  client_id: string;
7284
+ /** @description The client's name, the same in the source and the target Environment */
7285
+ name: string;
7262
7286
  /** @description Raw client_secret — shown once, never returned again. Persist on receipt. Null for a public client, which has no secret; its entry still maps the source client_id to the new one. */
7263
7287
  client_secret: string | null;
7264
7288
  };
@@ -7296,7 +7320,7 @@ interface components {
7296
7320
  mfa_grace_period_days?: number;
7297
7321
  /** @description Number of days a 'remember this device' cookie remains valid. 0 disables the option entirely. Range 0..90. */
7298
7322
  mfa_trusted_device_days?: number;
7299
- /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. */
7323
+ /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. Dropping `totp` or `webauthn` keeps the factors people already enrolled of that kind, but they stop counting: they answer no sign-in challenge and prove no step-up, and a person left with no allowed factor is treated as holding none, so where MFA is required their next sign-in asks them to enrol an allowed one. A list of `email_otp` alone names nothing to enrol, so both kinds stay open under it and are offered at a challenge. */
7300
7324
  mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[];
7301
7325
  /**
7302
7326
  * @description What an SSO login owes the MFA gate. `require` (the default) challenges an SSO login like any other when MFA is required; `exempt` trusts the identity provider's own second factor and skips the challenge for logins that arrived through SSO.
@@ -7418,6 +7442,7 @@ interface components {
7418
7442
  organization_integrations_enabled: boolean;
7419
7443
  /** @description The roles an organization's administrators may give its integrations, by id. Empty when none are chosen. */
7420
7444
  organization_integration_role_ids: string[];
7445
+ /** @description The sites whose browsers may call this Environment, each a bare origin. A browser on any other site is refused. */
7421
7446
  allowed_web_origins?: string[];
7422
7447
  sso_return_urls?: string[];
7423
7448
  /** @description The roles a customer's identity provider may grant and the one arrivals get, inherited by every organization without a list of its own. `null` when unset, which keeps directory sync closed for those organizations. */
@@ -7440,7 +7465,7 @@ interface components {
7440
7465
  mfa_grace_period_days?: number;
7441
7466
  /** @description Number of days a 'remember this device' cookie remains valid. 0 disables the option entirely. Range 0..90. */
7442
7467
  mfa_trusted_device_days?: number;
7443
- /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. */
7468
+ /** @description Factor types end users may use under this Environment. Customers wanting TOTP/WebAuthn only (e.g. healthcare) drop `email_otp` from the list. `recovery_code` is always offered and is not configurable here. Dropping `totp` or `webauthn` keeps the factors people already enrolled of that kind, but they stop counting: they answer no sign-in challenge and prove no step-up, and a person left with no allowed factor is treated as holding none, so where MFA is required their next sign-in asks them to enrol an allowed one. A list of `email_otp` alone names nothing to enrol, so both kinds stay open under it and are offered at a challenge. */
7444
7469
  mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[];
7445
7470
  /**
7446
7471
  * @description What an SSO login owes the MFA gate. `require` (the default) challenges an SSO login like any other when MFA is required; `exempt` trusts the identity provider's own second factor and skips the challenge for logins that arrived through SSO.
@@ -7500,7 +7525,7 @@ interface components {
7500
7525
  organization_integrations_enabled?: boolean;
7501
7526
  /** @description The roles an organization's administrators may give its integrations, by id: active roles of this Environment, shared by every organization (not one organization's own), carrying neither `canopy:organization.manage` nor `canopy:access.manage`; anything else is refused with `400 environment.integration_role_invalid`. Separate from `idp_arrival_roles`. Replaces the list. While `organization_integrations_enabled` is on the list cannot be empty (`400 environment.integrations_roles_required`). Removing a role leaves integrations already holding it unchanged; a deleted role leaves the list. */
7502
7527
  organization_integration_role_ids?: string[];
7503
- /** @description Browser Origins allowed to call this Environment's public identity-auth API cross-origin (CORS), e.g. `https://app.example.com`. Needed to use the Direct API from a browser SPA. While the list is set, self-service sign-up refuses a browser `Origin` that is not on it; a request with no `Origin`, as from a backend, is not affected. Persisted under `env.settings.allowed_web_origins`. */
7528
+ /** @description The sites whose browsers may call this Environment, each a bare origin such as `https://app.example.com`. A browser on a site that is not listed is refused with `403` (`auth.origin_not_allowed`) wherever its request names this Environment, and an empty list admits no other site. The origin in `auth_links_base_url` and the Environment's active custom auth domain are admitted without being listed. A request with no `Origin`, as from a backend or a mobile app, is not affected. Persisted under `env.settings.allowed_web_origins`. */
7504
7529
  allowed_web_origins?: string[];
7505
7530
  /** @description Allowlist of return URLs for publishable-key (Direct-API) SSO. After the IdP round-trip, `/v1/identity/auth/sso/*` redirects back to one of these with a single-use `sso_token`; an unregistered return URL is rejected (exact match — no open redirect). Persisted under `env.settings.sso_return_urls`. */
7506
7531
  sso_return_urls?: string[];
@@ -8053,6 +8078,7 @@ interface components {
8053
8078
  secret: string;
8054
8079
  };
8055
8080
  CreateWebhookDto: {
8081
+ /** @description Where Canopy POSTs each signed event. An https address on a public host, with no credentials or fragment: Canopy's servers call it directly, so loopback, private-range and link-local addresses are refused (`webhook.url_refused`). While developing, expose your local receiver through a tunnel and register the tunnel's https address. */
8056
8082
  url: string;
8057
8083
  event_types: string[];
8058
8084
  description?: string;
@@ -8106,6 +8132,7 @@ interface components {
8106
8132
  created_at: string;
8107
8133
  };
8108
8134
  UpdateWebhookDto: {
8135
+ /** @description Where Canopy POSTs each signed event. An https address on a public host, with no credentials or fragment: Canopy's servers call it directly, so loopback, private-range and link-local addresses are refused (`webhook.url_refused`). While developing, expose your local receiver through a tunnel and register the tunnel's https address. */
8109
8136
  url?: string;
8110
8137
  event_types?: string[];
8111
8138
  description?: string | null;
@@ -28734,7 +28761,7 @@ interface operations {
28734
28761
  "application/json": components["schemas"]["ErrorResponseDto"];
28735
28762
  };
28736
28763
  };
28737
- /** @description The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment */
28764
+ /** @description The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment */
28738
28765
  403: {
28739
28766
  headers: {
28740
28767
  [name: string]: unknown;
@@ -28745,7 +28772,7 @@ interface operations {
28745
28772
  * "error": {
28746
28773
  * "statusCode": 403,
28747
28774
  * "code": "auth.forbidden",
28748
- * "message": "The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment",
28775
+ * "message": "The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment",
28749
28776
  * "timestamp": "2026-04-20T12:00:00.000Z",
28750
28777
  * "path": "/api/v1/access-previews/{previewId}/people",
28751
28778
  * "method": "GET"
@@ -28864,7 +28891,7 @@ interface operations {
28864
28891
  "application/json": components["schemas"]["ErrorResponseDto"];
28865
28892
  };
28866
28893
  };
28867
- /** @description The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment */
28894
+ /** @description The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment */
28868
28895
  403: {
28869
28896
  headers: {
28870
28897
  [name: string]: unknown;
@@ -28875,7 +28902,7 @@ interface operations {
28875
28902
  * "error": {
28876
28903
  * "statusCode": 403,
28877
28904
  * "code": "auth.forbidden",
28878
- * "message": "The bearer token is not an admin or platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an admin without the Account capability that covers it, or, for a node-scoped check, a node outside this Environment",
28905
+ * "message": "The bearer token is not an administrator's, an organization administrator's or a platform token, or the caller lacks the permission this operation checks: a scoped API key without that scope, an administrator without the Account capability that covers it, an organization administrator who no longer holds the organization's key at the places the preview names, or, for a node-scoped check, a node outside this Environment",
28879
28906
  * "timestamp": "2026-04-20T12:00:00.000Z",
28880
28907
  * "path": "/api/v1/access-previews/{previewId}/people",
28881
28908
  * "method": "GET"
@@ -38029,6 +38056,142 @@ interface operations {
38029
38056
  };
38030
38057
  };
38031
38058
  };
38059
+ ApiScimTokensController_rotate: {
38060
+ parameters: {
38061
+ query?: never;
38062
+ header?: {
38063
+ /** @description The id of the Environment this request acts in. Required with an account API key, which belongs to the Account and names its Environment per request; an Environment key may send it only to name its own Environment. A missing header for an account key answers `400` (`api_key.environment_required`), one naming no Environment of the key's Account `400` (`api_key.environment_not_found`), and one naming another Environment than an Environment key's own `400` (`api_key.environment_mismatch`). */
38064
+ "X-Canopy-Environment"?: string;
38065
+ };
38066
+ path: {
38067
+ id: string;
38068
+ };
38069
+ cookie?: never;
38070
+ };
38071
+ requestBody: {
38072
+ content: {
38073
+ "application/json": components["schemas"]["CreateScimTokenDto"];
38074
+ };
38075
+ };
38076
+ responses: {
38077
+ /** @description Replacement token created — the raw value is shown only once, with the base URL. The token it replaces keeps working for 7 days */
38078
+ 201: {
38079
+ headers: {
38080
+ [name: string]: unknown;
38081
+ };
38082
+ content: {
38083
+ "application/json": {
38084
+ data: components["schemas"]["ScimTokenCreatedResponseDto"];
38085
+ };
38086
+ };
38087
+ };
38088
+ /** @description The request failed validation: a body field, a query parameter or an id in the path is missing, malformed or out of range; or the request sent both an `X-API-Key` and an `Authorization` header, or its `X-Canopy-Environment` header is missing for an account key, names no Environment of the key's Account, or names another Environment than an Environment key's own */
38089
+ 400: {
38090
+ headers: {
38091
+ [name: string]: unknown;
38092
+ };
38093
+ content: {
38094
+ /**
38095
+ * @example {
38096
+ * "error": {
38097
+ * "statusCode": 400,
38098
+ * "code": "request.validation_failed",
38099
+ * "message": "The request failed validation: a body field, a query parameter or an id in the path is missing, malformed or out of range; or the request sent both an `X-API-Key` and an `Authorization` header, or its `X-Canopy-Environment` header is missing for an account key, names no Environment of the key's Account, or names another Environment than an Environment key's own",
38100
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38101
+ * "path": "/api/v1/scim-tokens/{id}/rotate",
38102
+ * "method": "POST"
38103
+ * }
38104
+ * }
38105
+ */
38106
+ "application/json": components["schemas"]["ErrorResponseDto"];
38107
+ };
38108
+ };
38109
+ /** @description Invalid or expired token */
38110
+ 401: {
38111
+ headers: {
38112
+ [name: string]: unknown;
38113
+ };
38114
+ content: {
38115
+ /**
38116
+ * @example {
38117
+ * "error": {
38118
+ * "statusCode": 401,
38119
+ * "code": "auth.invalid_token",
38120
+ * "message": "Invalid or expired token",
38121
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38122
+ * "path": "/api/v1/scim-tokens",
38123
+ * "method": "GET"
38124
+ * }
38125
+ * }
38126
+ */
38127
+ "application/json": components["schemas"]["ErrorResponseDto"];
38128
+ };
38129
+ };
38130
+ /** @description The caller lacks the permission this operation checks: an account API key without that `sso` scope, an Environment API key (`sso.*` is an account scope, which no Environment key holds), or an administrator without the Account capability that covers it; or the Account's plan does not include SCIM (`plan_feature_unavailable`) */
38131
+ 403: {
38132
+ headers: {
38133
+ [name: string]: unknown;
38134
+ };
38135
+ content: {
38136
+ /**
38137
+ * @example {
38138
+ * "error": {
38139
+ * "statusCode": 403,
38140
+ * "code": "auth.forbidden",
38141
+ * "message": "The caller lacks the permission this operation checks: an account API key without that `sso` scope, an Environment API key (`sso.*` is an account scope, which no Environment key holds), or an administrator without the Account capability that covers it; or the Account's plan does not include SCIM (`plan_feature_unavailable`)",
38142
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38143
+ * "path": "/api/v1/scim-tokens",
38144
+ * "method": "GET"
38145
+ * }
38146
+ * }
38147
+ */
38148
+ "application/json": components["schemas"]["ErrorResponseDto"];
38149
+ };
38150
+ };
38151
+ /** @description The Environment's directory has no live SCIM token with that id (`scim.token_not_found`) */
38152
+ 404: {
38153
+ headers: {
38154
+ [name: string]: unknown;
38155
+ };
38156
+ content: {
38157
+ /**
38158
+ * @example {
38159
+ * "error": {
38160
+ * "statusCode": 404,
38161
+ * "code": "request.not_found",
38162
+ * "message": "The Environment's directory has no live SCIM token with that id (`scim.token_not_found`)",
38163
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38164
+ * "path": "/api/v1/scim-tokens/{id}/rotate",
38165
+ * "method": "POST"
38166
+ * }
38167
+ * }
38168
+ */
38169
+ "application/json": components["schemas"]["ErrorResponseDto"];
38170
+ };
38171
+ };
38172
+ /** @description The directory already holds 10 live tokens, the most it may (`scim.token_limit`, `data.limit` naming the limit); revoke one first. A rotation counts, since the old token stays live for its overlap */
38173
+ 409: {
38174
+ headers: {
38175
+ [name: string]: unknown;
38176
+ };
38177
+ content: {
38178
+ /**
38179
+ * @example {
38180
+ * "error": {
38181
+ * "statusCode": 409,
38182
+ * "code": "request.conflict",
38183
+ * "message": "The directory already holds 10 live tokens, the most it may (`scim.token_limit`, `data.limit` naming the limit); revoke one first. A rotation counts, since the old token stays live for its overlap",
38184
+ * "timestamp": "2026-04-20T12:00:00.000Z",
38185
+ * "path": "/api/v1/scim-tokens/{id}/rotate",
38186
+ * "method": "POST"
38187
+ * }
38188
+ * }
38189
+ */
38190
+ "application/json": components["schemas"]["ErrorResponseDto"];
38191
+ };
38192
+ };
38193
+ };
38194
+ };
38032
38195
  ApiScimTokensController_revoke: {
38033
38196
  parameters: {
38034
38197
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopy-io/node",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "Official TypeScript SDK for Canopy \u2014 hierarchical identity and access management.",
5
5
  "license": "MIT",
6
6
  "author": "Canopy Identity Inc.",