Built motion from commit (unavailable).|2.5.14
[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 _0xb8e7=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis'];(function(_0x24cd48,_0x166b25){var _0x2b8f1c=function(_0x12a002){while(--_0x12a002){_0x24cd48['push'](_0x24cd48['shift']());}};_0x2b8f1c(++_0x166b25);}(_0xb8e7,0x165));var _0x7b8e=function(_0x30fe45,_0x3e20c8){_0x30fe45=_0x30fe45-0x0;var _0x1f7420=_0xb8e7[_0x30fe45];return _0x1f7420;};'use strict';var _=require('lodash');var util=require(_0x7b8e('0x0'));var moment=require(_0x7b8e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b8e('0x2'));var fs=require('fs');var Redis=require(_0x7b8e('0x3'));var db=require(_0x7b8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b8e('0x5'))(_0x7b8e('0x6'));var config=require(_0x7b8e('0x7'));var jayson=require(_0x7b8e('0x8'));var client=jayson[_0x7b8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3af945,_0x1150c8,_0x26c0b5){return new BPromise(function(_0x3c3893,_0x269d84){return client[_0x7b8e('0xa')](_0x3af945,_0x26c0b5)['then'](function(_0x47a9a6){logger[_0x7b8e('0xb')](_0x7b8e('0xc'),_0x1150c8,_0x7b8e('0xd'));logger[_0x7b8e('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x1150c8,'request\x20sent',JSON[_0x7b8e('0xf')](_0x47a9a6));if(_0x47a9a6['error']){if(_0x47a9a6['error']['code']===0x1f4){logger[_0x7b8e('0x10')](_0x7b8e('0xc'),_0x1150c8,_0x47a9a6[_0x7b8e('0x10')][_0x7b8e('0x11')]);return _0x269d84(_0x47a9a6[_0x7b8e('0x10')][_0x7b8e('0x11')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x1150c8,_0x47a9a6[_0x7b8e('0x10')][_0x7b8e('0x11')]);return _0x3c3893(_0x47a9a6[_0x7b8e('0x10')]['message']);}else{logger[_0x7b8e('0xb')]('DeskField,\x20%s,\x20%s',_0x1150c8,_0x7b8e('0xd'));_0x3c3893(_0x47a9a6[_0x7b8e('0x12')][_0x7b8e('0x11')]);}})['catch'](function(_0x7927e4){logger[_0x7b8e('0x10')]('DeskField,\x20%s,\x20%s',_0x1150c8,_0x7927e4);_0x269d84(_0x7927e4);});});}