Built motion from commit 85328c08.|2.5.50
[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 _0xc385=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56ba84,_0x260dff){var _0x51e991=function(_0x35e115){while(--_0x35e115){_0x56ba84['push'](_0x56ba84['shift']());}};_0x51e991(++_0x260dff);}(_0xc385,0x99));var _0x5c38=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc385[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x5c38('0x0'));var util=require('util');var moment=require(_0x5c38('0x1'));var BPromise=require(_0x5c38('0x2'));var rs=require(_0x5c38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c38('0x4'));var logger=require('../../config/logger')(_0x5c38('0x5'));var config=require(_0x5c38('0x6'));var jayson=require(_0x5c38('0x7'));var client=jayson[_0x5c38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d329b,_0x40e510,_0x44865e){return new BPromise(function(_0x354829,_0x373ebf){return client[_0x5c38('0x9')](_0x1d329b,_0x44865e)[_0x5c38('0xa')](function(_0x432d77){logger[_0x5c38('0xb')](_0x5c38('0xc'),_0x40e510,_0x5c38('0xd'));logger[_0x5c38('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x40e510,_0x5c38('0xd'),JSON[_0x5c38('0xf')](_0x432d77));if(_0x432d77[_0x5c38('0x10')]){if(_0x432d77[_0x5c38('0x10')][_0x5c38('0x11')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x40e510,_0x432d77[_0x5c38('0x10')][_0x5c38('0x12')]);return _0x373ebf(_0x432d77['error'][_0x5c38('0x12')]);}logger['error'](_0x5c38('0xc'),_0x40e510,_0x432d77[_0x5c38('0x10')][_0x5c38('0x12')]);return _0x354829(_0x432d77[_0x5c38('0x10')][_0x5c38('0x12')]);}else{logger[_0x5c38('0xb')]('DeskField,\x20%s,\x20%s',_0x40e510,'request\x20sent');_0x354829(_0x432d77[_0x5c38('0x13')][_0x5c38('0x12')]);}})[_0x5c38('0x14')](function(_0x57ba63){logger['error'](_0x5c38('0xc'),_0x40e510,_0x57ba63);_0x373ebf(_0x57ba63);});});}