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 _0x71c4=['error','DeskField,\x20%s,\x20%s','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c3ff4,_0x2bcadb){var _0x53c25d=function(_0x4e1568){while(--_0x4e1568){_0x2c3ff4['push'](_0x2c3ff4['shift']());}};_0x53c25d(++_0x2bcadb);}(_0x71c4,0x17f));var _0x471c=function(_0x1e7ea8,_0x3f67ce){_0x1e7ea8=_0x1e7ea8-0x0;var _0x15d204=_0x71c4[_0x1e7ea8];return _0x15d204;};'use strict';var _=require(_0x471c('0x0'));var util=require('util');var moment=require(_0x471c('0x1'));var BPromise=require('bluebird');var rs=require(_0x471c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x471c('0x3'))['db'];var utils=require(_0x471c('0x4'));var logger=require(_0x471c('0x5'))(_0x471c('0x6'));var config=require(_0x471c('0x7'));var jayson=require(_0x471c('0x8'));var client=jayson['client'][_0x471c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2fcf,_0xebb201,_0x1108ea){return new BPromise(function(_0xebdc71,_0x4efab3){return client[_0x471c('0xa')](_0x3d2fcf,_0x1108ea)[_0x471c('0xb')](function(_0x6c9398){logger[_0x471c('0xc')]('DeskField,\x20%s,\x20%s',_0xebb201,_0x471c('0xd'));logger[_0x471c('0xe')](_0x471c('0xf'),_0xebb201,_0x471c('0xd'),JSON[_0x471c('0x10')](_0x6c9398));if(_0x6c9398[_0x471c('0x11')]){if(_0x6c9398[_0x471c('0x11')]['code']===0x1f4){logger[_0x471c('0x11')](_0x471c('0x12'),_0xebb201,_0x6c9398[_0x471c('0x11')][_0x471c('0x13')]);return _0x4efab3(_0x6c9398[_0x471c('0x11')][_0x471c('0x13')]);}logger['error'](_0x471c('0x12'),_0xebb201,_0x6c9398[_0x471c('0x11')][_0x471c('0x13')]);return _0xebdc71(_0x6c9398[_0x471c('0x11')][_0x471c('0x13')]);}else{logger[_0x471c('0xc')](_0x471c('0x12'),_0xebb201,_0x471c('0xd'));_0xebdc71(_0x6c9398['result'][_0x471c('0x13')]);}})['catch'](function(_0x1bab3b){logger[_0x471c('0x11')]('DeskField,\x20%s,\x20%s',_0xebb201,_0x1bab3b);_0x4efab3(_0x1bab3b);});});}