Built motion from commit ffdca78c.|2.6.24
[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 _0xe13a=['then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x556fc4,_0x1b82b3){var _0x560e72=function(_0x266c22){while(--_0x266c22){_0x556fc4['push'](_0x556fc4['shift']());}};_0x560e72(++_0x1b82b3);}(_0xe13a,0x15f));var _0xae13=function(_0x28ef92,_0x2e87e7){_0x28ef92=_0x28ef92-0x0;var _0x48533e=_0xe13a[_0x28ef92];return _0x48533e;};'use strict';var _=require(_0xae13('0x0'));var util=require('util');var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require(_0xae13('0x4'));var db=require(_0xae13('0x5'))['db'];var utils=require(_0xae13('0x6'));var logger=require('../../config/logger')(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4217f9,_0xb95b82,_0x27db12){return new BPromise(function(_0x52091a,_0x463ce8){return client['request'](_0x4217f9,_0x27db12)[_0xae13('0xa')](function(_0x3a1fdc){logger['info'](_0xae13('0xb'),_0xb95b82,_0xae13('0xc'));logger['debug'](_0xae13('0xd'),_0xb95b82,_0xae13('0xc'),JSON[_0xae13('0xe')](_0x3a1fdc));if(_0x3a1fdc[_0xae13('0xf')]){if(_0x3a1fdc[_0xae13('0xf')]['code']===0x1f4){logger[_0xae13('0xf')](_0xae13('0xb'),_0xb95b82,_0x3a1fdc[_0xae13('0xf')][_0xae13('0x10')]);return _0x463ce8(_0x3a1fdc[_0xae13('0xf')][_0xae13('0x10')]);}logger[_0xae13('0xf')]('DeskField,\x20%s,\x20%s',_0xb95b82,_0x3a1fdc[_0xae13('0xf')][_0xae13('0x10')]);return _0x52091a(_0x3a1fdc['error'][_0xae13('0x10')]);}else{logger[_0xae13('0x11')](_0xae13('0xb'),_0xb95b82,_0xae13('0xc'));_0x52091a(_0x3a1fdc['result']['message']);}})[_0xae13('0x12')](function(_0xd99045){logger['error'](_0xae13('0xb'),_0xb95b82,_0xd99045);_0x463ce8(_0xd99045);});});}