Built motion from commit (unavailable).|2.5.22
[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 _0x6d04=['moment','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x6d04,0x12a));var _0x46d0=function(_0x5bd072,_0x3f02d6){_0x5bd072=_0x5bd072-0x0;var _0x17c868=_0x6d04[_0x5bd072];return _0x17c868;};'use strict';var _=require(_0x46d0('0x0'));var util=require(_0x46d0('0x1'));var moment=require(_0x46d0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x46d0('0x4'));var logger=require(_0x46d0('0x5'))(_0x46d0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x46d0('0x7')][_0x46d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ddc36,_0x1289c7,_0x5c8dc4){return new BPromise(function(_0x258507,_0x5900e8){return client[_0x46d0('0x9')](_0x1ddc36,_0x5c8dc4)[_0x46d0('0xa')](function(_0x23ea0b){logger[_0x46d0('0xb')]('DeskField,\x20%s,\x20%s',_0x1289c7,'request\x20sent');logger[_0x46d0('0xc')](_0x46d0('0xd'),_0x1289c7,_0x46d0('0xe'),JSON['stringify'](_0x23ea0b));if(_0x23ea0b[_0x46d0('0xf')]){if(_0x23ea0b[_0x46d0('0xf')][_0x46d0('0x10')]===0x1f4){logger[_0x46d0('0xf')](_0x46d0('0x11'),_0x1289c7,_0x23ea0b[_0x46d0('0xf')][_0x46d0('0x12')]);return _0x5900e8(_0x23ea0b['error'][_0x46d0('0x12')]);}logger[_0x46d0('0xf')]('DeskField,\x20%s,\x20%s',_0x1289c7,_0x23ea0b['error'][_0x46d0('0x12')]);return _0x258507(_0x23ea0b[_0x46d0('0xf')][_0x46d0('0x12')]);}else{logger[_0x46d0('0xb')](_0x46d0('0x11'),_0x1289c7,_0x46d0('0xe'));_0x258507(_0x23ea0b[_0x46d0('0x13')][_0x46d0('0x12')]);}})['catch'](function(_0x2f8504){logger[_0x46d0('0xf')](_0x46d0('0x11'),_0x1289c7,_0x2f8504);_0x5900e8(_0x2f8504);});});}