Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / openchannelQueueReport / openchannelQueueReport.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 _0x3f48=['options','stringify','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','create','body'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3f48,0x17f));var _0x83f4=function(_0x29da5f,_0x43d051){_0x29da5f=_0x29da5f-0x0;var _0x1362b9=_0x3f48[_0x29da5f];return _0x1362b9;};'use strict';var _=require(_0x83f4('0x0'));var util=require(_0x83f4('0x1'));var moment=require('moment');var BPromise=require(_0x83f4('0x2'));var rs=require(_0x83f4('0x3'));var fs=require('fs');var Redis=require(_0x83f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x83f4('0x5'))(_0x83f4('0x6'));var config=require(_0x83f4('0x7'));var jayson=require(_0x83f4('0x8'));var client=jayson['client'][_0x83f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1879f6,_0x9c365a,_0x5821b5){return new BPromise(function(_0x552b54,_0xc4d69c){return client[_0x83f4('0xa')](_0x1879f6,_0x5821b5)[_0x83f4('0xb')](function(_0x30a2dc){logger[_0x83f4('0xc')](_0x83f4('0xd'),_0x9c365a,_0x83f4('0xe'));logger[_0x83f4('0xf')](_0x83f4('0x10'),_0x9c365a,_0x83f4('0xe'),JSON['stringify'](_0x30a2dc));if(_0x30a2dc[_0x83f4('0x11')]){if(_0x30a2dc[_0x83f4('0x11')][_0x83f4('0x12')]===0x1f4){logger[_0x83f4('0x11')](_0x83f4('0xd'),_0x9c365a,_0x30a2dc['error']['message']);return _0xc4d69c(_0x30a2dc[_0x83f4('0x11')][_0x83f4('0x13')]);}logger['error'](_0x83f4('0xd'),_0x9c365a,_0x30a2dc[_0x83f4('0x11')][_0x83f4('0x13')]);return _0x552b54(_0x30a2dc[_0x83f4('0x11')][_0x83f4('0x13')]);}else{logger[_0x83f4('0xc')](_0x83f4('0xd'),_0x9c365a,_0x83f4('0xe'));_0x552b54(_0x30a2dc[_0x83f4('0x14')][_0x83f4('0x13')]);}})[_0x83f4('0x15')](function(_0x26144f){logger[_0x83f4('0x11')](_0x83f4('0xd'),_0x9c365a,_0x26144f);_0xc4d69c(_0x26144f);});});}exports[_0x83f4('0x16')]=function(_0x5e05ca){var _0x10601d=this;return new Promise(function(_0x469eb5,_0x1bd7d3){return db['OpenchannelQueueReport'][_0x83f4('0x17')](_0x5e05ca[_0x83f4('0x18')],{'raw':_0x5e05ca['options']?_0x5e05ca[_0x83f4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x83f4('0xb')](function(_0x326e1a){logger[_0x83f4('0xc')](_0x83f4('0x16'),_0x5e05ca);logger[_0x83f4('0xf')]('CreateOpenchannelQueueReport',_0x5e05ca,JSON[_0x83f4('0x1a')](_0x326e1a));_0x469eb5(_0x326e1a);})[_0x83f4('0x15')](function(_0x289db2){logger['error'](_0x83f4('0x16'),_0x289db2['message'],_0x5e05ca);_0x1bd7d3(_0x10601d[_0x83f4('0x11')](0x1f4,_0x289db2[_0x83f4('0x13')]));});});};exports[_0x83f4('0x1b')]=function(_0x46a068){var _0x5e0969=this;return new Promise(function(_0x55ff8d,_0x28fcf0){return db[_0x83f4('0x1c')][_0x83f4('0x1d')](_0x46a068[_0x83f4('0x18')],{'raw':_0x46a068['options']?_0x46a068[_0x83f4('0x19')][_0x83f4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a068[_0x83f4('0x19')]?_0x46a068[_0x83f4('0x19')][_0x83f4('0x1f')]||null:null,'attributes':_0x46a068[_0x83f4('0x19')]?_0x46a068['options'][_0x83f4('0x20')]||null:null,'limit':_0x46a068[_0x83f4('0x19')]?_0x46a068['options'][_0x83f4('0x21')]||null:null})[_0x83f4('0xb')](function(_0x3a0ec6){logger[_0x83f4('0xc')]('UpdateOpenchannelQueueReport',_0x46a068);logger[_0x83f4('0xf')](_0x83f4('0x1b'),_0x46a068,JSON[_0x83f4('0x1a')](_0x3a0ec6));_0x55ff8d(_0x3a0ec6);})[_0x83f4('0x15')](function(_0x407e30){logger[_0x83f4('0x11')]('UpdateOpenchannelQueueReport',_0x407e30[_0x83f4('0x13')],_0x46a068);_0x28fcf0(_0x5e0969['error'](0x1f4,_0x407e30[_0x83f4('0x13')]));});});};