Built motion from commit (unavailable).|2.0.82
[motion2.git] / server / api / userChatQueue / userChatQueue.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 _0x973e=['moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x973e,0x18a));var _0xe973=function(_0x184b76,_0x36ad4e){_0x184b76=_0x184b76-0x0;var _0x2f27d7=_0x973e[_0x184b76];return _0x2f27d7;};'use strict';var _=require(_0xe973('0x0'));var util=require(_0xe973('0x1'));var moment=require(_0xe973('0x2'));var BPromise=require(_0xe973('0x3'));var rs=require(_0xe973('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe973('0x5'))(_0xe973('0x6'));var config=require(_0xe973('0x7'));var jayson=require(_0xe973('0x8'));var client=jayson[_0xe973('0x9')][_0xe973('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57fb22,_0x41cc03,_0x300424){return new BPromise(function(_0x55c779,_0x56e350){return client[_0xe973('0xb')](_0x57fb22,_0x300424)[_0xe973('0xc')](function(_0x49ece3){logger[_0xe973('0xd')](_0xe973('0xe'),_0x41cc03,_0xe973('0xf'));logger['debug'](_0xe973('0x10'),_0x41cc03,_0xe973('0xf'),JSON[_0xe973('0x11')](_0x49ece3));if(_0x49ece3[_0xe973('0x12')]){if(_0x49ece3['error']['code']===0x1f4){logger[_0xe973('0x12')](_0xe973('0xe'),_0x41cc03,_0x49ece3['error'][_0xe973('0x13')]);return _0x56e350(_0x49ece3[_0xe973('0x12')]['message']);}logger[_0xe973('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x41cc03,_0x49ece3[_0xe973('0x12')]['message']);return _0x55c779(_0x49ece3['error'][_0xe973('0x13')]);}else{logger[_0xe973('0xd')](_0xe973('0xe'),_0x41cc03,_0xe973('0xf'));_0x55c779(_0x49ece3[_0xe973('0x14')]['message']);}})[_0xe973('0x15')](function(_0x5aa221){logger[_0xe973('0x12')](_0xe973('0xe'),_0x41cc03,_0x5aa221);_0x56e350(_0x5aa221);});});}