@scalekit-sdk/node 2.1.6 → 2.1.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/buf.gen.yaml +1 -0
- package/lib/auth.d.ts +41 -9
- package/lib/auth.js +44 -12
- package/lib/auth.js.map +1 -1
- package/lib/connection.d.ts +195 -21
- package/lib/connection.js +197 -23
- package/lib/connection.js.map +1 -1
- package/lib/core.d.ts +2 -2
- package/lib/core.js +13 -12
- package/lib/core.js.map +1 -1
- package/lib/directory.d.ts +293 -40
- package/lib/directory.js +308 -44
- package/lib/directory.js.map +1 -1
- package/lib/domain.d.ts +166 -18
- package/lib/domain.js +178 -29
- package/lib/domain.js.map +1 -1
- package/lib/organization.d.ts +407 -40
- package/lib/organization.js +433 -49
- package/lib/organization.js.map +1 -1
- package/lib/permission.d.ts +179 -35
- package/lib/permission.js +190 -38
- package/lib/permission.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.d.ts +3 -3
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js +2 -2
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.d.ts +16 -16
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js +21 -21
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.d.ts +82 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js +90 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.d.ts +647 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js +993 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.d.ts +142 -0
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +165 -1
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.d.ts +1 -10
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js +0 -9
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +28 -63
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +9 -90
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.d.ts +6 -6
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js +5 -5
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.d.ts +19 -30
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js +22 -31
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +2 -2
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
- package/lib/role.d.ts +252 -56
- package/lib/role.js +262 -62
- package/lib/role.js.map +1 -1
- package/lib/scalekit.d.ts +323 -54
- package/lib/scalekit.js +354 -76
- package/lib/scalekit.js.map +1 -1
- package/lib/session.d.ts +235 -22
- package/lib/session.js +237 -24
- package/lib/session.js.map +1 -1
- package/lib/types/organization.d.ts +3 -0
- package/lib/user.d.ts +571 -53
- package/lib/user.js +598 -89
- package/lib/user.js.map +1 -1
- package/lib/webauthn.d.ts +33 -0
- package/lib/webauthn.js +80 -0
- package/lib/webauthn.js.map +1 -0
- package/package.json +2 -2
- package/src/auth.ts +53 -19
- package/src/connection.ts +237 -62
- package/src/core.ts +39 -33
- package/src/directory.ts +356 -98
- package/src/domain.ts +215 -68
- package/src/organization.ts +506 -105
- package/src/permission.ts +234 -88
- package/src/pkg/grpc/scalekit/v1/auth/auth_connect.ts +3 -3
- package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +24 -24
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_connect.ts +89 -0
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_pb.ts +1263 -0
- package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +217 -0
- package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +1 -10
- package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +42 -129
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_connect.ts +6 -6
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_pb.ts +28 -43
- package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +3 -3
- package/src/role.ts +336 -136
- package/src/scalekit.ts +478 -149
- package/src/session.ts +266 -63
- package/src/types/organization.ts +4 -0
- package/src/user.ts +675 -168
- package/src/webauthn.ts +98 -0
- package/tests/organization.test.ts +16 -0
package/lib/role.d.ts
CHANGED
|
@@ -1,104 +1,300 @@
|
|
|
1
|
-
import { Empty } from
|
|
2
|
-
import GrpcConnect from
|
|
3
|
-
import CoreClient from
|
|
4
|
-
import { CreateRoleResponse, UpdateRoleResponse, GetRoleResponse, ListRolesResponse, CreateOrganizationRoleResponse, UpdateOrganizationRoleResponse, GetOrganizationRoleResponse, ListOrganizationRolesResponse, GetRoleUsersCountResponse, GetOrganizationRoleUsersCountResponse, UpdateDefaultOrganizationRolesResponse, CreateRole, UpdateRole, CreateOrganizationRole } from
|
|
1
|
+
import { Empty } from "@bufbuild/protobuf";
|
|
2
|
+
import GrpcConnect from "./connect";
|
|
3
|
+
import CoreClient from "./core";
|
|
4
|
+
import { CreateRoleResponse, UpdateRoleResponse, GetRoleResponse, ListRolesResponse, CreateOrganizationRoleResponse, UpdateOrganizationRoleResponse, GetOrganizationRoleResponse, ListOrganizationRolesResponse, GetRoleUsersCountResponse, GetOrganizationRoleUsersCountResponse, UpdateDefaultOrganizationRolesResponse, CreateRole, UpdateRole, CreateOrganizationRole } from "./pkg/grpc/scalekit/v1/roles/roles_pb";
|
|
5
|
+
/**
|
|
6
|
+
* Client for managing roles at both environment and organization levels.
|
|
7
|
+
*
|
|
8
|
+
* Roles define sets of permissions that control user access to resources and operations.
|
|
9
|
+
* This client provides comprehensive role management including role hierarchies, permission
|
|
10
|
+
* inheritance, and both environment-wide and organization-specific roles.
|
|
11
|
+
*
|
|
12
|
+
* **Environment Roles**: Available across your entire Scalekit environment, shared by all organizations
|
|
13
|
+
* **Organization Roles**: Scoped to specific organizations for multi-tenant isolation. These are additional custom roles
|
|
14
|
+
* that are only applicable for that organization beyond the Environment Roles that are applicable for all organizations.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const scalekitClient = new ScalekitClient(envUrl, clientId, clientSecret);
|
|
18
|
+
* const roleClient = scalekitClient.role;
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Role API Documentation}
|
|
21
|
+
*/
|
|
5
22
|
export default class RoleClient {
|
|
6
23
|
private readonly grpcConnect;
|
|
7
24
|
private readonly coreClient;
|
|
8
25
|
private client;
|
|
9
26
|
constructor(grpcConnect: GrpcConnect, coreClient: CoreClient);
|
|
10
27
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
28
|
+
* Creates a new environment-level role with specified permissions.
|
|
29
|
+
*
|
|
30
|
+
* Environment roles are available across all organizations in your environment. Use this to
|
|
31
|
+
* establish foundational access control structures, create role hierarchies, or define granular
|
|
32
|
+
* permission sets that can be reused across organizations.
|
|
33
|
+
*
|
|
34
|
+
* @param {CreateRole} role - Role creation object containing:
|
|
35
|
+
* - name: Unique role identifier (alphanumeric with underscores, 1-64 chars)
|
|
36
|
+
* - displayName: Human-readable name for display
|
|
37
|
+
* - description: Purpose and scope of the role
|
|
38
|
+
* - permissions: Array of permission strings
|
|
39
|
+
* - baseRole?: Optional parent role for permission inheritance
|
|
40
|
+
*
|
|
41
|
+
* @returns {Promise<CreateRoleResponse>} The created role with metadata
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Create a basic role
|
|
45
|
+
* const response = await scalekitClient.role.createRole({
|
|
46
|
+
* name: 'content_editor',
|
|
47
|
+
* displayName: 'Content Editor',
|
|
48
|
+
* description: 'Can create and edit content',
|
|
49
|
+
* permissions: ['content:read', 'content:write', 'content:edit']
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Create role with inheritance
|
|
54
|
+
* await scalekitClient.role.createRole({
|
|
55
|
+
* name: 'senior_editor',
|
|
56
|
+
* displayName: 'Senior Editor',
|
|
57
|
+
* description: 'Editor with publishing rights',
|
|
58
|
+
* baseRole: 'content_editor',
|
|
59
|
+
* permissions: ['content:publish', 'content:delete']
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Create Role API}
|
|
14
63
|
*/
|
|
15
64
|
createRole(role: CreateRole): Promise<CreateRoleResponse>;
|
|
16
65
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
66
|
+
* Retrieves complete information for a specific environment role.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} roleName - Unique role identifier (alphanumeric with underscores, 1-64 chars)
|
|
69
|
+
*
|
|
70
|
+
* @returns {Promise<GetRoleResponse>} Role details including permissions and inheritance
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const response = await scalekitClient.role.getRole('content_editor');
|
|
74
|
+
* console.log('Role:', response.role.displayName);
|
|
75
|
+
* console.log('Permissions:', response.role.permissions);
|
|
76
|
+
*
|
|
77
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Get Role API}
|
|
20
78
|
*/
|
|
21
79
|
getRole(roleName: string): Promise<GetRoleResponse>;
|
|
22
80
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
81
|
+
* Lists all environment-level roles available in your Scalekit environment.
|
|
82
|
+
*
|
|
83
|
+
* @returns {Promise<ListRolesResponse>} Array of all roles with their metadata
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const response = await scalekitClient.role.listRoles();
|
|
87
|
+
* response.roles.forEach(role => {
|
|
88
|
+
* console.log(`${role.displayName}: ${role.permissions.length} permissions`);
|
|
89
|
+
* });
|
|
90
|
+
*
|
|
91
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | List Roles API}
|
|
25
92
|
*/
|
|
26
93
|
listRoles(): Promise<ListRolesResponse>;
|
|
27
94
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
95
|
+
* Updates an existing environment role's properties and permissions.
|
|
96
|
+
*
|
|
97
|
+
* Only specified fields are updated. The new permission list replaces existing permissions.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} roleName - Role to update
|
|
100
|
+
* @param {UpdateRole} role - Updated role properties
|
|
101
|
+
*
|
|
102
|
+
* @returns {Promise<UpdateRoleResponse>} Updated role details
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* await scalekitClient.role.updateRole('content_editor', {
|
|
106
|
+
* displayName: 'Content Editor (Updated)',
|
|
107
|
+
* permissions: ['content:read', 'content:write', 'content:edit', 'content:review']
|
|
108
|
+
* });
|
|
109
|
+
*
|
|
110
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Update Role API}
|
|
32
111
|
*/
|
|
33
112
|
updateRole(roleName: string, role: UpdateRole): Promise<UpdateRoleResponse>;
|
|
34
113
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
114
|
+
* Deletes an environment role and reassigns its users to another role.
|
|
115
|
+
*
|
|
116
|
+
* Cannot delete if dependent roles exist. Users must be reassigned before deletion.
|
|
117
|
+
* This operation is irreversible.
|
|
118
|
+
*
|
|
119
|
+
* @param {string} roleName - Role to delete
|
|
120
|
+
* @param {string} [reassignRoleName] - Target role for user migration
|
|
121
|
+
*
|
|
122
|
+
* @returns {Promise<Empty>} Empty response on success
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* await scalekitClient.role.deleteRole('old_role', 'new_role');
|
|
126
|
+
*
|
|
127
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Delete Role API}
|
|
39
128
|
*/
|
|
40
129
|
deleteRole(roleName: string, reassignRoleName?: string): Promise<Empty>;
|
|
41
130
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
131
|
+
* Gets the number of users assigned to an environment role.
|
|
132
|
+
*
|
|
133
|
+
* Useful for capacity planning, security auditing, and impact assessment before role changes.
|
|
134
|
+
*
|
|
135
|
+
* @param {string} roleName - Role to count users for
|
|
136
|
+
*
|
|
137
|
+
* @returns {Promise<GetRoleUsersCountResponse>} Total user count (direct and inherited)
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* const response = await scalekitClient.role.getRoleUsersCount('admin');
|
|
141
|
+
* console.log(`${response.count} users have admin role`);
|
|
142
|
+
*
|
|
143
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Get Role User Count API}
|
|
45
144
|
*/
|
|
46
145
|
getRoleUsersCount(roleName: string): Promise<GetRoleUsersCountResponse>;
|
|
47
146
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
147
|
+
* Creates a new organization-specific role with custom permissions.
|
|
148
|
+
*
|
|
149
|
+
* Organization roles are scoped to a specific organization for multi-tenant isolation.
|
|
150
|
+
* Use this for organization-specific access control and compartmentalized role management.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} orgId - Organization identifier (format: "org_...")
|
|
153
|
+
* @param {CreateOrganizationRole} role - Role configuration containing:
|
|
154
|
+
* - name: Unique role identifier within the organization
|
|
155
|
+
* - displayName: Human-readable name
|
|
156
|
+
* - description: Purpose and scope
|
|
157
|
+
* - permissions: Organization-specific permission array
|
|
158
|
+
* - baseRole?: Parent role for inheritance
|
|
159
|
+
*
|
|
160
|
+
* @returns {Promise<CreateOrganizationRoleResponse>} Created organization role
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* await scalekitClient.role.createOrganizationRole('org_123456', {
|
|
164
|
+
* name: 'department_lead',
|
|
165
|
+
* displayName: 'Department Lead',
|
|
166
|
+
* description: 'Manages department members',
|
|
167
|
+
* permissions: ['dept:members:read', 'dept:members:invite']
|
|
168
|
+
* });
|
|
169
|
+
*
|
|
170
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Create Organization Role API}
|
|
52
171
|
*/
|
|
53
172
|
createOrganizationRole(orgId: string, role: CreateOrganizationRole): Promise<CreateOrganizationRoleResponse>;
|
|
54
173
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* @param {string}
|
|
58
|
-
* @
|
|
174
|
+
* Retrieves details for a specific organization role.
|
|
175
|
+
*
|
|
176
|
+
* @param {string} orgId - Organization identifier
|
|
177
|
+
* @param {string} roleName - Role name to retrieve
|
|
178
|
+
*
|
|
179
|
+
* @returns {Promise<GetOrganizationRoleResponse>} Organization role details
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* const response = await scalekitClient.role.getOrganizationRole(
|
|
183
|
+
* 'org_123456',
|
|
184
|
+
* 'department_lead'
|
|
185
|
+
* );
|
|
186
|
+
* console.log('Permissions:', response.role.permissions);
|
|
187
|
+
*
|
|
188
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Get Organization Role API}
|
|
59
189
|
*/
|
|
60
190
|
getOrganizationRole(orgId: string, roleName: string): Promise<GetOrganizationRoleResponse>;
|
|
61
191
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
192
|
+
* Lists all roles available to an organization (environment + organization-specific).
|
|
193
|
+
*
|
|
194
|
+
* Returns both environment-level roles and organization-scoped roles.
|
|
195
|
+
*
|
|
196
|
+
* @param {string} orgId - Organization identifier
|
|
197
|
+
*
|
|
198
|
+
* @returns {Promise<ListOrganizationRolesResponse>} Array of available roles
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* const response = await scalekitClient.role.listOrganizationRoles('org_123456');
|
|
202
|
+
* response.roles.forEach(role => {
|
|
203
|
+
* console.log(`${role.displayName} (${role.scope})`);
|
|
204
|
+
* });
|
|
205
|
+
*
|
|
206
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | List Organization Roles API}
|
|
65
207
|
*/
|
|
66
208
|
listOrganizationRoles(orgId: string): Promise<ListOrganizationRolesResponse>;
|
|
67
209
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @
|
|
210
|
+
* Updates an organization role's properties and permissions.
|
|
211
|
+
*
|
|
212
|
+
* Only specified fields are updated. New permissions replace existing ones.
|
|
213
|
+
*
|
|
214
|
+
* @param {string} orgId - Organization identifier
|
|
215
|
+
* @param {string} roleName - Role to update
|
|
216
|
+
* @param {UpdateRole} role - Updated role properties
|
|
217
|
+
*
|
|
218
|
+
* @returns {Promise<UpdateOrganizationRoleResponse>} Updated role
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* await scalekitClient.role.updateOrganizationRole('org_123456', 'department_lead', {
|
|
222
|
+
* permissions: ['dept:members:read', 'dept:members:invite', 'dept:members:remove']
|
|
223
|
+
* });
|
|
224
|
+
*
|
|
225
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Update Organization Role API}
|
|
73
226
|
*/
|
|
74
227
|
updateOrganizationRole(orgId: string, roleName: string, role: UpdateRole): Promise<UpdateOrganizationRoleResponse>;
|
|
75
228
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* @
|
|
229
|
+
* Deletes an organization role and reassigns its users.
|
|
230
|
+
*
|
|
231
|
+
* Cannot delete if dependent roles exist. Users must be reassigned. Operation is irreversible.
|
|
232
|
+
*
|
|
233
|
+
* @param {string} orgId - Organization identifier
|
|
234
|
+
* @param {string} roleName - Role to delete
|
|
235
|
+
* @param {string} [reassignRoleName] - Target role for user migration
|
|
236
|
+
*
|
|
237
|
+
* @returns {Promise<Empty>} Empty response on success
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* await scalekitClient.role.deleteOrganizationRole(
|
|
241
|
+
* 'org_123456',
|
|
242
|
+
* 'old_role',
|
|
243
|
+
* 'new_role'
|
|
244
|
+
* );
|
|
245
|
+
*
|
|
246
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Delete Organization Role API}
|
|
81
247
|
*/
|
|
82
248
|
deleteOrganizationRole(orgId: string, roleName: string, reassignRoleName?: string): Promise<Empty>;
|
|
83
249
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* @param {string}
|
|
87
|
-
* @
|
|
250
|
+
* Gets the number of users assigned to an organization role.
|
|
251
|
+
*
|
|
252
|
+
* @param {string} orgId - Organization identifier
|
|
253
|
+
* @param {string} roleName - Role to count users for
|
|
254
|
+
*
|
|
255
|
+
* @returns {Promise<GetOrganizationRoleUsersCountResponse>} User count
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* const response = await scalekitClient.role.getOrganizationRoleUsersCount(
|
|
259
|
+
* 'org_123456',
|
|
260
|
+
* 'admin'
|
|
261
|
+
* );
|
|
262
|
+
* console.log(`${response.count} admins in this organization`);
|
|
263
|
+
*
|
|
264
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Get Organization Role User Count API}
|
|
88
265
|
*/
|
|
89
266
|
getOrganizationRoleUsersCount(orgId: string, roleName: string): Promise<GetOrganizationRoleUsersCountResponse>;
|
|
90
267
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
268
|
+
* Sets the default role automatically assigned to new organization members.
|
|
269
|
+
* This is the role that is by default assigned to every new user added to this organization.
|
|
270
|
+
*
|
|
271
|
+
* Affects all new user invitations and memberships within the organization.
|
|
272
|
+
*
|
|
273
|
+
* @param {string} orgId - Organization identifier
|
|
274
|
+
* @param {string} defaultMemberRole - Role name to assign by default
|
|
275
|
+
*
|
|
276
|
+
* @returns {Promise<UpdateDefaultOrganizationRolesResponse>} Updated configuration
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* await scalekitClient.role.updateDefaultOrganizationRoles('org_123456', 'member');
|
|
280
|
+
*
|
|
281
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Update Default Organization Roles API}
|
|
95
282
|
*/
|
|
96
283
|
updateDefaultOrganizationRoles(orgId: string, defaultMemberRole: string): Promise<UpdateDefaultOrganizationRolesResponse>;
|
|
97
284
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
285
|
+
* Removes a role's inheritance relationship, eliminating inherited permissions from base role.
|
|
286
|
+
*
|
|
287
|
+
* Role retains only directly assigned permissions after removal. This action cannot be undone.
|
|
288
|
+
*
|
|
289
|
+
* @param {string} orgId - Organization identifier
|
|
290
|
+
* @param {string} roleName - Role to remove inheritance from
|
|
291
|
+
*
|
|
292
|
+
* @returns {Promise<Empty>} Empty response on success
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* await scalekitClient.role.deleteOrganizationRoleBase('org_123456', 'custom_role');
|
|
296
|
+
*
|
|
297
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/roles | Delete Organization Role Base API}
|
|
102
298
|
*/
|
|
103
299
|
deleteOrganizationRoleBase(orgId: string, roleName: string): Promise<Empty>;
|
|
104
300
|
}
|