@canopy-io/node 0.3.5 → 0.3.7
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 +16 -0
- package/README.md +26 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +828 -3
- package/dist/index.d.ts +828 -3
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2964,10 +2964,10 @@ interface components {
|
|
|
2964
2964
|
/** @description The authentication methods the identity provider asserted. */
|
|
2965
2965
|
amr: string[];
|
|
2966
2966
|
/**
|
|
2967
|
-
* @description How the asserted email's domain fared against the bound organization's verified claims. `no_boundary` when the connection is bound to no organization in the
|
|
2967
|
+
* @description How the asserted email's domain fared against the bound organization's verified claims. `no_boundary` when the connection is bound to no organization in an Environment without organizations; `unbound` when it is bound to none in an Environment that has them, which refuses the sign-in.
|
|
2968
2968
|
* @enum {string|null}
|
|
2969
2969
|
*/
|
|
2970
|
-
domain_outcome: "accepted" | "no_boundary" | "not_listed" | "not_verified" | "unknown" | null;
|
|
2970
|
+
domain_outcome: "accepted" | "no_boundary" | "unbound" | "not_listed" | "not_verified" | "unknown" | null;
|
|
2971
2971
|
/** Format: date-time */
|
|
2972
2972
|
completed_at: string | null;
|
|
2973
2973
|
};
|
|
@@ -3684,6 +3684,13 @@ interface components {
|
|
|
3684
3684
|
scope: "environment" | "account";
|
|
3685
3685
|
category: string;
|
|
3686
3686
|
description: string;
|
|
3687
|
+
/** @description The `resource_type` values a delivery of this event carries. */
|
|
3688
|
+
resource_types: string[];
|
|
3689
|
+
/**
|
|
3690
|
+
* @description The schema in the published API spec (components.schemas) that describes a delivery of this event, including the fields its `metadata` carries.
|
|
3691
|
+
* @example WebhookOrganizationMemberAddedEvent
|
|
3692
|
+
*/
|
|
3693
|
+
payload_schema: string;
|
|
3687
3694
|
};
|
|
3688
3695
|
WebhookDeliveryResponseDto: {
|
|
3689
3696
|
id: string;
|
|
@@ -3804,6 +3811,780 @@ interface components {
|
|
|
3804
3811
|
ErrorResponseDto: {
|
|
3805
3812
|
error: components["schemas"]["ApiErrorBodyDto"];
|
|
3806
3813
|
};
|
|
3814
|
+
/** @description A delivery of the `identity.created` webhook event. */
|
|
3815
|
+
WebhookIdentityCreatedEvent: {
|
|
3816
|
+
/** @enum {string} */
|
|
3817
|
+
event: "identity.created";
|
|
3818
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3819
|
+
/** @enum {string} */
|
|
3820
|
+
resource_type: "identity";
|
|
3821
|
+
metadata: {
|
|
3822
|
+
/** @description The identity's email address. */
|
|
3823
|
+
email: string;
|
|
3824
|
+
/** @description Whether the identity was created with a password. */
|
|
3825
|
+
password_set?: boolean;
|
|
3826
|
+
/**
|
|
3827
|
+
* Format: uuid
|
|
3828
|
+
* @description The Environment the identity was created into, when it was created from the Account directory.
|
|
3829
|
+
*/
|
|
3830
|
+
environment_id?: string | null;
|
|
3831
|
+
/**
|
|
3832
|
+
* @description Set when the change came from an accepted invitation.
|
|
3833
|
+
* @enum {string}
|
|
3834
|
+
*/
|
|
3835
|
+
source?: "invite";
|
|
3836
|
+
};
|
|
3837
|
+
};
|
|
3838
|
+
};
|
|
3839
|
+
/** @description A delivery of the `identity.updated` webhook event. */
|
|
3840
|
+
WebhookIdentityUpdatedEvent: {
|
|
3841
|
+
/** @enum {string} */
|
|
3842
|
+
event: "identity.updated";
|
|
3843
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3844
|
+
/** @enum {string} */
|
|
3845
|
+
resource_type: "identity";
|
|
3846
|
+
metadata: {
|
|
3847
|
+
/** @description The profile fields that changed and their new values, when updated through an Environment. */
|
|
3848
|
+
changes?: {
|
|
3849
|
+
/** @description New first name. */
|
|
3850
|
+
first_name?: string;
|
|
3851
|
+
/** @description New last name. */
|
|
3852
|
+
last_name?: string;
|
|
3853
|
+
/** @description New custom metadata. */
|
|
3854
|
+
metadata?: Record<string, unknown> | null;
|
|
3855
|
+
};
|
|
3856
|
+
/** @description The names of the fields that changed, when updated from the Account directory. */
|
|
3857
|
+
fields_updated?: string[];
|
|
3858
|
+
};
|
|
3859
|
+
};
|
|
3860
|
+
};
|
|
3861
|
+
/** @description A delivery of the `identity.status_set` webhook event. */
|
|
3862
|
+
WebhookIdentityStatusSetEvent: {
|
|
3863
|
+
/** @enum {string} */
|
|
3864
|
+
event: "identity.status_set";
|
|
3865
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3866
|
+
/** @enum {string} */
|
|
3867
|
+
resource_type: "identity";
|
|
3868
|
+
metadata: {
|
|
3869
|
+
/** @description Whether the identity was active before. */
|
|
3870
|
+
previous_is_active: boolean;
|
|
3871
|
+
/** @description Whether the identity is active now. */
|
|
3872
|
+
new_is_active: boolean;
|
|
3873
|
+
/** @description The Environments the identity is a member of. Present on account-scoped deliveries only. */
|
|
3874
|
+
environment_ids?: string[];
|
|
3875
|
+
};
|
|
3876
|
+
};
|
|
3877
|
+
};
|
|
3878
|
+
/** @description A delivery of the `identity.erased` webhook event. */
|
|
3879
|
+
WebhookIdentityErasedEvent: {
|
|
3880
|
+
/** @enum {string} */
|
|
3881
|
+
event: "identity.erased";
|
|
3882
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3883
|
+
/** @enum {string} */
|
|
3884
|
+
resource_type: "identity";
|
|
3885
|
+
metadata: {
|
|
3886
|
+
/** @description The Environments the identity is a member of. Present on account-scoped deliveries only. */
|
|
3887
|
+
environment_ids?: string[];
|
|
3888
|
+
};
|
|
3889
|
+
};
|
|
3890
|
+
};
|
|
3891
|
+
/** @description A delivery of the `identity.env_membership.added` webhook event. */
|
|
3892
|
+
WebhookIdentityEnvMembershipAddedEvent: {
|
|
3893
|
+
/** @enum {string} */
|
|
3894
|
+
event: "identity.env_membership.added";
|
|
3895
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3896
|
+
/** @enum {string} */
|
|
3897
|
+
resource_type: "identity";
|
|
3898
|
+
metadata: {
|
|
3899
|
+
/** @description True when an earlier membership was restored rather than a new one created. */
|
|
3900
|
+
reactivated: boolean;
|
|
3901
|
+
/**
|
|
3902
|
+
* Format: uuid
|
|
3903
|
+
* @description The Environment membership.
|
|
3904
|
+
*/
|
|
3905
|
+
membership_id?: string;
|
|
3906
|
+
/**
|
|
3907
|
+
* Format: uuid
|
|
3908
|
+
* @description The SSO connection the identity signed in through, for a just-in-time membership.
|
|
3909
|
+
*/
|
|
3910
|
+
connection_id?: string;
|
|
3911
|
+
/**
|
|
3912
|
+
* Format: uuid
|
|
3913
|
+
* @description The invitation that was accepted.
|
|
3914
|
+
*/
|
|
3915
|
+
invite_id?: string;
|
|
3916
|
+
/**
|
|
3917
|
+
* @description How the membership was created, when known.
|
|
3918
|
+
* @enum {string}
|
|
3919
|
+
*/
|
|
3920
|
+
source?: "identity_create" | "sso_jit" | "invite";
|
|
3921
|
+
};
|
|
3922
|
+
};
|
|
3923
|
+
};
|
|
3924
|
+
/** @description A delivery of the `identity.env_membership.removed` webhook event. */
|
|
3925
|
+
WebhookIdentityEnvMembershipRemovedEvent: {
|
|
3926
|
+
/** @enum {string} */
|
|
3927
|
+
event: "identity.env_membership.removed";
|
|
3928
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3929
|
+
/** @enum {string} */
|
|
3930
|
+
resource_type: "identity";
|
|
3931
|
+
metadata: {
|
|
3932
|
+
/** @description Pending invitations into the Environment revoked with the membership. */
|
|
3933
|
+
revoked_pending_invites: number;
|
|
3934
|
+
};
|
|
3935
|
+
};
|
|
3936
|
+
};
|
|
3937
|
+
/** @description A delivery of the `assignment.created` webhook event. */
|
|
3938
|
+
WebhookAssignmentCreatedEvent: {
|
|
3939
|
+
/** @enum {string} */
|
|
3940
|
+
event: "assignment.created";
|
|
3941
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3942
|
+
/** @enum {string} */
|
|
3943
|
+
resource_type: "role_assignment";
|
|
3944
|
+
metadata: {
|
|
3945
|
+
/**
|
|
3946
|
+
* Format: uuid
|
|
3947
|
+
* @description The identity holding the assignment.
|
|
3948
|
+
*/
|
|
3949
|
+
identity_id: string;
|
|
3950
|
+
/**
|
|
3951
|
+
* Format: uuid
|
|
3952
|
+
* @description The hierarchy node the role is held at.
|
|
3953
|
+
*/
|
|
3954
|
+
node_id: string;
|
|
3955
|
+
/**
|
|
3956
|
+
* Format: uuid
|
|
3957
|
+
* @description The role assigned.
|
|
3958
|
+
*/
|
|
3959
|
+
role_id: string;
|
|
3960
|
+
/**
|
|
3961
|
+
* @description Set when the change came from an accepted invitation.
|
|
3962
|
+
* @enum {string}
|
|
3963
|
+
*/
|
|
3964
|
+
source?: "invite";
|
|
3965
|
+
};
|
|
3966
|
+
};
|
|
3967
|
+
};
|
|
3968
|
+
/** @description A delivery of the `assignment.updated` webhook event. */
|
|
3969
|
+
WebhookAssignmentUpdatedEvent: {
|
|
3970
|
+
/** @enum {string} */
|
|
3971
|
+
event: "assignment.updated";
|
|
3972
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3973
|
+
/** @enum {string} */
|
|
3974
|
+
resource_type: "role_assignment";
|
|
3975
|
+
metadata: {
|
|
3976
|
+
/**
|
|
3977
|
+
* Format: uuid
|
|
3978
|
+
* @description The identity holding the assignment.
|
|
3979
|
+
*/
|
|
3980
|
+
identity_id: string;
|
|
3981
|
+
/**
|
|
3982
|
+
* Format: uuid
|
|
3983
|
+
* @description The hierarchy node the role is held at.
|
|
3984
|
+
*/
|
|
3985
|
+
node_id: string;
|
|
3986
|
+
/**
|
|
3987
|
+
* Format: uuid
|
|
3988
|
+
* @description The role assigned.
|
|
3989
|
+
*/
|
|
3990
|
+
role_id: string;
|
|
3991
|
+
};
|
|
3992
|
+
};
|
|
3993
|
+
};
|
|
3994
|
+
/** @description A delivery of the `assignment.removed` webhook event. */
|
|
3995
|
+
WebhookAssignmentRemovedEvent: {
|
|
3996
|
+
/** @enum {string} */
|
|
3997
|
+
event: "assignment.removed";
|
|
3998
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
3999
|
+
/** @enum {string} */
|
|
4000
|
+
resource_type: "role_assignment";
|
|
4001
|
+
metadata: {
|
|
4002
|
+
/**
|
|
4003
|
+
* Format: uuid
|
|
4004
|
+
* @description The identity holding the assignment.
|
|
4005
|
+
*/
|
|
4006
|
+
identity_id: string;
|
|
4007
|
+
/**
|
|
4008
|
+
* Format: uuid
|
|
4009
|
+
* @description The hierarchy node the role is held at.
|
|
4010
|
+
*/
|
|
4011
|
+
node_id: string;
|
|
4012
|
+
/**
|
|
4013
|
+
* Format: uuid
|
|
4014
|
+
* @description The role assigned.
|
|
4015
|
+
*/
|
|
4016
|
+
role_id: string;
|
|
4017
|
+
};
|
|
4018
|
+
};
|
|
4019
|
+
};
|
|
4020
|
+
/** @description A delivery of the `assignment.bulk_created` webhook event. */
|
|
4021
|
+
WebhookAssignmentBulkCreatedEvent: {
|
|
4022
|
+
/** @enum {string} */
|
|
4023
|
+
event: "assignment.bulk_created";
|
|
4024
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4025
|
+
/** @enum {string} */
|
|
4026
|
+
resource_type: "role_assignment";
|
|
4027
|
+
metadata: {
|
|
4028
|
+
/** @description The assignments created. */
|
|
4029
|
+
assignment_ids: string[];
|
|
4030
|
+
/** @description How many were created. */
|
|
4031
|
+
succeeded: number;
|
|
4032
|
+
/** @description How many were refused. */
|
|
4033
|
+
failed: number;
|
|
4034
|
+
};
|
|
4035
|
+
};
|
|
4036
|
+
};
|
|
4037
|
+
/** @description A delivery of the `assignment.bulk_removed` webhook event. */
|
|
4038
|
+
WebhookAssignmentBulkRemovedEvent: {
|
|
4039
|
+
/** @enum {string} */
|
|
4040
|
+
event: "assignment.bulk_removed";
|
|
4041
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4042
|
+
/** @enum {string} */
|
|
4043
|
+
resource_type: "role_assignment";
|
|
4044
|
+
metadata: {
|
|
4045
|
+
/** @description The assignments removed. */
|
|
4046
|
+
assignment_ids: string[];
|
|
4047
|
+
/** @description Who lost which role, and where. */
|
|
4048
|
+
affected: {
|
|
4049
|
+
/**
|
|
4050
|
+
* Format: uuid
|
|
4051
|
+
* @description The identity holding the assignment.
|
|
4052
|
+
*/
|
|
4053
|
+
identity_id: string;
|
|
4054
|
+
/**
|
|
4055
|
+
* Format: uuid
|
|
4056
|
+
* @description The hierarchy node the role is held at.
|
|
4057
|
+
*/
|
|
4058
|
+
node_id: string;
|
|
4059
|
+
/**
|
|
4060
|
+
* Format: uuid
|
|
4061
|
+
* @description The role assigned.
|
|
4062
|
+
*/
|
|
4063
|
+
role_id: string;
|
|
4064
|
+
}[];
|
|
4065
|
+
};
|
|
4066
|
+
};
|
|
4067
|
+
};
|
|
4068
|
+
/** @description A delivery of the `assignment.bulk_role_changed` webhook event. */
|
|
4069
|
+
WebhookAssignmentBulkRoleChangedEvent: {
|
|
4070
|
+
/** @enum {string} */
|
|
4071
|
+
event: "assignment.bulk_role_changed";
|
|
4072
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4073
|
+
/** @enum {string} */
|
|
4074
|
+
resource_type: "role_assignment";
|
|
4075
|
+
metadata: {
|
|
4076
|
+
/** @description The assignments changed. */
|
|
4077
|
+
assignment_ids: string[];
|
|
4078
|
+
/**
|
|
4079
|
+
* Format: uuid
|
|
4080
|
+
* @description The role every one of them now holds.
|
|
4081
|
+
*/
|
|
4082
|
+
role_id: string;
|
|
4083
|
+
/** @description Whose assignment changed, and where. */
|
|
4084
|
+
affected: {
|
|
4085
|
+
/**
|
|
4086
|
+
* Format: uuid
|
|
4087
|
+
* @description The identity holding the assignment.
|
|
4088
|
+
*/
|
|
4089
|
+
identity_id: string;
|
|
4090
|
+
/**
|
|
4091
|
+
* Format: uuid
|
|
4092
|
+
* @description The hierarchy node the role is held at.
|
|
4093
|
+
*/
|
|
4094
|
+
node_id: string;
|
|
4095
|
+
}[];
|
|
4096
|
+
};
|
|
4097
|
+
};
|
|
4098
|
+
};
|
|
4099
|
+
/** @description A delivery of the `role.created` webhook event. */
|
|
4100
|
+
WebhookRoleCreatedEvent: {
|
|
4101
|
+
/** @enum {string} */
|
|
4102
|
+
event: "role.created";
|
|
4103
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4104
|
+
/** @enum {string} */
|
|
4105
|
+
resource_type: "role";
|
|
4106
|
+
metadata: {
|
|
4107
|
+
/** @description The role's name. */
|
|
4108
|
+
name: string;
|
|
4109
|
+
};
|
|
4110
|
+
};
|
|
4111
|
+
};
|
|
4112
|
+
/** @description A delivery of the `role.updated` webhook event. */
|
|
4113
|
+
WebhookRoleUpdatedEvent: {
|
|
4114
|
+
/** @enum {string} */
|
|
4115
|
+
event: "role.updated";
|
|
4116
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4117
|
+
/** @enum {string} */
|
|
4118
|
+
resource_type: "role";
|
|
4119
|
+
metadata: {
|
|
4120
|
+
/** @description The fields that changed and their new values. */
|
|
4121
|
+
changes: {
|
|
4122
|
+
/** @description New name. */
|
|
4123
|
+
name?: string;
|
|
4124
|
+
/** @description New description. */
|
|
4125
|
+
description?: string | null;
|
|
4126
|
+
/** @description Whether the role is active. */
|
|
4127
|
+
is_active?: boolean;
|
|
4128
|
+
};
|
|
4129
|
+
};
|
|
4130
|
+
};
|
|
4131
|
+
};
|
|
4132
|
+
/** @description A delivery of the `role.deleted` webhook event. */
|
|
4133
|
+
WebhookRoleDeletedEvent: {
|
|
4134
|
+
/** @enum {string} */
|
|
4135
|
+
event: "role.deleted";
|
|
4136
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4137
|
+
/** @enum {string} */
|
|
4138
|
+
resource_type: "role";
|
|
4139
|
+
metadata: {
|
|
4140
|
+
/** @description The role's name. */
|
|
4141
|
+
name: string;
|
|
4142
|
+
};
|
|
4143
|
+
};
|
|
4144
|
+
};
|
|
4145
|
+
/** @description A delivery of the `role.permissions.updated` webhook event. */
|
|
4146
|
+
WebhookRolePermissionsUpdatedEvent: {
|
|
4147
|
+
/** @enum {string} */
|
|
4148
|
+
event: "role.permissions.updated";
|
|
4149
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4150
|
+
/** @enum {string} */
|
|
4151
|
+
resource_type: "role";
|
|
4152
|
+
metadata: {
|
|
4153
|
+
/** @description Every permission key the role now carries. */
|
|
4154
|
+
permission_keys: string[];
|
|
4155
|
+
};
|
|
4156
|
+
};
|
|
4157
|
+
};
|
|
4158
|
+
/** @description A delivery of the `permission.created` webhook event. */
|
|
4159
|
+
WebhookPermissionCreatedEvent: {
|
|
4160
|
+
/** @enum {string} */
|
|
4161
|
+
event: "permission.created";
|
|
4162
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4163
|
+
/** @enum {string} */
|
|
4164
|
+
resource_type: "permission";
|
|
4165
|
+
metadata: {
|
|
4166
|
+
/** @description The permission key. */
|
|
4167
|
+
key: string;
|
|
4168
|
+
};
|
|
4169
|
+
};
|
|
4170
|
+
};
|
|
4171
|
+
/** @description A delivery of the `permission.updated` webhook event. */
|
|
4172
|
+
WebhookPermissionUpdatedEvent: {
|
|
4173
|
+
/** @enum {string} */
|
|
4174
|
+
event: "permission.updated";
|
|
4175
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4176
|
+
/** @enum {string} */
|
|
4177
|
+
resource_type: "permission";
|
|
4178
|
+
metadata: {
|
|
4179
|
+
/** @description The fields that changed and their new values. */
|
|
4180
|
+
changes: {
|
|
4181
|
+
/** @description New name. */
|
|
4182
|
+
name?: string;
|
|
4183
|
+
/** @description New description. */
|
|
4184
|
+
description?: string | null;
|
|
4185
|
+
/** @description New category. */
|
|
4186
|
+
category?: string;
|
|
4187
|
+
};
|
|
4188
|
+
};
|
|
4189
|
+
};
|
|
4190
|
+
};
|
|
4191
|
+
/** @description A delivery of the `permission.deleted` webhook event. */
|
|
4192
|
+
WebhookPermissionDeletedEvent: {
|
|
4193
|
+
/** @enum {string} */
|
|
4194
|
+
event: "permission.deleted";
|
|
4195
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4196
|
+
/** @enum {string} */
|
|
4197
|
+
resource_type: "permission";
|
|
4198
|
+
metadata: {
|
|
4199
|
+
/** @description The permission key. */
|
|
4200
|
+
key: string;
|
|
4201
|
+
};
|
|
4202
|
+
};
|
|
4203
|
+
};
|
|
4204
|
+
/** @description A delivery of the `node.created` webhook event. */
|
|
4205
|
+
WebhookNodeCreatedEvent: {
|
|
4206
|
+
/** @enum {string} */
|
|
4207
|
+
event: "node.created";
|
|
4208
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4209
|
+
/** @enum {string} */
|
|
4210
|
+
resource_type: "node";
|
|
4211
|
+
metadata: {
|
|
4212
|
+
/** @description The node's name. */
|
|
4213
|
+
name: string;
|
|
4214
|
+
/** @description The node's type. */
|
|
4215
|
+
node_type: string;
|
|
4216
|
+
/**
|
|
4217
|
+
* Format: uuid
|
|
4218
|
+
* @description The parent node, or null for the root.
|
|
4219
|
+
*/
|
|
4220
|
+
parent_node_id: string | null;
|
|
4221
|
+
};
|
|
4222
|
+
};
|
|
4223
|
+
};
|
|
4224
|
+
/** @description A delivery of the `node.updated` webhook event. */
|
|
4225
|
+
WebhookNodeUpdatedEvent: {
|
|
4226
|
+
/** @enum {string} */
|
|
4227
|
+
event: "node.updated";
|
|
4228
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4229
|
+
/** @enum {string} */
|
|
4230
|
+
resource_type: "node";
|
|
4231
|
+
metadata: {
|
|
4232
|
+
/** @description The node's name. */
|
|
4233
|
+
name: string;
|
|
4234
|
+
/** @description The node's new status, when it changed. */
|
|
4235
|
+
status?: string;
|
|
4236
|
+
};
|
|
4237
|
+
};
|
|
4238
|
+
};
|
|
4239
|
+
/** @description A delivery of the `node.moved` webhook event. */
|
|
4240
|
+
WebhookNodeMovedEvent: {
|
|
4241
|
+
/** @enum {string} */
|
|
4242
|
+
event: "node.moved";
|
|
4243
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4244
|
+
/** @enum {string} */
|
|
4245
|
+
resource_type: "node";
|
|
4246
|
+
metadata: {
|
|
4247
|
+
/** @description The node's name. */
|
|
4248
|
+
name: string;
|
|
4249
|
+
/**
|
|
4250
|
+
* Format: uuid
|
|
4251
|
+
* @description The node's new parent.
|
|
4252
|
+
*/
|
|
4253
|
+
parent_node_id: string | null;
|
|
4254
|
+
/** @description The node's new status, when it changed as well. */
|
|
4255
|
+
status?: string;
|
|
4256
|
+
};
|
|
4257
|
+
};
|
|
4258
|
+
};
|
|
4259
|
+
/** @description A delivery of the `node.deleted` webhook event. */
|
|
4260
|
+
WebhookNodeDeletedEvent: {
|
|
4261
|
+
/** @enum {string} */
|
|
4262
|
+
event: "node.deleted";
|
|
4263
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4264
|
+
/** @enum {string} */
|
|
4265
|
+
resource_type: "node";
|
|
4266
|
+
metadata: {
|
|
4267
|
+
/** @description The node's name. */
|
|
4268
|
+
name: string;
|
|
4269
|
+
/** @description Descendant nodes deleted with it. */
|
|
4270
|
+
descendant_count: number;
|
|
4271
|
+
/** @description Role assignments removed across the subtree. */
|
|
4272
|
+
assignments_removed: number;
|
|
4273
|
+
};
|
|
4274
|
+
};
|
|
4275
|
+
};
|
|
4276
|
+
/** @description A delivery of the `hierarchy_schema.updated` webhook event. */
|
|
4277
|
+
WebhookHierarchySchemaUpdatedEvent: {
|
|
4278
|
+
/** @enum {string} */
|
|
4279
|
+
event: "hierarchy_schema.updated";
|
|
4280
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4281
|
+
/** @enum {string} */
|
|
4282
|
+
resource_type: "hierarchy_schema";
|
|
4283
|
+
metadata: {
|
|
4284
|
+
/** @description The node types the schema defines. */
|
|
4285
|
+
node_types: string[];
|
|
4286
|
+
/** @description The deepest a tree may go. */
|
|
4287
|
+
max_depth: number;
|
|
4288
|
+
};
|
|
4289
|
+
};
|
|
4290
|
+
};
|
|
4291
|
+
/** @description A delivery of the `organization.created` webhook event. */
|
|
4292
|
+
WebhookOrganizationCreatedEvent: {
|
|
4293
|
+
/** @enum {string} */
|
|
4294
|
+
event: "organization.created";
|
|
4295
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4296
|
+
/** @enum {string} */
|
|
4297
|
+
resource_type: "organization";
|
|
4298
|
+
metadata: {
|
|
4299
|
+
/** @description The organization's name. */
|
|
4300
|
+
name: string;
|
|
4301
|
+
/** @description The organization's slug. */
|
|
4302
|
+
slug: string;
|
|
4303
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4304
|
+
external_id: string | null;
|
|
4305
|
+
};
|
|
4306
|
+
};
|
|
4307
|
+
};
|
|
4308
|
+
/** @description A delivery of the `organization.updated` webhook event. */
|
|
4309
|
+
WebhookOrganizationUpdatedEvent: {
|
|
4310
|
+
/** @enum {string} */
|
|
4311
|
+
event: "organization.updated";
|
|
4312
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4313
|
+
/** @enum {string} */
|
|
4314
|
+
resource_type: "organization";
|
|
4315
|
+
metadata: {
|
|
4316
|
+
/** @description The organization's name. */
|
|
4317
|
+
name: string;
|
|
4318
|
+
/** @description The organization's slug. */
|
|
4319
|
+
slug: string;
|
|
4320
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4321
|
+
external_id: string | null;
|
|
4322
|
+
};
|
|
4323
|
+
};
|
|
4324
|
+
};
|
|
4325
|
+
/** @description A delivery of the `organization.deleted` webhook event. */
|
|
4326
|
+
WebhookOrganizationDeletedEvent: {
|
|
4327
|
+
/** @enum {string} */
|
|
4328
|
+
event: "organization.deleted";
|
|
4329
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4330
|
+
/** @enum {string} */
|
|
4331
|
+
resource_type: "organization";
|
|
4332
|
+
metadata: {
|
|
4333
|
+
/** @description The organization's name. */
|
|
4334
|
+
name: string;
|
|
4335
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4336
|
+
external_id: string | null;
|
|
4337
|
+
/** @description Memberships removed with it. */
|
|
4338
|
+
memberships_removed: number;
|
|
4339
|
+
/** @description Pending invitations revoked with it. */
|
|
4340
|
+
invites_revoked: number;
|
|
4341
|
+
/** @description Hierarchy nodes deleted with it. */
|
|
4342
|
+
nodes_deleted: number;
|
|
4343
|
+
/** @description Email-domain claims released with it. */
|
|
4344
|
+
domains_released: number;
|
|
4345
|
+
/** @description SSO connection bindings removed with it. */
|
|
4346
|
+
sso_bindings_removed: number;
|
|
4347
|
+
/** @description SSO connections it owned, deleted with it. */
|
|
4348
|
+
sso_connections_removed: number;
|
|
4349
|
+
};
|
|
4350
|
+
};
|
|
4351
|
+
};
|
|
4352
|
+
/** @description A delivery of the `organization.deleted_all` webhook event. */
|
|
4353
|
+
WebhookOrganizationDeletedAllEvent: {
|
|
4354
|
+
/** @enum {string} */
|
|
4355
|
+
event: "organization.deleted_all";
|
|
4356
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4357
|
+
/** @enum {string} */
|
|
4358
|
+
resource_type: "environment";
|
|
4359
|
+
metadata: {
|
|
4360
|
+
/** @description Organizations deleted. */
|
|
4361
|
+
organizations_deleted: number;
|
|
4362
|
+
/** @description Memberships removed with it. */
|
|
4363
|
+
memberships_removed: number;
|
|
4364
|
+
/** @description Pending invitations revoked with it. */
|
|
4365
|
+
invites_revoked: number;
|
|
4366
|
+
/** @description Hierarchy nodes deleted with it. */
|
|
4367
|
+
nodes_deleted: number;
|
|
4368
|
+
/** @description Email-domain claims released with it. */
|
|
4369
|
+
domains_released: number;
|
|
4370
|
+
/** @description SSO connection bindings removed with it. */
|
|
4371
|
+
sso_bindings_removed: number;
|
|
4372
|
+
/** @description SSO connections it owned, deleted with it. */
|
|
4373
|
+
sso_connections_removed: number;
|
|
4374
|
+
};
|
|
4375
|
+
};
|
|
4376
|
+
};
|
|
4377
|
+
/** @description A delivery of the `organization.member.added` webhook event. */
|
|
4378
|
+
WebhookOrganizationMemberAddedEvent: {
|
|
4379
|
+
/** @enum {string} */
|
|
4380
|
+
event: "organization.member.added";
|
|
4381
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4382
|
+
/** @enum {string} */
|
|
4383
|
+
resource_type: "organization";
|
|
4384
|
+
metadata: {
|
|
4385
|
+
/**
|
|
4386
|
+
* Format: uuid
|
|
4387
|
+
* @description The identity that joined.
|
|
4388
|
+
*/
|
|
4389
|
+
identity_id: string;
|
|
4390
|
+
/**
|
|
4391
|
+
* Format: uuid
|
|
4392
|
+
* @description The role it holds in the organization.
|
|
4393
|
+
*/
|
|
4394
|
+
role_id: string;
|
|
4395
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4396
|
+
external_id?: string | null;
|
|
4397
|
+
/**
|
|
4398
|
+
* Format: uuid
|
|
4399
|
+
* @description The role assignment that is the membership.
|
|
4400
|
+
*/
|
|
4401
|
+
assignment_id?: string;
|
|
4402
|
+
/**
|
|
4403
|
+
* Format: uuid
|
|
4404
|
+
* @description The SSO connection the identity signed in through, for a just-in-time membership.
|
|
4405
|
+
*/
|
|
4406
|
+
connection_id?: string;
|
|
4407
|
+
/**
|
|
4408
|
+
* Format: uuid
|
|
4409
|
+
* @description The invitation that was accepted.
|
|
4410
|
+
*/
|
|
4411
|
+
invite_id?: string;
|
|
4412
|
+
/**
|
|
4413
|
+
* @description How the member joined, when it was not added directly.
|
|
4414
|
+
* @enum {string}
|
|
4415
|
+
*/
|
|
4416
|
+
source?: "sso_jit" | "invite";
|
|
4417
|
+
};
|
|
4418
|
+
};
|
|
4419
|
+
};
|
|
4420
|
+
/** @description A delivery of the `organization.member.role_changed` webhook event. */
|
|
4421
|
+
WebhookOrganizationMemberRoleChangedEvent: {
|
|
4422
|
+
/** @enum {string} */
|
|
4423
|
+
event: "organization.member.role_changed";
|
|
4424
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4425
|
+
/** @enum {string} */
|
|
4426
|
+
resource_type: "organization";
|
|
4427
|
+
metadata: {
|
|
4428
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4429
|
+
external_id: string | null;
|
|
4430
|
+
/**
|
|
4431
|
+
* Format: uuid
|
|
4432
|
+
* @description The member.
|
|
4433
|
+
*/
|
|
4434
|
+
identity_id: string;
|
|
4435
|
+
/**
|
|
4436
|
+
* Format: uuid
|
|
4437
|
+
* @description The role it held.
|
|
4438
|
+
*/
|
|
4439
|
+
from_role_id: string;
|
|
4440
|
+
/**
|
|
4441
|
+
* Format: uuid
|
|
4442
|
+
* @description The role it holds now.
|
|
4443
|
+
*/
|
|
4444
|
+
to_role_id: string;
|
|
4445
|
+
};
|
|
4446
|
+
};
|
|
4447
|
+
};
|
|
4448
|
+
/** @description A delivery of the `organization.member.removed` webhook event. */
|
|
4449
|
+
WebhookOrganizationMemberRemovedEvent: {
|
|
4450
|
+
/** @enum {string} */
|
|
4451
|
+
event: "organization.member.removed";
|
|
4452
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4453
|
+
/** @enum {string} */
|
|
4454
|
+
resource_type: "organization";
|
|
4455
|
+
metadata: {
|
|
4456
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4457
|
+
external_id: string | null;
|
|
4458
|
+
/**
|
|
4459
|
+
* Format: uuid
|
|
4460
|
+
* @description The identity removed.
|
|
4461
|
+
*/
|
|
4462
|
+
identity_id: string;
|
|
4463
|
+
/**
|
|
4464
|
+
* Format: uuid
|
|
4465
|
+
* @description The role it held.
|
|
4466
|
+
*/
|
|
4467
|
+
role_id: string;
|
|
4468
|
+
/** @description Grants it held beneath the organization, removed with the membership. */
|
|
4469
|
+
scoped_assignments_removed: number;
|
|
4470
|
+
};
|
|
4471
|
+
};
|
|
4472
|
+
};
|
|
4473
|
+
/** @description A delivery of the `organization.policy.updated` webhook event. */
|
|
4474
|
+
WebhookOrganizationPolicyUpdatedEvent: {
|
|
4475
|
+
/** @enum {string} */
|
|
4476
|
+
event: "organization.policy.updated";
|
|
4477
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4478
|
+
/** @enum {string} */
|
|
4479
|
+
resource_type: "organization";
|
|
4480
|
+
metadata: {
|
|
4481
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4482
|
+
external_id: string | null;
|
|
4483
|
+
/** @description Whether members must use MFA, or null to inherit the Environment. */
|
|
4484
|
+
mfa_required: boolean | null;
|
|
4485
|
+
/** @description The factors members may use, or null to inherit the Environment. */
|
|
4486
|
+
mfa_factor_allowlist: ("totp" | "webauthn" | "email_otp")[] | null;
|
|
4487
|
+
/**
|
|
4488
|
+
* @description Whether an SSO sign-in still needs MFA, or null to inherit the Environment.
|
|
4489
|
+
* @enum {string|null}
|
|
4490
|
+
*/
|
|
4491
|
+
mfa_after_sso: "exempt" | "require" | null;
|
|
4492
|
+
/** @description Whether members must sign in with SSO. */
|
|
4493
|
+
require_sso: boolean;
|
|
4494
|
+
};
|
|
4495
|
+
};
|
|
4496
|
+
};
|
|
4497
|
+
/** @description A delivery of the `organization.sso_connection.bound` webhook event. */
|
|
4498
|
+
WebhookOrganizationSsoConnectionBoundEvent: {
|
|
4499
|
+
/** @enum {string} */
|
|
4500
|
+
event: "organization.sso_connection.bound";
|
|
4501
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4502
|
+
/** @enum {string} */
|
|
4503
|
+
resource_type: "organization";
|
|
4504
|
+
metadata: {
|
|
4505
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4506
|
+
external_id: string | null;
|
|
4507
|
+
/**
|
|
4508
|
+
* Format: uuid
|
|
4509
|
+
* @description The SSO connection.
|
|
4510
|
+
*/
|
|
4511
|
+
connection_id: string;
|
|
4512
|
+
/**
|
|
4513
|
+
* Format: uuid
|
|
4514
|
+
* @description The role a just-in-time sign-in through it joins with.
|
|
4515
|
+
*/
|
|
4516
|
+
default_role_id: string;
|
|
4517
|
+
/** @description The connection's name, on a new binding. */
|
|
4518
|
+
connection_name?: string;
|
|
4519
|
+
/**
|
|
4520
|
+
* @description Set when an existing binding's role changed, rather than a new binding made.
|
|
4521
|
+
* @enum {string}
|
|
4522
|
+
*/
|
|
4523
|
+
changed?: "default_role";
|
|
4524
|
+
};
|
|
4525
|
+
};
|
|
4526
|
+
};
|
|
4527
|
+
/** @description A delivery of the `organization.sso_connection.unbound` webhook event. */
|
|
4528
|
+
WebhookOrganizationSsoConnectionUnboundEvent: {
|
|
4529
|
+
/** @enum {string} */
|
|
4530
|
+
event: "organization.sso_connection.unbound";
|
|
4531
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4532
|
+
/** @enum {string} */
|
|
4533
|
+
resource_type: "organization";
|
|
4534
|
+
metadata: {
|
|
4535
|
+
/** @description Your own identifier for the organization, when you set one. */
|
|
4536
|
+
external_id: string | null;
|
|
4537
|
+
/**
|
|
4538
|
+
* Format: uuid
|
|
4539
|
+
* @description The SSO connection.
|
|
4540
|
+
*/
|
|
4541
|
+
connection_id: string;
|
|
4542
|
+
};
|
|
4543
|
+
};
|
|
4544
|
+
};
|
|
4545
|
+
/** @description A delivery of the `account_member.added` webhook event. */
|
|
4546
|
+
WebhookAccountMemberAddedEvent: {
|
|
4547
|
+
/** @enum {string} */
|
|
4548
|
+
event: "account_member.added";
|
|
4549
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4550
|
+
/** @enum {string} */
|
|
4551
|
+
resource_type: "account_member";
|
|
4552
|
+
metadata: {
|
|
4553
|
+
/** @description The member's email address. */
|
|
4554
|
+
email: string;
|
|
4555
|
+
/**
|
|
4556
|
+
* Format: uuid
|
|
4557
|
+
* @description The invitation that was accepted.
|
|
4558
|
+
*/
|
|
4559
|
+
invite_id: string;
|
|
4560
|
+
};
|
|
4561
|
+
};
|
|
4562
|
+
};
|
|
4563
|
+
/** @description A delivery of the `account_member.removed` webhook event. */
|
|
4564
|
+
WebhookAccountMemberRemovedEvent: {
|
|
4565
|
+
/** @enum {string} */
|
|
4566
|
+
event: "account_member.removed";
|
|
4567
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4568
|
+
/** @enum {string} */
|
|
4569
|
+
resource_type: "account_member";
|
|
4570
|
+
metadata: Record<string, unknown>;
|
|
4571
|
+
};
|
|
4572
|
+
};
|
|
4573
|
+
/** @description A delivery of the `session.all_revoked` webhook event. */
|
|
4574
|
+
WebhookSessionAllRevokedEvent: {
|
|
4575
|
+
/** @enum {string} */
|
|
4576
|
+
event: "session.all_revoked";
|
|
4577
|
+
data: components["schemas"]["ChangeEventDataDto"] & {
|
|
4578
|
+
/** @enum {string} */
|
|
4579
|
+
resource_type: "identity" | "user";
|
|
4580
|
+
metadata: {
|
|
4581
|
+
/** @description Sessions revoked. */
|
|
4582
|
+
revoked_count: number;
|
|
4583
|
+
/** @description Why, when a reason was given. */
|
|
4584
|
+
reason: string | null;
|
|
4585
|
+
};
|
|
4586
|
+
};
|
|
4587
|
+
};
|
|
3807
4588
|
};
|
|
3808
4589
|
responses: never;
|
|
3809
4590
|
parameters: never;
|
|
@@ -16982,4 +17763,48 @@ declare class TokenVerifier {
|
|
|
16982
17763
|
private fetchKeys;
|
|
16983
17764
|
}
|
|
16984
17765
|
|
|
16985
|
-
|
|
17766
|
+
/**
|
|
17767
|
+
* Typed webhook deliveries.
|
|
17768
|
+
*
|
|
17769
|
+
* Canopy publishes one schema per webhook event, named `Webhook…Event`, each
|
|
17770
|
+
* the shared envelope narrowed to that event's name, `resource_type` and
|
|
17771
|
+
* `metadata`. These types read them straight out of the generated document,
|
|
17772
|
+
* so a handler is written against the contract rather than against
|
|
17773
|
+
* deliveries it happened to capture, and `npm run generate` brings in any
|
|
17774
|
+
* field the API adds.
|
|
17775
|
+
*
|
|
17776
|
+
* app.post("/webhooks/canopy", (req, res) => {
|
|
17777
|
+
* const delivery = req.body as WebhookDelivery;
|
|
17778
|
+
*
|
|
17779
|
+
* if (isWebhookEvent(delivery, "organization.member.added")) {
|
|
17780
|
+
* delivery.data.metadata.identity_id; // string
|
|
17781
|
+
* }
|
|
17782
|
+
* });
|
|
17783
|
+
*
|
|
17784
|
+
* `GET /api/v1/webhooks/event-types` names each event's schema in
|
|
17785
|
+
* `payload_schema`, which is the name to look up in `Schema<…>`.
|
|
17786
|
+
*/
|
|
17787
|
+
/** The name of every published delivery schema. */
|
|
17788
|
+
type WebhookSchemaName = Extract<keyof components["schemas"], `Webhook${string}Event`>;
|
|
17789
|
+
/** A delivery of any webhook event: `{ event, data }`. */
|
|
17790
|
+
type WebhookDelivery = components["schemas"][WebhookSchemaName];
|
|
17791
|
+
/** Every event a subscription can receive. */
|
|
17792
|
+
type WebhookEventName = WebhookDelivery["event"];
|
|
17793
|
+
/**
|
|
17794
|
+
* The delivery of one event, e.g. `WebhookEvent<"assignment.created">`.
|
|
17795
|
+
* Its `data.metadata` carries exactly the fields that event sends, with the
|
|
17796
|
+
* ones every delivery includes required and the rest optional.
|
|
17797
|
+
*/
|
|
17798
|
+
type WebhookEvent<Name extends WebhookEventName> = Extract<WebhookDelivery, {
|
|
17799
|
+
event: Name;
|
|
17800
|
+
}>;
|
|
17801
|
+
/** The `data` object of one event's delivery. */
|
|
17802
|
+
type WebhookEventData<Name extends WebhookEventName> = WebhookEvent<Name>["data"];
|
|
17803
|
+
/**
|
|
17804
|
+
* Narrow a delivery to one event by its name. A type guard rather than a
|
|
17805
|
+
* switch over `delivery.event`, so a handler for one event reads that
|
|
17806
|
+
* event's `metadata` without a cast.
|
|
17807
|
+
*/
|
|
17808
|
+
declare function isWebhookEvent<Name extends WebhookEventName>(delivery: WebhookDelivery, name: Name): delivery is WebhookEvent<Name>;
|
|
17809
|
+
|
|
17810
|
+
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 };
|