Built motion from commit 1333b3551.|1.0.38
[motion.git] / server / api / telephone / telephone.controller.js
index 0f80cd2..91684d7 100644 (file)
@@ -1 +1 @@
-var _0x5e07=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x61\x6D\x69\x2F\x75\x74\x69\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x53\x65\x74\x74\x69\x6E\x67","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x72\x6F\x6C\x65","\x62\x6F\x64\x79","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64\x73"];_0x5e07[0];var _=require(_0x5e07[1]);var Util=require(_0x5e07[2]);var amiUtil=require(_0x5e07[3]);var userTools=require(_0x5e07[4]);var sequelize=require(_0x5e07[6])[_0x5e07[5]];var Telephone=require(_0x5e07[6])[_0x5e07[7]];var Setting=require(_0x5e07[6])[_0x5e07[8]];var BPromise=require(_0x5e07[9]);function handleError(_0x78bcxa,_0x78bcxb){_0x78bcxb= _0x78bcxb|| 500;return function(_0x78bcxc){_0x78bcxa[_0x5e07[11]](_0x78bcxb)[_0x5e07[10]](_0x78bcxc)}}function responseWithResult(_0x78bcxa,_0x78bcxb){_0x78bcxb= _0x78bcxb|| 200;return function(_0x78bcxe){if(_0x78bcxe){_0x78bcxa[_0x5e07[11]](_0x78bcxb)[_0x5e07[12]](_0x78bcxe)}}}function handleEntityNotFound(_0x78bcxa){return function(_0x78bcxe){if(!_0x78bcxe){_0x78bcxa[_0x5e07[11]](404)[_0x5e07[13]]();return null};return _0x78bcxe}}function saveUpdates(_0x78bcx11,_0x78bcx12){return function(_0x78bcxe){return _0x78bcxe[_0x5e07[15]](_0x78bcx11,{transaction:_0x78bcx12})[_0x5e07[14]](function(_0x78bcx13){return _0x78bcx13})}}function removeEntity(_0x78bcxa){return function(_0x78bcxe){if(_0x78bcxe){return _0x78bcxe[_0x5e07[16]]()[_0x5e07[14]](function(){_0x78bcxa[_0x5e07[11]](204)[_0x5e07[13]]()})}}}exports[_0x5e07[17]]= function(_0x78bcx15,_0x78bcxa){return Telephone[_0x5e07[23]](_0x5e07[22])[_0x5e07[21]](Util[_0x5e07[20]](_0x78bcx15[_0x5e07[19]]))[_0x5e07[14]](function(_0x78bcx16){_0x78bcxa[_0x5e07[11]](200)[_0x5e07[10]](_0x78bcx16)})[_0x5e07[18]](function(_0x78bcxc){return handleError(_0x78bcxa,_0x78bcxc)})};exports[_0x5e07[24]]= function(_0x78bcx15,_0x78bcxa){Telephone[_0x5e07[27]](_0x78bcx15[_0x5e07[26]][_0x5e07[25]])[_0x5e07[14]](handleEntityNotFound(_0x78bcxa))[_0x5e07[14]](responseWithResult(_0x78bcxa))[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[28]]= function(_0x78bcx15,_0x78bcxa){_0x78bcx15[_0x5e07[30]][_0x5e07[29]]= _0x5e07[22];return sequelize[_0x5e07[38]](function(_0x78bcx12){return Setting[_0x5e07[27]](1)[_0x5e07[14]](function(_0x78bcx17){var _0x78bcx18=String(_0x78bcx15[_0x5e07[30]][_0x5e07[34]]);var _0x78bcx19=_0x78bcx17[_0x5e07[35]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x78bcx19[_0x5e07[36]](_0x78bcx18)){throw  new Error(_0x5e07[37])};return Telephone[_0x5e07[28]](_0x78bcx15[_0x5e07[30]],{transaction:_0x78bcx12})})[_0x5e07[14]](userTools[_0x5e07[33]]({transaction:_0x78bcx12}))[_0x5e07[14]](responseWithResult(_0x78bcxa,201))})[_0x5e07[18]](sequelize.UniqueConstraintError,function(_0x78bcxc){return Util[_0x5e07[32]][_0x5e07[31]](_0x78bcxa,_0x78bcxc)})[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[39]]= function(_0x78bcx15,_0x78bcxa){if(_0x78bcx15[_0x5e07[30]][_0x5e07[25]]){delete _0x78bcx15[_0x5e07[30]][_0x5e07[25]]};delete _0x78bcx15[_0x5e07[30]][_0x5e07[40]];delete _0x78bcx15[_0x5e07[30]][_0x5e07[34]];delete _0x78bcx15[_0x5e07[30]][_0x5e07[41]];return sequelize[_0x5e07[38]](function(_0x78bcx12){return Telephone[_0x5e07[27]](_0x78bcx15[_0x5e07[26]][_0x5e07[25]])[_0x5e07[14]](handleEntityNotFound(_0x78bcxa))[_0x5e07[14]](saveUpdates(_0x78bcx15[_0x5e07[30]],_0x78bcx12))[_0x5e07[14]](responseWithResult(_0x78bcxa))})[_0x5e07[18]](sequelize.UniqueConstraintError,function(_0x78bcxc){return Util[_0x5e07[32]][_0x5e07[31]](_0x78bcxa,_0x78bcxc)})[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[16]]= function(_0x78bcx15,_0x78bcxa){return Telephone[_0x5e07[27]](_0x78bcx15[_0x5e07[26]][_0x5e07[25]])[_0x5e07[14]](handleEntityNotFound(_0x78bcxa))[_0x5e07[14]](removeEntity(_0x78bcxa))[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[42]]= function(_0x78bcx15,_0x78bcxa){return Telephone[_0x5e07[16]]({where:{id:_0x78bcx15[_0x5e07[19]][_0x5e07[44]]},individualHooks:true})[_0x5e07[14]](function(){return _0x78bcxa[_0x5e07[43]](204)})[_0x5e07[18]](function(_0x78bcxc){return handleError(_0x78bcxa,_0x78bcxc)})}
\ No newline at end of file
+var _0xe423=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x61\x6D\x69\x2F\x75\x74\x69\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x53\x65\x74\x74\x69\x6E\x67","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x72\x6F\x6C\x65","\x62\x6F\x64\x79","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64\x73"];_0xe423[0];var _=require(_0xe423[1]);var Util=require(_0xe423[2]);var amiUtil=require(_0xe423[3]);var userTools=require(_0xe423[4]);var logger=require(_0xe423[6])(_0xe423[5]);var sequelize=require(_0xe423[8])[_0xe423[7]];var Telephone=require(_0xe423[8])[_0xe423[9]];var Setting=require(_0xe423[8])[_0xe423[10]];var BPromise=require(_0xe423[11]);function handleError(_0x5b08xb,_0x5b08xc){_0x5b08xc= _0x5b08xc|| 500;return function(_0x5b08xd){logger[_0xe423[13]](_0x5b08xd[_0xe423[12]]);_0x5b08xb[_0xe423[15]](_0x5b08xc)[_0xe423[14]](_0x5b08xd)}}function responseWithResult(_0x5b08xb,_0x5b08xc){_0x5b08xc= _0x5b08xc|| 200;return function(_0x5b08xf){if(_0x5b08xf){_0x5b08xb[_0xe423[15]](_0x5b08xc)[_0xe423[16]](_0x5b08xf)}}}function handleEntityNotFound(_0x5b08xb){return function(_0x5b08xf){if(!_0x5b08xf){_0x5b08xb[_0xe423[15]](404)[_0xe423[17]]();return null};return _0x5b08xf}}function saveUpdates(_0x5b08x12,_0x5b08x13){return function(_0x5b08xf){return _0x5b08xf[_0xe423[19]](_0x5b08x12,{transaction:_0x5b08x13})[_0xe423[18]](function(_0x5b08x14){return _0x5b08x14})}}function removeEntity(_0x5b08xb){return function(_0x5b08xf){if(_0x5b08xf){return _0x5b08xf[_0xe423[20]]()[_0xe423[18]](function(){_0x5b08xb[_0xe423[15]](204)[_0xe423[17]]()})}}}exports[_0xe423[21]]= function(_0x5b08x16,_0x5b08xb){return Telephone[_0xe423[27]](_0xe423[26])[_0xe423[25]](Util[_0xe423[24]](_0x5b08x16[_0xe423[23]]))[_0xe423[18]](function(_0x5b08x17){_0x5b08xb[_0xe423[15]](200)[_0xe423[14]](_0x5b08x17)})[_0xe423[22]](function(_0x5b08xd){return handleError(_0x5b08xb,_0x5b08xd)})};exports[_0xe423[28]]= function(_0x5b08x16,_0x5b08xb){Telephone[_0xe423[31]](_0x5b08x16[_0xe423[30]][_0xe423[29]])[_0xe423[18]](handleEntityNotFound(_0x5b08xb))[_0xe423[18]](responseWithResult(_0x5b08xb))[_0xe423[22]](handleError(_0x5b08xb))};exports[_0xe423[32]]= function(_0x5b08x16,_0x5b08xb){_0x5b08x16[_0xe423[34]][_0xe423[33]]= _0xe423[26];return sequelize[_0xe423[42]](function(_0x5b08x13){return Setting[_0xe423[31]](1)[_0xe423[18]](function(_0x5b08x18){var _0x5b08x19=String(_0x5b08x16[_0xe423[34]][_0xe423[38]]);var _0x5b08x1a=_0x5b08x18[_0xe423[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x5b08x1a[_0xe423[40]](_0x5b08x19)){throw  new Error(_0xe423[41])};return Telephone[_0xe423[32]](_0x5b08x16[_0xe423[34]],{transaction:_0x5b08x13})})[_0xe423[18]](userTools[_0xe423[37]]({transaction:_0x5b08x13}))[_0xe423[18]](responseWithResult(_0x5b08xb,201))})[_0xe423[22]](sequelize.UniqueConstraintError,function(_0x5b08xd){return Util[_0xe423[36]][_0xe423[35]](_0x5b08xb,_0x5b08xd)})[_0xe423[22]](handleError(_0x5b08xb))};exports[_0xe423[43]]= function(_0x5b08x16,_0x5b08xb){if(_0x5b08x16[_0xe423[34]][_0xe423[29]]){delete _0x5b08x16[_0xe423[34]][_0xe423[29]]};delete _0x5b08x16[_0xe423[34]][_0xe423[44]];delete _0x5b08x16[_0xe423[34]][_0xe423[38]];delete _0x5b08x16[_0xe423[34]][_0xe423[45]];return sequelize[_0xe423[42]](function(_0x5b08x13){return Telephone[_0xe423[31]](_0x5b08x16[_0xe423[30]][_0xe423[29]])[_0xe423[18]](handleEntityNotFound(_0x5b08xb))[_0xe423[18]](saveUpdates(_0x5b08x16[_0xe423[34]],_0x5b08x13))[_0xe423[18]](responseWithResult(_0x5b08xb))})[_0xe423[22]](sequelize.UniqueConstraintError,function(_0x5b08xd){return Util[_0xe423[36]][_0xe423[35]](_0x5b08xb,_0x5b08xd)})[_0xe423[22]](handleError(_0x5b08xb))};exports[_0xe423[20]]= function(_0x5b08x16,_0x5b08xb){return Telephone[_0xe423[31]](_0x5b08x16[_0xe423[30]][_0xe423[29]])[_0xe423[18]](handleEntityNotFound(_0x5b08xb))[_0xe423[18]](removeEntity(_0x5b08xb))[_0xe423[22]](handleError(_0x5b08xb))};exports[_0xe423[46]]= function(_0x5b08x16,_0x5b08xb){return Telephone[_0xe423[20]]({where:{id:_0x5b08x16[_0xe423[23]][_0xe423[48]]},individualHooks:true})[_0xe423[18]](function(){return _0x5b08xb[_0xe423[47]](204)})[_0xe423[22]](function(_0x5b08xd){return handleError(_0x5b08xb,_0x5b08xd)})}
\ No newline at end of file