UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

110 lines (109 loc) 2.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CCoreSylog = void 0; var mongoose_1 = require("mongoose"); /* SCHEMA START */ var core_system_logs = new mongoose_1.Schema({ sylog_id_user: { type: mongoose_1.default.Schema.Types.ObjectId, required: false }, sylog_id_logses: { type: mongoose_1.default.Schema.Types.ObjectId, required: false }, sylog_log_type: { type: String, maxlength: 20, required: true, trim: true }, sylog_action: { type: String, maxlength: 20, trim: true }, sylog_security_event: { type: String, maxlength: 20, trim: true }, sylog_previous_data: { type: Object }, sylog_updated_data: { type: Object }, sylog_diagnostic_code: { type: String, maxlength: 20, trim: true }, sylog_ip_address: { type: String, maxlength: 255, trim: true }, sylog_message: { type: String, maxlength: 255, trim: true }, sylog_timestamp: { type: Date }, sylog_method: { type: String, maxlength: 20, trim: true }, sylog_route: { type: String, maxlength: 1000, trim: true }, sylog_request: { type: Object }, sylog_monitor_type: { type: String, maxlength: 40, trim: true }, sylog_monitor_value: { type: Number, maxlength: 20 }, sylog_config_data: { type: Object }, sylog_isactive: { type: Boolean, default: true } }, { collection: 'core_system_logs' }); var CCoreSylog = mongoose_1.default.model("core_system_logs", core_system_logs); exports.CCoreSylog = CCoreSylog; /* || EXAMPLE for TRACE log type ||{ || user_id: "user001", // this is after login succuess for each route || log_type: "TRACE", || timestamp: new Date(), || method: "POST", || route: "/auth/login", || request: {}, || ip_address" "192.168.0.6", ||} */ /* || EXAMPLE for SECURITY log type ||{ || user_id: "user001", // this is after reset password link sent || log_type: "SECURITY", || timestamp: new Date(), || sylog_security_event: "reset_password", || sylog_config_data: {"reset_password_id":""} || ip_address" "192.168.0.6", ||} */