@canopy-io/node 0.3.4 → 0.3.5
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 +12 -0
- package/README.md +21 -2
- package/dist/index.cjs +121 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +310 -2
- package/dist/index.d.ts +310 -2
- package/dist/index.js +121 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1679,6 +1679,30 @@ interface paths {
|
|
|
1679
1679
|
patch?: never;
|
|
1680
1680
|
trace?: never;
|
|
1681
1681
|
};
|
|
1682
|
+
"/api/v1/organizations/{id}/directory/grantable-roles": {
|
|
1683
|
+
parameters: {
|
|
1684
|
+
query?: never;
|
|
1685
|
+
header?: never;
|
|
1686
|
+
path?: never;
|
|
1687
|
+
cookie?: never;
|
|
1688
|
+
};
|
|
1689
|
+
/**
|
|
1690
|
+
* List the roles an organization's directory may grant
|
|
1691
|
+
* @description What this organization's identity provider is allowed to hand out, and which role arriving people hold.
|
|
1692
|
+
*/
|
|
1693
|
+
get: operations["ApiOrganizationDirectoryController_listGrantableRoles"];
|
|
1694
|
+
/**
|
|
1695
|
+
* Replace the roles an organization's directory may grant
|
|
1696
|
+
* @description Replaces the whole list in one act. Withdrawing a role unmaps the groups that name it and releases the grants those mappings produced. An empty list disables directory sync for the organization.
|
|
1697
|
+
*/
|
|
1698
|
+
put: operations["ApiOrganizationDirectoryController_setGrantableRoles"];
|
|
1699
|
+
post?: never;
|
|
1700
|
+
delete?: never;
|
|
1701
|
+
options?: never;
|
|
1702
|
+
head?: never;
|
|
1703
|
+
patch?: never;
|
|
1704
|
+
trace?: never;
|
|
1705
|
+
};
|
|
1682
1706
|
"/api/v1/organizations/{id}/directory/groups": {
|
|
1683
1707
|
parameters: {
|
|
1684
1708
|
query?: never;
|
|
@@ -3223,7 +3247,7 @@ interface components {
|
|
|
3223
3247
|
OrganizationDirectoryResponseDto: {
|
|
3224
3248
|
/** @description The directory's id, or null when none has been created. */
|
|
3225
3249
|
id?: string | null;
|
|
3226
|
-
/** @description The SCIM 2.0 base URL to paste into the identity provider's connector, or null when no directory exists. */
|
|
3250
|
+
/** @description The full SCIM 2.0 base URL (the instance's public origin and the directory's path) to paste into the identity provider's connector, or null when no directory exists. */
|
|
3227
3251
|
base_url?: string | null;
|
|
3228
3252
|
/** Format: date-time */
|
|
3229
3253
|
created_at?: string | null;
|
|
@@ -3251,7 +3275,7 @@ interface components {
|
|
|
3251
3275
|
/** @description Plaintext SCIM token — shown only once */
|
|
3252
3276
|
token: string;
|
|
3253
3277
|
token_preview: string;
|
|
3254
|
-
/** @description The directory's SCIM 2.0 base URL, to paste into the identity provider's connector. */
|
|
3278
|
+
/** @description The directory's full SCIM 2.0 base URL (the instance's public origin and the directory's path), to paste into the identity provider's connector. */
|
|
3255
3279
|
base_url: string;
|
|
3256
3280
|
/**
|
|
3257
3281
|
* Format: date-time
|
|
@@ -3284,6 +3308,19 @@ interface components {
|
|
|
3284
3308
|
/** Format: date-time */
|
|
3285
3309
|
created_at: string;
|
|
3286
3310
|
};
|
|
3311
|
+
DirectoryGrantableRoleResponseDto: {
|
|
3312
|
+
id: string;
|
|
3313
|
+
name: string;
|
|
3314
|
+
description?: string | null;
|
|
3315
|
+
/** @description The role an arriving person holds when no mapped group says otherwise. */
|
|
3316
|
+
is_default: boolean;
|
|
3317
|
+
};
|
|
3318
|
+
SetDirectoryGrantableRolesDto: {
|
|
3319
|
+
/** @description The roles this organization's directory may grant. An empty list disables directory sync for the organization. */
|
|
3320
|
+
role_ids: string[];
|
|
3321
|
+
/** @description The role somebody arrives with when no mapped group says otherwise. Required unless the list is empty, and must be one of `role_ids`. */
|
|
3322
|
+
default_role_id?: string | null;
|
|
3323
|
+
};
|
|
3287
3324
|
ScimGroupResponseDto: {
|
|
3288
3325
|
id: string;
|
|
3289
3326
|
external_id?: string | null;
|
|
@@ -12299,6 +12336,226 @@ interface operations {
|
|
|
12299
12336
|
};
|
|
12300
12337
|
};
|
|
12301
12338
|
};
|
|
12339
|
+
ApiOrganizationDirectoryController_listGrantableRoles: {
|
|
12340
|
+
parameters: {
|
|
12341
|
+
query?: never;
|
|
12342
|
+
header?: never;
|
|
12343
|
+
path: {
|
|
12344
|
+
id: string;
|
|
12345
|
+
};
|
|
12346
|
+
cookie?: never;
|
|
12347
|
+
};
|
|
12348
|
+
requestBody?: never;
|
|
12349
|
+
responses: {
|
|
12350
|
+
/** @description Grantable roles returned */
|
|
12351
|
+
200: {
|
|
12352
|
+
headers: {
|
|
12353
|
+
[name: string]: unknown;
|
|
12354
|
+
};
|
|
12355
|
+
content: {
|
|
12356
|
+
"application/json": {
|
|
12357
|
+
items: components["schemas"]["DirectoryGrantableRoleResponseDto"][];
|
|
12358
|
+
};
|
|
12359
|
+
};
|
|
12360
|
+
};
|
|
12361
|
+
/** @description Invalid or expired token */
|
|
12362
|
+
401: {
|
|
12363
|
+
headers: {
|
|
12364
|
+
[name: string]: unknown;
|
|
12365
|
+
};
|
|
12366
|
+
content: {
|
|
12367
|
+
/**
|
|
12368
|
+
* @example {
|
|
12369
|
+
* "error": {
|
|
12370
|
+
* "statusCode": 401,
|
|
12371
|
+
* "code": null,
|
|
12372
|
+
* "message": "Invalid or expired token",
|
|
12373
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12374
|
+
* "path": "/api/v1/organizations/{id}/directory",
|
|
12375
|
+
* "method": "GET"
|
|
12376
|
+
* }
|
|
12377
|
+
* }
|
|
12378
|
+
*/
|
|
12379
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12380
|
+
};
|
|
12381
|
+
};
|
|
12382
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
12383
|
+
403: {
|
|
12384
|
+
headers: {
|
|
12385
|
+
[name: string]: unknown;
|
|
12386
|
+
};
|
|
12387
|
+
content: {
|
|
12388
|
+
/**
|
|
12389
|
+
* @example {
|
|
12390
|
+
* "error": {
|
|
12391
|
+
* "statusCode": 403,
|
|
12392
|
+
* "code": null,
|
|
12393
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
12394
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12395
|
+
* "path": "/api/v1/organizations/{id}/directory",
|
|
12396
|
+
* "method": "GET"
|
|
12397
|
+
* }
|
|
12398
|
+
* }
|
|
12399
|
+
*/
|
|
12400
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12401
|
+
};
|
|
12402
|
+
};
|
|
12403
|
+
/** @description Organization not found */
|
|
12404
|
+
404: {
|
|
12405
|
+
headers: {
|
|
12406
|
+
[name: string]: unknown;
|
|
12407
|
+
};
|
|
12408
|
+
content: {
|
|
12409
|
+
/**
|
|
12410
|
+
* @example {
|
|
12411
|
+
* "error": {
|
|
12412
|
+
* "statusCode": 404,
|
|
12413
|
+
* "code": null,
|
|
12414
|
+
* "message": "Organization not found",
|
|
12415
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12416
|
+
* "path": "/api/v1/organizations/{id}/directory/grantable-roles",
|
|
12417
|
+
* "method": "GET"
|
|
12418
|
+
* }
|
|
12419
|
+
* }
|
|
12420
|
+
*/
|
|
12421
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12422
|
+
};
|
|
12423
|
+
};
|
|
12424
|
+
};
|
|
12425
|
+
};
|
|
12426
|
+
ApiOrganizationDirectoryController_setGrantableRoles: {
|
|
12427
|
+
parameters: {
|
|
12428
|
+
query?: never;
|
|
12429
|
+
header?: never;
|
|
12430
|
+
path: {
|
|
12431
|
+
id: string;
|
|
12432
|
+
};
|
|
12433
|
+
cookie?: never;
|
|
12434
|
+
};
|
|
12435
|
+
requestBody: {
|
|
12436
|
+
content: {
|
|
12437
|
+
"application/json": components["schemas"]["SetDirectoryGrantableRolesDto"];
|
|
12438
|
+
};
|
|
12439
|
+
};
|
|
12440
|
+
responses: {
|
|
12441
|
+
/** @description Grantable roles replaced */
|
|
12442
|
+
200: {
|
|
12443
|
+
headers: {
|
|
12444
|
+
[name: string]: unknown;
|
|
12445
|
+
};
|
|
12446
|
+
content: {
|
|
12447
|
+
"application/json": {
|
|
12448
|
+
items: components["schemas"]["DirectoryGrantableRoleResponseDto"][];
|
|
12449
|
+
};
|
|
12450
|
+
};
|
|
12451
|
+
};
|
|
12452
|
+
/** @description The list names a role that does not exist here, a system role, or no role for arriving people to hold */
|
|
12453
|
+
400: {
|
|
12454
|
+
headers: {
|
|
12455
|
+
[name: string]: unknown;
|
|
12456
|
+
};
|
|
12457
|
+
content: {
|
|
12458
|
+
/**
|
|
12459
|
+
* @example {
|
|
12460
|
+
* "error": {
|
|
12461
|
+
* "statusCode": 400,
|
|
12462
|
+
* "code": null,
|
|
12463
|
+
* "message": "The list names a role that does not exist here, a system role, or no role for arriving people to hold",
|
|
12464
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12465
|
+
* "path": "/api/v1/organizations/{id}/directory/grantable-roles",
|
|
12466
|
+
* "method": "PUT"
|
|
12467
|
+
* }
|
|
12468
|
+
* }
|
|
12469
|
+
*/
|
|
12470
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12471
|
+
};
|
|
12472
|
+
};
|
|
12473
|
+
/** @description Invalid or expired token */
|
|
12474
|
+
401: {
|
|
12475
|
+
headers: {
|
|
12476
|
+
[name: string]: unknown;
|
|
12477
|
+
};
|
|
12478
|
+
content: {
|
|
12479
|
+
/**
|
|
12480
|
+
* @example {
|
|
12481
|
+
* "error": {
|
|
12482
|
+
* "statusCode": 401,
|
|
12483
|
+
* "code": null,
|
|
12484
|
+
* "message": "Invalid or expired token",
|
|
12485
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12486
|
+
* "path": "/api/v1/organizations/{id}/directory",
|
|
12487
|
+
* "method": "GET"
|
|
12488
|
+
* }
|
|
12489
|
+
* }
|
|
12490
|
+
*/
|
|
12491
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12492
|
+
};
|
|
12493
|
+
};
|
|
12494
|
+
/** @description Only the application owner may change this list. An organization's own administrator can read it, not change it. */
|
|
12495
|
+
403: {
|
|
12496
|
+
headers: {
|
|
12497
|
+
[name: string]: unknown;
|
|
12498
|
+
};
|
|
12499
|
+
content: {
|
|
12500
|
+
/**
|
|
12501
|
+
* @example {
|
|
12502
|
+
* "error": {
|
|
12503
|
+
* "statusCode": 403,
|
|
12504
|
+
* "code": null,
|
|
12505
|
+
* "message": "Only the application owner may change this list. An organization's own administrator can read it, not change it.",
|
|
12506
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12507
|
+
* "path": "/api/v1/organizations/{id}/directory/grantable-roles",
|
|
12508
|
+
* "method": "PUT"
|
|
12509
|
+
* }
|
|
12510
|
+
* }
|
|
12511
|
+
*/
|
|
12512
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12513
|
+
};
|
|
12514
|
+
};
|
|
12515
|
+
/** @description Organization not found */
|
|
12516
|
+
404: {
|
|
12517
|
+
headers: {
|
|
12518
|
+
[name: string]: unknown;
|
|
12519
|
+
};
|
|
12520
|
+
content: {
|
|
12521
|
+
/**
|
|
12522
|
+
* @example {
|
|
12523
|
+
* "error": {
|
|
12524
|
+
* "statusCode": 404,
|
|
12525
|
+
* "code": null,
|
|
12526
|
+
* "message": "Organization not found",
|
|
12527
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12528
|
+
* "path": "/api/v1/organizations/{id}/directory/grantable-roles",
|
|
12529
|
+
* "method": "PUT"
|
|
12530
|
+
* }
|
|
12531
|
+
* }
|
|
12532
|
+
*/
|
|
12533
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12534
|
+
};
|
|
12535
|
+
};
|
|
12536
|
+
/** @description The list cannot be emptied while the organization's directory is connected; remove the directory first */
|
|
12537
|
+
409: {
|
|
12538
|
+
headers: {
|
|
12539
|
+
[name: string]: unknown;
|
|
12540
|
+
};
|
|
12541
|
+
content: {
|
|
12542
|
+
/**
|
|
12543
|
+
* @example {
|
|
12544
|
+
* "error": {
|
|
12545
|
+
* "statusCode": 409,
|
|
12546
|
+
* "code": null,
|
|
12547
|
+
* "message": "The list cannot be emptied while the organization's directory is connected; remove the directory first",
|
|
12548
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
12549
|
+
* "path": "/api/v1/organizations/{id}/directory/grantable-roles",
|
|
12550
|
+
* "method": "PUT"
|
|
12551
|
+
* }
|
|
12552
|
+
* }
|
|
12553
|
+
*/
|
|
12554
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
12555
|
+
};
|
|
12556
|
+
};
|
|
12557
|
+
};
|
|
12558
|
+
};
|
|
12302
12559
|
ApiOrganizationDirectoryGroupsController_list: {
|
|
12303
12560
|
parameters: {
|
|
12304
12561
|
query?: never;
|
|
@@ -16105,6 +16362,57 @@ declare class Organizations {
|
|
|
16105
16362
|
*/
|
|
16106
16363
|
bindSsoConnection(id: string, input: RequestBody<"ApiOrganizationsController_bindSsoConnection">): Promise<ResponseBody<"ApiOrganizationsController_bindSsoConnection">>;
|
|
16107
16364
|
unbindSsoConnection(id: string, connectionId: string): Promise<void>;
|
|
16365
|
+
/**
|
|
16366
|
+
* The roles this organization's identity provider may grant, and the one
|
|
16367
|
+
* people arrive with. An empty list means directory sync is not open for
|
|
16368
|
+
* the organization.
|
|
16369
|
+
*/
|
|
16370
|
+
listDirectoryGrantableRoles(id: string): Promise<ResponseBody<"ApiOrganizationDirectoryController_listGrantableRoles">>;
|
|
16371
|
+
/**
|
|
16372
|
+
* Replace the list in one act, which is how directory sync is opened for
|
|
16373
|
+
* an organization. Exactly one role is `default_role_id`, the one people
|
|
16374
|
+
* arrive with. Withdrawing a role unmaps the groups naming it and keeps
|
|
16375
|
+
* their members in the organization; an empty list is refused while a
|
|
16376
|
+
* directory is connected. Your API key only: an organization admin's
|
|
16377
|
+
* token can read the list but is refused changing it.
|
|
16378
|
+
*/
|
|
16379
|
+
setDirectoryGrantableRoles(id: string, input: RequestBody<"ApiOrganizationDirectoryController_setGrantableRoles">): Promise<ResponseBody<"ApiOrganizationDirectoryController_setGrantableRoles">>;
|
|
16380
|
+
/**
|
|
16381
|
+
* The organization's directory, its full SCIM base URL, and the roles it
|
|
16382
|
+
* may grant. `id` is null until a directory is connected.
|
|
16383
|
+
*/
|
|
16384
|
+
getDirectory(id: string): Promise<ResponseBody<"ApiOrganizationDirectoryController_get">>;
|
|
16385
|
+
/** Connect a directory. Refused until the organization's roles are set. */
|
|
16386
|
+
createDirectory(id: string): Promise<ResponseBody<"ApiOrganizationDirectoryController_create">>;
|
|
16387
|
+
/**
|
|
16388
|
+
* End the connection. The people it provisioned keep their accounts and
|
|
16389
|
+
* their membership; what ends is the provider's ability to push.
|
|
16390
|
+
*/
|
|
16391
|
+
removeDirectory(id: string): Promise<void>;
|
|
16392
|
+
listDirectoryTokens(id: string): Promise<ResponseBody<"ApiOrganizationDirectoryController_listTokens">>;
|
|
16393
|
+
/**
|
|
16394
|
+
* The raw token is in this answer and nowhere else, alongside the full
|
|
16395
|
+
* base URL the identity provider's connector needs with it.
|
|
16396
|
+
*/
|
|
16397
|
+
mintDirectoryToken(id: string, input?: RequestBody<"ApiOrganizationDirectoryController_mintToken">): Promise<ResponseBody<"ApiOrganizationDirectoryController_mintToken">>;
|
|
16398
|
+
/**
|
|
16399
|
+
* A replacement token, shown once. The old one keeps working for a short
|
|
16400
|
+
* overlap, so the provider can be moved across without an outage.
|
|
16401
|
+
*/
|
|
16402
|
+
rotateDirectoryToken(id: string, tokenId: string, input?: RequestBody<"ApiOrganizationDirectoryController_rotateToken">): Promise<ResponseBody<"ApiOrganizationDirectoryController_rotateToken">>;
|
|
16403
|
+
revokeDirectoryToken(id: string, tokenId: string): Promise<void>;
|
|
16404
|
+
/** The organization's own provisioning events, newest first. */
|
|
16405
|
+
listDirectoryActivity(id: string): Promise<ResponseBody<"ApiOrganizationDirectoryController_activity">>;
|
|
16406
|
+
/** The groups the provider has pushed, each with its role mapping. */
|
|
16407
|
+
listDirectoryGroups(id: string): Promise<ResponseBody<"ApiOrganizationDirectoryGroupsController_list">>;
|
|
16408
|
+
/**
|
|
16409
|
+
* Grant a listed role to every member of a pushed group, at the
|
|
16410
|
+
* organization. A role not on the organization's list is refused with
|
|
16411
|
+
* `scim.role_not_grantable`.
|
|
16412
|
+
*/
|
|
16413
|
+
mapDirectoryGroup(id: string, groupId: string, input: RequestBody<"ApiOrganizationDirectoryGroupsController_map">): Promise<ResponseBody<"ApiOrganizationDirectoryGroupsController_map">>;
|
|
16414
|
+
/** Members fall back to the arrival role and stay in the organization. */
|
|
16415
|
+
unmapDirectoryGroup(id: string, groupId: string): Promise<ResponseBody<"ApiOrganizationDirectoryGroupsController_unmap">>;
|
|
16108
16416
|
}
|
|
16109
16417
|
type OrganizationItem = ItemOf$2<ResponseBody<"ApiOrganizationsController_listOrganizations">>;
|
|
16110
16418
|
type OrganizationMemberItem = ItemOf$2<ResponseBody<"ApiOrganizationsController_listMembers">>;
|