Built motion from commit 6f14c8ba.|2.6.29
[motion2.git] / server / api / intDeskField / intDeskField.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 _0xd07a=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','DeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45a3ae,_0x2b9745){var _0x58a2b1=function(_0x49efa8){while(--_0x49efa8){_0x45a3ae['push'](_0x45a3ae['shift']());}};_0x58a2b1(++_0x2b9745);}(_0xd07a,0x1b2));var _0xad07=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0xd07a[_0x41ee16];return _0x1f60de;};'use strict';var _=require(_0xad07('0x0'));var util=require(_0xad07('0x1'));var moment=require('moment');var BPromise=require(_0xad07('0x2'));var rs=require(_0xad07('0x3'));var fs=require('fs');var Redis=require(_0xad07('0x4'));var db=require(_0xad07('0x5'))['db'];var utils=require(_0xad07('0x6'));var logger=require(_0xad07('0x7'))('rpc');var config=require(_0xad07('0x8'));var jayson=require(_0xad07('0x9'));var client=jayson[_0xad07('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d30fb,_0x26f60a,_0x2178f3){return new BPromise(function(_0x5c7cab,_0x5651b9){return client['request'](_0x1d30fb,_0x2178f3)['then'](function(_0x251124){logger['info']('DeskField,\x20%s,\x20%s',_0x26f60a,_0xad07('0xb'));logger['debug'](_0xad07('0xc'),_0x26f60a,_0xad07('0xb'),JSON['stringify'](_0x251124));if(_0x251124['error']){if(_0x251124[_0xad07('0xd')][_0xad07('0xe')]===0x1f4){logger[_0xad07('0xd')](_0xad07('0xf'),_0x26f60a,_0x251124['error']['message']);return _0x5651b9(_0x251124[_0xad07('0xd')]['message']);}logger['error'](_0xad07('0xf'),_0x26f60a,_0x251124[_0xad07('0xd')][_0xad07('0x10')]);return _0x5c7cab(_0x251124[_0xad07('0xd')][_0xad07('0x10')]);}else{logger[_0xad07('0x11')](_0xad07('0xf'),_0x26f60a,_0xad07('0xb'));_0x5c7cab(_0x251124[_0xad07('0x12')][_0xad07('0x10')]);}})[_0xad07('0x13')](function(_0x50335d){logger[_0xad07('0xd')]('DeskField,\x20%s,\x20%s',_0x26f60a,_0x50335d);_0x5651b9(_0x50335d);});});}