@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.
Files changed (92) hide show
  1. package/buf.gen.yaml +1 -0
  2. package/lib/auth.d.ts +41 -9
  3. package/lib/auth.js +44 -12
  4. package/lib/auth.js.map +1 -1
  5. package/lib/connection.d.ts +195 -21
  6. package/lib/connection.js +197 -23
  7. package/lib/connection.js.map +1 -1
  8. package/lib/core.d.ts +2 -2
  9. package/lib/core.js +13 -12
  10. package/lib/core.js.map +1 -1
  11. package/lib/directory.d.ts +293 -40
  12. package/lib/directory.js +308 -44
  13. package/lib/directory.js.map +1 -1
  14. package/lib/domain.d.ts +166 -18
  15. package/lib/domain.js +178 -29
  16. package/lib/domain.js.map +1 -1
  17. package/lib/organization.d.ts +407 -40
  18. package/lib/organization.js +433 -49
  19. package/lib/organization.js.map +1 -1
  20. package/lib/permission.d.ts +179 -35
  21. package/lib/permission.js +190 -38
  22. package/lib/permission.js.map +1 -1
  23. package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.d.ts +3 -3
  24. package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js +2 -2
  25. package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js.map +1 -1
  26. package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.d.ts +16 -16
  27. package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js +21 -21
  28. package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js.map +1 -1
  29. package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.d.ts +82 -0
  30. package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js +90 -0
  31. package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js.map +1 -0
  32. package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.d.ts +647 -0
  33. package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js +993 -0
  34. package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js.map +1 -0
  35. package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.d.ts +142 -0
  36. package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +165 -1
  37. package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
  38. package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.d.ts +1 -10
  39. package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js +0 -9
  40. package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js.map +1 -1
  41. package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +28 -63
  42. package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +9 -90
  43. package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
  44. package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.d.ts +6 -6
  45. package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js +5 -5
  46. package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.d.ts +19 -30
  47. package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js +22 -31
  48. package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js.map +1 -1
  49. package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +2 -2
  50. package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +1 -1
  51. package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
  52. package/lib/role.d.ts +252 -56
  53. package/lib/role.js +262 -62
  54. package/lib/role.js.map +1 -1
  55. package/lib/scalekit.d.ts +323 -54
  56. package/lib/scalekit.js +354 -76
  57. package/lib/scalekit.js.map +1 -1
  58. package/lib/session.d.ts +235 -22
  59. package/lib/session.js +237 -24
  60. package/lib/session.js.map +1 -1
  61. package/lib/types/organization.d.ts +3 -0
  62. package/lib/user.d.ts +571 -53
  63. package/lib/user.js +598 -89
  64. package/lib/user.js.map +1 -1
  65. package/lib/webauthn.d.ts +33 -0
  66. package/lib/webauthn.js +80 -0
  67. package/lib/webauthn.js.map +1 -0
  68. package/package.json +2 -2
  69. package/src/auth.ts +53 -19
  70. package/src/connection.ts +237 -62
  71. package/src/core.ts +39 -33
  72. package/src/directory.ts +356 -98
  73. package/src/domain.ts +215 -68
  74. package/src/organization.ts +506 -105
  75. package/src/permission.ts +234 -88
  76. package/src/pkg/grpc/scalekit/v1/auth/auth_connect.ts +3 -3
  77. package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +24 -24
  78. package/src/pkg/grpc/scalekit/v1/auth/webauthn_connect.ts +89 -0
  79. package/src/pkg/grpc/scalekit/v1/auth/webauthn_pb.ts +1263 -0
  80. package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +217 -0
  81. package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +1 -10
  82. package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +42 -129
  83. package/src/pkg/grpc/scalekit/v1/organizations/organizations_connect.ts +6 -6
  84. package/src/pkg/grpc/scalekit/v1/organizations/organizations_pb.ts +28 -43
  85. package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +3 -3
  86. package/src/role.ts +336 -136
  87. package/src/scalekit.ts +478 -149
  88. package/src/session.ts +266 -63
  89. package/src/types/organization.ts +4 -0
  90. package/src/user.ts +675 -168
  91. package/src/webauthn.ts +98 -0
  92. package/tests/organization.test.ts +16 -0
package/src/permission.ts CHANGED
@@ -1,9 +1,9 @@
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 {
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 './pkg/grpc/scalekit/v1/roles/roles_pb';
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
- * Create a new permission
38
- * @param {CreatePermission} permission The permission creation object
39
- * @returns {Promise<CreatePermissionResponse>} The created permission
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(permission: CreatePermission): Promise<CreatePermissionResponse> {
42
- return this.coreClient.connectExec(
43
- this.client.createPermission,
44
- { permission }
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
- * Get permission by name
50
- * @param {string} permissionName The permission name
51
- * @returns {Promise<GetPermissionResponse>} The permission details
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
- this.client.getPermission,
56
- { permissionName }
57
- );
98
+ return this.coreClient.connectExec(this.client.getPermission, {
99
+ permissionName,
100
+ });
58
101
  }
59
102
 
60
103
  /**
61
- * List all permissions
62
- * @param {string} [pageToken] Token for pagination
63
- * @param {number} [pageSize] Number of permissions per page
64
- * @returns {Promise<ListPermissionsResponse>} List of permissions
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(pageToken?: string, pageSize?: number): Promise<ListPermissionsResponse> {
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
- * Update an existing permission by name
83
- * @param {string} permissionName The permission name to update
84
- * @param {CreatePermission} permission The permission update object
85
- * @returns {Promise<UpdatePermissionResponse>} The updated permission
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(permissionName: string, permission: CreatePermission): Promise<UpdatePermissionResponse> {
88
- return this.coreClient.connectExec(
89
- this.client.updatePermission,
90
- {
91
- permissionName,
92
- permission
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
- * Delete permission by name
99
- * @param {string} permissionName The permission name to be deleted
100
- * @returns {Promise<Empty>} Empty response
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
- this.client.deletePermission,
105
- { permissionName }
106
- );
189
+ return this.coreClient.connectExec(this.client.deletePermission, {
190
+ permissionName,
191
+ });
107
192
  }
108
193
 
109
194
  /**
110
- * List all permissions associated with a role
111
- * @param {string} roleName The role name to get permissions for
112
- * @returns {Promise<ListRolePermissionsResponse>} List of role permissions
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(roleName: string): Promise<ListRolePermissionsResponse> {
115
- return this.coreClient.connectExec(
116
- this.client.listRolePermissions,
117
- { roleName }
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
- * Add permissions to a role
123
- * @param {string} roleName The role name to add permissions to
124
- * @param {string[]} permissionNames List of permission names to add
125
- * @returns {Promise<AddPermissionsToRoleResponse>} The response after adding permissions
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(roleName: string, permissionNames: string[]): Promise<AddPermissionsToRoleResponse> {
128
- return this.coreClient.connectExec(
129
- this.client.addPermissionsToRole,
130
- {
131
- roleName,
132
- permissionNames
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
- * Remove a permission from a role
139
- * @param {string} roleName The role name to remove permission from
140
- * @param {string} permissionName The permission name to remove
141
- * @returns {Promise<Empty>} Empty response
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(roleName: string, permissionName: string): Promise<Empty> {
144
- return this.coreClient.connectExec(
145
- this.client.removePermissionFromRole,
146
- {
147
- roleName,
148
- permissionName
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
- * List all effective permissions for a role (including inherited permissions)
155
- * @param {string} roleName The role name to get effective permissions for
156
- * @returns {Promise<ListEffectiveRolePermissionsResponse>} List of effective role permissions
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(roleName: string): Promise<ListEffectiveRolePermissionsResponse> {
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, VerifyPasswordLessRequest, VerifyPasswordLessResponse } from "./auth_pb.js";
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: VerifyPasswordLessRequest,
39
- O: VerifyPasswordLessResponse,
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.VerifyPasswordLessRequest
522
+ * @generated from message scalekit.v1.auth.VerifyPasswordLessOtpRequest
523
523
  */
524
- export class VerifyPasswordLessRequest extends Message<VerifyPasswordLessRequest> {
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<VerifyPasswordLessRequest>) {
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.VerifyPasswordLessRequest";
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>): VerifyPasswordLessRequest {
542
- return new VerifyPasswordLessRequest().fromBinary(bytes, options);
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>): VerifyPasswordLessRequest {
546
- return new VerifyPasswordLessRequest().fromJson(jsonValue, options);
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>): VerifyPasswordLessRequest {
550
- return new VerifyPasswordLessRequest().fromJsonString(jsonString, options);
549
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): VerifyPasswordLessOtpRequest {
550
+ return new VerifyPasswordLessOtpRequest().fromJsonString(jsonString, options);
551
551
  }
552
552
 
553
- static equals(a: VerifyPasswordLessRequest | PlainMessage<VerifyPasswordLessRequest> | undefined, b: VerifyPasswordLessRequest | PlainMessage<VerifyPasswordLessRequest> | undefined): boolean {
554
- return proto3.util.equals(VerifyPasswordLessRequest, a, b);
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.VerifyPasswordLessResponse
559
+ * @generated from message scalekit.v1.auth.VerifyPasswordLessOtpResponse
560
560
  */
561
- export class VerifyPasswordLessResponse extends Message<VerifyPasswordLessResponse> {
562
- constructor(data?: PartialMessage<VerifyPasswordLessResponse>) {
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.VerifyPasswordLessResponse";
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>): VerifyPasswordLessResponse {
573
- return new VerifyPasswordLessResponse().fromBinary(bytes, options);
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>): VerifyPasswordLessResponse {
577
- return new VerifyPasswordLessResponse().fromJson(jsonValue, options);
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>): VerifyPasswordLessResponse {
581
- return new VerifyPasswordLessResponse().fromJsonString(jsonString, options);
580
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): VerifyPasswordLessOtpResponse {
581
+ return new VerifyPasswordLessOtpResponse().fromJsonString(jsonString, options);
582
582
  }
583
583
 
584
- static equals(a: VerifyPasswordLessResponse | PlainMessage<VerifyPasswordLessResponse> | undefined, b: VerifyPasswordLessResponse | PlainMessage<VerifyPasswordLessResponse> | undefined): boolean {
585
- return proto3.util.equals(VerifyPasswordLessResponse, a, b);
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
+