Built motion from commit f25620e4.|2.6.30
[motion2.git] / server / api / mailAccount / mailAccount.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x120c=['service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','./mailAccount.attributes','exports','provider','custom'];(function(_0x4f7e5b,_0x452c65){var _0x13ea34=function(_0x3f04c0){while(--_0x3f04c0){_0x4f7e5b['push'](_0x4f7e5b['shift']());}};_0x13ea34(++_0x452c65);}(_0x120c,0x172));var _0xc120=function(_0x5a62e5,_0x25cfe8){_0x5a62e5=_0x5a62e5-0x0;var _0x4c1f12=_0x120c[_0x5a62e5];return _0x4c1f12;};'use strict';var attributes=require(_0xc120('0x0'));module[_0xc120('0x1')]=function(_0x43fb5f){return _0x43fb5f['define']('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x42570b=this;var _0x1e1961={'id':_0x42570b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x42570b[_0xc120('0x2')]!==_0xc120('0x3')){_0x1e1961[_0xc120('0x4')]=_0x42570b[_0xc120('0x2')];}else{_0x1e1961[_0xc120('0x5')]=_0x42570b[_0xc120('0x6')]['host'];_0x1e1961[_0xc120('0x7')]=_0x42570b[_0xc120('0x6')][_0xc120('0x7')];_0x1e1961[_0xc120('0x8')]=_0x42570b['Smtp'][_0xc120('0x8')];}if(_0x42570b[_0xc120('0x6')][_0xc120('0x9')]){if(_0x42570b[_0xc120('0x6')][_0xc120('0xa')]){if(!_0x42570b[_0xc120('0x6')][_0xc120('0xb')])throw new Error(_0xc120('0xc'));_0x1e1961['auth']={'type':_0xc120('0xd'),'user':_0x42570b[_0xc120('0x6')][_0xc120('0xe')],'accessToken':_0x42570b[_0xc120('0x6')][_0xc120('0xb')][_0xc120('0xf')]};}else{_0x1e1961[_0xc120('0x10')]={'user':_0x42570b[_0xc120('0x6')][_0xc120('0xe')],'pass':_0x42570b[_0xc120('0x6')]['pass']};}}return _0x1e1961;}}});};