Built motion from commit (unavailable).|2.5.11
[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 _0xcc0c=['update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','then','UpdateFaxQueueReport'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xcc0c,0x1f3));var _0xccc0=function(_0x303986,_0x5c751c){_0x303986=_0x303986-0x0;var _0x4c4431=_0xcc0c[_0x303986];return _0x4c4431;};'use strict';var _=require(_0xccc0('0x0'));var util=require(_0xccc0('0x1'));var moment=require(_0xccc0('0x2'));var BPromise=require(_0xccc0('0x3'));var rs=require(_0xccc0('0x4'));var fs=require('fs');var Redis=require(_0xccc0('0x5'));var db=require(_0xccc0('0x6'))['db'];var utils=require(_0xccc0('0x7'));var logger=require(_0xccc0('0x8'))(_0xccc0('0x9'));var config=require(_0xccc0('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xccc0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e295c,_0x1d4d41,_0x2cb89a){return new BPromise(function(_0x44e06b,_0x1188c5){return client['request'](_0x1e295c,_0x2cb89a)['then'](function(_0x23f43b){logger[_0xccc0('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x1d4d41,'request\x20sent');logger[_0xccc0('0xd')](_0xccc0('0xe'),_0x1d4d41,_0xccc0('0xf'),JSON[_0xccc0('0x10')](_0x23f43b));if(_0x23f43b['error']){if(_0x23f43b[_0xccc0('0x11')][_0xccc0('0x12')]===0x1f4){logger[_0xccc0('0x11')](_0xccc0('0x13'),_0x1d4d41,_0x23f43b[_0xccc0('0x11')][_0xccc0('0x14')]);return _0x1188c5(_0x23f43b[_0xccc0('0x11')][_0xccc0('0x14')]);}logger[_0xccc0('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1d4d41,_0x23f43b[_0xccc0('0x11')][_0xccc0('0x14')]);return _0x44e06b(_0x23f43b[_0xccc0('0x11')][_0xccc0('0x14')]);}else{logger[_0xccc0('0xc')](_0xccc0('0x13'),_0x1d4d41,_0xccc0('0xf'));_0x44e06b(_0x23f43b['result'][_0xccc0('0x14')]);}})[_0xccc0('0x15')](function(_0x47ecbc){logger['error'](_0xccc0('0x13'),_0x1d4d41,_0x47ecbc);_0x1188c5(_0x47ecbc);});});}exports[_0xccc0('0x16')]=function(_0x1086b1){var _0x494843=this;return new Promise(function(_0x26a406,_0x3e1811){return db[_0xccc0('0x17')][_0xccc0('0x18')](_0x1086b1[_0xccc0('0x19')],{'raw':_0x1086b1[_0xccc0('0x1a')]?_0x1086b1[_0xccc0('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xccc0('0x1b')](function(_0x5ea2fe){logger['info'](_0xccc0('0x16'),_0x1086b1);logger['debug'](_0xccc0('0x16'),_0x1086b1,JSON[_0xccc0('0x10')](_0x5ea2fe));_0x26a406(_0x5ea2fe);})['catch'](function(_0x26bf29){logger['error'](_0xccc0('0x16'),_0x26bf29[_0xccc0('0x14')],_0x1086b1);_0x3e1811(_0x494843[_0xccc0('0x11')](0x1f4,_0x26bf29[_0xccc0('0x14')]));});});};exports[_0xccc0('0x1c')]=function(_0xcabeb){var _0xff954e=this;return new Promise(function(_0x3e46e7,_0x7b8a23){return db[_0xccc0('0x17')][_0xccc0('0x1d')](_0xcabeb[_0xccc0('0x19')],{'raw':_0xcabeb[_0xccc0('0x1a')]?_0xcabeb['options'][_0xccc0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcabeb[_0xccc0('0x1a')]?_0xcabeb[_0xccc0('0x1a')][_0xccc0('0x1f')]||null:null,'attributes':_0xcabeb[_0xccc0('0x1a')]?_0xcabeb[_0xccc0('0x1a')][_0xccc0('0x20')]||null:null,'limit':_0xcabeb['options']?_0xcabeb[_0xccc0('0x1a')]['limit']||null:null})[_0xccc0('0x1b')](function(_0x474dea){logger[_0xccc0('0xc')](_0xccc0('0x1c'),_0xcabeb);logger[_0xccc0('0xd')](_0xccc0('0x1c'),_0xcabeb,JSON[_0xccc0('0x10')](_0x474dea));_0x3e46e7(_0x474dea);})[_0xccc0('0x15')](function(_0x1747b4){logger['error']('UpdateFaxQueueReport',_0x1747b4[_0xccc0('0x14')],_0xcabeb);_0x7b8a23(_0xff954e[_0xccc0('0x11')](0x1f4,_0x1747b4[_0xccc0('0x14')]));});});};