@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/src/permission.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Empty, PartialMessage } from
|
|
2
|
-
import { PromiseClient } from
|
|
3
|
-
import GrpcConnect from
|
|
4
|
-
import CoreClient from
|
|
5
|
-
import { RolesService } from
|
|
6
|
-
import {
|
|
1
|
+
import { Empty, PartialMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { PromiseClient } from "@connectrpc/connect";
|
|
3
|
+
import GrpcConnect from "./connect";
|
|
4
|
+
import CoreClient from "./core";
|
|
5
|
+
import { RolesService } from "./pkg/grpc/scalekit/v1/roles/roles_connect";
|
|
6
|
+
import {
|
|
7
7
|
CreatePermissionRequest,
|
|
8
8
|
CreatePermissionResponse,
|
|
9
9
|
GetPermissionRequest,
|
|
@@ -20,9 +20,27 @@ import {
|
|
|
20
20
|
RemovePermissionFromRoleRequest,
|
|
21
21
|
ListEffectiveRolePermissionsRequest,
|
|
22
22
|
ListEffectiveRolePermissionsResponse,
|
|
23
|
-
CreatePermission
|
|
24
|
-
} from
|
|
23
|
+
CreatePermission,
|
|
24
|
+
} from "./pkg/grpc/scalekit/v1/roles/roles_pb";
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Client for managing permissions and role-permission assignments.
|
|
28
|
+
*
|
|
29
|
+
* Permissions represent granular access controls defining specific actions users can perform
|
|
30
|
+
* on resources (e.g., 'read:documents', 'write:settings', 'delete:users'). This client provides
|
|
31
|
+
* comprehensive permission management including CRUD operations and role assignment.
|
|
32
|
+
*
|
|
33
|
+
* **Key Concepts:**
|
|
34
|
+
* - **Direct Permissions**: Explicitly assigned to a role
|
|
35
|
+
* - **Effective Permissions**: Direct + inherited from parent roles through hierarchy
|
|
36
|
+
* - **Permission Format**: 'action:resource' (e.g., 'read:invoices', 'admin:users')
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const scalekitClient = new ScalekitClient(envUrl, clientId, clientSecret);
|
|
40
|
+
* const permissionClient = scalekitClient.permission;
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Permission API Documentation}
|
|
43
|
+
*/
|
|
26
44
|
export default class PermissionClient {
|
|
27
45
|
private client: PromiseClient<typeof RolesService>;
|
|
28
46
|
|
|
@@ -34,36 +52,86 @@ export default class PermissionClient {
|
|
|
34
52
|
}
|
|
35
53
|
|
|
36
54
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
55
|
+
* Creates a new permission defining a specific action users can perform.
|
|
56
|
+
*
|
|
57
|
+
* Permissions represent granular access controls following the 'action:resource' format.
|
|
58
|
+
* Use this to define the building blocks of your access control system.
|
|
59
|
+
*
|
|
60
|
+
* @param {CreatePermission} permission - Permission object containing:
|
|
61
|
+
* - name: Permission identifier in 'action:resource' format (e.g., 'read:documents', 'write:settings')
|
|
62
|
+
* - description: Optional explanation of what this permission grants
|
|
63
|
+
*
|
|
64
|
+
* @returns {Promise<CreatePermissionResponse>} Created permission with ID and timestamps
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Create basic permissions
|
|
68
|
+
* await scalekitClient.permission.createPermission({
|
|
69
|
+
* name: 'read:invoices',
|
|
70
|
+
* description: 'View invoice details'
|
|
71
|
+
* });
|
|
72
|
+
|
|
73
|
+
*
|
|
74
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Create Permission API}
|
|
40
75
|
*/
|
|
41
|
-
async createPermission(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
76
|
+
async createPermission(
|
|
77
|
+
permission: CreatePermission
|
|
78
|
+
): Promise<CreatePermissionResponse> {
|
|
79
|
+
return this.coreClient.connectExec(this.client.createPermission, {
|
|
80
|
+
permission,
|
|
81
|
+
});
|
|
46
82
|
}
|
|
47
83
|
|
|
48
84
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* @
|
|
85
|
+
* Retrieves complete information for a specific permission.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} permissionName - Permission identifier (e.g., 'read:documents')
|
|
88
|
+
*
|
|
89
|
+
* @returns {Promise<GetPermissionResponse>} Permission details including description and timestamps
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* const response = await scalekitClient.permission.getPermission('read:invoices');
|
|
93
|
+
* console.log('Description:', response.permission.description);
|
|
94
|
+
*
|
|
95
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Get Permission API}
|
|
52
96
|
*/
|
|
53
97
|
async getPermission(permissionName: string): Promise<GetPermissionResponse> {
|
|
54
|
-
return this.coreClient.connectExec(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
);
|
|
98
|
+
return this.coreClient.connectExec(this.client.getPermission, {
|
|
99
|
+
permissionName,
|
|
100
|
+
});
|
|
58
101
|
}
|
|
59
102
|
|
|
60
103
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
104
|
+
* Lists all permissions with pagination support.
|
|
105
|
+
*
|
|
106
|
+
* View all permission definitions for auditing, role management, or understanding available access controls.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} [pageToken] - Token for retrieving the next page
|
|
109
|
+
* @param {number} [pageSize] - Number of permissions per page (max: 100)
|
|
110
|
+
*
|
|
111
|
+
* @returns {Promise<ListPermissionsResponse>} Paginated list of permissions
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* // List all permissions
|
|
115
|
+
* const response = await scalekitClient.permission.listPermissions();
|
|
116
|
+
* response.permissions.forEach(perm => {
|
|
117
|
+
* console.log(`${perm.name}: ${perm.description}`);
|
|
118
|
+
* });
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // Paginate through permissions
|
|
122
|
+
* let pageToken = undefined;
|
|
123
|
+
* do {
|
|
124
|
+
* const response = await scalekitClient.permission.listPermissions(pageToken, 50);
|
|
125
|
+
* // Process permissions
|
|
126
|
+
* pageToken = response.nextPageToken;
|
|
127
|
+
* } while (pageToken);
|
|
128
|
+
*
|
|
129
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | List Permissions API}
|
|
65
130
|
*/
|
|
66
|
-
async listPermissions(
|
|
131
|
+
async listPermissions(
|
|
132
|
+
pageToken?: string,
|
|
133
|
+
pageSize?: number
|
|
134
|
+
): Promise<ListPermissionsResponse> {
|
|
67
135
|
const request: PartialMessage<ListPermissionsRequest> = {};
|
|
68
136
|
if (pageToken) {
|
|
69
137
|
request.pageToken = pageToken;
|
|
@@ -71,91 +139,169 @@ export default class PermissionClient {
|
|
|
71
139
|
if (pageSize) {
|
|
72
140
|
request.pageSize = pageSize;
|
|
73
141
|
}
|
|
74
|
-
|
|
75
|
-
return this.coreClient.connectExec(
|
|
76
|
-
this.client.listPermissions,
|
|
77
|
-
request
|
|
78
|
-
);
|
|
142
|
+
|
|
143
|
+
return this.coreClient.connectExec(this.client.listPermissions, request);
|
|
79
144
|
}
|
|
80
145
|
|
|
81
146
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
147
|
+
* Updates an existing permission's attributes.
|
|
148
|
+
*
|
|
149
|
+
* Note: The permission name itself cannot be changed as it serves as the immutable identifier.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} permissionName - Permission to update
|
|
152
|
+
* @param {CreatePermission} permission - Updated permission properties
|
|
153
|
+
*
|
|
154
|
+
* @returns {Promise<UpdatePermissionResponse>} Updated permission details
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* await scalekitClient.permission.updatePermission('read:invoices', {
|
|
158
|
+
* name: 'read:invoices',
|
|
159
|
+
* description: 'View invoice details and history (updated)'
|
|
160
|
+
* });
|
|
161
|
+
*
|
|
162
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Update Permission API}
|
|
86
163
|
*/
|
|
87
|
-
async updatePermission(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
164
|
+
async updatePermission(
|
|
165
|
+
permissionName: string,
|
|
166
|
+
permission: CreatePermission
|
|
167
|
+
): Promise<UpdatePermissionResponse> {
|
|
168
|
+
return this.coreClient.connectExec(this.client.updatePermission, {
|
|
169
|
+
permissionName,
|
|
170
|
+
permission,
|
|
171
|
+
});
|
|
95
172
|
}
|
|
96
173
|
|
|
97
174
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
175
|
+
* Permanently removes a permission.
|
|
176
|
+
*
|
|
177
|
+
* Ensure no active roles depend on the permission before deletion.
|
|
178
|
+
*
|
|
179
|
+
* @param {string} permissionName - Permission identifier to delete
|
|
180
|
+
*
|
|
181
|
+
* @returns {Promise<Empty>} Empty response on success
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* await scalekitClient.permission.deletePermission('deprecated:feature');
|
|
185
|
+
*
|
|
186
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Delete Permission API}
|
|
101
187
|
*/
|
|
102
188
|
async deletePermission(permissionName: string): Promise<Empty> {
|
|
103
|
-
return this.coreClient.connectExec(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
);
|
|
189
|
+
return this.coreClient.connectExec(this.client.deletePermission, {
|
|
190
|
+
permissionName,
|
|
191
|
+
});
|
|
107
192
|
}
|
|
108
193
|
|
|
109
194
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
195
|
+
* Lists direct permissions assigned to a role (excluding inherited permissions).
|
|
196
|
+
*
|
|
197
|
+
* Use this to view explicit permission assignments without inheritance from base roles.
|
|
198
|
+
*
|
|
199
|
+
* @param {string} roleName - Role to examine
|
|
200
|
+
*
|
|
201
|
+
* @returns {Promise<ListRolePermissionsResponse>} List of directly assigned permissions only
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* const response = await scalekitClient.permission.listRolePermissions('editor');
|
|
205
|
+
* console.log('Direct permissions:', response.permissions);
|
|
206
|
+
*
|
|
207
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | List Role Permissions API}
|
|
208
|
+
* @see {@link listEffectiveRolePermissions} - Get all permissions including inherited
|
|
113
209
|
*/
|
|
114
|
-
async listRolePermissions(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
210
|
+
async listRolePermissions(
|
|
211
|
+
roleName: string
|
|
212
|
+
): Promise<ListRolePermissionsResponse> {
|
|
213
|
+
return this.coreClient.connectExec(this.client.listRolePermissions, {
|
|
214
|
+
roleName,
|
|
215
|
+
});
|
|
119
216
|
}
|
|
120
217
|
|
|
121
218
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
219
|
+
* Grants additional permissions to a role without removing existing assignments.
|
|
220
|
+
*
|
|
221
|
+
* This is an incremental operation that adds new permissions while preserving existing ones.
|
|
222
|
+
* System validates permission existence before assignment.
|
|
223
|
+
*
|
|
224
|
+
* @param {string} roleName - Target role to enhance
|
|
225
|
+
* @param {string[]} permissionNames - Array of permission identifiers to add
|
|
226
|
+
*
|
|
227
|
+
* @returns {Promise<AddPermissionsToRoleResponse>} Updated list of all role permissions
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* // Add multiple permissions to a role
|
|
231
|
+
* await scalekitClient.permission.addPermissionsToRole('editor', [
|
|
232
|
+
* 'read:documents',
|
|
233
|
+
* 'write:documents',
|
|
234
|
+
* 'edit:documents'
|
|
235
|
+
* ]);
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* // Incrementally add permissions
|
|
239
|
+
* await scalekitClient.permission.addPermissionsToRole('support', ['read:tickets']);
|
|
240
|
+
* await scalekitClient.permission.addPermissionsToRole('support', ['update:tickets']);
|
|
241
|
+
*
|
|
242
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Add Permissions to Role API}
|
|
126
243
|
*/
|
|
127
|
-
async addPermissionsToRole(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
);
|
|
244
|
+
async addPermissionsToRole(
|
|
245
|
+
roleName: string,
|
|
246
|
+
permissionNames: string[]
|
|
247
|
+
): Promise<AddPermissionsToRoleResponse> {
|
|
248
|
+
return this.coreClient.connectExec(this.client.addPermissionsToRole, {
|
|
249
|
+
roleName,
|
|
250
|
+
permissionNames,
|
|
251
|
+
});
|
|
135
252
|
}
|
|
136
253
|
|
|
137
254
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
255
|
+
* Revokes a specific permission from a role, restricting access for all assigned users.
|
|
256
|
+
*
|
|
257
|
+
* Only affects direct assignments; doesn't impact inherited permissions from base roles.
|
|
258
|
+
*
|
|
259
|
+
* @param {string} roleName - Role to modify
|
|
260
|
+
* @param {string} permissionName - Permission to remove
|
|
261
|
+
*
|
|
262
|
+
* @returns {Promise<Empty>} Empty response on success
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* // Remove delete permission from editor role
|
|
266
|
+
* await scalekitClient.permission.removePermissionFromRole('editor', 'delete:documents');
|
|
267
|
+
*
|
|
268
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | Remove Permission from Role API}
|
|
142
269
|
*/
|
|
143
|
-
async removePermissionFromRole(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
270
|
+
async removePermissionFromRole(
|
|
271
|
+
roleName: string,
|
|
272
|
+
permissionName: string
|
|
273
|
+
): Promise<Empty> {
|
|
274
|
+
return this.coreClient.connectExec(this.client.removePermissionFromRole, {
|
|
275
|
+
roleName,
|
|
276
|
+
permissionName,
|
|
277
|
+
});
|
|
151
278
|
}
|
|
152
279
|
|
|
153
280
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
281
|
+
* Lists all effective permissions for a role including both direct and inherited permissions.
|
|
282
|
+
*
|
|
283
|
+
* This returns the complete set of capabilities available through the role hierarchy.
|
|
284
|
+
* Essential for understanding the full scope of access granted to users assigned to this role.
|
|
285
|
+
*
|
|
286
|
+
* @param {string} roleName - Role to analyze
|
|
287
|
+
*
|
|
288
|
+
* @returns {Promise<ListEffectiveRolePermissionsResponse>} Complete list including inherited permissions
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* // Compare direct vs effective permissions
|
|
292
|
+
* const direct = await scalekitClient.permission.listRolePermissions('senior_editor');
|
|
293
|
+
* const effective = await scalekitClient.permission.listEffectiveRolePermissions('senior_editor');
|
|
294
|
+
*
|
|
295
|
+
* console.log('Direct permissions:', direct.permissions.length);
|
|
296
|
+
* console.log('Total effective permissions:', effective.permissions.length);
|
|
297
|
+
* console.log('Inherited:', effective.permissions.length - direct.permissions.length);
|
|
298
|
+
*
|
|
299
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/permissions | List Effective Role Permissions API}
|
|
300
|
+
* @see {@link listRolePermissions} - Get only direct permissions
|
|
157
301
|
*/
|
|
158
|
-
async listEffectiveRolePermissions(
|
|
302
|
+
async listEffectiveRolePermissions(
|
|
303
|
+
roleName: string
|
|
304
|
+
): Promise<ListEffectiveRolePermissionsResponse> {
|
|
159
305
|
return this.coreClient.connectExec(
|
|
160
306
|
this.client.listEffectiveRolePermissions,
|
|
161
307
|
{ roleName }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
|
|
6
|
-
import { DiscoveryAuthMethodRequest, DiscoveryAuthMethodResponse, GetAuthCustomizationsRequest, GetAuthCustomizationsResponse, GetAuthErrorRequest, GetAuthErrorResponse, GetAuthFeaturesResponse, GetAuthStateResponse, ListAuthMethodsRequest, ListAuthMethodsResponse, ListUserOrganizationsResponse, SignupOrganizationRequest, SignupOrganizationResponse, UpdateLoginUserDetailsRequest,
|
|
6
|
+
import { DiscoveryAuthMethodRequest, DiscoveryAuthMethodResponse, GetAuthCustomizationsRequest, GetAuthCustomizationsResponse, GetAuthErrorRequest, GetAuthErrorResponse, GetAuthFeaturesResponse, GetAuthStateResponse, ListAuthMethodsRequest, ListAuthMethodsResponse, ListUserOrganizationsResponse, SignupOrganizationRequest, SignupOrganizationResponse, UpdateLoginUserDetailsRequest, VerifyPasswordLessOtpRequest, VerifyPasswordLessOtpResponse } from "./auth_pb.js";
|
|
7
7
|
import { Empty, MethodKind } from "@bufbuild/protobuf";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -35,8 +35,8 @@ export const AuthService = {
|
|
|
35
35
|
*/
|
|
36
36
|
verifyPasswordLessOtp: {
|
|
37
37
|
name: "VerifyPasswordLessOtp",
|
|
38
|
-
I:
|
|
39
|
-
O:
|
|
38
|
+
I: VerifyPasswordLessOtpRequest,
|
|
39
|
+
O: VerifyPasswordLessOtpResponse,
|
|
40
40
|
kind: MethodKind.Unary,
|
|
41
41
|
},
|
|
42
42
|
/**
|
|
@@ -519,70 +519,70 @@ export class GetAuthFeaturesResponse extends Message<GetAuthFeaturesResponse> {
|
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
/**
|
|
522
|
-
* @generated from message scalekit.v1.auth.
|
|
522
|
+
* @generated from message scalekit.v1.auth.VerifyPasswordLessOtpRequest
|
|
523
523
|
*/
|
|
524
|
-
export class
|
|
524
|
+
export class VerifyPasswordLessOtpRequest extends Message<VerifyPasswordLessOtpRequest> {
|
|
525
525
|
/**
|
|
526
526
|
* @generated from field: scalekit.v1.auth.OTPRequest otp_req = 2;
|
|
527
527
|
*/
|
|
528
528
|
otpReq?: OTPRequest;
|
|
529
529
|
|
|
530
|
-
constructor(data?: PartialMessage<
|
|
530
|
+
constructor(data?: PartialMessage<VerifyPasswordLessOtpRequest>) {
|
|
531
531
|
super();
|
|
532
532
|
proto3.util.initPartial(data, this);
|
|
533
533
|
}
|
|
534
534
|
|
|
535
535
|
static readonly runtime: typeof proto3 = proto3;
|
|
536
|
-
static readonly typeName = "scalekit.v1.auth.
|
|
536
|
+
static readonly typeName = "scalekit.v1.auth.VerifyPasswordLessOtpRequest";
|
|
537
537
|
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
538
538
|
{ no: 2, name: "otp_req", kind: "message", T: OTPRequest },
|
|
539
539
|
]);
|
|
540
540
|
|
|
541
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>):
|
|
542
|
-
return new
|
|
541
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): VerifyPasswordLessOtpRequest {
|
|
542
|
+
return new VerifyPasswordLessOtpRequest().fromBinary(bytes, options);
|
|
543
543
|
}
|
|
544
544
|
|
|
545
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>):
|
|
546
|
-
return new
|
|
545
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): VerifyPasswordLessOtpRequest {
|
|
546
|
+
return new VerifyPasswordLessOtpRequest().fromJson(jsonValue, options);
|
|
547
547
|
}
|
|
548
548
|
|
|
549
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>):
|
|
550
|
-
return new
|
|
549
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): VerifyPasswordLessOtpRequest {
|
|
550
|
+
return new VerifyPasswordLessOtpRequest().fromJsonString(jsonString, options);
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
-
static equals(a:
|
|
554
|
-
return proto3.util.equals(
|
|
553
|
+
static equals(a: VerifyPasswordLessOtpRequest | PlainMessage<VerifyPasswordLessOtpRequest> | undefined, b: VerifyPasswordLessOtpRequest | PlainMessage<VerifyPasswordLessOtpRequest> | undefined): boolean {
|
|
554
|
+
return proto3.util.equals(VerifyPasswordLessOtpRequest, a, b);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
/**
|
|
559
|
-
* @generated from message scalekit.v1.auth.
|
|
559
|
+
* @generated from message scalekit.v1.auth.VerifyPasswordLessOtpResponse
|
|
560
560
|
*/
|
|
561
|
-
export class
|
|
562
|
-
constructor(data?: PartialMessage<
|
|
561
|
+
export class VerifyPasswordLessOtpResponse extends Message<VerifyPasswordLessOtpResponse> {
|
|
562
|
+
constructor(data?: PartialMessage<VerifyPasswordLessOtpResponse>) {
|
|
563
563
|
super();
|
|
564
564
|
proto3.util.initPartial(data, this);
|
|
565
565
|
}
|
|
566
566
|
|
|
567
567
|
static readonly runtime: typeof proto3 = proto3;
|
|
568
|
-
static readonly typeName = "scalekit.v1.auth.
|
|
568
|
+
static readonly typeName = "scalekit.v1.auth.VerifyPasswordLessOtpResponse";
|
|
569
569
|
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
570
570
|
]);
|
|
571
571
|
|
|
572
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>):
|
|
573
|
-
return new
|
|
572
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): VerifyPasswordLessOtpResponse {
|
|
573
|
+
return new VerifyPasswordLessOtpResponse().fromBinary(bytes, options);
|
|
574
574
|
}
|
|
575
575
|
|
|
576
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>):
|
|
577
|
-
return new
|
|
576
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): VerifyPasswordLessOtpResponse {
|
|
577
|
+
return new VerifyPasswordLessOtpResponse().fromJson(jsonValue, options);
|
|
578
578
|
}
|
|
579
579
|
|
|
580
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>):
|
|
581
|
-
return new
|
|
580
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): VerifyPasswordLessOtpResponse {
|
|
581
|
+
return new VerifyPasswordLessOtpResponse().fromJsonString(jsonString, options);
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
-
static equals(a:
|
|
585
|
-
return proto3.util.equals(
|
|
584
|
+
static equals(a: VerifyPasswordLessOtpResponse | PlainMessage<VerifyPasswordLessOtpResponse> | undefined, b: VerifyPasswordLessOtpResponse | PlainMessage<VerifyPasswordLessOtpResponse> | undefined): boolean {
|
|
585
|
+
return proto3.util.equals(VerifyPasswordLessOtpResponse, a, b);
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts"
|
|
2
|
+
// @generated from file scalekit/v1/auth/webauthn.proto (package scalekit.v1.auth.webauthn, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
|
|
6
|
+
import { BeginAuthenticationRequest, BeginAuthenticationResponse, BeginRegistrationRequest, BeginRegistrationResponse, DeleteCredentialRequest, DeleteCredentialResponse, FinishAuthenticationRequest, FinishAuthenticationResponse, FinishRegistrationRequest, FinishRegistrationResponse, GetRelatedOriginsRequest, GetRelatedOriginsResponse, ListCredentialsRequest, ListCredentialsResponse, UpdateCredentialRequest, UpdateCredentialResponse } from "./webauthn_pb.js";
|
|
7
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @generated from service scalekit.v1.auth.webauthn.WebAuthnService
|
|
11
|
+
*/
|
|
12
|
+
export const WebAuthnService = {
|
|
13
|
+
typeName: "scalekit.v1.auth.webauthn.WebAuthnService",
|
|
14
|
+
methods: {
|
|
15
|
+
/**
|
|
16
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.BeginRegistration
|
|
17
|
+
*/
|
|
18
|
+
beginRegistration: {
|
|
19
|
+
name: "BeginRegistration",
|
|
20
|
+
I: BeginRegistrationRequest,
|
|
21
|
+
O: BeginRegistrationResponse,
|
|
22
|
+
kind: MethodKind.Unary,
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.FinishRegistration
|
|
26
|
+
*/
|
|
27
|
+
finishRegistration: {
|
|
28
|
+
name: "FinishRegistration",
|
|
29
|
+
I: FinishRegistrationRequest,
|
|
30
|
+
O: FinishRegistrationResponse,
|
|
31
|
+
kind: MethodKind.Unary,
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.BeginAuthentication
|
|
35
|
+
*/
|
|
36
|
+
beginAuthentication: {
|
|
37
|
+
name: "BeginAuthentication",
|
|
38
|
+
I: BeginAuthenticationRequest,
|
|
39
|
+
O: BeginAuthenticationResponse,
|
|
40
|
+
kind: MethodKind.Unary,
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.FinishAuthentication
|
|
44
|
+
*/
|
|
45
|
+
finishAuthentication: {
|
|
46
|
+
name: "FinishAuthentication",
|
|
47
|
+
I: FinishAuthenticationRequest,
|
|
48
|
+
O: FinishAuthenticationResponse,
|
|
49
|
+
kind: MethodKind.Unary,
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.ListCredentials
|
|
53
|
+
*/
|
|
54
|
+
listCredentials: {
|
|
55
|
+
name: "ListCredentials",
|
|
56
|
+
I: ListCredentialsRequest,
|
|
57
|
+
O: ListCredentialsResponse,
|
|
58
|
+
kind: MethodKind.Unary,
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.DeleteCredential
|
|
62
|
+
*/
|
|
63
|
+
deleteCredential: {
|
|
64
|
+
name: "DeleteCredential",
|
|
65
|
+
I: DeleteCredentialRequest,
|
|
66
|
+
O: DeleteCredentialResponse,
|
|
67
|
+
kind: MethodKind.Unary,
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.UpdateCredential
|
|
71
|
+
*/
|
|
72
|
+
updateCredential: {
|
|
73
|
+
name: "UpdateCredential",
|
|
74
|
+
I: UpdateCredentialRequest,
|
|
75
|
+
O: UpdateCredentialResponse,
|
|
76
|
+
kind: MethodKind.Unary,
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* @generated from rpc scalekit.v1.auth.webauthn.WebAuthnService.GetRelatedOrigins
|
|
80
|
+
*/
|
|
81
|
+
getRelatedOrigins: {
|
|
82
|
+
name: "GetRelatedOrigins",
|
|
83
|
+
I: GetRelatedOriginsRequest,
|
|
84
|
+
O: GetRelatedOriginsResponse,
|
|
85
|
+
kind: MethodKind.Unary,
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
} as const;
|
|
89
|
+
|