@scalekit-sdk/node 2.1.2 → 2.1.4

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 (64) hide show
  1. package/README.md +47 -11
  2. package/buf.gen.yaml +3 -0
  3. package/lib/core.js +1 -1
  4. package/lib/permission.d.ts +68 -0
  5. package/lib/permission.js +131 -0
  6. package/lib/permission.js.map +1 -0
  7. package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.d.ts +19 -0
  8. package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.js +27 -0
  9. package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.js.map +1 -0
  10. package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.d.ts +154 -0
  11. package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js +226 -0
  12. package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js.map +1 -0
  13. package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.d.ts +2 -2
  14. package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +1 -1
  15. package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
  16. package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +16 -0
  17. package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +4 -0
  18. package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
  19. package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.d.ts +0 -8
  20. package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js +0 -6
  21. package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js.map +1 -1
  22. package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.d.ts +250 -0
  23. package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.js +258 -0
  24. package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.js.map +1 -0
  25. package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.d.ts +1157 -0
  26. package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js +1799 -0
  27. package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js.map +1 -0
  28. package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.d.ts +46 -0
  29. package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.js +54 -0
  30. package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.js.map +1 -0
  31. package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.d.ts +377 -0
  32. package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js +513 -0
  33. package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js.map +1 -0
  34. package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +2 -2
  35. package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +1 -1
  36. package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
  37. package/lib/role.d.ts +104 -0
  38. package/lib/role.js +205 -0
  39. package/lib/role.js.map +1 -0
  40. package/lib/scalekit.d.ts +6 -0
  41. package/lib/scalekit.js +6 -0
  42. package/lib/scalekit.js.map +1 -1
  43. package/lib/session.d.ts +48 -0
  44. package/lib/session.js +101 -0
  45. package/lib/session.js.map +1 -0
  46. package/package.json +1 -1
  47. package/src/core.ts +1 -1
  48. package/src/permission.ts +164 -0
  49. package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.ts +26 -0
  50. package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.ts +282 -0
  51. package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +3 -3
  52. package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +24 -0
  53. package/src/pkg/grpc/scalekit/v1/domains/domains_pb.ts +0 -12
  54. package/src/pkg/grpc/scalekit/v1/roles/roles_connect.ts +257 -0
  55. package/src/pkg/grpc/scalekit/v1/roles/roles_pb.ts +2357 -0
  56. package/src/pkg/grpc/scalekit/v1/sessions/sessions_connect.ts +53 -0
  57. package/src/pkg/grpc/scalekit/v1/sessions/sessions_pb.ts +697 -0
  58. package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +3 -3
  59. package/src/role.ts +261 -0
  60. package/src/scalekit.ts +18 -0
  61. package/src/session.ts +134 -0
  62. package/tests/permission.test.ts +399 -0
  63. package/tests/role.test.ts +323 -0
  64. package/tests/utils/test-data.ts +168 -1
@@ -0,0 +1,48 @@
1
+ import GrpcConnect from './connect';
2
+ import CoreClient from './core';
3
+ import { SessionDetails, UserSessionDetails, RevokeSessionResponse, RevokeAllUserSessionsResponse } from './pkg/grpc/scalekit/v1/sessions/sessions_pb';
4
+ export default class SessionClient {
5
+ private readonly grpcConnect;
6
+ private readonly coreClient;
7
+ private client;
8
+ constructor(grpcConnect: GrpcConnect, coreClient: CoreClient);
9
+ /**
10
+ * Get details for a specific session
11
+ * @param {string} sessionId The session id
12
+ * @returns {Promise<SessionDetails>} The session details
13
+ */
14
+ getSession(sessionId: string): Promise<SessionDetails>;
15
+ /**
16
+ * Get all session details for a user with pagination and filtering
17
+ * @param {string} userId The user id
18
+ * @param {object} options The pagination and filtering options
19
+ * @param {number} options.pageSize The page size
20
+ * @param {string} options.pageToken The page token
21
+ * @param {object} options.filter The session filter options
22
+ * @param {string[]} options.filter.status The session statuses to filter by
23
+ * @param {Date} options.filter.startTime The start time for filtering sessions
24
+ * @param {Date} options.filter.endTime The end time for filtering sessions
25
+ * @returns {Promise<UserSessionDetails>} The user session details
26
+ */
27
+ getUserSessions(userId: string, options?: {
28
+ pageSize?: number;
29
+ pageToken?: string;
30
+ filter?: {
31
+ status?: string[];
32
+ startTime?: Date;
33
+ endTime?: Date;
34
+ };
35
+ }): Promise<UserSessionDetails>;
36
+ /**
37
+ * Revoke a session for a user
38
+ * @param {string} sessionId The session id to revoke
39
+ * @returns {Promise<RevokeSessionResponse>} The response with revoked session details
40
+ */
41
+ revokeSession(sessionId: string): Promise<RevokeSessionResponse>;
42
+ /**
43
+ * Revoke all sessions for a user
44
+ * @param {string} userId The user id whose sessions should be revoked
45
+ * @returns {Promise<RevokeAllUserSessionsResponse>} The response with all revoked session details
46
+ */
47
+ revokeAllUserSessions(userId: string): Promise<RevokeAllUserSessionsResponse>;
48
+ }
package/lib/session.js ADDED
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const sessions_connect_1 = require("./pkg/grpc/scalekit/v1/sessions/sessions_connect");
13
+ const sessions_pb_1 = require("./pkg/grpc/scalekit/v1/sessions/sessions_pb");
14
+ const protobuf_1 = require("@bufbuild/protobuf");
15
+ class SessionClient {
16
+ constructor(grpcConnect, coreClient) {
17
+ this.grpcConnect = grpcConnect;
18
+ this.coreClient = coreClient;
19
+ this.client = this.grpcConnect.createClient(sessions_connect_1.SessionService);
20
+ }
21
+ /**
22
+ * Get details for a specific session
23
+ * @param {string} sessionId The session id
24
+ * @returns {Promise<SessionDetails>} The session details
25
+ */
26
+ getSession(sessionId) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return this.coreClient.connectExec(this.client.getSession, {
29
+ sessionId
30
+ });
31
+ });
32
+ }
33
+ /**
34
+ * Get all session details for a user with pagination and filtering
35
+ * @param {string} userId The user id
36
+ * @param {object} options The pagination and filtering options
37
+ * @param {number} options.pageSize The page size
38
+ * @param {string} options.pageToken The page token
39
+ * @param {object} options.filter The session filter options
40
+ * @param {string[]} options.filter.status The session statuses to filter by
41
+ * @param {Date} options.filter.startTime The start time for filtering sessions
42
+ * @param {Date} options.filter.endTime The end time for filtering sessions
43
+ * @returns {Promise<UserSessionDetails>} The user session details
44
+ */
45
+ getUserSessions(userId, options) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ const request = {
48
+ userId
49
+ };
50
+ if ((options === null || options === void 0 ? void 0 : options.pageSize) !== undefined) {
51
+ request.pageSize = options.pageSize;
52
+ }
53
+ if (options === null || options === void 0 ? void 0 : options.pageToken) {
54
+ request.pageToken = options.pageToken;
55
+ }
56
+ if (options === null || options === void 0 ? void 0 : options.filter) {
57
+ const filter = new sessions_pb_1.UserSessionFilter();
58
+ if (options.filter.status) {
59
+ filter.status = options.filter.status;
60
+ }
61
+ if (options.filter.startTime) {
62
+ filter.startTime = protobuf_1.Timestamp.fromDate(options.filter.startTime);
63
+ }
64
+ if (options.filter.endTime) {
65
+ filter.endTime = protobuf_1.Timestamp.fromDate(options.filter.endTime);
66
+ }
67
+ request.filter = filter;
68
+ }
69
+ return this.coreClient.connectExec(this.client.getUserSessions, request);
70
+ });
71
+ }
72
+ /**
73
+ * Revoke a session for a user
74
+ * @param {string} sessionId The session id to revoke
75
+ * @returns {Promise<RevokeSessionResponse>} The response with revoked session details
76
+ */
77
+ revokeSession(sessionId) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ return this.coreClient.connectExec(this.client.revokeSession, {
80
+ sessionId
81
+ });
82
+ });
83
+ }
84
+ /**
85
+ * Revoke all sessions for a user
86
+ * @param {string} userId The user id whose sessions should be revoked
87
+ * @returns {Promise<RevokeAllUserSessionsResponse>} The response with all revoked session details
88
+ */
89
+ revokeAllUserSessions(userId) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ if (!userId) {
92
+ throw new Error('userId is required');
93
+ }
94
+ return this.coreClient.connectExec(this.client.revokeAllUserSessions, {
95
+ userId
96
+ });
97
+ });
98
+ }
99
+ }
100
+ exports.default = SessionClient;
101
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,uFAAkF;AAClF,6EAUqD;AACrD,iDAA+C;AAE/C,MAAqB,aAAa;IAGhC,YACmB,WAAwB,EACxB,UAAsB;QADtB,gBAAW,GAAX,WAAW,CAAa;QACxB,eAAU,GAAV,UAAU,CAAY;QAEvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,iCAAc,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACG,UAAU,CAAC,SAAiB;;YAChC,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,UAAU,EACtB;gBACE,SAAS;aACV,CACF,CAAC;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;OAWG;IACG,eAAe,CACnB,MAAc,EACd,OAQC;;YAED,MAAM,OAAO,GAA8C;gBACzD,MAAM;aACP,CAAC;YAEF,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,SAAS,EAAE,CAAC;gBACpC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;YACtC,CAAC;YAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,EAAE,CAAC;gBACvB,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YACxC,CAAC;YAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,CAAC;gBACpB,MAAM,MAAM,GAAG,IAAI,+BAAiB,EAAE,CAAC;gBAEvC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBAC1B,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;gBACxC,CAAC;gBAED,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;oBAC7B,MAAM,CAAC,SAAS,GAAG,oBAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAClE,CAAC;gBAED,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBAC3B,MAAM,CAAC,OAAO,GAAG,oBAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC9D,CAAC;gBAED,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;YAC1B,CAAC;YAED,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,eAAe,EAC3B,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;IAED;;;;OAIG;IACG,aAAa,CAAC,SAAiB;;YACnC,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,aAAa,EACzB;gBACE,SAAS;aACV,CACF,CAAC;QACJ,CAAC;KAAA;IAED;;;;OAIG;IACG,qBAAqB,CAAC,MAAc;;YACxC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACxC,CAAC;YAED,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EACjC;gBACE,MAAM;aACP,CACF,CAAC;QACJ,CAAC;KAAA;CACF;AAnHD,gCAmHC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.2",
2
+ "version": "2.1.4",
3
3
  "name": "@scalekit-sdk/node",
4
4
  "description": "Official Scalekit Node SDK",
5
5
  "main": "lib/index.js",
package/src/core.ts CHANGED
@@ -20,7 +20,7 @@ export default class CoreClient {
20
20
  public keys: JWK[] = [];
21
21
  public accessToken: string | null = null;
22
22
  public axios: Axios;
23
- public sdkVersion = `Scalekit-Node/2.1.2`;
23
+ public sdkVersion = `Scalekit-Node/2.1.4`;
24
24
  public apiVersion = "20250830";
25
25
  public userAgent = `${this.sdkVersion} Node/${process.version} (${process.platform}; ${os.arch()})`;
26
26
  constructor(
@@ -0,0 +1,164 @@
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
+ CreatePermissionRequest,
8
+ CreatePermissionResponse,
9
+ GetPermissionRequest,
10
+ GetPermissionResponse,
11
+ UpdatePermissionRequest,
12
+ UpdatePermissionResponse,
13
+ ListPermissionsRequest,
14
+ ListPermissionsResponse,
15
+ DeletePermissionRequest,
16
+ ListRolePermissionsRequest,
17
+ ListRolePermissionsResponse,
18
+ AddPermissionsToRoleRequest,
19
+ AddPermissionsToRoleResponse,
20
+ RemovePermissionFromRoleRequest,
21
+ ListEffectiveRolePermissionsRequest,
22
+ ListEffectiveRolePermissionsResponse,
23
+ CreatePermission
24
+ } from './pkg/grpc/scalekit/v1/roles/roles_pb';
25
+
26
+ export default class PermissionClient {
27
+ private client: PromiseClient<typeof RolesService>;
28
+
29
+ constructor(
30
+ private readonly grpcConnect: GrpcConnect,
31
+ private readonly coreClient: CoreClient
32
+ ) {
33
+ this.client = this.grpcConnect.createClient(RolesService);
34
+ }
35
+
36
+ /**
37
+ * Create a new permission
38
+ * @param {CreatePermission} permission The permission creation object
39
+ * @returns {Promise<CreatePermissionResponse>} The created permission
40
+ */
41
+ async createPermission(permission: CreatePermission): Promise<CreatePermissionResponse> {
42
+ return this.coreClient.connectExec(
43
+ this.client.createPermission,
44
+ { permission }
45
+ );
46
+ }
47
+
48
+ /**
49
+ * Get permission by name
50
+ * @param {string} permissionName The permission name
51
+ * @returns {Promise<GetPermissionResponse>} The permission details
52
+ */
53
+ async getPermission(permissionName: string): Promise<GetPermissionResponse> {
54
+ return this.coreClient.connectExec(
55
+ this.client.getPermission,
56
+ { permissionName }
57
+ );
58
+ }
59
+
60
+ /**
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
65
+ */
66
+ async listPermissions(pageToken?: string, pageSize?: number): Promise<ListPermissionsResponse> {
67
+ const request: PartialMessage<ListPermissionsRequest> = {};
68
+ if (pageToken) {
69
+ request.pageToken = pageToken;
70
+ }
71
+ if (pageSize) {
72
+ request.pageSize = pageSize;
73
+ }
74
+
75
+ return this.coreClient.connectExec(
76
+ this.client.listPermissions,
77
+ request
78
+ );
79
+ }
80
+
81
+ /**
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
86
+ */
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
+ );
95
+ }
96
+
97
+ /**
98
+ * Delete permission by name
99
+ * @param {string} permissionName The permission name to be deleted
100
+ * @returns {Promise<Empty>} Empty response
101
+ */
102
+ async deletePermission(permissionName: string): Promise<Empty> {
103
+ return this.coreClient.connectExec(
104
+ this.client.deletePermission,
105
+ { permissionName }
106
+ );
107
+ }
108
+
109
+ /**
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
113
+ */
114
+ async listRolePermissions(roleName: string): Promise<ListRolePermissionsResponse> {
115
+ return this.coreClient.connectExec(
116
+ this.client.listRolePermissions,
117
+ { roleName }
118
+ );
119
+ }
120
+
121
+ /**
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
126
+ */
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
+ );
135
+ }
136
+
137
+ /**
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
142
+ */
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
+ );
151
+ }
152
+
153
+ /**
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
157
+ */
158
+ async listEffectiveRolePermissions(roleName: string): Promise<ListEffectiveRolePermissionsResponse> {
159
+ return this.coreClient.connectExec(
160
+ this.client.listEffectiveRolePermissions,
161
+ { roleName }
162
+ );
163
+ }
164
+ }
@@ -0,0 +1,26 @@
1
+ // @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts"
2
+ // @generated from file scalekit/v1/auditlogs/auditlogs.proto (package scalekit.v1.auditlogs, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+
6
+ import { ListAuthLogRequest, ListAuthLogResponse } from "./auditlogs_pb.js";
7
+ import { MethodKind } from "@bufbuild/protobuf";
8
+
9
+ /**
10
+ * @generated from service scalekit.v1.auditlogs.AuditLogsService
11
+ */
12
+ export const AuditLogsService = {
13
+ typeName: "scalekit.v1.auditlogs.AuditLogsService",
14
+ methods: {
15
+ /**
16
+ * @generated from rpc scalekit.v1.auditlogs.AuditLogsService.ListAuthRequests
17
+ */
18
+ listAuthRequests: {
19
+ name: "ListAuthRequests",
20
+ I: ListAuthLogRequest,
21
+ O: ListAuthLogResponse,
22
+ kind: MethodKind.Unary,
23
+ },
24
+ }
25
+ } as const;
26
+
@@ -0,0 +1,282 @@
1
+ // @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
2
+ // @generated from file scalekit/v1/auditlogs/auditlogs.proto (package scalekit.v1.auditlogs, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+
6
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
7
+ import { Message, proto3, Timestamp } from "@bufbuild/protobuf";
8
+
9
+ /**
10
+ * @generated from message scalekit.v1.auditlogs.ListAuthLogRequest
11
+ */
12
+ export class ListAuthLogRequest extends Message<ListAuthLogRequest> {
13
+ /**
14
+ * @generated from field: uint32 page_size = 1;
15
+ */
16
+ pageSize = 0;
17
+
18
+ /**
19
+ * @generated from field: string page_token = 2;
20
+ */
21
+ pageToken = "";
22
+
23
+ /**
24
+ * @generated from field: string email = 3;
25
+ */
26
+ email = "";
27
+
28
+ /**
29
+ * @generated from field: repeated string status = 4;
30
+ */
31
+ status: string[] = [];
32
+
33
+ /**
34
+ * @generated from field: google.protobuf.Timestamp start_time = 5;
35
+ */
36
+ startTime?: Timestamp;
37
+
38
+ /**
39
+ * @generated from field: google.protobuf.Timestamp end_time = 6;
40
+ */
41
+ endTime?: Timestamp;
42
+
43
+ constructor(data?: PartialMessage<ListAuthLogRequest>) {
44
+ super();
45
+ proto3.util.initPartial(data, this);
46
+ }
47
+
48
+ static readonly runtime: typeof proto3 = proto3;
49
+ static readonly typeName = "scalekit.v1.auditlogs.ListAuthLogRequest";
50
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
51
+ { no: 1, name: "page_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
52
+ { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
53
+ { no: 3, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ },
54
+ { no: 4, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
55
+ { no: 5, name: "start_time", kind: "message", T: Timestamp },
56
+ { no: 6, name: "end_time", kind: "message", T: Timestamp },
57
+ ]);
58
+
59
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAuthLogRequest {
60
+ return new ListAuthLogRequest().fromBinary(bytes, options);
61
+ }
62
+
63
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListAuthLogRequest {
64
+ return new ListAuthLogRequest().fromJson(jsonValue, options);
65
+ }
66
+
67
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListAuthLogRequest {
68
+ return new ListAuthLogRequest().fromJsonString(jsonString, options);
69
+ }
70
+
71
+ static equals(a: ListAuthLogRequest | PlainMessage<ListAuthLogRequest> | undefined, b: ListAuthLogRequest | PlainMessage<ListAuthLogRequest> | undefined): boolean {
72
+ return proto3.util.equals(ListAuthLogRequest, a, b);
73
+ }
74
+ }
75
+
76
+ /**
77
+ * @generated from message scalekit.v1.auditlogs.ListAuthLogResponse
78
+ */
79
+ export class ListAuthLogResponse extends Message<ListAuthLogResponse> {
80
+ /**
81
+ * @generated from field: string next_page_token = 1;
82
+ */
83
+ nextPageToken = "";
84
+
85
+ /**
86
+ * @generated from field: string prev_page_token = 2;
87
+ */
88
+ prevPageToken = "";
89
+
90
+ /**
91
+ * @generated from field: uint32 total_size = 3;
92
+ */
93
+ totalSize = 0;
94
+
95
+ /**
96
+ * @generated from field: repeated scalekit.v1.auditlogs.AuthLogRequest authRequests = 4;
97
+ */
98
+ authRequests: AuthLogRequest[] = [];
99
+
100
+ constructor(data?: PartialMessage<ListAuthLogResponse>) {
101
+ super();
102
+ proto3.util.initPartial(data, this);
103
+ }
104
+
105
+ static readonly runtime: typeof proto3 = proto3;
106
+ static readonly typeName = "scalekit.v1.auditlogs.ListAuthLogResponse";
107
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
108
+ { no: 1, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
109
+ { no: 2, name: "prev_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
110
+ { no: 3, name: "total_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
111
+ { no: 4, name: "authRequests", kind: "message", T: AuthLogRequest, repeated: true },
112
+ ]);
113
+
114
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAuthLogResponse {
115
+ return new ListAuthLogResponse().fromBinary(bytes, options);
116
+ }
117
+
118
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListAuthLogResponse {
119
+ return new ListAuthLogResponse().fromJson(jsonValue, options);
120
+ }
121
+
122
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListAuthLogResponse {
123
+ return new ListAuthLogResponse().fromJsonString(jsonString, options);
124
+ }
125
+
126
+ static equals(a: ListAuthLogResponse | PlainMessage<ListAuthLogResponse> | undefined, b: ListAuthLogResponse | PlainMessage<ListAuthLogResponse> | undefined): boolean {
127
+ return proto3.util.equals(ListAuthLogResponse, a, b);
128
+ }
129
+ }
130
+
131
+ /**
132
+ * @generated from message scalekit.v1.auditlogs.AuthLogRequest
133
+ */
134
+ export class AuthLogRequest extends Message<AuthLogRequest> {
135
+ /**
136
+ * @generated from field: string organization_id = 1;
137
+ */
138
+ organizationId = "";
139
+
140
+ /**
141
+ * @generated from field: string environment_id = 2;
142
+ */
143
+ environmentId = "";
144
+
145
+ /**
146
+ * @generated from field: string connection_id = 3;
147
+ */
148
+ connectionId = "";
149
+
150
+ /**
151
+ * @generated from field: string auth_request_id = 4;
152
+ */
153
+ authRequestId = "";
154
+
155
+ /**
156
+ * @generated from field: string email = 5;
157
+ */
158
+ email = "";
159
+
160
+ /**
161
+ * @generated from field: string connection_type = 6;
162
+ */
163
+ connectionType = "";
164
+
165
+ /**
166
+ * @generated from field: string connection_provider = 7;
167
+ */
168
+ connectionProvider = "";
169
+
170
+ /**
171
+ * @generated from field: string status = 8;
172
+ */
173
+ status = "";
174
+
175
+ /**
176
+ * @generated from field: google.protobuf.Timestamp timestamp = 9;
177
+ */
178
+ timestamp?: Timestamp;
179
+
180
+ /**
181
+ * @generated from field: repeated scalekit.v1.auditlogs.ConnectionDetails connection_details = 10;
182
+ */
183
+ connectionDetails: ConnectionDetails[] = [];
184
+
185
+ /**
186
+ * @generated from field: string workflow = 11;
187
+ */
188
+ workflow = "";
189
+
190
+ constructor(data?: PartialMessage<AuthLogRequest>) {
191
+ super();
192
+ proto3.util.initPartial(data, this);
193
+ }
194
+
195
+ static readonly runtime: typeof proto3 = proto3;
196
+ static readonly typeName = "scalekit.v1.auditlogs.AuthLogRequest";
197
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
198
+ { no: 1, name: "organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
199
+ { no: 2, name: "environment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
200
+ { no: 3, name: "connection_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
201
+ { no: 4, name: "auth_request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
202
+ { no: 5, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ },
203
+ { no: 6, name: "connection_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
204
+ { no: 7, name: "connection_provider", kind: "scalar", T: 9 /* ScalarType.STRING */ },
205
+ { no: 8, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ },
206
+ { no: 9, name: "timestamp", kind: "message", T: Timestamp },
207
+ { no: 10, name: "connection_details", kind: "message", T: ConnectionDetails, repeated: true },
208
+ { no: 11, name: "workflow", kind: "scalar", T: 9 /* ScalarType.STRING */ },
209
+ ]);
210
+
211
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AuthLogRequest {
212
+ return new AuthLogRequest().fromBinary(bytes, options);
213
+ }
214
+
215
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AuthLogRequest {
216
+ return new AuthLogRequest().fromJson(jsonValue, options);
217
+ }
218
+
219
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AuthLogRequest {
220
+ return new AuthLogRequest().fromJsonString(jsonString, options);
221
+ }
222
+
223
+ static equals(a: AuthLogRequest | PlainMessage<AuthLogRequest> | undefined, b: AuthLogRequest | PlainMessage<AuthLogRequest> | undefined): boolean {
224
+ return proto3.util.equals(AuthLogRequest, a, b);
225
+ }
226
+ }
227
+
228
+ /**
229
+ * @generated from message scalekit.v1.auditlogs.ConnectionDetails
230
+ */
231
+ export class ConnectionDetails extends Message<ConnectionDetails> {
232
+ /**
233
+ * @generated from field: string connection_id = 1;
234
+ */
235
+ connectionId = "";
236
+
237
+ /**
238
+ * @generated from field: string organization_id = 2;
239
+ */
240
+ organizationId = "";
241
+
242
+ /**
243
+ * @generated from field: string connection_type = 3;
244
+ */
245
+ connectionType = "";
246
+
247
+ /**
248
+ * @generated from field: string connection_provider = 4;
249
+ */
250
+ connectionProvider = "";
251
+
252
+ constructor(data?: PartialMessage<ConnectionDetails>) {
253
+ super();
254
+ proto3.util.initPartial(data, this);
255
+ }
256
+
257
+ static readonly runtime: typeof proto3 = proto3;
258
+ static readonly typeName = "scalekit.v1.auditlogs.ConnectionDetails";
259
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
260
+ { no: 1, name: "connection_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
261
+ { no: 2, name: "organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
262
+ { no: 3, name: "connection_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
263
+ { no: 4, name: "connection_provider", kind: "scalar", T: 9 /* ScalarType.STRING */ },
264
+ ]);
265
+
266
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ConnectionDetails {
267
+ return new ConnectionDetails().fromBinary(bytes, options);
268
+ }
269
+
270
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ConnectionDetails {
271
+ return new ConnectionDetails().fromJson(jsonValue, options);
272
+ }
273
+
274
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ConnectionDetails {
275
+ return new ConnectionDetails().fromJsonString(jsonString, options);
276
+ }
277
+
278
+ static equals(a: ConnectionDetails | PlainMessage<ConnectionDetails> | undefined, b: ConnectionDetails | PlainMessage<ConnectionDetails> | undefined): boolean {
279
+ return proto3.util.equals(ConnectionDetails, a, b);
280
+ }
281
+ }
282
+
@@ -113,9 +113,9 @@ export class OrganizationMembership extends Message<OrganizationMembership> {
113
113
  displayName?: string;
114
114
 
115
115
  /**
116
- * @generated from field: optional string invited_by = 10;
116
+ * @generated from field: optional string inviter_email = 10;
117
117
  */
118
- invitedBy?: string;
118
+ inviterEmail?: string;
119
119
 
120
120
  /**
121
121
  * @generated from field: optional google.protobuf.Timestamp created_at = 11;
@@ -147,7 +147,7 @@ export class OrganizationMembership extends Message<OrganizationMembership> {
147
147
  { no: 5, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
148
148
  { no: 7, name: "metadata", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
149
149
  { no: 9, name: "display_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
150
- { no: 10, name: "invited_by", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
150
+ { no: 10, name: "inviter_email", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
151
151
  { no: 11, name: "created_at", kind: "message", T: Timestamp, opt: true },
152
152
  { no: 12, name: "accepted_at", kind: "message", T: Timestamp, opt: true },
153
153
  { no: 13, name: "expires_at", kind: "message", T: Timestamp, opt: true },