b2a6fc558ab4802b7b3615246451acd1b5a13c29
[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 _0xac35=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x45dd9b,_0x35fa24){var _0x410941=function(_0x5ebe2a){while(--_0x5ebe2a){_0x45dd9b['push'](_0x45dd9b['shift']());}};_0x410941(++_0x35fa24);}(_0xac35,0x141));var _0x5ac3=function(_0x22b64d,_0x35413c){_0x22b64d=_0x22b64d-0x0;var _0x80f48=_0xac35[_0x22b64d];return _0x80f48;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a16,_0x77dc9f,_0x5e96cb){return new BPromise(function(_0x2a19b9,_0x1754d2){return client[_0x5ac3('0xe')](_0x4c9a16,_0x5e96cb)[_0x5ac3('0xf')](function(_0x378900){logger[_0x5ac3('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x77dc9f,_0x5ac3('0x11'));logger['debug'](_0x5ac3('0x12'),_0x77dc9f,_0x5ac3('0x11'),JSON[_0x5ac3('0x13')](_0x378900));if(_0x378900[_0x5ac3('0x14')]){if(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x15')]===0x1f4){logger[_0x5ac3('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x1754d2(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);}logger[_0x5ac3('0x14')](_0x5ac3('0x17'),_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x2a19b9(_0x378900['error']['message']);}else{logger[_0x5ac3('0x10')](_0x5ac3('0x17'),_0x77dc9f,'request\x20sent');_0x2a19b9(_0x378900[_0x5ac3('0x18')]['message']);}})[_0x5ac3('0x19')](function(_0x18cad4){logger[_0x5ac3('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x77dc9f,_0x18cad4);_0x1754d2(_0x18cad4);});});}exports[_0x5ac3('0x1a')]=function(_0x1c2566){var _0x200eca=this;return new Promise(function(_0x141128,_0x5aab00){return db[_0x5ac3('0x1b')][_0x5ac3('0x1c')](_0x1c2566[_0x5ac3('0x1d')],{'raw':_0x1c2566[_0x5ac3('0x1e')]?_0x1c2566[_0x5ac3('0x1e')][_0x5ac3('0x1f')]===undefined?!![]:![]:!![]})[_0x5ac3('0xf')](function(_0x2fcc26){logger[_0x5ac3('0x10')](_0x5ac3('0x1a'),_0x1c2566);logger[_0x5ac3('0x20')](_0x5ac3('0x1a'),_0x1c2566,JSON['stringify'](_0x2fcc26));_0x141128(_0x2fcc26);})[_0x5ac3('0x19')](function(_0x3cbb52){logger[_0x5ac3('0x14')](_0x5ac3('0x1a'),_0x3cbb52['message'],_0x1c2566);_0x5aab00(_0x200eca[_0x5ac3('0x14')](0x1f4,_0x3cbb52[_0x5ac3('0x16')]));});});};