479b68e2db64399c73f8d4037e59b6d687c78fc8
[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 _0xf239=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x7d9557,_0x2d6000){var _0x207a60=function(_0x489d7c){while(--_0x489d7c){_0x7d9557['push'](_0x7d9557['shift']());}};_0x207a60(++_0x2d6000);}(_0xf239,0x176));var _0x9f23=function(_0x29d351,_0x3a8f7b){_0x29d351=_0x29d351-0x0;var _0x23eba0=_0xf239[_0x29d351];return _0x23eba0;};'use strict';var _=require(_0x9f23('0x0'));var util=require(_0x9f23('0x1'));var moment=require(_0x9f23('0x2'));var BPromise=require(_0x9f23('0x3'));var rs=require(_0x9f23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f23('0x5'))['db'];var utils=require(_0x9f23('0x6'));var logger=require(_0x9f23('0x7'))(_0x9f23('0x8'));var config=require(_0x9f23('0x9'));var jayson=require(_0x9f23('0xa'));var client=jayson[_0x9f23('0xb')][_0x9f23('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46ae17,_0x5151db,_0x5bc703){return new BPromise(function(_0x5c6f71,_0x5a2f4d){return client[_0x9f23('0xd')](_0x46ae17,_0x5bc703)[_0x9f23('0xe')](function(_0x3ef677){logger[_0x9f23('0xf')](_0x9f23('0x10'),_0x5151db,'request\x20sent');logger['debug'](_0x9f23('0x11'),_0x5151db,_0x9f23('0x12'),JSON[_0x9f23('0x13')](_0x3ef677));if(_0x3ef677[_0x9f23('0x14')]){if(_0x3ef677[_0x9f23('0x14')][_0x9f23('0x15')]===0x1f4){logger[_0x9f23('0x14')](_0x9f23('0x10'),_0x5151db,_0x3ef677[_0x9f23('0x14')]['message']);return _0x5a2f4d(_0x3ef677['error']['message']);}logger[_0x9f23('0x14')](_0x9f23('0x10'),_0x5151db,_0x3ef677['error'][_0x9f23('0x16')]);return _0x5c6f71(_0x3ef677['error']['message']);}else{logger[_0x9f23('0xf')](_0x9f23('0x10'),_0x5151db,_0x9f23('0x12'));_0x5c6f71(_0x3ef677[_0x9f23('0x17')][_0x9f23('0x16')]);}})[_0x9f23('0x18')](function(_0x49a439){logger[_0x9f23('0x14')](_0x9f23('0x10'),_0x5151db,_0x49a439);_0x5a2f4d(_0x49a439);});});}