Built motion from commit 0900f080.|2.5.45
[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 _0x9a32=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x379162,_0x4234c0){var _0x897bd4=function(_0x1e0da1){while(--_0x1e0da1){_0x379162['push'](_0x379162['shift']());}};_0x897bd4(++_0x4234c0);}(_0x9a32,0xd1));var _0x29a3=function(_0x244911,_0x54bed9){_0x244911=_0x244911-0x0;var _0x1218e6=_0x9a32[_0x244911];return _0x1218e6;};'use strict';var _=require(_0x29a3('0x0'));var util=require(_0x29a3('0x1'));var moment=require(_0x29a3('0x2'));var BPromise=require(_0x29a3('0x3'));var rs=require(_0x29a3('0x4'));var fs=require('fs');var Redis=require(_0x29a3('0x5'));var db=require(_0x29a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x29a3('0x7'))(_0x29a3('0x8'));var config=require('../../config/environment');var jayson=require(_0x29a3('0x9'));var client=jayson['client'][_0x29a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29bd63,_0x536ae6,_0x5d87e3){return new BPromise(function(_0xabdaea,_0x495c3f){return client[_0x29a3('0xb')](_0x29bd63,_0x5d87e3)[_0x29a3('0xc')](function(_0x1c05c9){logger[_0x29a3('0xd')](_0x29a3('0xe'),_0x536ae6,_0x29a3('0xf'));logger[_0x29a3('0x10')](_0x29a3('0x11'),_0x536ae6,'request\x20sent',JSON[_0x29a3('0x12')](_0x1c05c9));if(_0x1c05c9['error']){if(_0x1c05c9[_0x29a3('0x13')][_0x29a3('0x14')]===0x1f4){logger['error'](_0x29a3('0xe'),_0x536ae6,_0x1c05c9['error'][_0x29a3('0x15')]);return _0x495c3f(_0x1c05c9[_0x29a3('0x13')][_0x29a3('0x15')]);}logger[_0x29a3('0x13')](_0x29a3('0xe'),_0x536ae6,_0x1c05c9['error'][_0x29a3('0x15')]);return _0xabdaea(_0x1c05c9[_0x29a3('0x13')][_0x29a3('0x15')]);}else{logger['info'](_0x29a3('0xe'),_0x536ae6,_0x29a3('0xf'));_0xabdaea(_0x1c05c9[_0x29a3('0x16')][_0x29a3('0x15')]);}})['catch'](function(_0x4c2937){logger[_0x29a3('0x13')](_0x29a3('0xe'),_0x536ae6,_0x4c2937);_0x495c3f(_0x4c2937);});});}