Built motion from commit (unavailable).|2.0.81
[motion2.git] / server / api / squareReportDetail / squareReportDetail.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 _0x7a54=['result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x235cf2,_0x5eed7a){var _0x2f69da=function(_0x14a4b9){while(--_0x14a4b9){_0x235cf2['push'](_0x235cf2['shift']());}};_0x2f69da(++_0x5eed7a);}(_0x7a54,0x106));var _0x47a5=function(_0x5d679a,_0x3f814a){_0x5d679a=_0x5d679a-0x0;var _0x14f61f=_0x7a54[_0x5d679a];return _0x14f61f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var db=require(_0x47a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var jayson=require(_0x47a5('0x8'));var client=jayson[_0x47a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5629,_0x59199c,_0x343372){return new BPromise(function(_0x30e405,_0x506eda){return client[_0x47a5('0xa')](_0x3d5629,_0x343372)['then'](function(_0x5d90b3){logger['info'](_0x47a5('0xb'),_0x59199c,_0x47a5('0xc'));logger['debug'](_0x47a5('0xd'),_0x59199c,'request\x20sent',JSON['stringify'](_0x5d90b3));if(_0x5d90b3[_0x47a5('0xe')]){if(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0xf')]===0x1f4){logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x506eda(_0x5d90b3['error'][_0x47a5('0x10')]);}logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x30e405(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);}else{logger[_0x47a5('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x59199c,_0x47a5('0xc'));_0x30e405(_0x5d90b3[_0x47a5('0x12')][_0x47a5('0x10')]);}})[_0x47a5('0x13')](function(_0x1ef44c){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x59199c,_0x1ef44c);_0x506eda(_0x1ef44c);});});}exports[_0x47a5('0x14')]=function(_0x4b966e){var _0x5247fd=this;return new Promise(function(_0x423a81,_0xaf70a6){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x4b966e[_0x47a5('0x17')],{'raw':_0x4b966e[_0x47a5('0x18')]?_0x4b966e[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})[_0x47a5('0x1a')](function(_0x4a9fcb){logger[_0x47a5('0x11')](_0x47a5('0x14'),_0x4b966e);logger['debug'](_0x47a5('0x14'),_0x4b966e,JSON[_0x47a5('0x1b')](_0x4a9fcb));_0x423a81(_0x4a9fcb);})[_0x47a5('0x13')](function(_0x4c5910){logger[_0x47a5('0xe')](_0x47a5('0x14'),_0x4c5910[_0x47a5('0x10')],_0x4b966e);_0xaf70a6(_0x5247fd[_0x47a5('0xe')](0x1f4,_0x4c5910['message']));});});};