Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / chatQueueReport / chatQueueReport.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 _0x97ae=['ChatQueueReport','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport'];(function(_0xc318f2,_0x25594c){var _0x5649a9=function(_0x38fb2b){while(--_0x38fb2b){_0xc318f2['push'](_0xc318f2['shift']());}};_0x5649a9(++_0x25594c);}(_0x97ae,0x148));var _0xe97a=function(_0xa692b,_0x3a5394){_0xa692b=_0xa692b-0x0;var _0x302a6f=_0x97ae[_0xa692b];return _0x302a6f;};'use strict';var _=require(_0xe97a('0x0'));var util=require('util');var moment=require(_0xe97a('0x1'));var BPromise=require(_0xe97a('0x2'));var rs=require(_0xe97a('0x3'));var fs=require('fs');var Redis=require(_0xe97a('0x4'));var db=require(_0xe97a('0x5'))['db'];var utils=require(_0xe97a('0x6'));var logger=require('../../config/logger')(_0xe97a('0x7'));var config=require(_0xe97a('0x8'));var jayson=require(_0xe97a('0x9'));var client=jayson['client'][_0xe97a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x556304,_0x23e92e,_0x54f351){return new BPromise(function(_0x5186f7,_0x5f0390){return client[_0xe97a('0xb')](_0x556304,_0x54f351)[_0xe97a('0xc')](function(_0x419231){logger[_0xe97a('0xd')](_0xe97a('0xe'),_0x23e92e,_0xe97a('0xf'));logger[_0xe97a('0x10')](_0xe97a('0x11'),_0x23e92e,_0xe97a('0xf'),JSON[_0xe97a('0x12')](_0x419231));if(_0x419231[_0xe97a('0x13')]){if(_0x419231['error'][_0xe97a('0x14')]===0x1f4){logger[_0xe97a('0x13')](_0xe97a('0xe'),_0x23e92e,_0x419231[_0xe97a('0x13')][_0xe97a('0x15')]);return _0x5f0390(_0x419231['error'][_0xe97a('0x15')]);}logger[_0xe97a('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x23e92e,_0x419231['error'][_0xe97a('0x15')]);return _0x5186f7(_0x419231['error']['message']);}else{logger[_0xe97a('0xd')](_0xe97a('0xe'),_0x23e92e,_0xe97a('0xf'));_0x5186f7(_0x419231['result'][_0xe97a('0x15')]);}})[_0xe97a('0x16')](function(_0x2cbbf9){logger[_0xe97a('0x13')](_0xe97a('0xe'),_0x23e92e,_0x2cbbf9);_0x5f0390(_0x2cbbf9);});});}exports[_0xe97a('0x17')]=function(_0x451459){var _0x545713=this;return new Promise(function(_0x5aa7a7,_0x215539){return db[_0xe97a('0x18')]['create'](_0x451459[_0xe97a('0x19')],{'raw':_0x451459[_0xe97a('0x1a')]?_0x451459[_0xe97a('0x1a')][_0xe97a('0x1b')]===undefined?!![]:![]:!![]})[_0xe97a('0xc')](function(_0x1dc2d6){logger[_0xe97a('0xd')](_0xe97a('0x17'),_0x451459);logger['debug'](_0xe97a('0x17'),_0x451459,JSON['stringify'](_0x1dc2d6));_0x5aa7a7(_0x1dc2d6);})[_0xe97a('0x16')](function(_0x43972d){logger[_0xe97a('0x13')]('CreateChatQueueReport',_0x43972d[_0xe97a('0x15')],_0x451459);_0x215539(_0x545713[_0xe97a('0x13')](0x1f4,_0x43972d['message']));});});};exports[_0xe97a('0x1c')]=function(_0x2b8da8){var _0x5ab17f=this;return new Promise(function(_0x3ac35a,_0x26e332){return db['ChatQueueReport']['update'](_0x2b8da8['body'],{'raw':_0x2b8da8[_0xe97a('0x1a')]?_0x2b8da8[_0xe97a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b8da8[_0xe97a('0x1a')]?_0x2b8da8[_0xe97a('0x1a')][_0xe97a('0x1d')]||null:null,'attributes':_0x2b8da8[_0xe97a('0x1a')]?_0x2b8da8['options'][_0xe97a('0x1e')]||null:null,'limit':_0x2b8da8[_0xe97a('0x1a')]?_0x2b8da8[_0xe97a('0x1a')][_0xe97a('0x1f')]||null:null})[_0xe97a('0xc')](function(_0x329842){logger[_0xe97a('0xd')]('UpdateChatQueueReport',_0x2b8da8);logger[_0xe97a('0x10')]('UpdateChatQueueReport',_0x2b8da8,JSON[_0xe97a('0x12')](_0x329842));_0x3ac35a(_0x329842);})[_0xe97a('0x16')](function(_0x349673){logger[_0xe97a('0x13')](_0xe97a('0x1c'),_0x349673[_0xe97a('0x15')],_0x2b8da8);_0x26e332(_0x5ab17f[_0xe97a('0x13')](0x1f4,_0x349673[_0xe97a('0x15')]));});});};