/* eslint-disable camelcase,no-unused-vars,new-cap,no-undef,comma-dangle */
// This file is generated automatically and contain definition for code insight.
// It ignored by UnityBase server because name start from "_".
// Do not modify this file directly, instead run `ubcli createCodeInsightHelper -u root`

/**
 * UnityBase Administrative model. Define users, roles and permissions
 *
 * @version 5.23.56
 * @module @unitybase/uba
 */

/**
 * Advanced security settings.
 * For any authentication type add binding of user to IP address. For CERT additionally adds a binding to device fingerprint
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_advSecurity_ns extends EntityNamespace {}

/**
 * @typedef ubaAdvSecurityAttrs
 * @type {object}
 * @property {number} ID
 * @property {number|ubaUserAttrs} userID - User
 * @property {string} editCause - Cause of change
 * @property {string} allowedIP - Allowed IP address
 * @property {boolean} refreshIP - Refresh allowed IP
 * @property {string} fp - Fingerprint
 * @property {boolean} refreshFp - Refresh fingerprint
 * @property {string} keyMediaName - Key media name
 * @property {boolean} refreshKeyMedia - Refresh key media name
 * @property {string} additional - Additional
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaAdvSecurityAttrs}
 */
uba_advSecurity_ns.attrs = {}

/**
 * Advanced security settings.
 * For any authentication type add binding of user to IP address. For CERT additionally adds a binding to device fingerprint
 *
 * @type {uba_advSecurity_ns}
 */
const uba_advSecurity = new uba_advSecurity_ns()
/**
 * Attribute level security
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_als_ns extends EntityNamespace {}

/**
 * @typedef ubaAlsAttrs
 * @type {object}
 * @property {number} ID
 * @property {string} entity - Entity
 * @property {string} attribute - Attribute
 * @property {string} state - State code
 * @property {string} roleName - Role name
 * @property {number} actions - Allow actions
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaAlsAttrs}
 */
uba_als_ns.attrs = {}

/**
 * Attribute level security
 *
 * @type {uba_als_ns}
 */
const uba_als = new uba_als_ns()
/**
 * Security Audit Trail.
 * All changes to UBA model entities (except uba_als & uba_subject) + user login related event are logged here
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_audit_ns extends EntityNamespace {}

/**
 * @typedef ubaAuditAttrs
 * @type {object}
 * @property {number} ID
 * @property {string} entity - Entity
 * @property {number} entityinfo_id - Instance ID
 * @property {string|ubmEnumAttrs} actionType - Action
 * @property {string} actionUser - User
 * @property {Date} actionTime - Action time
 * @property {string} remoteIP - Remote IP
 * @property {string} targetUser - Target user
 * @property {string} targetGroup - Target group
 * @property {string} targetRole - Target role
 * @property {string} fromValue - Old values
 * @property {string} toValue - New values
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaAuditAttrs}
 */
uba_audit_ns.attrs = {}

/**
 * Security Audit Trail.
 * All changes to UBA model entities (except uba_als & uba_subject) + user login related event are logged here
 *
 * @type {uba_audit_ns}
 */
const uba_audit = new uba_audit_ns()
/**
 * Data Changes Audit Trail.
 * All DML statement for entity with mixin 'audit' logged here
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_auditTrail_ns extends EntityNamespace {}

/**
 * @typedef ubaAuditTrailAttrs
 * @type {object}
 * @property {number} ID
 * @property {string} entity - Entity
 * @property {number} entityinfo_id - Instance ID
 * @property {string|ubmEnumAttrs} actionType - Action
 * @property {number} actionUser - User
 * @property {string} actionUserName - Login
 * @property {Date} actionTime - Action time
 * @property {string} remoteIP - Remote IP
 * @property {string} parentEntity - Parent entity name
 * @property {number} parentEntityInfo_id - Parent instance ID
 * @property {number} request_id - Request ID
 * @property {string} fromValue - Old values
 * @property {string} toValue - New values
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaAuditTrailAttrs}
 */
uba_auditTrail_ns.attrs = {}

/**
 * Data Changes Audit Trail.
 * All DML statement for entity with mixin 'audit' logged here
 *
 * @type {uba_auditTrail_ns}
 */
const uba_auditTrail = new uba_auditTrail_ns()
/**
 * Describe, which role have access permissions to Entities methods.
 * Administering of entity level. The system checks the access by the rule "Allowed and NOT Prohibited"
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_els_ns extends EntityNamespace {}

/**
 * @typedef ubaElsAttrs
 * @type {object}
 * @property {number} ID
 * @property {string} code - Rule code
 * @property {string} description - Description
 * @property {boolean} disabled - Disabled
 * @property {string} entityMask - Entity mask
 * @property {string} methodMask - Method mask
 * @property {string|ubmEnumAttrs} ruleType - Rule type
 * @property {number|ubaRoleAttrs} ruleRole - Role
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaElsAttrs}
 */
uba_els_ns.attrs = {}

/**
 * Describe, which role have access permissions to Entities methods.
 * Administering of entity level. The system checks the access by the rule "Allowed and NOT Prohibited"
 *
 * @type {uba_els_ns}
 */
const uba_els = new uba_els_ns()
/**
 * Virtual entity with calculated methods permissions for specified sets of roles.
 * 'Everyone' role is automatically assigned for everyone; 'User' role - for anyone who logged in
 *
 * @augments EntityNamespace
 */
class uba_elsPermission_ns extends EntityNamespace {}

/**
 * @typedef ubaElsPermissionAttrs
 * @type {object}
 * @property {number} ID - #
 * @property {string} entity - Entity
 * @property {string} method - Method
 * @property {boolean} hasAccess - Has access
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaElsPermissionAttrs}
 */
uba_elsPermission_ns.attrs = {}

/**
 * Virtual entity with calculated methods permissions for specified sets of roles.
 * 'Everyone' role is automatically assigned for everyone; 'User' role - for anyone who logged in
 *
 * @type {uba_elsPermission_ns}
 */
const uba_elsPermission = new uba_elsPermission_ns()
/**
 * User groups
 *
 * @augments EntityNamespace
 * @mixes mStorage
 * @mixes unity
 */
class uba_group_ns extends EntityNamespace {}

/**
 * @typedef ubaGroupAttrs
 * @type {object}
 * @property {number|ubaSubjectAttrs} ID
 * @property {string} code - Code
 * @property {string} name - Name
 * @property {string} description - Description
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaGroupAttrs}
 */
uba_group_ns.attrs = {}

/**
 * User groups
 *
 * @type {uba_group_ns}
 */
const uba_group = new uba_group_ns()
/**
 * Roles assigned to groups
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_grouprole_ns extends EntityNamespace {}

/**
 * @typedef ubaGrouproleAttrs
 * @type {object}
 * @property {number} ID
 * @property {number|ubaGroupAttrs} groupID - Group
 * @property {number|ubaRoleAttrs} roleID - Role
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaGrouproleAttrs}
 */
uba_grouprole_ns.attrs = {}

/**
 * Roles assigned to groups
 *
 * @type {uba_grouprole_ns}
 */
const uba_grouprole = new uba_grouprole_ns()
/**
 * One-time passwords.
 * One-time-password generation and verification
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_otp_ns extends EntityNamespace {}

/**
 * @typedef ubaOtpAttrs
 * @type {object}
 * @property {number} ID
 * @property {string} otp - OTP
 * @property {number|ubaUserAttrs} userID - User
 * @property {string} uData - uData
 * @property {Date} expiredDate - Expired date
 * @property {string|ubmEnumAttrs} otpKind - Otp kind
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaOtpAttrs}
 */
uba_otp_ns.attrs = {}

/**
 * One-time passwords.
 * One-time-password generation and verification
 *
 * @type {uba_otp_ns}
 */
const uba_otp = new uba_otp_ns()
/**
 * Previous passwords hashes
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_prevPasswordsHash_ns extends EntityNamespace {}

/**
 * @typedef ubaPrevPasswordsHashAttrs
 * @type {object}
 * @property {number} ID
 * @property {number|ubaUserAttrs} userID - User
 * @property {string} uPasswordHashHexa - Password hash
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaPrevPasswordsHashAttrs}
 */
uba_prevPasswordsHash_ns.attrs = {}

/**
 * Previous passwords hashes
 *
 * @type {uba_prevPasswordsHash_ns}
 */
const uba_prevPasswordsHash = new uba_prevPasswordsHash_ns()
/**
 * Administering subsystem roles
 *
 * @augments EntityNamespace
 * @mixes mStorage
 * @mixes unity
 */
class uba_role_ns extends EntityNamespace {}

/**
 * @typedef ubaRoleAttrs
 * @type {object}
 * @property {number|ubaSubjectAttrs} ID
 * @property {string} name - Role
 * @property {string} description - Description
 * @property {number} sessionTimeout - Session duration
 * @property {string} allowedAppMethods - Which application level methods are allowed
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaRoleAttrs}
 */
uba_role_ns.attrs = {}

/**
 * Administering subsystem roles
 *
 * @type {uba_role_ns}
 */
const uba_role = new uba_role_ns()
/**
 * Logged-in user sessions list.
 * Read-only access to server-side sessions list of logged-in users
 *
 * @augments EntityNamespace
 */
class uba_session_ns extends EntityNamespace {}

/**
 * @typedef ubaSessionAttrs
 * @type {object}
 * @property {string} ID - SessionID
 * @property {number|ubaUserAttrs} userID - User
 * @property {string} userName - Login
 * @property {string} remoteIP - IP address
 * @property {number} tenantID - Tenant
 * @property {boolean} isPasswordExpired - Password expired
 * @property {boolean} isLocked - Is locked
 * @property {number} serverTimeDelta - Time delta
 * @property {Date} createdAt - Created at
 * @property {Date} accessedAt - Accessed at
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaSessionAttrs}
 */
uba_session_ns.attrs = {}

/**
 * Logged-in user sessions list.
 * Read-only access to server-side sessions list of logged-in users
 *
 * @type {uba_session_ns}
 */
const uba_session = new uba_session_ns()
/**
 * Administration subjects
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_subject_ns extends EntityNamespace {}

/**
 * @typedef ubaSubjectAttrs
 * @type {object}
 * @property {number} ID
 * @property {string} code - Code
 * @property {string} name - Login
 * @property {string} sType - Subject type
 * @property {string} mi_unityEntity
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaSubjectAttrs}
 */
uba_subject_ns.attrs = {}

/**
 * Administration subjects
 *
 * @type {uba_subject_ns}
 */
const uba_subject = new uba_subject_ns()
/**
 * Users
 *
 * @augments EntityNamespace
 * @mixes mStorage
 * @mixes unity
 */
class uba_user_ns extends EntityNamespace {}

/**
 * @typedef ubaUserAttrs
 * @type {object}
 * @property {number|ubaSubjectAttrs} ID
 * @property {string} name - Login
 * @property {string} firstName - First Name
 * @property {string} lastName - Last Name
 * @property {string} middleName - Middle name
 * @property {string} fullName - Full Name
 * @property {string} title - Title
 * @property {string} email - Email
 * @property {string} phone - Phone
 * @property {string} avatar - Avatar
 * @property {string} description - Description
 * @property {string} uData - uData
 * @property {boolean} disabled - Disabled
 * @property {boolean} isPending - Registration pending
 * @property {string} trustedIP - Trusted IPs
 * @property {string} uPasswordHashHexa - Password hash
 * @property {Date} lastPasswordChangeDate - Last password change date
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaUserAttrs}
 */
uba_user_ns.attrs = {}

/**
 * Users
 *
 * @type {uba_user_ns}
 */
const uba_user = new uba_user_ns()
/**
 * User certificates.
 * used for Certificate authentication
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_usercertificate_ns extends EntityNamespace {}

/**
 * @typedef ubaUsercertificateAttrs
 * @type {object}
 * @property {number} ID
 * @property {number|ubaUserAttrs} userID - User
 * @property {string} issuer_serial - Issuer Serial Number
 * @property {string} issuer_cn - Issuer Name
 * @property {string} serial - Serial Number
 * @property {ArrayBuffer} certificate - Certificate
 * @property {*} certParsed - Certificate content
 * @property {boolean} isForSigning - For signing
 * @property {string} description - Description
 * @property {boolean} disabled - Disabled
 * @property {boolean} revoked - Revoked
 * @property {Date} revocationDate - Revocation date
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaUsercertificateAttrs}
 */
uba_usercertificate_ns.attrs = {}

/**
 * User certificates.
 * used for Certificate authentication
 *
 * @type {uba_usercertificate_ns}
 */
const uba_usercertificate = new uba_usercertificate_ns()
/**
 * User Group Membership
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_usergroup_ns extends EntityNamespace {}

/**
 * @typedef ubaUsergroupAttrs
 * @type {object}
 * @property {number} ID
 * @property {number|ubaUserAttrs} userID - User
 * @property {number|ubaGroupAttrs} groupID - Group
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaUsergroupAttrs}
 */
uba_usergroup_ns.attrs = {}

/**
 * User Group Membership
 *
 * @type {uba_usergroup_ns}
 */
const uba_usergroup = new uba_usergroup_ns()
/**
 * Roles assigned to users
 *
 * @augments EntityNamespace
 * @mixes mStorage
 */
class uba_userrole_ns extends EntityNamespace {}

/**
 * @typedef ubaUserroleAttrs
 * @type {object}
 * @property {number} ID
 * @property {number|ubaUserAttrs} userID - User
 * @property {number|ubaRoleAttrs} roleID - Role
 * @property {number|ubaUserAttrs} mi_owner
 * @property {Date} mi_createDate
 * @property {number|ubaUserAttrs} mi_createUser
 * @property {Date} mi_modifyDate
 * @property {number|ubaUserAttrs} mi_modifyUser
 */

/**
 * Attributes defined in metadata. Property does not exist in real life and added for IDE
 *
 * @type {ubaUserroleAttrs}
 */
uba_userrole_ns.attrs = {}

/**
 * Roles assigned to users
 *
 * @type {uba_userrole_ns}
 */
const uba_userrole = new uba_userrole_ns()