@frontegg/rest-api
Advanced tools
Comparing version 1.23.30 to 1.23.31
@@ -8,3 +8,2 @@ export declare const AUTH_SERVICE_URL_V1 = "/identity/resources/auth/v1"; | ||
export declare const SSO_SERVICE_URL_V1 = "/team/resources/sso/v1"; | ||
export declare const TEAMS_SERVICE_URL_V1 = "/team"; | ||
export declare const CONNECTIVITY_SERVICE_URL_V1 = "/integrations/resources/configurations/v1"; | ||
@@ -23,5 +22,6 @@ export declare const CONNECTIVITY_SERVICE_URL_V2 = "/integrations/resources/configurations/v2"; | ||
export declare const AUDITS_SERVICE_EXPORT_URL = "/audits/export"; | ||
export declare const TENANTS_SERVICE_V1 = "/tenants/resources/tenants/v1"; | ||
export declare const ACCOUNT_SETTINGS_SERVICE_V1 = "/tenants/resources/account-settings/v1"; | ||
export declare const IDENTITY_API_TOKENS_USERS_SERVICE = "/identity/resources/users/api-tokens/v1"; | ||
export declare const IDENTITY_API_TOKENS_TENANTS_SERVICE = "/identity/resources/tenants/api-tokens/v1"; | ||
export declare const IDENTITY_ROLES_SERVICE_URL_V1 = "/identity/resources/roles/v1"; | ||
export declare const IDENTITY_PERMISSIONS_SERVICE_URL_V1 = "/identity/resources/permissions/v1"; |
@@ -11,2 +11,3 @@ import * as auth from './auth'; | ||
import * as accountSettings from './account-settings'; | ||
import * as roles from './roles'; | ||
import { ContextHolder, FronteggContext } from './ContextHolder'; | ||
@@ -23,2 +24,3 @@ export * from './interfaces'; | ||
export * from './account-settings/interfaces'; | ||
export * from './roles/interfaces'; | ||
declare const api: { | ||
@@ -34,3 +36,4 @@ auth: typeof auth; | ||
accountSettings: typeof accountSettings; | ||
roles: typeof roles; | ||
}; | ||
export { fetch, ContextHolder, FronteggContext, api }; |
@@ -250,2 +250,4 @@ import { __awaiter, __rest } from 'tslib'; | ||
const IDENTITY_API_TOKENS_TENANTS_SERVICE = '/identity/resources/tenants/api-tokens/v1'; | ||
const IDENTITY_ROLES_SERVICE_URL_V1 = '/identity/resources/roles/v1'; | ||
const IDENTITY_PERMISSIONS_SERVICE_URL_V1 = '/identity/resources/permissions/v1'; | ||
@@ -794,3 +796,3 @@ /* tslint:disable:no-console */ | ||
console.debug('getUserById()'); | ||
return Get(`${USERS_SERVICE_URL_V1}/${userId}`); | ||
return Get(`${USERS_SERVICE_URL_V2}/${userId}`); | ||
}); | ||
@@ -1313,2 +1315,91 @@ } | ||
/** | ||
* Gets tenant related roles | ||
*/ | ||
function getRoles() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('getRoles()'); | ||
return Get(`${IDENTITY_ROLES_SERVICE_URL_V1}`); | ||
}); | ||
} | ||
/** | ||
* Adds tenant related roles | ||
* @param body: IAddRole | ||
*/ | ||
function addRole(body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('addRole()', body); | ||
return Post(`${IDENTITY_ROLES_SERVICE_URL_V1}`, body); | ||
}); | ||
} | ||
/** | ||
* Deletes role given role ID | ||
*/ | ||
function deleteRole({ roleId }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('deleteRole()', roleId); | ||
return Delete(`${IDENTITY_ROLES_SERVICE_URL_V1}/${roleId}`); | ||
}); | ||
} | ||
/** | ||
* Updates role using a given role ID and IUpdateRole object | ||
*/ | ||
function updateRole(_a) { | ||
var { roleId } = _a, body = __rest(_a, ["roleId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('updateRole()', roleId, body); | ||
return Patch(`${IDENTITY_ROLES_SERVICE_URL_V1}/${roleId}`, body); | ||
}); | ||
} | ||
/** | ||
* Attaches permissions to role given a role ID | ||
*/ | ||
function attachPermissionsToRole(_a) { | ||
var { roleId } = _a, body = __rest(_a, ["roleId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('attachPermissionsToRole()', roleId, body); | ||
return Put(`${IDENTITY_ROLES_SERVICE_URL_V1}/${roleId}/permissions`, body); | ||
}); | ||
} | ||
/** | ||
* Gets all vendor permissions | ||
*/ | ||
function getPermissions() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('getPermissions()'); | ||
return Get(`${IDENTITY_PERMISSIONS_SERVICE_URL_V1}`); | ||
}); | ||
} | ||
/** | ||
* Associate permission to roles | ||
*/ | ||
function attachPermissionToRoles(_a) { | ||
var { permissionId } = _a, body = __rest(_a, ["permissionId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('attachPermissionToRoles()'); | ||
return Put(`${IDENTITY_PERMISSIONS_SERVICE_URL_V1}/${permissionId}/roles`, body); | ||
}); | ||
} | ||
/** | ||
* Gets all vendor categories including the permissions | ||
*/ | ||
function getPermissionCategories() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.debug('getPermissionCategories()'); | ||
return Get(`${IDENTITY_PERMISSIONS_SERVICE_URL_V1}/categories`); | ||
}); | ||
} | ||
var roles = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
getRoles: getRoles, | ||
addRole: addRole, | ||
deleteRole: deleteRole, | ||
updateRole: updateRole, | ||
attachPermissionsToRole: attachPermissionsToRole, | ||
getPermissions: getPermissions, | ||
attachPermissionToRoles: attachPermissionToRoles, | ||
getPermissionCategories: getPermissionCategories | ||
}); | ||
var SocialLoginsProviders; | ||
@@ -1330,2 +1421,3 @@ (function (SocialLoginsProviders) { | ||
accountSettings, | ||
roles, | ||
}; | ||
@@ -1332,0 +1424,0 @@ |
{ | ||
"name": "@frontegg/rest-api", | ||
"libName": "FronteggRestApi", | ||
"version": "1.23.30", | ||
"version": "1.23.31", | ||
"author": "Frontegg LTD", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
import { QueryFilter, QuerySort } from '../interfaces'; | ||
export declare type IRole = { | ||
id: string; | ||
key: string; | ||
isDefault: boolean; | ||
name: string; | ||
description?: null; | ||
permissions: string[]; | ||
tenantId?: string; | ||
vendorId: string; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
}; | ||
export declare type IRolePermission = { | ||
id: string; | ||
key: string; | ||
name: string; | ||
description?: string; | ||
categoryId: string; | ||
fePermission: boolean; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
}; | ||
import { IRole, IRolePermission } from '../roles/interfaces'; | ||
export declare type IUserProfile = { | ||
@@ -25,0 +4,0 @@ id: string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
470347
35
6178