cc32c9505b98e0f38f720ab44ef7717112ed13a6
[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 _0xcfc9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x25b1de,_0xcd12ef){var _0x208acd=function(_0x341060){while(--_0x341060){_0x25b1de['push'](_0x25b1de['shift']());}};_0x208acd(++_0xcd12ef);}(_0xcfc9,0x127));var _0x9cfc=function(_0x40c277,_0x4c51d9){_0x40c277=_0x40c277-0x0;var _0x206ae8=_0xcfc9[_0x40c277];return _0x206ae8;};'use strict';var _=require(_0x9cfc('0x0'));var util=require(_0x9cfc('0x1'));var moment=require('moment');var BPromise=require(_0x9cfc('0x2'));var rs=require(_0x9cfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cfc('0x4'))['db'];var utils=require(_0x9cfc('0x5'));var logger=require(_0x9cfc('0x6'))(_0x9cfc('0x7'));var config=require(_0x9cfc('0x8'));var jayson=require(_0x9cfc('0x9'));var client=jayson[_0x9cfc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d9722,_0x8e821e,_0x8c6592){return new BPromise(function(_0x2a663c,_0x31cbf2){return client[_0x9cfc('0xb')](_0x2d9722,_0x8c6592)[_0x9cfc('0xc')](function(_0x3e7a56){logger[_0x9cfc('0xd')](_0x9cfc('0xe'),_0x8e821e,_0x9cfc('0xf'));logger[_0x9cfc('0x10')](_0x9cfc('0x11'),_0x8e821e,'request\x20sent',JSON[_0x9cfc('0x12')](_0x3e7a56));if(_0x3e7a56[_0x9cfc('0x13')]){if(_0x3e7a56['error']['code']===0x1f4){logger[_0x9cfc('0x13')](_0x9cfc('0xe'),_0x8e821e,_0x3e7a56[_0x9cfc('0x13')][_0x9cfc('0x14')]);return _0x31cbf2(_0x3e7a56[_0x9cfc('0x13')][_0x9cfc('0x14')]);}logger['error'](_0x9cfc('0xe'),_0x8e821e,_0x3e7a56[_0x9cfc('0x13')][_0x9cfc('0x14')]);return _0x2a663c(_0x3e7a56[_0x9cfc('0x13')][_0x9cfc('0x14')]);}else{logger['info'](_0x9cfc('0xe'),_0x8e821e,_0x9cfc('0xf'));_0x2a663c(_0x3e7a56[_0x9cfc('0x15')]['message']);}})[_0x9cfc('0x16')](function(_0x59f845){logger[_0x9cfc('0x13')](_0x9cfc('0xe'),_0x8e821e,_0x59f845);_0x31cbf2(_0x59f845);});});}