@scalekit-sdk/node 2.1.6 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/buf.gen.yaml +1 -0
- package/lib/auth.d.ts +41 -9
- package/lib/auth.js +44 -12
- package/lib/auth.js.map +1 -1
- package/lib/connection.d.ts +195 -21
- package/lib/connection.js +197 -23
- package/lib/connection.js.map +1 -1
- package/lib/core.d.ts +2 -2
- package/lib/core.js +13 -12
- package/lib/core.js.map +1 -1
- package/lib/directory.d.ts +293 -40
- package/lib/directory.js +308 -44
- package/lib/directory.js.map +1 -1
- package/lib/domain.d.ts +166 -18
- package/lib/domain.js +178 -29
- package/lib/domain.js.map +1 -1
- package/lib/organization.d.ts +407 -40
- package/lib/organization.js +433 -49
- package/lib/organization.js.map +1 -1
- package/lib/permission.d.ts +179 -35
- package/lib/permission.js +190 -38
- package/lib/permission.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.d.ts +3 -3
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js +2 -2
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.d.ts +16 -16
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js +21 -21
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.d.ts +82 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js +90 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.d.ts +647 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js +993 -0
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.d.ts +142 -0
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +165 -1
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.d.ts +1 -10
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js +0 -9
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +28 -63
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +9 -90
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.d.ts +6 -6
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js +5 -5
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.d.ts +19 -30
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js +22 -31
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +2 -2
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
- package/lib/role.d.ts +252 -56
- package/lib/role.js +262 -62
- package/lib/role.js.map +1 -1
- package/lib/scalekit.d.ts +323 -54
- package/lib/scalekit.js +354 -76
- package/lib/scalekit.js.map +1 -1
- package/lib/session.d.ts +235 -22
- package/lib/session.js +237 -24
- package/lib/session.js.map +1 -1
- package/lib/types/organization.d.ts +3 -0
- package/lib/user.d.ts +571 -53
- package/lib/user.js +598 -89
- package/lib/user.js.map +1 -1
- package/lib/webauthn.d.ts +33 -0
- package/lib/webauthn.js +80 -0
- package/lib/webauthn.js.map +1 -0
- package/package.json +2 -2
- package/src/auth.ts +53 -19
- package/src/connection.ts +237 -62
- package/src/core.ts +39 -33
- package/src/directory.ts +356 -98
- package/src/domain.ts +215 -68
- package/src/organization.ts +506 -105
- package/src/permission.ts +234 -88
- package/src/pkg/grpc/scalekit/v1/auth/auth_connect.ts +3 -3
- package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +24 -24
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_connect.ts +89 -0
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_pb.ts +1263 -0
- package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +217 -0
- package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +1 -10
- package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +42 -129
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_connect.ts +6 -6
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_pb.ts +28 -43
- package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +3 -3
- package/src/role.ts +336 -136
- package/src/scalekit.ts +478 -149
- package/src/session.ts +266 -63
- package/src/types/organization.ts +4 -0
- package/src/user.ts +675 -168
- package/src/webauthn.ts +98 -0
- package/tests/organization.test.ts +16 -0
package/lib/directory.d.ts
CHANGED
|
@@ -1,41 +1,196 @@
|
|
|
1
|
-
import GrpcConnect from
|
|
2
|
-
import CoreClient from
|
|
3
|
-
import { GetDirectoryResponse, Directory, ListDirectoriesResponse, ListDirectoryGroupsResponse, ListDirectoryUsersResponse, ToggleDirectoryResponse } from
|
|
1
|
+
import GrpcConnect from "./connect";
|
|
2
|
+
import CoreClient from "./core";
|
|
3
|
+
import { GetDirectoryResponse, Directory, ListDirectoriesResponse, ListDirectoryGroupsResponse, ListDirectoryUsersResponse, ToggleDirectoryResponse } from "./pkg/grpc/scalekit/v1/directories/directories_pb";
|
|
4
|
+
/**
|
|
5
|
+
* Client for managing SCIM directory synchronization.
|
|
6
|
+
*
|
|
7
|
+
* Directories represent SCIM connections that automatically sync users and groups from an
|
|
8
|
+
* organization's identity provider (Okta, Azure AD, Google Workspace, etc.) to your application.
|
|
9
|
+
* Use this client to retrieve synchronized user/group data, manage directory settings, and
|
|
10
|
+
* monitor sync status.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const scalekitClient = new ScalekitClient(envUrl, clientId, clientSecret);
|
|
14
|
+
* const directoryClient = scalekitClient.directory;
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | Directory API Documentation}
|
|
17
|
+
* @see {@link https://docs.scalekit.com/directory/scim/quickstart/ | SCIM Directory Sync Guide}
|
|
18
|
+
*/
|
|
4
19
|
export default class DirectoryClient {
|
|
5
20
|
private readonly grpcConncet;
|
|
6
21
|
private readonly coreClient;
|
|
7
22
|
private client;
|
|
8
23
|
constructor(grpcConncet: GrpcConnect, coreClient: CoreClient);
|
|
9
24
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
25
|
+
* Retrieves all SCIM directories configured for an organization.
|
|
26
|
+
*
|
|
27
|
+
* Lists all directory sync connections that have been set up for the organization. Each directory
|
|
28
|
+
* represents a SCIM integration with an identity provider (Okta, Azure AD, Google Workspace, etc.)
|
|
29
|
+
* that automatically syncs users and groups. Use this to view directory configurations, check sync
|
|
30
|
+
* status, and manage directory integrations.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} organizationId - The organization ID to list directories for (format: "org_...")
|
|
33
|
+
*
|
|
34
|
+
* @returns {Promise<ListDirectoriesResponse>} Response containing:
|
|
35
|
+
* - directories: Array of directory objects with:
|
|
36
|
+
* - id: Unique directory identifier
|
|
37
|
+
* - organizationId: Parent organization ID
|
|
38
|
+
* - provider: Identity provider name (e.g., "okta", "azure_ad", "google")
|
|
39
|
+
* - enabled: Whether directory sync is active
|
|
40
|
+
* - status: Current synchronization status
|
|
41
|
+
* - lastSyncTime: When the last sync occurred
|
|
42
|
+
* - userCount: Number of synced users
|
|
43
|
+
* - groupCount: Number of synced groups
|
|
44
|
+
*
|
|
45
|
+
* @throws {Error} If the organization is not found
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // List all directories for an organization
|
|
49
|
+
* const response = await scalekitClient.directory.listDirectories('org_123456');
|
|
50
|
+
*
|
|
51
|
+
* console.log(`Found ${response.directories.length} directories`);
|
|
52
|
+
* response.directories.forEach(dir => {
|
|
53
|
+
* console.log(`- ${dir.provider}: ${dir.enabled ? 'Active' : 'Inactive'}`);
|
|
54
|
+
* console.log(` Users: ${dir.userCount}, Groups: ${dir.groupCount}`);
|
|
55
|
+
* });
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Check if organization has any active directories
|
|
59
|
+
* const response = await scalekitClient.directory.listDirectories('org_123456');
|
|
60
|
+
* const hasActiveDirectory = response.directories.some(dir => dir.enabled);
|
|
61
|
+
*
|
|
62
|
+
* if (hasActiveDirectory) {
|
|
63
|
+
* console.log('Directory sync is enabled for this organization');
|
|
64
|
+
* } else {
|
|
65
|
+
* console.log('No active directory sync');
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
*
|
|
69
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | List Directories API}
|
|
70
|
+
* @see {@link getDirectory} - Get details of a specific directory
|
|
71
|
+
* @see {@link enableDirectory} - Enable directory sync
|
|
72
|
+
* @see {@link disableDirectory} - Disable directory sync
|
|
13
73
|
*/
|
|
14
74
|
listDirectories(organizationId: string): Promise<ListDirectoriesResponse>;
|
|
15
75
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
76
|
+
* Retrieves comprehensive details about a specific SCIM directory.
|
|
77
|
+
*
|
|
78
|
+
* Fetches complete configuration and status information for a directory, including provider settings,
|
|
79
|
+
* synchronization status, user/group counts, and metadata. Use this to view directory configuration,
|
|
80
|
+
* monitor sync health, verify setup, or display directory details in admin interfaces.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} organizationId - The organization ID that owns the directory (format: "org_...")
|
|
83
|
+
* @param {string} directoryId - The directory identifier to retrieve (format: "dir_...")
|
|
84
|
+
*
|
|
85
|
+
* @returns {Promise<GetDirectoryResponse>} Response containing:
|
|
86
|
+
* - directory: Complete directory object with:
|
|
87
|
+
* - id: Unique directory identifier
|
|
88
|
+
* - organizationId: Parent organization ID
|
|
89
|
+
* - provider: Identity provider name (e.g., "okta", "azure_ad", "google")
|
|
90
|
+
* - enabled: Whether directory sync is active
|
|
91
|
+
* - status: Current synchronization status
|
|
92
|
+
* - scimBaseUrl: SCIM endpoint URL
|
|
93
|
+
* - scimToken: Authentication token (masked)
|
|
94
|
+
* - lastSyncTime: Timestamp of last successful sync
|
|
95
|
+
* - nextSyncTime: Scheduled time for next sync
|
|
96
|
+
* - userCount: Number of synced users
|
|
97
|
+
* - groupCount: Number of synced groups
|
|
98
|
+
* - createTime: When directory was created
|
|
99
|
+
* - updateTime: When directory was last updated
|
|
100
|
+
*
|
|
101
|
+
* @throws {Error} If the organization or directory is not found
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* // Get directory details
|
|
105
|
+
* const response = await scalekitClient.directory.getDirectory(
|
|
106
|
+
* 'org_123456',
|
|
107
|
+
* 'dir_abc123'
|
|
108
|
+
* );
|
|
109
|
+
*
|
|
110
|
+
* const dir = response.directory;
|
|
111
|
+
* console.log('Provider:', dir.provider);
|
|
112
|
+
* console.log('Status:', dir.enabled ? 'Active' : 'Inactive');
|
|
113
|
+
* console.log('Last sync:', dir.lastSyncTime);
|
|
114
|
+
* console.log('Users:', dir.userCount);
|
|
115
|
+
* console.log('Groups:', dir.groupCount);
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | Get Directory API}
|
|
119
|
+
* @see {@link getPrimaryDirectoryByOrganizationId} - List the first directory in an Organization.
|
|
120
|
+
* - Useful utility API if you don't know the directory ID but only have an organizationID.
|
|
121
|
+
* @see {@link listDirectoryUsers} - List users in this directory
|
|
122
|
+
* @see {@link listDirectoryGroups} - List groups in this directory
|
|
20
123
|
*/
|
|
21
124
|
getDirectory(organizationId: string, directoryId: string): Promise<GetDirectoryResponse>;
|
|
22
125
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
126
|
+
* Retrieves the primary (first) directory for an organization.
|
|
127
|
+
*
|
|
128
|
+
* This is a convenience method that fetches the first directory from the organization's list
|
|
129
|
+
* of directories. Most organizations have a single directory, making this useful for quickly
|
|
130
|
+
* accessing directory data without needing to know the specific directory ID. If the organization
|
|
131
|
+
* has multiple directories, this returns the first one.
|
|
132
|
+
*
|
|
133
|
+
* @param {string} organizationId - The organization ID to get the primary directory for (format: "org_...")
|
|
134
|
+
*
|
|
135
|
+
* @returns {Promise<Directory>} The first directory object for the organization
|
|
136
|
+
*
|
|
137
|
+
* @throws {Error} When the organization has no directories configured
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* // Get primary directory for an organization
|
|
141
|
+
* try {
|
|
142
|
+
* const directory = await scalekitClient.directory.getPrimaryDirectoryByOrganizationId('org_123456');
|
|
143
|
+
*
|
|
144
|
+
* console.log('Primary Directory:', directory.provider);
|
|
145
|
+
* console.log('Users:', directory.userCount);
|
|
146
|
+
* console.log('Groups:', directory.groupCount);
|
|
147
|
+
* } catch (error) {
|
|
148
|
+
* console.log('No directory configured for this organization');
|
|
149
|
+
* }
|
|
150
|
+
*
|
|
151
|
+
*
|
|
152
|
+
* @see {@link listDirectories} - List all directories for an organization
|
|
153
|
+
* @see {@link getDirectory} - Get a specific directory by ID
|
|
154
|
+
* @see {@link listDirectoryUsers} - List users in the directory
|
|
26
155
|
*/
|
|
27
156
|
getPrimaryDirectoryByOrganizationId(organizationId: string): Promise<Directory>;
|
|
28
157
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @param {
|
|
36
|
-
* @param {string}
|
|
37
|
-
* @param {
|
|
38
|
-
* @
|
|
158
|
+
* Lists users synchronized from an identity provider via SCIM directory sync.
|
|
159
|
+
*
|
|
160
|
+
* Retrieves all users that have been synced from the organization's IdP to your application.
|
|
161
|
+
* This includes user profile information, group memberships, and sync status. Use this to
|
|
162
|
+
* display organization users, implement user search, or track provisioning/deprovisioning.
|
|
163
|
+
*
|
|
164
|
+
* @param {string} organizationId - The organization ID
|
|
165
|
+
* @param {string} directoryId - The directory ID
|
|
166
|
+
* @param {object} [options] - Optional filtering and pagination parameters
|
|
167
|
+
* @param {number} [options.pageSize] - Number of users per page (max: 100)
|
|
168
|
+
* @param {string} [options.pageToken] - Token for next page from previous response
|
|
169
|
+
* @param {boolean} [options.includeDetail] - Include full user profile details
|
|
170
|
+
* @param {string} [options.directoryGroupId] - Filter users by group membership
|
|
171
|
+
* @param {string} [options.updatedAfter] - ISO 8601 timestamp to fetch only users updated after this time
|
|
172
|
+
*
|
|
173
|
+
* @returns {Promise<ListDirectoryUsersResponse>} Response containing:
|
|
174
|
+
* - users: Array of directory user objects with profiles and attributes
|
|
175
|
+
* - nextPageToken: Token for retrieving the next page
|
|
176
|
+
* - totalSize: Total number of users in the directory
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* // List all directory users with pagination
|
|
180
|
+
* const response = await scalekitClient.directory.listDirectoryUsers(
|
|
181
|
+
* 'org_123456',
|
|
182
|
+
* 'dir_abc123',
|
|
183
|
+
* { pageSize: 50 }
|
|
184
|
+
* );
|
|
185
|
+
*
|
|
186
|
+
* console.log(`Found ${response.totalSize} users`);
|
|
187
|
+
* response.users.forEach(user => {
|
|
188
|
+
* console.log(`- ${user.email} (${user.firstName} ${user.lastName})`);
|
|
189
|
+
* });
|
|
190
|
+
*
|
|
191
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | List Directory Users API}
|
|
192
|
+
* @see {@link listDirectoryGroups} - List directory groups
|
|
193
|
+
* @see {@link listDirectories} - List all directories for an organization
|
|
39
194
|
*/
|
|
40
195
|
listDirectoryUsers(organizationId: string, directoryId: string, options?: {
|
|
41
196
|
pageSize?: number;
|
|
@@ -45,15 +200,61 @@ export default class DirectoryClient {
|
|
|
45
200
|
updatedAfter?: string;
|
|
46
201
|
}): Promise<ListDirectoryUsersResponse>;
|
|
47
202
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @param {string}
|
|
56
|
-
* @
|
|
203
|
+
* Retrieves groups synchronized from an identity provider via SCIM directory sync.
|
|
204
|
+
*
|
|
205
|
+
* Fetches all groups that have been synced from the organization's IdP to your application.
|
|
206
|
+
* Groups typically represent teams, departments, or organizational units. Use this to display
|
|
207
|
+
* group hierarchies, implement group-based access control, manage group memberships, or track
|
|
208
|
+
* organizational structure changes.
|
|
209
|
+
*
|
|
210
|
+
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
211
|
+
* @param {string} directoryId - The directory ID (format: "dir_...")
|
|
212
|
+
* @param {object} [options] - Optional filtering and pagination parameters
|
|
213
|
+
* @param {number} [options.pageSize] - Number of groups per page (max: 30, default: 10)
|
|
214
|
+
* @param {string} [options.pageToken] - Token for next page from previous response
|
|
215
|
+
* @param {boolean} [options.includeDetail] - Include full group details and member lists
|
|
216
|
+
* @param {string} [options.updatedAfter] - ISO 8601 timestamp to fetch only groups updated after this time
|
|
217
|
+
*
|
|
218
|
+
* @returns {Promise<ListDirectoryGroupsResponse>} Response containing:
|
|
219
|
+
* - groups: Array of directory group objects with:
|
|
220
|
+
* - id: Group identifier
|
|
221
|
+
* - displayName: Group name
|
|
222
|
+
* - description: Group description
|
|
223
|
+
* - members: Array of member user IDs (when includeDetail is true)
|
|
224
|
+
* - attributes: Custom group attributes
|
|
225
|
+
* - updateTime: When the group was last updated
|
|
226
|
+
* - nextPageToken: Token for retrieving the next page
|
|
227
|
+
* - totalSize: Total number of groups in the directory
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* // List all directory groups with pagination
|
|
231
|
+
* const response = await scalekitClient.directory.listDirectoryGroups(
|
|
232
|
+
* 'org_123456',
|
|
233
|
+
* 'dir_abc123',
|
|
234
|
+
* { pageSize: 30 }
|
|
235
|
+
* );
|
|
236
|
+
*
|
|
237
|
+
* console.log(`Found ${response.totalSize} groups`);
|
|
238
|
+
* response.groups.forEach(group => {
|
|
239
|
+
* console.log(`- ${group.displayName}`);
|
|
240
|
+
* if (group.description) console.log(` ${group.description}`);
|
|
241
|
+
* });
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* // Get groups with full member details
|
|
245
|
+
* const response = await scalekitClient.directory.listDirectoryGroups(
|
|
246
|
+
* 'org_123456',
|
|
247
|
+
* 'dir_abc123',
|
|
248
|
+
* { includeDetail: true }
|
|
249
|
+
* );
|
|
250
|
+
*
|
|
251
|
+
* response.groups.forEach(group => {
|
|
252
|
+
* console.log(`${group.displayName}: ${group.members?.length || 0} members`);
|
|
253
|
+
* });
|
|
254
|
+
*
|
|
255
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | List Directory Groups API}
|
|
256
|
+
* @see {@link listDirectoryUsers} - List directory users
|
|
257
|
+
* @see {@link getDirectory} - Get directory details
|
|
57
258
|
*/
|
|
58
259
|
listDirectoryGroups(organizationId: string, directoryId: string, options?: {
|
|
59
260
|
pageSize?: number;
|
|
@@ -62,17 +263,69 @@ export default class DirectoryClient {
|
|
|
62
263
|
updatedAfter?: string;
|
|
63
264
|
}): Promise<ListDirectoryGroupsResponse>;
|
|
64
265
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
266
|
+
* Enables SCIM directory synchronization for an organization.
|
|
267
|
+
*
|
|
268
|
+
* Activates automatic user and group synchronization from the organization's identity provider.
|
|
269
|
+
* Once enabled, users and groups from the IdP will be synced to your application, and any changes
|
|
270
|
+
* in the IdP (additions, updates, deletions) will be automatically reflected. This is essential
|
|
271
|
+
* for implementing automated user provisioning and deprovisioning.
|
|
272
|
+
*
|
|
273
|
+
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
274
|
+
* @param {string} directoryId - The directory ID to enable (format: "dir_...")
|
|
275
|
+
*
|
|
276
|
+
* @returns {Promise<ToggleDirectoryResponse>} Response containing:
|
|
277
|
+
* - directory: The updated directory object with enabled status set to true
|
|
278
|
+
*
|
|
279
|
+
* @throws {Error} If the organization or directory is not found
|
|
280
|
+
* @throws {Error} If the directory configuration is incomplete or invalid
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* // Enable directory sync
|
|
284
|
+
* const response = await scalekitClient.directory.enableDirectory(
|
|
285
|
+
* 'org_123456',
|
|
286
|
+
* 'dir_abc123'
|
|
287
|
+
* );
|
|
288
|
+
*
|
|
289
|
+
* console.log('Directory enabled:', response.directory.enabled); // true
|
|
290
|
+
* console.log('Sync will start automatically');
|
|
291
|
+
*
|
|
292
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | Enable Directory API}
|
|
293
|
+
* @see {@link disableDirectory} - Disable directory sync
|
|
294
|
+
* @see {@link getDirectory} - Check directory status
|
|
295
|
+
* @see {@link listDirectoryUsers} - View synced users after enabling
|
|
69
296
|
*/
|
|
70
297
|
enableDirectory(organizationId: string, directoryId: string): Promise<ToggleDirectoryResponse>;
|
|
71
298
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
299
|
+
* Disables SCIM directory synchronization for an organization.
|
|
300
|
+
*
|
|
301
|
+
* Stops automatic user and group synchronization from the organization's identity provider.
|
|
302
|
+
* When disabled, no new updates will be received from the IdP, but existing synced users and
|
|
303
|
+
* groups remain in your application. This is useful for temporarily pausing sync during maintenance,
|
|
304
|
+
* troubleshooting, or when migrating to a different directory provider. Does not delete existing data.
|
|
305
|
+
*
|
|
306
|
+
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
307
|
+
* @param {string} directoryId - The directory ID to disable (format: "dir_...")
|
|
308
|
+
*
|
|
309
|
+
* @returns {Promise<ToggleDirectoryResponse>} Response containing:
|
|
310
|
+
* - directory: The updated directory object with enabled status set to false
|
|
311
|
+
*
|
|
312
|
+
* @throws {Error} If the organization or directory is not found
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* // Disable directory sync
|
|
316
|
+
* const response = await scalekitClient.directory.disableDirectory(
|
|
317
|
+
* 'org_123456',
|
|
318
|
+
* 'dir_abc123'
|
|
319
|
+
* );
|
|
320
|
+
*
|
|
321
|
+
* console.log('Directory disabled:', !response.directory.enabled); // true
|
|
322
|
+
* console.log('Existing users and groups are preserved');
|
|
323
|
+
*
|
|
324
|
+
*
|
|
325
|
+
* @see {@link https://docs.scalekit.com/apis/#tag/directory | Disable Directory API}
|
|
326
|
+
* @see {@link enableDirectory} - Enable directory sync
|
|
327
|
+
* @see {@link getDirectory} - Check directory status
|
|
328
|
+
* @see {@link listDirectories} - List all directories
|
|
76
329
|
*/
|
|
77
330
|
disableDirectory(organizationId: string, directoryId: string): Promise<ToggleDirectoryResponse>;
|
|
78
331
|
}
|