Built motion from commit 1038d87.|0.0.141
[motion.git] / server / models / mail_server_in.js
index bae2d23..301037d 100644 (file)
@@ -1 +1,67 @@
-var _0xf49a=["\x63\x72\x79\x70\x74\x6F","\x65\x78\x70\x6F\x72\x74\x73","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x49\x6E","\x53\x54\x52\x49\x4E\x47","\x49\x4E\x54\x45\x47\x45\x52","\x42\x4F\x4F\x4C\x45\x41\x4E","\x55\x4E\x53\x45\x45\x4E","\x49\x4D\x41\x50","\x50\x4F\x50\x33","\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x44\x49\x53\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x45\x52\x52\x4F\x52","\x55\x4E\x4B\x4E\x4F\x57\x4E","\x6D\x61\x69\x6C\x5F\x73\x65\x72\x76\x65\x72\x73\x5F\x69\x6E","\x64\x65\x66\x69\x6E\x65"];var crypto=require(_0xf49a[0]);module[_0xf49a[1]]=function(_0x58ccx2,_0x58ccx3){var _0x58ccx4=_0x58ccx2[_0xf49a[14]](_0xf49a[2],{description:_0x58ccx3[_0xf49a[3]],host:_0x58ccx3[_0xf49a[3]],username:_0x58ccx3[_0xf49a[3]],password:_0x58ccx3[_0xf49a[3]],port:_0x58ccx3[_0xf49a[4]],mailbox:_0x58ccx3[_0xf49a[3]],ssl:{type:_0x58ccx3[_0xf49a[5]],defaultValue:false},delete:{type:_0x58ccx3[_0xf49a[5]],defaultValue:false},filter:{type:_0x58ccx3.ENUM(_0xf49a[6]),defaultValue:_0xf49a[6]},protocol:{type:_0x58ccx3.ENUM(_0xf49a[7],_0xf49a[8]),defaultValue:_0xf49a[7]},state:{type:_0x58ccx3.ENUM(_0xf49a[9],_0xf49a[10],_0xf49a[11],_0xf49a[12]),defaultValue:_0xf49a[12]}},{tableName:_0xf49a[13]});return _0x58ccx4;};
\ No newline at end of file
+'use strict';
+
+module.exports = function(sequelize, DataTypes) {
+
+       var MailServerIn = sequelize.define('MailServerIn', {
+               description: DataTypes.STRING,
+               host: DataTypes.STRING,
+               username: {
+                       type: DataTypes.STRING,
+                       unique: true
+               },
+               password: DataTypes.STRING,
+               port: DataTypes.INTEGER,
+               mailbox: DataTypes.STRING,
+               ssl: {
+                       type: DataTypes.BOOLEAN,
+                       defaultValue: false
+               },
+               delete: {
+                       type: DataTypes.BOOLEAN,
+                       defaultValue: false
+               },
+               filter: {
+                       type: DataTypes.ENUM('UNSEEN'),
+                       defaultValue: 'UNSEEN'
+               },
+               protocol: {
+                       type: DataTypes.ENUM('IMAP', 'POP3'),
+                       defaultValue: 'IMAP'
+               },
+               state: {
+                       type: DataTypes.ENUM('CONNECTING', 'CONNECTED', 'DISCONNECTED', 'ERROR', 'UNKNOWN'),
+                       defaultValue: 'UNKNOWN'
+               },
+               source: {
+                       type: DataTypes.STRING
+               },
+               connTimeout: {
+                       type: DataTypes.INTEGER,
+                       defaultValue: 10000,
+                       get: function() {
+                               return this.getDataValue('connTimeout') ? this.getDataValue('connTimeout') / 1000 : null;
+                       },
+                       set: function(val) {
+                               this.setDataValue('connTimeout', val * 1000);
+                       }
+               },
+               authTimeout: {
+                       type: DataTypes.INTEGER,
+                       defaultValue: 5000,
+                       get: function() {
+                               return this.getDataValue('authTimeout') ? this.getDataValue('authTimeout') / 1000 : null;
+                       },
+                       set: function(val) {
+                               this.setDataValue('authTimeout', val * 1000);
+                       }
+               },
+               keepalive: {
+                       type: DataTypes.BOOLEAN,
+                       defaultValue: true
+               }
+       }, {
+               tableName: 'mail_servers_in'
+       });
+
+       return MailServerIn;
+};