Built motion from commit (unavailable).|2.3.7
[motion2.git] / server / api / openchannelApplication / openchannelApplication.rpc.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 _0x171c=['request','then','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','result','catch','options','raw','attributes','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3cc291,_0x1aa13b){var _0x12ede2=function(_0x3f2bd5){while(--_0x3f2bd5){_0x3cc291['push'](_0x3cc291['shift']());}};_0x12ede2(++_0x1aa13b);}(_0x171c,0x16d));var _0xc171=function(_0x40dfaf,_0x40eb00){_0x40dfaf=_0x40dfaf-0x0;var _0x14c770=_0x171c[_0x40dfaf];return _0x14c770;};'use strict';var _=require(_0xc171('0x0'));var util=require(_0xc171('0x1'));var moment=require(_0xc171('0x2'));var BPromise=require(_0xc171('0x3'));var rs=require(_0xc171('0x4'));var fs=require('fs');var Redis=require(_0xc171('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc171('0x6'));var logger=require('../../config/logger')(_0xc171('0x7'));var config=require(_0xc171('0x8'));var jayson=require(_0xc171('0x9'));var client=jayson[_0xc171('0xa')][_0xc171('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11e32b,_0x44c202,_0x105519){return new BPromise(function(_0x973293,_0x1b9847){return client[_0xc171('0xc')](_0x11e32b,_0x105519)[_0xc171('0xd')](function(_0x31cca5){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x44c202,_0xc171('0xe'));logger[_0xc171('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x44c202,_0xc171('0xe'),JSON[_0xc171('0x10')](_0x31cca5));if(_0x31cca5[_0xc171('0x11')]){if(_0x31cca5[_0xc171('0x11')][_0xc171('0x12')]===0x1f4){logger['error'](_0xc171('0x13'),_0x44c202,_0x31cca5['error'][_0xc171('0x14')]);return _0x1b9847(_0x31cca5['error'][_0xc171('0x14')]);}logger[_0xc171('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x44c202,_0x31cca5[_0xc171('0x11')][_0xc171('0x14')]);return _0x973293(_0x31cca5[_0xc171('0x11')][_0xc171('0x14')]);}else{logger[_0xc171('0x15')](_0xc171('0x13'),_0x44c202,_0xc171('0xe'));_0x973293(_0x31cca5[_0xc171('0x16')][_0xc171('0x14')]);}})[_0xc171('0x17')](function(_0x2e87e9){logger[_0xc171('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x44c202,_0x2e87e9);_0x1b9847(_0x2e87e9);});});}exports['UpdateOpenchannelApplication']=function(_0x3e7256){var _0x4eadf0=this;return new Promise(function(_0x1b5610,_0x4f1267){return db['OpenchannelApplication']['update'](_0x3e7256['body'],{'raw':_0x3e7256[_0xc171('0x18')]?_0x3e7256[_0xc171('0x18')][_0xc171('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7256[_0xc171('0x18')]?_0x3e7256[_0xc171('0x18')]['where']||null:null,'attributes':_0x3e7256['options']?_0x3e7256[_0xc171('0x18')][_0xc171('0x1a')]||null:null,'limit':_0x3e7256[_0xc171('0x18')]?_0x3e7256['options'][_0xc171('0x1b')]||null:null})['then'](function(_0x34c812){logger[_0xc171('0x15')](_0xc171('0x1c'),_0x3e7256);logger[_0xc171('0xf')](_0xc171('0x1c'),_0x3e7256,JSON['stringify'](_0x34c812));_0x1b5610(_0x34c812);})[_0xc171('0x17')](function(_0x1f7b33){logger[_0xc171('0x11')](_0xc171('0x1c'),_0x1f7b33[_0xc171('0x14')],_0x3e7256);_0x4f1267(_0x4eadf0[_0xc171('0x11')](0x1f4,_0x1f7b33[_0xc171('0x14')]));});});};