Built motion from commit (unavailable).|2.4.21
[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 _0x85e5=['../../config/utils','../../config/logger','rpc','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x19acaf,_0x2f7815){var _0x58cb9c=function(_0xd08dc7){while(--_0xd08dc7){_0x19acaf['push'](_0x19acaf['shift']());}};_0x58cb9c(++_0x2f7815);}(_0x85e5,0x1f4));var _0x585e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85e5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x585e('0x0'));var util=require(_0x585e('0x1'));var moment=require(_0x585e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x585e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x585e('0x4'));var logger=require(_0x585e('0x5'))(_0x585e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x585e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x211db2,_0xf04cd4,_0x13abe7){return new BPromise(function(_0x3ca4c4,_0x190cc9){return client[_0x585e('0x8')](_0x211db2,_0x13abe7)[_0x585e('0x9')](function(_0x3cc4cb){logger[_0x585e('0xa')](_0x585e('0xb'),_0xf04cd4,'request\x20sent');logger[_0x585e('0xc')](_0x585e('0xd'),_0xf04cd4,_0x585e('0xe'),JSON[_0x585e('0xf')](_0x3cc4cb));if(_0x3cc4cb['error']){if(_0x3cc4cb[_0x585e('0x10')][_0x585e('0x11')]===0x1f4){logger[_0x585e('0x10')](_0x585e('0xb'),_0xf04cd4,_0x3cc4cb[_0x585e('0x10')][_0x585e('0x12')]);return _0x190cc9(_0x3cc4cb['error'][_0x585e('0x12')]);}logger[_0x585e('0x10')](_0x585e('0xb'),_0xf04cd4,_0x3cc4cb[_0x585e('0x10')][_0x585e('0x12')]);return _0x3ca4c4(_0x3cc4cb[_0x585e('0x10')][_0x585e('0x12')]);}else{logger[_0x585e('0xa')](_0x585e('0xb'),_0xf04cd4,'request\x20sent');_0x3ca4c4(_0x3cc4cb[_0x585e('0x13')][_0x585e('0x12')]);}})[_0x585e('0x14')](function(_0x34cfe4){logger[_0x585e('0x10')](_0x585e('0xb'),_0xf04cd4,_0x34cfe4);_0x190cc9(_0x34cfe4);});});}