Built motion from commit (unavailable).|2.5.29
[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 _0x99fa=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport'];(function(_0x33c797,_0x430c30){var _0x514ff7=function(_0x17920c){while(--_0x17920c){_0x33c797['push'](_0x33c797['shift']());}};_0x514ff7(++_0x430c30);}(_0x99fa,0x123));var _0xa99f=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x99fa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xa99f('0x0'));var util=require('util');var moment=require(_0xa99f('0x1'));var BPromise=require(_0xa99f('0x2'));var rs=require(_0xa99f('0x3'));var fs=require('fs');var Redis=require(_0xa99f('0x4'));var db=require(_0xa99f('0x5'))['db'];var utils=require(_0xa99f('0x6'));var logger=require(_0xa99f('0x7'))(_0xa99f('0x8'));var config=require(_0xa99f('0x9'));var jayson=require(_0xa99f('0xa'));var client=jayson['client'][_0xa99f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5297b5,_0x3610c7,_0x79b845){return new BPromise(function(_0x3e2738,_0x3a7dce){return client['request'](_0x5297b5,_0x79b845)[_0xa99f('0xc')](function(_0x80002a){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x3610c7,_0xa99f('0xd'));logger[_0xa99f('0xe')](_0xa99f('0xf'),_0x3610c7,_0xa99f('0xd'),JSON[_0xa99f('0x10')](_0x80002a));if(_0x80002a[_0xa99f('0x11')]){if(_0x80002a[_0xa99f('0x11')][_0xa99f('0x12')]===0x1f4){logger['error'](_0xa99f('0x13'),_0x3610c7,_0x80002a[_0xa99f('0x11')][_0xa99f('0x14')]);return _0x3a7dce(_0x80002a[_0xa99f('0x11')][_0xa99f('0x14')]);}logger['error'](_0xa99f('0x13'),_0x3610c7,_0x80002a[_0xa99f('0x11')][_0xa99f('0x14')]);return _0x3e2738(_0x80002a[_0xa99f('0x11')][_0xa99f('0x14')]);}else{logger[_0xa99f('0x15')](_0xa99f('0x13'),_0x3610c7,_0xa99f('0xd'));_0x3e2738(_0x80002a['result'][_0xa99f('0x14')]);}})['catch'](function(_0x5db566){logger[_0xa99f('0x11')](_0xa99f('0x13'),_0x3610c7,_0x5db566);_0x3a7dce(_0x5db566);});});}exports['CreateSquareDetailsReport']=function(_0x757295){var _0x17cb7e=this;return new Promise(function(_0x1bac43,_0x134f22){return db[_0xa99f('0x16')][_0xa99f('0x17')](_0x757295[_0xa99f('0x18')],{'raw':_0x757295[_0xa99f('0x19')]?_0x757295[_0xa99f('0x19')][_0xa99f('0x1a')]===undefined?!![]:![]:!![]})[_0xa99f('0xc')](function(_0x2b9bb3){logger['info'](_0xa99f('0x1b'),_0x757295);logger[_0xa99f('0xe')](_0xa99f('0x1b'),_0x757295,JSON[_0xa99f('0x10')](_0x2b9bb3));_0x1bac43(_0x2b9bb3);})[_0xa99f('0x1c')](function(_0x4f68ff){logger[_0xa99f('0x11')](_0xa99f('0x1b'),_0x4f68ff[_0xa99f('0x14')],_0x757295);_0x134f22(_0x17cb7e[_0xa99f('0x11')](0x1f4,_0x4f68ff['message']));});});};