Built motion from commit 753c950e.|2.5.42
[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 _0xa09d=['client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x36f5ae,_0x53960b){var _0x10c86c=function(_0x597583){while(--_0x597583){_0x36f5ae['push'](_0x36f5ae['shift']());}};_0x10c86c(++_0x53960b);}(_0xa09d,0xd4));var _0xda09=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xa09d[_0x264545];return _0x114d10;};'use strict';var _=require(_0xda09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda09('0x1'));var rs=require(_0xda09('0x2'));var fs=require('fs');var Redis=require(_0xda09('0x3'));var db=require(_0xda09('0x4'))['db'];var utils=require(_0xda09('0x5'));var logger=require(_0xda09('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda09('0x7'));var client=jayson[_0xda09('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f2fd,_0x4a2e21,_0x19da33){return new BPromise(function(_0x3f1208,_0x577cdf){return client[_0xda09('0x9')](_0x27f2fd,_0x19da33)[_0xda09('0xa')](function(_0x2e313b){logger[_0xda09('0xb')](_0xda09('0xc'),_0x4a2e21,_0xda09('0xd'));logger[_0xda09('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4a2e21,_0xda09('0xd'),JSON['stringify'](_0x2e313b));if(_0x2e313b['error']){if(_0x2e313b[_0xda09('0xf')][_0xda09('0x10')]===0x1f4){logger[_0xda09('0xf')](_0xda09('0xc'),_0x4a2e21,_0x2e313b[_0xda09('0xf')][_0xda09('0x11')]);return _0x577cdf(_0x2e313b[_0xda09('0xf')][_0xda09('0x11')]);}logger[_0xda09('0xf')](_0xda09('0xc'),_0x4a2e21,_0x2e313b[_0xda09('0xf')]['message']);return _0x3f1208(_0x2e313b[_0xda09('0xf')][_0xda09('0x11')]);}else{logger[_0xda09('0xb')](_0xda09('0xc'),_0x4a2e21,_0xda09('0xd'));_0x3f1208(_0x2e313b[_0xda09('0x12')][_0xda09('0x11')]);}})[_0xda09('0x13')](function(_0x506c71){logger[_0xda09('0xf')](_0xda09('0xc'),_0x4a2e21,_0x506c71);_0x577cdf(_0x506c71);});});}