This commit is contained in:
1
lib/constants/index.ts
Normal file
1
lib/constants/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './security-events.const'
|
||||||
32
lib/constants/security-events.const.ts
Normal file
32
lib/constants/security-events.const.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
export const SecurityEventType = {
|
||||||
|
AUTH: 'AUTH', // Логины, логауты
|
||||||
|
SESSION: 'SESSION', // Блокировки, кража токенов
|
||||||
|
PROFILE: 'PROFILE', // Смена пароля, пин-кода
|
||||||
|
SYSTEM: 'SYSTEM' // Системные события, например, блокировка IP, изменение ролей и т.д.
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const SecurityEventAction = {
|
||||||
|
LOGIN_SUCCESS: 'LOGIN_SUCCESS',
|
||||||
|
LOGIN_FAILED: 'LOGIN_FAILED',
|
||||||
|
LOGOUT: 'LOGOUT',
|
||||||
|
TOKEN_STOLEN: 'TOKEN_STOLEN',
|
||||||
|
SET_PIN: 'SET_PIN',
|
||||||
|
PIN_CHANGED: 'PIN_CHANGED',
|
||||||
|
PIN_LOCKED: 'PIN_LOCKED',
|
||||||
|
REMOVE_PIN: 'REMOVE_PIN',
|
||||||
|
TWOFA_ENABLED: 'TWOFA_ENABLED',
|
||||||
|
TWOFA_DISABLED: 'TWOFA_DISABLED',
|
||||||
|
UNLOCK_PIN_FAILED: 'UNLOCK_PIN_FAILED',
|
||||||
|
PASSWORD_CHANGE_SUCCESS: 'PASSWORD_CHANGE_SUCCESS',
|
||||||
|
PASSWORD_CHANGE_FAILED: 'PASSWORD_CHANGE_FAILED',
|
||||||
|
CHANGE_DATA_SUCCESS: 'CHANGE_DATA_SUCCESS',
|
||||||
|
CHANGE_DATA_FAILED: 'CHANGE_DATA_FAILED',
|
||||||
|
DELETE_ACCOUNT: 'DELETE_ACCOUNT',
|
||||||
|
ASSIGN_ROLE: 'ASSIGN_ROLE',
|
||||||
|
REVOKE_ROLE: 'REVOKE_ROLE',
|
||||||
|
IP_UNBLACKLISTED: 'IP_UNBLACKLISTED',
|
||||||
|
IP_BLACKLISTED: 'IP_BLACKLISTED',
|
||||||
|
USER_BLOCKED: 'USER_BLOCKED',
|
||||||
|
USER_UNBLOCKED: 'USER_UNBLOCKED',
|
||||||
|
SEARCH_SYNC_MANUAL: 'SEARCH_SYNC_MANUAL'
|
||||||
|
} as const
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
export * from './enums'
|
export * from './enums'
|
||||||
export * from './utils'
|
export * from './utils'
|
||||||
|
export * from './types'
|
||||||
|
export * from './constants'
|
||||||
|
|||||||
4
lib/types/client-context.type.ts
Normal file
4
lib/types/client-context.type.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export type ClientContext = {
|
||||||
|
ipAddress: string
|
||||||
|
userAgent: string
|
||||||
|
}
|
||||||
1
lib/types/index.ts
Normal file
1
lib/types/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './client-context.type'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lendry-erp/common",
|
"name": "@lendry-erp/common",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "Core shared components for Lendry-ERP microservice ecosystem",
|
"description": "Core shared components for Lendry-ERP microservice ecosystem",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "dist/index.d.ts",
|
"type": "dist/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user