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 _0x1455=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','then','UpdateFaxQueueReport','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x1455,0x17d));var _0x5145=function(_0x54ca89,_0xa23eb){_0x54ca89=_0x54ca89-0x0;var _0x129799=_0x1455[_0x54ca89];return _0x129799;};'use strict';var _=require(_0x5145('0x0'));var util=require('util');var moment=require(_0x5145('0x1'));var BPromise=require(_0x5145('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5145('0x3'));var db=require(_0x5145('0x4'))['db'];var utils=require(_0x5145('0x5'));var logger=require(_0x5145('0x6'))(_0x5145('0x7'));var config=require(_0x5145('0x8'));var jayson=require(_0x5145('0x9'));var client=jayson[_0x5145('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x563a42,_0x1c28d2,_0x38cd70){return new BPromise(function(_0x5be7ac,_0x1e5811){return client[_0x5145('0xb')](_0x563a42,_0x38cd70)['then'](function(_0x8f607c){logger[_0x5145('0xc')](_0x5145('0xd'),_0x1c28d2,_0x5145('0xe'));logger[_0x5145('0xf')](_0x5145('0x10'),_0x1c28d2,'request\x20sent',JSON[_0x5145('0x11')](_0x8f607c));if(_0x8f607c['error']){if(_0x8f607c[_0x5145('0x12')][_0x5145('0x13')]===0x1f4){logger[_0x5145('0x12')](_0x5145('0xd'),_0x1c28d2,_0x8f607c['error'][_0x5145('0x14')]);return _0x1e5811(_0x8f607c[_0x5145('0x12')][_0x5145('0x14')]);}logger['error'](_0x5145('0xd'),_0x1c28d2,_0x8f607c[_0x5145('0x12')]['message']);return _0x5be7ac(_0x8f607c['error'][_0x5145('0x14')]);}else{logger[_0x5145('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x1c28d2,_0x5145('0xe'));_0x5be7ac(_0x8f607c[_0x5145('0x15')][_0x5145('0x14')]);}})[_0x5145('0x16')](function(_0x13cb0a){logger[_0x5145('0x12')](_0x5145('0xd'),_0x1c28d2,_0x13cb0a);_0x1e5811(_0x13cb0a);});});}exports[_0x5145('0x17')]=function(_0x208bc1){var _0x2fdbb2=this;return new Promise(function(_0x29db5a,_0x1aa92b){return db[_0x5145('0x18')]['create'](_0x208bc1[_0x5145('0x19')],{'raw':_0x208bc1[_0x5145('0x1a')]?_0x208bc1['options'][_0x5145('0x1b')]===undefined?!![]:![]:!![]})[_0x5145('0x1c')](function(_0xd2b107){logger[_0x5145('0xc')]('CreateFaxQueueReport',_0x208bc1);logger['debug']('CreateFaxQueueReport',_0x208bc1,JSON[_0x5145('0x11')](_0xd2b107));_0x29db5a(_0xd2b107);})[_0x5145('0x16')](function(_0x9fc7b8){logger[_0x5145('0x12')](_0x5145('0x17'),_0x9fc7b8[_0x5145('0x14')],_0x208bc1);_0x1aa92b(_0x2fdbb2[_0x5145('0x12')](0x1f4,_0x9fc7b8[_0x5145('0x14')]));});});};exports[_0x5145('0x1d')]=function(_0x419b01){var _0x41a697=this;return new Promise(function(_0x2809ad,_0x38e0f6){return db[_0x5145('0x18')]['update'](_0x419b01[_0x5145('0x19')],{'raw':_0x419b01[_0x5145('0x1a')]?_0x419b01[_0x5145('0x1a')][_0x5145('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419b01[_0x5145('0x1a')]?_0x419b01[_0x5145('0x1a')][_0x5145('0x1e')]||null:null,'attributes':_0x419b01[_0x5145('0x1a')]?_0x419b01[_0x5145('0x1a')][_0x5145('0x1f')]||null:null,'limit':_0x419b01[_0x5145('0x1a')]?_0x419b01[_0x5145('0x1a')][_0x5145('0x20')]||null:null})['then'](function(_0xf272c1){logger[_0x5145('0xc')](_0x5145('0x1d'),_0x419b01);logger[_0x5145('0xf')](_0x5145('0x1d'),_0x419b01,JSON[_0x5145('0x11')](_0xf272c1));_0x2809ad(_0xf272c1);})[_0x5145('0x16')](function(_0x430489){logger[_0x5145('0x12')](_0x5145('0x1d'),_0x430489['message'],_0x419b01);_0x38e0f6(_0x41a697[_0x5145('0x12')](0x1f4,_0x430489[_0x5145('0x14')]));});});};