Built motion from commit eddce310.|2.6.12
[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 _0xec38=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring'];(function(_0x2687c9,_0x218a66){var _0x1e346a=function(_0x52b018){while(--_0x52b018){_0x2687c9['push'](_0x2687c9['shift']());}};_0x1e346a(++_0x218a66);}(_0xec38,0x123));var _0x8ec3=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0xec38[_0xf16b1];return _0x26f94d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8ec3('0x0'));var BPromise=require(_0x8ec3('0x1'));var rs=require(_0x8ec3('0x2'));var fs=require('fs');var Redis=require(_0x8ec3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ec3('0x4'));var logger=require(_0x8ec3('0x5'))(_0x8ec3('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ec3('0x7'));var client=jayson[_0x8ec3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf90233,_0x294641,_0xe5b5f5){return new BPromise(function(_0x4e5355,_0x2f7674){return client[_0x8ec3('0x9')](_0xf90233,_0xe5b5f5)[_0x8ec3('0xa')](function(_0x5e78a2){logger[_0x8ec3('0xb')](_0x8ec3('0xc'),_0x294641,_0x8ec3('0xd'));logger[_0x8ec3('0xe')](_0x8ec3('0xf'),_0x294641,_0x8ec3('0xd'),JSON[_0x8ec3('0x10')](_0x5e78a2));if(_0x5e78a2[_0x8ec3('0x11')]){if(_0x5e78a2[_0x8ec3('0x11')]['code']===0x1f4){logger['error'](_0x8ec3('0xc'),_0x294641,_0x5e78a2[_0x8ec3('0x11')][_0x8ec3('0x12')]);return _0x2f7674(_0x5e78a2[_0x8ec3('0x11')][_0x8ec3('0x12')]);}logger[_0x8ec3('0x11')](_0x8ec3('0xc'),_0x294641,_0x5e78a2['error'][_0x8ec3('0x12')]);return _0x4e5355(_0x5e78a2[_0x8ec3('0x11')][_0x8ec3('0x12')]);}else{logger[_0x8ec3('0xb')](_0x8ec3('0xc'),_0x294641,_0x8ec3('0xd'));_0x4e5355(_0x5e78a2[_0x8ec3('0x13')][_0x8ec3('0x12')]);}})[_0x8ec3('0x14')](function(_0xbdaa90){logger[_0x8ec3('0x11')]('DeskField,\x20%s,\x20%s',_0x294641,_0xbdaa90);_0x2f7674(_0xbdaa90);});});}