8c54815408aa403b736bc0588c04de3b330185d5
[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 _0x260c=['DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f1438,_0x2fb615){var _0x2d209f=function(_0x2e5b0e){while(--_0x2e5b0e){_0x3f1438['push'](_0x3f1438['shift']());}};_0x2d209f(++_0x2fb615);}(_0x260c,0x1d2));var _0xc260=function(_0x4d1f59,_0x4483ec){_0x4d1f59=_0x4d1f59-0x0;var _0x468441=_0x260c[_0x4d1f59];return _0x468441;};'use strict';var _=require(_0xc260('0x0'));var util=require('util');var moment=require(_0xc260('0x1'));var BPromise=require(_0xc260('0x2'));var rs=require(_0xc260('0x3'));var fs=require('fs');var Redis=require(_0xc260('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc260('0x5'));var logger=require(_0xc260('0x6'))(_0xc260('0x7'));var config=require(_0xc260('0x8'));var jayson=require(_0xc260('0x9'));var client=jayson[_0xc260('0xa')][_0xc260('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22cf87,_0x4a557b,_0x157c24){return new BPromise(function(_0xe1d2a5,_0x129165){return client[_0xc260('0xc')](_0x22cf87,_0x157c24)['then'](function(_0x2b7f5c){logger[_0xc260('0xd')](_0xc260('0xe'),_0x4a557b,_0xc260('0xf'));logger[_0xc260('0x10')](_0xc260('0x11'),_0x4a557b,'request\x20sent',JSON['stringify'](_0x2b7f5c));if(_0x2b7f5c['error']){if(_0x2b7f5c[_0xc260('0x12')][_0xc260('0x13')]===0x1f4){logger[_0xc260('0x12')]('DeskField,\x20%s,\x20%s',_0x4a557b,_0x2b7f5c[_0xc260('0x12')][_0xc260('0x14')]);return _0x129165(_0x2b7f5c[_0xc260('0x12')][_0xc260('0x14')]);}logger[_0xc260('0x12')]('DeskField,\x20%s,\x20%s',_0x4a557b,_0x2b7f5c[_0xc260('0x12')]['message']);return _0xe1d2a5(_0x2b7f5c['error'][_0xc260('0x14')]);}else{logger['info'](_0xc260('0xe'),_0x4a557b,_0xc260('0xf'));_0xe1d2a5(_0x2b7f5c[_0xc260('0x15')][_0xc260('0x14')]);}})[_0xc260('0x16')](function(_0x43b531){logger['error'](_0xc260('0xe'),_0x4a557b,_0x43b531);_0x129165(_0x43b531);});});}