@canopy-io/node 0.3.7 → 0.3.8

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.d.ts CHANGED
@@ -1371,6 +1371,26 @@ interface paths {
1371
1371
  patch: operations["ApiOrganizationsController_changeMemberRole"];
1372
1372
  trace?: never;
1373
1373
  };
1374
+ "/api/v1/organizations/{id}/members/{identityId}/mfa/reset": {
1375
+ parameters: {
1376
+ query?: never;
1377
+ header?: never;
1378
+ path?: never;
1379
+ cookie?: never;
1380
+ };
1381
+ get?: never;
1382
+ put?: never;
1383
+ /**
1384
+ * Reset a member's multi-factor authentication
1385
+ * @description The organization's own administrator, or the developer, clears a member's multi-factor enrolment: every factor, the recovery codes and the trusted devices, so the person enrols afresh at their next sign-in. For a member who lost their authenticator. Sessions already open are left alone. Audited as `identity.mfa.admin.forced_reset`. Returns `404` when the identity is not a member. Responds `204 No Content`; requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1386
+ */
1387
+ post: operations["ApiOrganizationsController_resetMemberMfa"];
1388
+ delete?: never;
1389
+ options?: never;
1390
+ head?: never;
1391
+ patch?: never;
1392
+ trace?: never;
1393
+ };
1374
1394
  "/api/v1/organizations/{id}/invites": {
1375
1395
  parameters: {
1376
1396
  query?: never;
@@ -1450,7 +1470,7 @@ interface paths {
1450
1470
  put?: never;
1451
1471
  /**
1452
1472
  * Set up an organization's SSO connection
1453
- * @description Creates an `end_user` SSO connection at the Account, links it to the organization's Environment, and binds it to the organization with `default_role_id` as the membership role, in one call. The connection starts `configuring` and belongs to this organization: no other organization may bind it. Returns `409` (`organization.sso_connection_already_configured`) when the organization already has one. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1473
+ * @description Creates an `end_user` SSO connection at the Account, links it to the organization's Environment, and binds it to the organization, with `default_role_id` as the membership role when given, in one call. Without one the binding waits for an arrival role, which activation requires; the arrival-roles route lists the choices and which to preselect. The connection starts `configuring` and belongs to this organization: no other organization may bind it. Returns `409` (`organization.sso_connection_already_configured`) when the organization already has one. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1454
1474
  */
1455
1475
  post: operations["ApiOrganizationSsoConnectionController_create"];
1456
1476
  /**
@@ -1478,7 +1498,7 @@ interface paths {
1478
1498
  put?: never;
1479
1499
  /**
1480
1500
  * Activate an organization's SSO connection
1481
- * @description Promotes the connection from `configuring` to `active`. The protocol's required fields must be present and the organization must hold at least one verified domain (`400` otherwise). Refused on a developer-managed connection. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1501
+ * @description Promotes the connection from `configuring` to `active`. The protocol's required fields must be present, the binding must carry an arrival role, and the organization must hold at least one verified domain (`400` otherwise). When the organization's own administrator activates (an identity token), the connection's last test sign-in must also have passed since its provider settings last changed; the developer's API key and Console are not held to that, since they cannot run a person's sign-in. Refused on a developer-managed connection. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1482
1502
  */
1483
1503
  post: operations["ApiOrganizationSsoConnectionController_activate"];
1484
1504
  delete?: never;
@@ -1547,6 +1567,26 @@ interface paths {
1547
1567
  patch?: never;
1548
1568
  trace?: never;
1549
1569
  };
1570
+ "/api/v1/organizations/{id}/sso-connection/arrival-roles": {
1571
+ parameters: {
1572
+ query?: never;
1573
+ header?: never;
1574
+ path?: never;
1575
+ cookie?: never;
1576
+ };
1577
+ /**
1578
+ * List the roles the organization's SSO sign-ins may arrive with
1579
+ * @description The roles a sign-in through the organization's connection may join with, for choosing its `default_role_id`. When the developer has set the organization's directory grantable roles, the list is those roles and `is_default` marks the arrival role among them; otherwise the Environment's identity-provider arrival roles (`idp_arrival_roles` in its auth settings), which every organization without a list of its own inherits; with neither, the Environment's active custom roles with nothing marked. `administers_organization` marks a role carrying `canopy:organization.manage`: everyone arriving with it administers the organization. An organization administrator (identity token) may only bind a role from this list; the developer's key is not bound by it. Requires `hierarchy.view` or `canopy:organization.manage` at the organization. The response is an unpaginated `{ items }` array.
1580
+ */
1581
+ get: operations["ApiOrganizationSsoConnectionController_arrivalRoles"];
1582
+ put?: never;
1583
+ post?: never;
1584
+ delete?: never;
1585
+ options?: never;
1586
+ head?: never;
1587
+ patch?: never;
1588
+ trace?: never;
1589
+ };
1550
1590
  "/api/v1/organizations/{id}/sso-connection/service-provider": {
1551
1591
  parameters: {
1552
1592
  query?: never;
@@ -3005,8 +3045,8 @@ interface components {
3005
3045
  sso_connection_id: string;
3006
3046
  sso_connection: components["schemas"]["OrganizationSsoConnectionSummaryDto"];
3007
3047
  /** @description The membership role a login through this connection receives when it joins the organization. */
3008
- default_role_id: string;
3009
- default_role: components["schemas"]["OrganizationSsoRoleSummaryDto"];
3048
+ default_role_id?: string | null;
3049
+ default_role?: components["schemas"]["OrganizationSsoRoleSummaryDto"] | null;
3010
3050
  /** Format: date-time */
3011
3051
  created_at: string;
3012
3052
  };
@@ -3096,6 +3136,18 @@ interface components {
3096
3136
  /** @description Number of distinct identities assigned this role. Populated on list responses; omitted on single-role responses where the join isn't computed. */
3097
3137
  member_count?: number;
3098
3138
  };
3139
+ SsoConnectionTestSummaryDto: {
3140
+ test_id: string;
3141
+ /** @enum {string} */
3142
+ outcome: "success" | "failed";
3143
+ /** @description Why a failed test failed, in the sign-in vocabulary. `email_domain_not_allowed` means the provider accepted the sign-in and the domain check refused it. */
3144
+ reason?: string | null;
3145
+ email?: string | null;
3146
+ /** @enum {string|null} */
3147
+ domain_outcome?: "accepted" | "no_boundary" | "unbound" | "not_listed" | "not_verified" | "unknown" | null;
3148
+ /** Format: date-time */
3149
+ completed_at: string;
3150
+ };
3099
3151
  SsoConnectionResponseDto: {
3100
3152
  id: string;
3101
3153
  account_id: string;
@@ -3106,6 +3158,10 @@ interface components {
3106
3158
  name: string;
3107
3159
  /** @enum {string} */
3108
3160
  status: "configuring" | "active" | "disabled" | "failed";
3161
+ /** @description The HTTPS address the identity provider's SAML metadata was last imported from. `null` when the metadata was pasted as a document or never imported. */
3162
+ saml_metadata_url?: string | null;
3163
+ /** @description The last test sign-in run against the connection. Cleared when its provider settings change, since a test no longer proves them. */
3164
+ last_test_sign_in?: components["schemas"]["SsoConnectionTestSummaryDto"] | null;
3109
3165
  saml_entity_id?: string | null;
3110
3166
  saml_sso_url?: string | null;
3111
3167
  saml_slo_url?: string | null;
@@ -3161,7 +3217,8 @@ interface components {
3161
3217
  };
3162
3218
  OrganizationSsoConnectionDetailResponseDto: {
3163
3219
  connection: components["schemas"]["SsoConnectionResponseDto"];
3164
- default_role: components["schemas"]["OrganizationSsoConnectionRoleDto"];
3220
+ /** @description The membership role a sign-in joins with. `null` until chosen; activation requires one. */
3221
+ default_role?: components["schemas"]["OrganizationSsoConnectionRoleDto"] | null;
3165
3222
  /** @description True when the organization set the connection up itself; false when the developer manages it from the Console, in which case its configuration, activation, and removal are refused here. */
3166
3223
  owned_by_organization: boolean;
3167
3224
  service_provider: components["schemas"]["ServiceProviderDetailsResponseDto"];
@@ -3192,8 +3249,8 @@ interface components {
3192
3249
  [key: string]: unknown;
3193
3250
  };
3194
3251
  jit_provisioning_enabled?: boolean;
3195
- /** @description The Environment role a person joins the organization with when they first sign in through this connection. */
3196
- default_role_id: string;
3252
+ /** @description The Environment role a person joins the organization with when they first sign in through this connection. May be left for later; activation requires it. The arrival-roles route lists what may be chosen. */
3253
+ default_role_id?: string;
3197
3254
  };
3198
3255
  UpdateOrganizationSsoConnectionDto: {
3199
3256
  /** @description Human label, e.g. "Acme Corp Okta". */
@@ -3237,6 +3294,15 @@ interface components {
3237
3294
  /** Format: date-time */
3238
3295
  occurred_at: string;
3239
3296
  };
3297
+ OrganizationSsoArrivalRoleDto: {
3298
+ id: string;
3299
+ name: string;
3300
+ description?: string | null;
3301
+ /** @description The role carries `canopy:organization.manage`: everyone arriving with it administers the organization. */
3302
+ administers_organization: boolean;
3303
+ /** @description The role to preselect: the directory list's arrival role, or the default of the Environment's identity-provider arrival roles. At most one entry. */
3304
+ is_default: boolean;
3305
+ };
3240
3306
  OrganizationGrantableRoleDto: {
3241
3307
  id: string;
3242
3308
  name: string;
@@ -3252,6 +3318,11 @@ interface components {
3252
3318
  /** Format: date-time */
3253
3319
  created_at?: string | null;
3254
3320
  grantable_roles: components["schemas"]["OrganizationGrantableRoleDto"][];
3321
+ /**
3322
+ * @description Whose list `grantable_roles` is: the organization's own, the Environment's default that it inherits, or none, in which case directory sync is closed for it.
3323
+ * @enum {string}
3324
+ */
3325
+ grantable_roles_source: "organization" | "environment" | "none";
3255
3326
  };
3256
3327
  ScimTokenResponseDto: {
3257
3328
  id: string;
@@ -4511,9 +4582,9 @@ interface components {
4511
4582
  connection_id: string;
4512
4583
  /**
4513
4584
  * Format: uuid
4514
- * @description The role a just-in-time sign-in through it joins with.
4585
+ * @description The role a just-in-time sign-in through it joins with; null while the binding waits for one.
4515
4586
  */
4516
- default_role_id: string;
4587
+ default_role_id: string | null;
4517
4588
  /** @description The connection's name, on a new binding. */
4518
4589
  connection_name?: string;
4519
4590
  /**
@@ -10992,6 +11063,90 @@ interface operations {
10992
11063
  };
10993
11064
  };
10994
11065
  };
11066
+ ApiOrganizationsController_resetMemberMfa: {
11067
+ parameters: {
11068
+ query?: never;
11069
+ header?: never;
11070
+ path: {
11071
+ id: string;
11072
+ identityId: string;
11073
+ };
11074
+ cookie?: never;
11075
+ };
11076
+ requestBody?: never;
11077
+ responses: {
11078
+ /** @description Factors, recovery codes and trusted devices cleared; the member enrols again at their next sign-in */
11079
+ 204: {
11080
+ headers: {
11081
+ [name: string]: unknown;
11082
+ };
11083
+ content?: never;
11084
+ };
11085
+ /** @description Invalid or expired token */
11086
+ 401: {
11087
+ headers: {
11088
+ [name: string]: unknown;
11089
+ };
11090
+ content: {
11091
+ /**
11092
+ * @example {
11093
+ * "error": {
11094
+ * "statusCode": 401,
11095
+ * "code": null,
11096
+ * "message": "Invalid or expired token",
11097
+ * "timestamp": "2026-04-20T12:00:00.000Z",
11098
+ * "path": "/api/v1/organizations",
11099
+ * "method": "GET"
11100
+ * }
11101
+ * }
11102
+ */
11103
+ "application/json": components["schemas"]["ErrorResponseDto"];
11104
+ };
11105
+ };
11106
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
11107
+ 403: {
11108
+ headers: {
11109
+ [name: string]: unknown;
11110
+ };
11111
+ content: {
11112
+ /**
11113
+ * @example {
11114
+ * "error": {
11115
+ * "statusCode": 403,
11116
+ * "code": null,
11117
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
11118
+ * "timestamp": "2026-04-20T12:00:00.000Z",
11119
+ * "path": "/api/v1/organizations",
11120
+ * "method": "GET"
11121
+ * }
11122
+ * }
11123
+ */
11124
+ "application/json": components["schemas"]["ErrorResponseDto"];
11125
+ };
11126
+ };
11127
+ /** @description The identity is not a member of this organization */
11128
+ 404: {
11129
+ headers: {
11130
+ [name: string]: unknown;
11131
+ };
11132
+ content: {
11133
+ /**
11134
+ * @example {
11135
+ * "error": {
11136
+ * "statusCode": 404,
11137
+ * "code": null,
11138
+ * "message": "The identity is not a member of this organization",
11139
+ * "timestamp": "2026-04-20T12:00:00.000Z",
11140
+ * "path": "/api/v1/organizations/{id}/members/{identityId}/mfa/reset",
11141
+ * "method": "POST"
11142
+ * }
11143
+ * }
11144
+ */
11145
+ "application/json": components["schemas"]["ErrorResponseDto"];
11146
+ };
11147
+ };
11148
+ };
11149
+ };
10995
11150
  ApiOrganizationsController_listInvites: {
10996
11151
  parameters: {
10997
11152
  query?: {
@@ -11855,7 +12010,7 @@ interface operations {
11855
12010
  };
11856
12011
  };
11857
12012
  };
11858
- /** @description The connection is missing the fields its protocol needs, or the organization has no verified domain yet */
12013
+ /** @description The connection is missing the fields its protocol needs, the organization has no verified domain yet, no arrival role is chosen, or (for the organization's own administrator) no test sign-in has passed since the provider settings last changed */
11859
12014
  400: {
11860
12015
  headers: {
11861
12016
  [name: string]: unknown;
@@ -11866,7 +12021,7 @@ interface operations {
11866
12021
  * "error": {
11867
12022
  * "statusCode": 400,
11868
12023
  * "code": null,
11869
- * "message": "The connection is missing the fields its protocol needs, or the organization has no verified domain yet",
12024
+ * "message": "The connection is missing the fields its protocol needs, the organization has no verified domain yet, no arrival role is chosen, or (for the organization's own administrator) no test sign-in has passed since the provider settings last changed",
11870
12025
  * "timestamp": "2026-04-20T12:00:00.000Z",
11871
12026
  * "path": "/api/v1/organizations/{id}/sso-connection/activate",
11872
12027
  * "method": "POST"
@@ -12290,6 +12445,93 @@ interface operations {
12290
12445
  };
12291
12446
  };
12292
12447
  };
12448
+ ApiOrganizationSsoConnectionController_arrivalRoles: {
12449
+ parameters: {
12450
+ query?: never;
12451
+ header?: never;
12452
+ path: {
12453
+ id: string;
12454
+ };
12455
+ cookie?: never;
12456
+ };
12457
+ requestBody?: never;
12458
+ responses: {
12459
+ /** @description The roles this caller may choose as the arrival role, with the one to preselect */
12460
+ 200: {
12461
+ headers: {
12462
+ [name: string]: unknown;
12463
+ };
12464
+ content: {
12465
+ "application/json": {
12466
+ items: components["schemas"]["OrganizationSsoArrivalRoleDto"][];
12467
+ };
12468
+ };
12469
+ };
12470
+ /** @description Invalid or expired token */
12471
+ 401: {
12472
+ headers: {
12473
+ [name: string]: unknown;
12474
+ };
12475
+ content: {
12476
+ /**
12477
+ * @example {
12478
+ * "error": {
12479
+ * "statusCode": 401,
12480
+ * "code": null,
12481
+ * "message": "Invalid or expired token",
12482
+ * "timestamp": "2026-04-20T12:00:00.000Z",
12483
+ * "path": "/api/v1/organizations/{id}/sso-connection",
12484
+ * "method": "GET"
12485
+ * }
12486
+ * }
12487
+ */
12488
+ "application/json": components["schemas"]["ErrorResponseDto"];
12489
+ };
12490
+ };
12491
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
12492
+ 403: {
12493
+ headers: {
12494
+ [name: string]: unknown;
12495
+ };
12496
+ content: {
12497
+ /**
12498
+ * @example {
12499
+ * "error": {
12500
+ * "statusCode": 403,
12501
+ * "code": null,
12502
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
12503
+ * "timestamp": "2026-04-20T12:00:00.000Z",
12504
+ * "path": "/api/v1/organizations/{id}/sso-connection",
12505
+ * "method": "GET"
12506
+ * }
12507
+ * }
12508
+ */
12509
+ "application/json": components["schemas"]["ErrorResponseDto"];
12510
+ };
12511
+ };
12512
+ /** @description Organization not found */
12513
+ 404: {
12514
+ headers: {
12515
+ [name: string]: unknown;
12516
+ };
12517
+ content: {
12518
+ /**
12519
+ * @example {
12520
+ * "error": {
12521
+ * "statusCode": 404,
12522
+ * "code": null,
12523
+ * "message": "Organization not found",
12524
+ * "timestamp": "2026-04-20T12:00:00.000Z",
12525
+ * "path": "/api/v1/organizations/{id}/sso-connection/arrival-roles",
12526
+ * "method": "GET"
12527
+ * }
12528
+ * }
12529
+ */
12530
+ "application/json": components["schemas"]["ErrorResponseDto"];
12531
+ };
12532
+ };
12533
+ };
12534
+ };
12293
12535
  ApiOrganizationSsoConnectionController_serviceProvider: {
12294
12536
  parameters: {
12295
12537
  query?: never;
@@ -17119,6 +17361,13 @@ declare class Organizations {
17119
17361
  changeMemberRole(id: string, identityId: string, input: RequestBody<"ApiOrganizationsController_changeMemberRole">): Promise<ResponseBody<"ApiOrganizationsController_changeMemberRole">>;
17120
17362
  /** Revokes that organization's one role; the identity and its other memberships are untouched. */
17121
17363
  removeMember(id: string, identityId: string): Promise<void>;
17364
+ /**
17365
+ * Clears a member's second factor, for one who lost their authenticator:
17366
+ * their factors, recovery codes and remembered devices go, and they enrol
17367
+ * again at their next sign-in. Sessions already open are left alone. The
17368
+ * identity must be a member of the organization.
17369
+ */
17370
+ resetMemberMfa(id: string, identityId: string): Promise<void>;
17122
17371
  listInvites(id: string, query?: QueryParams<"ApiOrganizationsController_listInvites">): Paginator<OrganizationInviteItem>;
17123
17372
  createInvite(id: string, input: RequestBody<"ApiOrganizationsController_createInvite">): Promise<ResponseBody<"ApiOrganizationsController_createInvite">>;
17124
17373
  revokeInvite(id: string, inviteId: string): Promise<void>;
package/dist/index.js CHANGED
@@ -696,6 +696,18 @@ var Organizations = class {
696
696
  `/api/v1/organizations/${enc(id)}/members/${enc(identityId)}`
697
697
  );
698
698
  }
699
+ /**
700
+ * Clears a member's second factor, for one who lost their authenticator:
701
+ * their factors, recovery codes and remembered devices go, and they enrol
702
+ * again at their next sign-in. Sessions already open are left alone. The
703
+ * identity must be a member of the organization.
704
+ */
705
+ resetMemberMfa(id, identityId) {
706
+ return this.client.request(
707
+ "POST",
708
+ `/api/v1/organizations/${enc(id)}/members/${enc(identityId)}/mfa/reset`
709
+ );
710
+ }
699
711
  // ── Invitations: pending membership, carrying the role the recipient will hold ──
700
712
  listInvites(id, query = {}) {
701
713
  return paginate(