Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / faxQueueReport / faxQueueReport.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 _0x85cf=['request','info','debug','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','then','update','body','where','attributes','UpdateFaxQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x22e86a,_0x282717){var _0xf37984=function(_0x275de9){while(--_0x275de9){_0x22e86a['push'](_0x22e86a['shift']());}};_0xf37984(++_0x282717);}(_0x85cf,0x76));var _0xf85c=function(_0x465e84,_0x2ad6f8){_0x465e84=_0x465e84-0x0;var _0x29c6df=_0x85cf[_0x465e84];return _0x29c6df;};'use strict';var _=require('lodash');var util=require(_0xf85c('0x0'));var moment=require(_0xf85c('0x1'));var BPromise=require(_0xf85c('0x2'));var rs=require(_0xf85c('0x3'));var fs=require('fs');var Redis=require(_0xf85c('0x4'));var db=require(_0xf85c('0x5'))['db'];var utils=require(_0xf85c('0x6'));var logger=require(_0xf85c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf85c('0x8'));var client=jayson[_0xf85c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x386a60,_0x41d08d,_0xe1be83){return new BPromise(function(_0x1bebcf,_0x1857d9){return client[_0xf85c('0xa')](_0x386a60,_0xe1be83)['then'](function(_0x25aa6e){logger[_0xf85c('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x41d08d,'request\x20sent');logger[_0xf85c('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x41d08d,_0xf85c('0xd'),JSON[_0xf85c('0xe')](_0x25aa6e));if(_0x25aa6e[_0xf85c('0xf')]){if(_0x25aa6e['error'][_0xf85c('0x10')]===0x1f4){logger[_0xf85c('0xf')](_0xf85c('0x11'),_0x41d08d,_0x25aa6e[_0xf85c('0xf')]['message']);return _0x1857d9(_0x25aa6e[_0xf85c('0xf')][_0xf85c('0x12')]);}logger[_0xf85c('0xf')](_0xf85c('0x11'),_0x41d08d,_0x25aa6e['error'][_0xf85c('0x12')]);return _0x1bebcf(_0x25aa6e['error'][_0xf85c('0x12')]);}else{logger['info'](_0xf85c('0x11'),_0x41d08d,'request\x20sent');_0x1bebcf(_0x25aa6e[_0xf85c('0x13')]['message']);}})[_0xf85c('0x14')](function(_0x30b768){logger[_0xf85c('0xf')](_0xf85c('0x11'),_0x41d08d,_0x30b768);_0x1857d9(_0x30b768);});});}exports[_0xf85c('0x15')]=function(_0x5260c5){var _0x495854=this;return new Promise(function(_0x389693,_0x5a4a80){return db[_0xf85c('0x16')][_0xf85c('0x17')](_0x5260c5['body'],{'raw':_0x5260c5[_0xf85c('0x18')]?_0x5260c5[_0xf85c('0x18')][_0xf85c('0x19')]===undefined?!![]:![]:!![]})[_0xf85c('0x1a')](function(_0x41ff9e){logger['info'](_0xf85c('0x15'),_0x5260c5);logger['debug'](_0xf85c('0x15'),_0x5260c5,JSON[_0xf85c('0xe')](_0x41ff9e));_0x389693(_0x41ff9e);})['catch'](function(_0x5e7c08){logger[_0xf85c('0xf')](_0xf85c('0x15'),_0x5e7c08[_0xf85c('0x12')],_0x5260c5);_0x5a4a80(_0x495854[_0xf85c('0xf')](0x1f4,_0x5e7c08[_0xf85c('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x903fe6){var _0xae5462=this;return new Promise(function(_0x550cf3,_0x5c819f){return db[_0xf85c('0x16')][_0xf85c('0x1b')](_0x903fe6[_0xf85c('0x1c')],{'raw':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')][_0xf85c('0x1d')]||null:null,'attributes':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')][_0xf85c('0x1e')]||null:null,'limit':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')]['limit']||null:null})[_0xf85c('0x1a')](function(_0x5d36e8){logger[_0xf85c('0xb')](_0xf85c('0x1f'),_0x903fe6);logger[_0xf85c('0xc')]('UpdateFaxQueueReport',_0x903fe6,JSON[_0xf85c('0xe')](_0x5d36e8));_0x550cf3(_0x5d36e8);})[_0xf85c('0x14')](function(_0x4cd913){logger[_0xf85c('0xf')](_0xf85c('0x1f'),_0x4cd913[_0xf85c('0x12')],_0x903fe6);_0x5c819f(_0xae5462[_0xf85c('0xf')](0x1f4,_0x4cd913[_0xf85c('0x12')]));});});};