@scalekit-sdk/node 2.1.7 → 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 (82) 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 +404 -44
  18. package/lib/organization.js +419 -54
  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/users/users_pb.d.ts +2 -2
  45. package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +1 -1
  46. package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
  47. package/lib/role.d.ts +252 -56
  48. package/lib/role.js +262 -62
  49. package/lib/role.js.map +1 -1
  50. package/lib/scalekit.d.ts +323 -54
  51. package/lib/scalekit.js +354 -76
  52. package/lib/scalekit.js.map +1 -1
  53. package/lib/session.d.ts +235 -22
  54. package/lib/session.js +237 -24
  55. package/lib/session.js.map +1 -1
  56. package/lib/user.d.ts +571 -53
  57. package/lib/user.js +598 -89
  58. package/lib/user.js.map +1 -1
  59. package/lib/webauthn.d.ts +33 -0
  60. package/lib/webauthn.js +80 -0
  61. package/lib/webauthn.js.map +1 -0
  62. package/package.json +2 -2
  63. package/src/auth.ts +53 -19
  64. package/src/connection.ts +237 -62
  65. package/src/core.ts +39 -33
  66. package/src/directory.ts +356 -98
  67. package/src/domain.ts +215 -68
  68. package/src/organization.ts +490 -112
  69. package/src/permission.ts +234 -88
  70. package/src/pkg/grpc/scalekit/v1/auth/auth_connect.ts +3 -3
  71. package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +24 -24
  72. package/src/pkg/grpc/scalekit/v1/auth/webauthn_connect.ts +89 -0
  73. package/src/pkg/grpc/scalekit/v1/auth/webauthn_pb.ts +1263 -0
  74. package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +217 -0
  75. package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +1 -10
  76. package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +42 -129
  77. package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +3 -3
  78. package/src/role.ts +336 -136
  79. package/src/scalekit.ts +478 -149
  80. package/src/session.ts +266 -63
  81. package/src/user.ts +675 -168
  82. package/src/webauthn.ts +98 -0
package/lib/user.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../src/user.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,8EAAyE;AACzE,oEAyB+C;AAG/C,MAAqB,UAAU;IAG7B,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,2BAAW,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACG,uBAAuB,CAAC,cAAsB,EAAE,OAA0B;;YAC9E,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvC,CAAC;YAED,MAAM,IAAI,GAAG,IAAI,qBAAU,CAAC;gBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,4BAAiB,CAAC;oBACvD,SAAS,EAAE,OAAO,CAAC,WAAW,CAA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,MAAM;aACX,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;CACF;AAvwBD,6BAuwBC"}
@@ -0,0 +1,33 @@
1
+ import GrpcConnect from './connect';
2
+ import CoreClient from './core';
3
+ import { ListCredentialsResponse, UpdateCredentialResponse, DeleteCredentialResponse } from './pkg/grpc/scalekit/v1/auth/webauthn_pb';
4
+ export default class WebAuthnClient {
5
+ private readonly grpcConnect;
6
+ private readonly coreClient;
7
+ private client;
8
+ constructor(grpcConnect: GrpcConnect, coreClient: CoreClient);
9
+ /**
10
+ * List all WebAuthn credentials for a user
11
+ * @param {string} userId The user ID to list credentials for
12
+ * @returns {Promise<ListCredentialsResponse>} The response containing:
13
+ * - credentials: Array of WebAuthn credentials
14
+ * - allAcceptedCredentialsOptions: Options for all accepted credentials
15
+ */
16
+ listCredentials(userId: string): Promise<ListCredentialsResponse>;
17
+ /**
18
+ * Update a WebAuthn credential's display name
19
+ * @param {string} credentialId The credential ID to update
20
+ * @param {string} displayName The new display name for the credential
21
+ * @returns {Promise<UpdateCredentialResponse>} The response containing:
22
+ * - credential: The updated WebAuthn credential
23
+ */
24
+ updateCredential(credentialId: string, displayName: string): Promise<UpdateCredentialResponse>;
25
+ /**
26
+ * Delete a WebAuthn credential
27
+ * @param {string} credentialId The credential ID to delete
28
+ * @returns {Promise<DeleteCredentialResponse>} The response containing:
29
+ * - success: Boolean indicating if the deletion was successful
30
+ * - unknownCredentialOptions: Options if the credential was not found
31
+ */
32
+ deleteCredential(credentialId: string): Promise<DeleteCredentialResponse>;
33
+ }
@@ -0,0 +1,80 @@
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 webauthn_connect_1 = require("./pkg/grpc/scalekit/v1/auth/webauthn_connect");
13
+ const webauthn_pb_1 = require("./pkg/grpc/scalekit/v1/auth/webauthn_pb");
14
+ class WebAuthnClient {
15
+ constructor(grpcConnect, coreClient) {
16
+ this.grpcConnect = grpcConnect;
17
+ this.coreClient = coreClient;
18
+ this.client = this.grpcConnect.createClient(webauthn_connect_1.WebAuthnService);
19
+ }
20
+ /**
21
+ * List all WebAuthn credentials for a user
22
+ * @param {string} userId The user ID to list credentials for
23
+ * @returns {Promise<ListCredentialsResponse>} The response containing:
24
+ * - credentials: Array of WebAuthn credentials
25
+ * - allAcceptedCredentialsOptions: Options for all accepted credentials
26
+ */
27
+ listCredentials(userId) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ if (!userId || typeof userId !== 'string') {
30
+ throw new Error('userId must be a non-empty string');
31
+ }
32
+ const request = new webauthn_pb_1.ListCredentialsRequest({
33
+ userId
34
+ });
35
+ return this.coreClient.connectExec(this.client.listCredentials, request);
36
+ });
37
+ }
38
+ /**
39
+ * Update a WebAuthn credential's display name
40
+ * @param {string} credentialId The credential ID to update
41
+ * @param {string} displayName The new display name for the credential
42
+ * @returns {Promise<UpdateCredentialResponse>} The response containing:
43
+ * - credential: The updated WebAuthn credential
44
+ */
45
+ updateCredential(credentialId, displayName) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ if (!credentialId || typeof credentialId !== 'string') {
48
+ throw new Error('credentialId must be a non-empty string');
49
+ }
50
+ if (!displayName || typeof displayName !== 'string') {
51
+ throw new Error('displayName must be a non-empty string');
52
+ }
53
+ const request = new webauthn_pb_1.UpdateCredentialRequest({
54
+ credentialId,
55
+ displayName
56
+ });
57
+ return this.coreClient.connectExec(this.client.updateCredential, request);
58
+ });
59
+ }
60
+ /**
61
+ * Delete a WebAuthn credential
62
+ * @param {string} credentialId The credential ID to delete
63
+ * @returns {Promise<DeleteCredentialResponse>} The response containing:
64
+ * - success: Boolean indicating if the deletion was successful
65
+ * - unknownCredentialOptions: Options if the credential was not found
66
+ */
67
+ deleteCredential(credentialId) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ if (!credentialId || typeof credentialId !== 'string') {
70
+ throw new Error('credentialId must be a non-empty string');
71
+ }
72
+ const request = new webauthn_pb_1.DeleteCredentialRequest({
73
+ credentialId
74
+ });
75
+ return this.coreClient.connectExec(this.client.deleteCredential, request);
76
+ });
77
+ }
78
+ }
79
+ exports.default = WebAuthnClient;
80
+ //# sourceMappingURL=webauthn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webauthn.js","sourceRoot":"","sources":["../src/webauthn.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,mFAA+E;AAC/E,yEAOiD;AAEjD,MAAqB,cAAc;IAGjC,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,kCAAe,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;OAMG;IACG,eAAe,CAAC,MAAc;;YAClC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,oCAAsB,CAAC;gBACzC,MAAM;aACP,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,eAAe,EAC3B,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;IAED;;;;;;OAMG;IACG,gBAAgB,CACpB,YAAoB,EACpB,WAAmB;;YAEnB,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACtD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAC7D,CAAC;YAED,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC5D,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,qCAAuB,CAAC;gBAC1C,YAAY;gBACZ,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAC5B,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;IAED;;;;;;OAMG;IACG,gBAAgB,CAAC,YAAoB;;YACzC,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACtD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAC7D,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,qCAAuB,CAAC;gBAC1C,YAAY;aACb,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAChC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAC5B,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;CACF;AAnFD,iCAmFC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.7",
2
+ "version": "2.1.8",
3
3
  "name": "@scalekit-sdk/node",
4
4
  "description": "Official Scalekit Node SDK",
5
5
  "main": "lib/index.js",
@@ -29,7 +29,7 @@
29
29
  "@connectrpc/connect-node": "^1.4.0",
30
30
  "axios": "^1.10.0",
31
31
  "jose": "^5.6.3",
32
- "qs": "^6.13.0"
32
+ "qs": "^6.14.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@bufbuild/buf": "^1.36.0",
package/src/auth.ts CHANGED
@@ -1,14 +1,27 @@
1
- import { Empty, PartialMessage, Struct, JsonValue } from '@bufbuild/protobuf';
2
- import { PromiseClient } from '@connectrpc/connect';
3
- import CoreClient from './core';
4
- import GrpcConnect from './connect';
5
- import { AuthService } from './pkg/grpc/scalekit/v1/auth/auth_connect';
6
- import { UpdateLoginUserDetailsRequest, User } from './pkg/grpc/scalekit/v1/auth/auth_pb';
1
+ import { Empty, PartialMessage, Struct, JsonValue } from "@bufbuild/protobuf";
2
+ import { PromiseClient } from "@connectrpc/connect";
3
+ import CoreClient from "./core";
4
+ import GrpcConnect from "./connect";
5
+ import { AuthService } from "./pkg/grpc/scalekit/v1/auth/auth_connect";
6
+ import {
7
+ UpdateLoginUserDetailsRequest,
8
+ User,
9
+ } from "./pkg/grpc/scalekit/v1/auth/auth_pb";
7
10
 
8
11
  type UserInput = PartialMessage<User> & {
9
12
  customAttributes?: Record<string, JsonValue>;
10
13
  };
11
14
 
15
+ /**
16
+ * If you are using Auth for MCP solution of Scalekit in "Bring your own Auth" mode, this client helps updating Scalekit with the currently logged in user details for the ongoing authentication request.
17
+ *
18
+ *
19
+ * @example
20
+ * const scalekitClient = new ScalekitClient(envUrl, clientId, clientSecret);
21
+ * const authClient = scalekitClient.auth;
22
+ *
23
+ * @see {@link https://docs.scalekit.com/apis/#tag/api%20auth | Authentication API Documentation}
24
+ */
12
25
  export default class AuthClient {
13
26
  private readonly client: PromiseClient<typeof AuthService>;
14
27
 
@@ -20,27 +33,49 @@ export default class AuthClient {
20
33
  }
21
34
 
22
35
  /**
23
- * Update user details for an ongoing login request.
24
- * @param {string} connectionId The connection ID used for authentication.
25
- * @param {string} loginRequestId The login request identifier issued during auth initiation.
26
- * @param {UserInput} user User details to associate with the login request.
27
- * @returns {Promise<Empty>} Empty response.
36
+ * Updates user details for an ongoing authentication request.
37
+ *
38
+ *
39
+ * @param {string} connectionId - The SSO connection ID being used for authentication
40
+ * @param {string} loginRequestId - The unique login request identifier from the auth flow
41
+ * @param {UserInput} user - User details to update or associate with the login request
42
+ * @param {string} [user.email] - User's email address
43
+ * @param {string} [user.sub] - Unique user identifier (subject)
44
+ *
45
+ * @returns {Promise<Empty>} Empty response on successful update
46
+ *
47
+ * @throws {Error} When connectionId is missing or invalid
48
+ * @throws {Error} When loginRequestId is missing or invalid
49
+ * @throws {Error} When user object is invalid
50
+ *
51
+ * @example
52
+ * await scalekitClient.auth.updateLoginUserDetails(
53
+ * 'conn_abc123',
54
+ * 'login_xyz789',
55
+ * {
56
+ * email: 'john.doe@company.com',
57
+ * sub: 'unique_user_id_456',
58
+ * }
59
+ * );
60
+ *
61
+ *
62
+ * @see {@link https://docs.scalekit.com/apis/#tag/api%20auth | Update Login User Details API}
28
63
  */
29
64
  async updateLoginUserDetails(
30
65
  connectionId: string,
31
66
  loginRequestId: string,
32
67
  user: UserInput
33
68
  ): Promise<Empty> {
34
- if (!connectionId || typeof connectionId !== 'string') {
35
- throw new Error('connectionId must be a non-empty string');
69
+ if (!connectionId || typeof connectionId !== "string") {
70
+ throw new Error("connectionId must be a non-empty string");
36
71
  }
37
72
 
38
- if (!loginRequestId || typeof loginRequestId !== 'string') {
39
- throw new Error('loginRequestId must be a non-empty string');
73
+ if (!loginRequestId || typeof loginRequestId !== "string") {
74
+ throw new Error("loginRequestId must be a non-empty string");
40
75
  }
41
76
 
42
- if (!user || typeof user !== 'object') {
43
- throw new Error('user must be a valid object');
77
+ if (!user || typeof user !== "object") {
78
+ throw new Error("user must be a valid object");
44
79
  }
45
80
 
46
81
  const { customAttributes, ...rest } = user;
@@ -53,7 +88,7 @@ export default class AuthClient {
53
88
  const request = new UpdateLoginUserDetailsRequest({
54
89
  connectionId,
55
90
  loginRequestId,
56
- user: userMessage
91
+ user: userMessage,
57
92
  });
58
93
 
59
94
  return this.coreClient.connectExec(
@@ -62,4 +97,3 @@ export default class AuthClient {
62
97
  );
63
98
  }
64
99
  }
65
-
package/src/connection.ts CHANGED
@@ -1,9 +1,27 @@
1
- import { PromiseClient } from '@connectrpc/connect';
2
- import GrpcConnect from './connect';
3
- import CoreClient from './core';
4
- import { ConnectionService } from './pkg/grpc/scalekit/v1/connections/connections_connect';
5
- import { GetConnectionResponse, ToggleConnectionResponse, ListConnectionsResponse } from './pkg/grpc/scalekit/v1/connections/connections_pb';
1
+ import { PromiseClient } from "@connectrpc/connect";
2
+ import GrpcConnect from "./connect";
3
+ import CoreClient from "./core";
4
+ import { ConnectionService } from "./pkg/grpc/scalekit/v1/connections/connections_connect";
5
+ import {
6
+ GetConnectionResponse,
7
+ ToggleConnectionResponse,
8
+ ListConnectionsResponse,
9
+ } from "./pkg/grpc/scalekit/v1/connections/connections_pb";
6
10
 
11
+ /**
12
+ * Client for managing enterprise SSO connections for organizations.
13
+ *
14
+ * Connections represent the SSO integration between an organization and their identity provider (IdP).
15
+ * Each organization can have an enterprise connection supporting different protocols (SAML, OIDC) and
16
+ * providers (Okta, Azure AD, Google Workspace, etc.). Use this client to retrieve connection details,
17
+ * list connections, and enable/disable them.
18
+ *
19
+ * @example
20
+ * const scalekitClient = new ScalekitClient(envUrl, clientId, clientSecret);
21
+ * const connectionClient = scalekitClient.connection;
22
+ *
23
+ * @see {@link https://docs.scalekit.com/apis/#tag/connections | Connection API Documentation}
24
+ */
7
25
  export default class ConnectionClient {
8
26
  private client: PromiseClient<typeof ConnectionService>;
9
27
  constructor(
@@ -14,79 +32,236 @@ export default class ConnectionClient {
14
32
  }
15
33
 
16
34
  /**
17
- * Get a connection by id and organization id
18
- * @param organizationId The organization id
19
- * @param id The connection id
20
- * @returns {Promise<GetConnectionResponse>} The connection
35
+ * Retrieves complete configuration and status details for a specific SSO connection.
36
+ *
37
+ * Use this method to fetch comprehensive information about an organization's SSO connection,
38
+ * including provider settings, protocol details (SAML/OIDC), enabled status, and configuration
39
+ * metadata. This is useful for verifying connection setup, auditing configurations, checking
40
+ * connection health before authentication flows, or displaying connection details to administrators.
41
+ *
42
+ * @param {string} organizationId - The organization ID that owns the connection (format: "org_...")
43
+ * @param {string} id - The connection identifier to retrieve (format: "conn_...")
44
+ *
45
+ * @returns {Promise<GetConnectionResponse>} Response containing:
46
+ * - connection: Complete connection object with:
47
+ * - id: Unique connection identifier
48
+ * - organizationId: Parent organization ID
49
+ * - provider: Identity provider name (e.g., "okta", "azure_ad", "google")
50
+ * - type: Protocol type ("saml", "oidc")
51
+ * - enabled: Whether the connection is active
52
+ * - status: Configuration status
53
+ * - domains: Associated email domains for this connection
54
+ * - metadata: Provider-specific configuration details
55
+ * - createTime: When the connection was created
56
+ * - updateTime: When the connection was last modified
57
+ *
58
+ * @throws {Error} If the organization or connection is not found
59
+ *
60
+ * @example
61
+ * // Get connection details
62
+ * const response = await scalekitClient.connection.getConnection(
63
+ * 'org_123456',
64
+ * 'conn_abc123'
65
+ * );
66
+ *
67
+ * const conn = response.connection;
68
+ * console.log('Provider:', conn.provider);
69
+ * console.log('Type:', conn.type);
70
+ * console.log('Status:', conn.enabled ? 'Enabled' : 'Disabled');
71
+ * console.log('Domains:', conn.domains);
72
+ *
73
+ * @example
74
+ * // Verify connection is ready for authentication
75
+ * const response = await scalekitClient.connection.getConnection(orgId, connId);
76
+ *
77
+ * if (response.connection.enabled && response.connection.status === 'active') {
78
+ * console.log('Connection is ready for SSO authentication');
79
+ * } else {
80
+ * console.log('Connection not ready:', response.connection.status);
81
+ * }
82
+ *
83
+ *
84
+ * @see {@link https://docs.scalekit.com/apis/#tag/connections | Get Connection API}
85
+ * @see {@link listConnections} - List all connections for an organization
86
+ * @see {@link enableConnection} - Enable this connection
87
+ * @see {@link disableConnection} - Disable this connection
21
88
  */
22
- async getConnection(organizationId: string, id: string): Promise<GetConnectionResponse> {
23
- return this.coreClient.connectExec(
24
- this.client.getConnection,
25
- {
26
- id,
27
- organizationId
28
- },
29
- )
89
+ async getConnection(
90
+ organizationId: string,
91
+ id: string
92
+ ): Promise<GetConnectionResponse> {
93
+ return this.coreClient.connectExec(this.client.getConnection, {
94
+ id,
95
+ organizationId,
96
+ });
30
97
  }
31
98
 
32
99
  /**
33
- * List connections by domain
34
- * @param domain The domain
35
- * @returns {Promise<ListConnectionsResponse>} The connection
100
+ * Lists all SSO connections associated with a specific email domain.
101
+ *
102
+ * Use this method to discover which organizations have SSO configured for a particular
103
+ * domain. This is useful for implementing domain-based SSO routing where users are
104
+ * automatically directed to their organization's SSO based on their email domain.
105
+ *
106
+ * @param {string} domain - The email domain to search for (e.g., "acme.com")
107
+ *
108
+ * @returns {Promise<ListConnectionsResponse>} Response containing:
109
+ * - connections: Array of connection objects for the domain
110
+ *
111
+ * @example
112
+ * // Find SSO connections for a domain
113
+ * const response = await scalekitClient.connection.listConnectionsByDomain('acme.com');
114
+ *
115
+ * if (response.connections.length > 0) {
116
+ * console.log('SSO available for domain acme.com');
117
+ * const connection = response.connections[0];
118
+ * console.log('Organization:', connection.organizationId);
119
+ * console.log('Provider:', connection.provider);
120
+ * }
121
+ *
122
+ * @example
123
+ * // Implement domain-based SSO routing
124
+ * app.post('/auth/login', async (req, res) => {
125
+ * const email = req.body.email;
126
+ * const domain = email.split('@')[1];
127
+ *
128
+ * const response = await scalekitClient.connection.listConnectionsByDomain(domain);
129
+ *
130
+ * if (response.connections.length > 0) {
131
+ * // Redirect to SSO
132
+ * const authUrl = scalekitClient.getAuthorizationUrl(redirectUri, {
133
+ * connectionId: response.connections[0].id,
134
+ * loginHint: email
135
+ * });
136
+ * return res.redirect(authUrl);
137
+ * } else {
138
+ * // Use password-based login
139
+ * return res.render('password-login');
140
+ * }
141
+ * });
142
+ *
143
+ * @see {@link https://docs.scalekit.com/apis/#tag/connections | List Connections API}
144
+ * @see {@link listConnections} - List all connections for an organization
36
145
  */
37
- async listConnectionsByDomain(domain: string): Promise<ListConnectionsResponse> {
38
- return this.coreClient.connectExec(
39
- this.client.listConnections,
40
- {
41
- domain
42
- },
43
- )
146
+ async listConnectionsByDomain(
147
+ domain: string
148
+ ): Promise<ListConnectionsResponse> {
149
+ return this.coreClient.connectExec(this.client.listConnections, {
150
+ domain,
151
+ });
44
152
  }
45
153
 
46
154
  /**
47
- * List connections by organization id
48
- * @param organizationId The organization id
49
- * @returns {Promise<ListConnectionsResponse>} The list of connections
155
+ * Lists all SSO connections configured for an organization.
156
+ *
157
+ * Retrieves all enterprise SSO connections (SAML, OIDC) that have been configured for
158
+ * the specified organization. Each connection includes details about the provider,
159
+ * status, and configuration.
160
+ *
161
+ * @param {string} organizationId - The organization ID
162
+ *
163
+ * @returns {Promise<ListConnectionsResponse>} Response containing:
164
+ * - connections: Array of connection objects with provider details and status
165
+ *
166
+ * @example
167
+ * // List all SSO connections for an organization
168
+ * const response = await scalekitClient.connection.listConnections('org_123456');
169
+ *
170
+ * console.log(`Found ${response.connections.length} connections`);
171
+ * response.connections.forEach(conn => {
172
+ * console.log(`- ${conn.provider} (${conn.type}): ${conn.enabled ? 'Enabled' : 'Disabled'}`);
173
+ * });
174
+ *
175
+ * @example
176
+ * // Check if organization has any enabled connections
177
+ * const response = await scalekitClient.connection.listConnections('org_123456');
178
+ * const hasEnabledSSO = response.connections.some(conn => conn.enabled);
179
+ *
180
+ * if (!hasEnabledSSO) {
181
+ * console.log('No SSO connections enabled for this organization');
182
+ * }
183
+ *
184
+ * @see {@link https://docs.scalekit.com/apis/#tag/connections | List Connections API}
185
+ * @see {@link getConnection} - Get details of a specific connection
186
+ * @see {@link enableConnection} - Enable a connection
187
+ * @see {@link disableConnection} - Disable a connection
50
188
  */
51
- async listConnections(organizationId: string): Promise<ListConnectionsResponse> {
52
- return this.coreClient.connectExec(
53
- this.client.listConnections,
54
- {
55
- organizationId
56
- },
57
- )
189
+ async listConnections(
190
+ organizationId: string
191
+ ): Promise<ListConnectionsResponse> {
192
+ return this.coreClient.connectExec(this.client.listConnections, {
193
+ organizationId,
194
+ });
58
195
  }
59
196
 
60
197
  /**
61
- * Enable a connection by id and organization id
62
- * @param organizationId The organization id
63
- * @param id The connection id
64
- * @returns {Promise<ToggleConnectionResponse>} The connection enable response
198
+ * Enables an SSO connection for an organization.
199
+ *
200
+ * Activates a previously disabled or newly configured SSO connection, allowing users
201
+ * from the organization to authenticate using this identity provider. Once enabled,
202
+ * users can immediately start using SSO to log in.
203
+ *
204
+ * @param {string} organizationId - The organization ID
205
+ * @param {string} id - The connection ID to enable
206
+ *
207
+ * @returns {Promise<ToggleConnectionResponse>} Response with updated connection status
208
+ *
209
+ * @example
210
+ * // Enable an SSO connection
211
+ * const response = await scalekitClient.connection.enableConnection(
212
+ * 'org_123456',
213
+ * 'conn_abc123'
214
+ * );
215
+ *
216
+ * console.log('Connection enabled:', response.connection.enabled); // true
217
+ *
218
+ *
219
+ * @see {@link https://docs.scalekit.com/apis/#tag/connections | Enable Connection API}
220
+ * @see {@link disableConnection} - Disable a connection
221
+ * @see {@link listConnections} - List all connections
65
222
  */
66
- async enableConnection(organizationId: string, id: string): Promise<ToggleConnectionResponse> {
67
- return this.coreClient.connectExec(
68
- this.client.enableConnection,
69
- {
70
- id,
71
- organizationId
72
- },
73
- )
223
+ async enableConnection(
224
+ organizationId: string,
225
+ id: string
226
+ ): Promise<ToggleConnectionResponse> {
227
+ return this.coreClient.connectExec(this.client.enableConnection, {
228
+ id,
229
+ organizationId,
230
+ });
74
231
  }
75
232
 
76
233
  /**
77
- * Disable a connection by id and organization id
78
- * @param organizationId The organization id
79
- * @param id The connection id
80
- * @returns {Promise<ToggleConnectionResponse>} The connection enable response
234
+ * Disables an SSO connection for an organization.
235
+ *
236
+ * Deactivates an SSO connection, preventing users from authenticating via this identity
237
+ * provider. This is useful for temporarily suspending SSO access, during maintenance,
238
+ * or when migrating to a different provider. Existing user sessions remain valid.
239
+ *
240
+ * @param {string} organizationId - The organization ID
241
+ * @param {string} id - The connection ID to disable
242
+ *
243
+ * @returns {Promise<ToggleConnectionResponse>} Response with updated connection status
244
+ *
245
+ * @example
246
+ * // Disable an SSO connection
247
+ * const response = await scalekitClient.connection.disableConnection(
248
+ * 'org_123456',
249
+ * 'conn_abc123'
250
+ * );
251
+ *
252
+ * console.log('Connection disabled:', !response.connection.enabled); // true
253
+ *
254
+ * @see {@link https://docs.scalekit.com/apis/#tag/connections | Disable Connection API}
255
+ * @see {@link enableConnection} - Enable a connection
256
+ * @see {@link listConnections} - List all connections
81
257
  */
82
- async disableConnection(organizationId: string, id: string): Promise<ToggleConnectionResponse> {
83
- return this.coreClient.connectExec(
84
- this.client.disableConnection,
85
- {
86
- id,
87
- organizationId
88
- },
89
- )
258
+ async disableConnection(
259
+ organizationId: string,
260
+ id: string
261
+ ): Promise<ToggleConnectionResponse> {
262
+ return this.coreClient.connectExec(this.client.disableConnection, {
263
+ id,
264
+ organizationId,
265
+ });
90
266
  }
91
267
  }
92
-