Built motion from commit (unavailable).|2.5.27
[motion2.git] / server / api / cmHopperFinal / cmHopperFinal.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 _0x6b0b=['body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create'];(function(_0x375f61,_0x52b949){var _0x333182=function(_0x638bff){while(--_0x638bff){_0x375f61['push'](_0x375f61['shift']());}};_0x333182(++_0x52b949);}(_0x6b0b,0x1c6));var _0xb6b0=function(_0x2e36a9,_0x28088a){_0x2e36a9=_0x2e36a9-0x0;var _0xd7417d=_0x6b0b[_0x2e36a9];return _0xd7417d;};'use strict';var _=require(_0xb6b0('0x0'));var util=require(_0xb6b0('0x1'));var moment=require(_0xb6b0('0x2'));var BPromise=require(_0xb6b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6b0('0x4'));var db=require(_0xb6b0('0x5'))['db'];var utils=require(_0xb6b0('0x6'));var logger=require('../../config/logger')(_0xb6b0('0x7'));var config=require(_0xb6b0('0x8'));var jayson=require(_0xb6b0('0x9'));var client=jayson[_0xb6b0('0xa')][_0xb6b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x150542,_0x2b452a,_0x5ab80c){return new BPromise(function(_0x4157b6,_0x16e78a){return client[_0xb6b0('0xc')](_0x150542,_0x5ab80c)['then'](function(_0x20b9bb){logger[_0xb6b0('0xd')](_0xb6b0('0xe'),_0x2b452a,_0xb6b0('0xf'));logger[_0xb6b0('0x10')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x2b452a,_0xb6b0('0xf'),JSON[_0xb6b0('0x11')](_0x20b9bb));if(_0x20b9bb[_0xb6b0('0x12')]){if(_0x20b9bb['error'][_0xb6b0('0x13')]===0x1f4){logger[_0xb6b0('0x12')](_0xb6b0('0xe'),_0x2b452a,_0x20b9bb['error']['message']);return _0x16e78a(_0x20b9bb[_0xb6b0('0x12')][_0xb6b0('0x14')]);}logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x2b452a,_0x20b9bb[_0xb6b0('0x12')][_0xb6b0('0x14')]);return _0x4157b6(_0x20b9bb[_0xb6b0('0x12')][_0xb6b0('0x14')]);}else{logger[_0xb6b0('0xd')](_0xb6b0('0xe'),_0x2b452a,_0xb6b0('0xf'));_0x4157b6(_0x20b9bb[_0xb6b0('0x15')][_0xb6b0('0x14')]);}})[_0xb6b0('0x16')](function(_0x2485a4){logger[_0xb6b0('0x12')](_0xb6b0('0xe'),_0x2b452a,_0x2485a4);_0x16e78a(_0x2485a4);});});}exports[_0xb6b0('0x17')]=function(_0x227d62){var _0xcc58d6=this;return new Promise(function(_0x1128db,_0x1af50b){return db[_0xb6b0('0x18')][_0xb6b0('0x19')](_0x227d62[_0xb6b0('0x1a')],{'raw':_0x227d62[_0xb6b0('0x1b')]?_0x227d62['options'][_0xb6b0('0x1c')]===undefined?!![]:![]:!![]})[_0xb6b0('0x1d')](function(_0x43ee99){logger[_0xb6b0('0xd')](_0xb6b0('0x17'),_0x227d62);logger['debug'](_0xb6b0('0x17'),_0x227d62,JSON[_0xb6b0('0x11')](_0x43ee99));_0x1128db(_0x43ee99);})[_0xb6b0('0x16')](function(_0x2a8401){logger['error'](_0xb6b0('0x17'),_0x2a8401[_0xb6b0('0x14')],_0x227d62);_0x1af50b(_0xcc58d6['error'](0x1f4,_0x2a8401[_0xb6b0('0x14')]));});});};