Built motion from commit (unavailable).|2.5.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 _0xa94c=['FaxQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','then','stringify','UpdateFaxQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1c9f35,_0x3ee402){var _0xd1dd8d=function(_0x29786c){while(--_0x29786c){_0x1c9f35['push'](_0x1c9f35['shift']());}};_0xd1dd8d(++_0x3ee402);}(_0xa94c,0x72));var _0xca94=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa94c[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xca94('0x0'));var moment=require(_0xca94('0x1'));var BPromise=require(_0xca94('0x2'));var rs=require(_0xca94('0x3'));var fs=require('fs');var Redis=require(_0xca94('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca94('0x5'))(_0xca94('0x6'));var config=require('../../config/environment');var jayson=require(_0xca94('0x7'));var client=jayson[_0xca94('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9db6,_0x35dbed,_0x422ad2){return new BPromise(function(_0x4df202,_0x19d79b){return client['request'](_0x1b9db6,_0x422ad2)['then'](function(_0x6c470f){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x35dbed,_0xca94('0x9'));logger[_0xca94('0xa')](_0xca94('0xb'),_0x35dbed,_0xca94('0x9'),JSON['stringify'](_0x6c470f));if(_0x6c470f['error']){if(_0x6c470f[_0xca94('0xc')][_0xca94('0xd')]===0x1f4){logger[_0xca94('0xc')](_0xca94('0xe'),_0x35dbed,_0x6c470f[_0xca94('0xc')][_0xca94('0xf')]);return _0x19d79b(_0x6c470f[_0xca94('0xc')][_0xca94('0xf')]);}logger['error'](_0xca94('0xe'),_0x35dbed,_0x6c470f[_0xca94('0xc')][_0xca94('0xf')]);return _0x4df202(_0x6c470f[_0xca94('0xc')]['message']);}else{logger[_0xca94('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x35dbed,'request\x20sent');_0x4df202(_0x6c470f[_0xca94('0x11')]['message']);}})[_0xca94('0x12')](function(_0xb7a07f){logger['error'](_0xca94('0xe'),_0x35dbed,_0xb7a07f);_0x19d79b(_0xb7a07f);});});}exports[_0xca94('0x13')]=function(_0x49d229){var _0x1a277d=this;return new Promise(function(_0x4f245c,_0x1baa24){return db[_0xca94('0x14')][_0xca94('0x15')](_0x49d229[_0xca94('0x16')],{'raw':_0x49d229[_0xca94('0x17')]?_0x49d229['options']['raw']===undefined?!![]:![]:!![]})[_0xca94('0x18')](function(_0x252b9d){logger[_0xca94('0x10')]('CreateFaxQueueReport',_0x49d229);logger['debug'](_0xca94('0x13'),_0x49d229,JSON[_0xca94('0x19')](_0x252b9d));_0x4f245c(_0x252b9d);})[_0xca94('0x12')](function(_0x1f4989){logger[_0xca94('0xc')](_0xca94('0x13'),_0x1f4989['message'],_0x49d229);_0x1baa24(_0x1a277d['error'](0x1f4,_0x1f4989[_0xca94('0xf')]));});});};exports[_0xca94('0x1a')]=function(_0x1e6a5f){var _0x51efcf=this;return new Promise(function(_0x145a80,_0x121d93){return db[_0xca94('0x14')][_0xca94('0x1b')](_0x1e6a5f[_0xca94('0x16')],{'raw':_0x1e6a5f[_0xca94('0x17')]?_0x1e6a5f[_0xca94('0x17')][_0xca94('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e6a5f[_0xca94('0x17')]?_0x1e6a5f[_0xca94('0x17')][_0xca94('0x1d')]||null:null,'attributes':_0x1e6a5f[_0xca94('0x17')]?_0x1e6a5f['options'][_0xca94('0x1e')]||null:null,'limit':_0x1e6a5f[_0xca94('0x17')]?_0x1e6a5f[_0xca94('0x17')][_0xca94('0x1f')]||null:null})[_0xca94('0x18')](function(_0x35da51){logger[_0xca94('0x10')]('UpdateFaxQueueReport',_0x1e6a5f);logger[_0xca94('0xa')](_0xca94('0x1a'),_0x1e6a5f,JSON[_0xca94('0x19')](_0x35da51));_0x145a80(_0x35da51);})[_0xca94('0x12')](function(_0x12c914){logger[_0xca94('0xc')](_0xca94('0x1a'),_0x12c914[_0xca94('0xf')],_0x1e6a5f);_0x121d93(_0x51efcf[_0xca94('0xc')](0x1f4,_0x12c914['message']));});});};