Built motion from commit (unavailable).|2.0.76
[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 _0x2709=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2786f9,_0x45dfec){var _0x22c3ec=function(_0x542ceb){while(--_0x542ceb){_0x2786f9['push'](_0x2786f9['shift']());}};_0x22c3ec(++_0x45dfec);}(_0x2709,0x1b5));var _0x9270=function(_0x26aa5a,_0x359ba8){_0x26aa5a=_0x26aa5a-0x0;var _0x312a41=_0x2709[_0x26aa5a];return _0x312a41;};'use strict';var _=require(_0x9270('0x0'));var util=require(_0x9270('0x1'));var moment=require(_0x9270('0x2'));var BPromise=require(_0x9270('0x3'));var rs=require(_0x9270('0x4'));var fs=require('fs');var db=require(_0x9270('0x5'))['db'];var utils=require(_0x9270('0x6'));var logger=require(_0x9270('0x7'))(_0x9270('0x8'));var config=require(_0x9270('0x9'));var jayson=require(_0x9270('0xa'));var client=jayson['client'][_0x9270('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x79c780,_0x1e57bc,_0x277bd8){return new BPromise(function(_0x14539c,_0x18d1c5){return client[_0x9270('0xc')](_0x79c780,_0x277bd8)[_0x9270('0xd')](function(_0x208eef){logger[_0x9270('0xe')](_0x9270('0xf'),_0x1e57bc,'request\x20sent');logger[_0x9270('0x10')](_0x9270('0x11'),_0x1e57bc,_0x9270('0x12'),JSON[_0x9270('0x13')](_0x208eef));if(_0x208eef[_0x9270('0x14')]){if(_0x208eef[_0x9270('0x14')]['code']===0x1f4){logger[_0x9270('0x14')](_0x9270('0xf'),_0x1e57bc,_0x208eef['error'][_0x9270('0x15')]);return _0x18d1c5(_0x208eef[_0x9270('0x14')][_0x9270('0x15')]);}logger[_0x9270('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x1e57bc,_0x208eef['error'][_0x9270('0x15')]);return _0x14539c(_0x208eef['error']['message']);}else{logger[_0x9270('0xe')](_0x9270('0xf'),_0x1e57bc,'request\x20sent');_0x14539c(_0x208eef[_0x9270('0x16')]['message']);}})[_0x9270('0x17')](function(_0x38c02f){logger[_0x9270('0x14')](_0x9270('0xf'),_0x1e57bc,_0x38c02f);_0x18d1c5(_0x38c02f);});});}