@unboundcx/sdk 4.13.146-security.1 → 4.13.146-security.3
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/package.json +1 -1
- package/services/licenses.js +21 -0
- package/services/permissions.js +27 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.146-security.
|
|
3
|
+
"version": "4.13.146-security.3",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/services/licenses.js
CHANGED
|
@@ -180,6 +180,27 @@ export class LicensesService {
|
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Get a user's active/disabled status (read-side of setUserStatus,
|
|
185
|
+
* W1-3). Allowed for the caller's own userId with no scope, or for any
|
|
186
|
+
* userId in the account when holding admin:user:manage.
|
|
187
|
+
* @param {string} userId
|
|
188
|
+
* @returns {Promise<Object>} `{ userId, status, updatedAt? }`
|
|
189
|
+
* @example
|
|
190
|
+
* await sdk.licenses.getUserStatus('user-123');
|
|
191
|
+
*/
|
|
192
|
+
async getUserStatus(userId) {
|
|
193
|
+
this.sdk.validateParams(
|
|
194
|
+
{ userId },
|
|
195
|
+
{ userId: { type: 'string', required: true } },
|
|
196
|
+
);
|
|
197
|
+
return internalRequest(
|
|
198
|
+
this.sdk,
|
|
199
|
+
`/permissions/users/${userId}/status`,
|
|
200
|
+
'GET',
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
183
204
|
// -- Brand-owner methods (requireBrandOwner; 2D api routes) --------------
|
|
184
205
|
|
|
185
206
|
/**
|
package/services/permissions.js
CHANGED
|
@@ -302,6 +302,33 @@ export class PermissionsService {
|
|
|
302
302
|
return result;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Direct holders of a permission set — for the Setup -> Permission Sets
|
|
307
|
+
* Members panel. A user who only has the set via group membership is
|
|
308
|
+
* NOT included in `users` here; look up that group's `members` (from
|
|
309
|
+
* listGroups()) to show them nested under the group instead.
|
|
310
|
+
* @param {string} setId - Permission set ID
|
|
311
|
+
* @returns {Promise<Object>} { users: [{userId, name, email, grantType}], groups: [{groupId, name, grantType}] }
|
|
312
|
+
* @example
|
|
313
|
+
* const { users, groups } = await sdk.permissions.listSetAssignments('set-123');
|
|
314
|
+
*/
|
|
315
|
+
async listSetAssignments(setId) {
|
|
316
|
+
setId = String(setId);
|
|
317
|
+
this.sdk.validateParams(
|
|
318
|
+
{ setId },
|
|
319
|
+
{
|
|
320
|
+
setId: { type: 'string', required: true },
|
|
321
|
+
},
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
const result = await internalRequest(
|
|
325
|
+
this.sdk,
|
|
326
|
+
`/permissions/sets/${setId}/assignments`,
|
|
327
|
+
'GET',
|
|
328
|
+
);
|
|
329
|
+
return result;
|
|
330
|
+
}
|
|
331
|
+
|
|
305
332
|
/**
|
|
306
333
|
* Assign a permission set to a principal (user or group)
|
|
307
334
|
* @param {Object} assignment - Assignment configuration
|