Built motion from commit (unavailable).|2.4.4
[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 _0x95f4=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0xc5775d,_0x3701ab){var _0x3b4edd=function(_0x37c3cb){while(--_0x37c3cb){_0xc5775d['push'](_0xc5775d['shift']());}};_0x3b4edd(++_0x3701ab);}(_0x95f4,0xf1));var _0x495f=function(_0x222508,_0x2b9eb5){_0x222508=_0x222508-0x0;var _0x4681d9=_0x95f4[_0x222508];return _0x4681d9;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var moment=require(_0x495f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x495f('0x3'));var db=require(_0x495f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x495f('0x5'));var config=require(_0x495f('0x6'));var jayson=require(_0x495f('0x7'));var client=jayson['client'][_0x495f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x435e2a,_0x304274,_0x4c17af){return new BPromise(function(_0x2103a4,_0x4610a7){return client[_0x495f('0x9')](_0x435e2a,_0x4c17af)['then'](function(_0x55dc23){logger[_0x495f('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x304274,_0x495f('0xb'));logger['debug'](_0x495f('0xc'),_0x304274,_0x495f('0xb'),JSON[_0x495f('0xd')](_0x55dc23));if(_0x55dc23[_0x495f('0xe')]){if(_0x55dc23['error'][_0x495f('0xf')]===0x1f4){logger[_0x495f('0xe')](_0x495f('0x10'),_0x304274,_0x55dc23[_0x495f('0xe')][_0x495f('0x11')]);return _0x4610a7(_0x55dc23['error'][_0x495f('0x11')]);}logger[_0x495f('0xe')](_0x495f('0x10'),_0x304274,_0x55dc23[_0x495f('0xe')][_0x495f('0x11')]);return _0x2103a4(_0x55dc23[_0x495f('0xe')][_0x495f('0x11')]);}else{logger['info'](_0x495f('0x10'),_0x304274,_0x495f('0xb'));_0x2103a4(_0x55dc23[_0x495f('0x12')][_0x495f('0x11')]);}})['catch'](function(_0x20f97c){logger[_0x495f('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x304274,_0x20f97c);_0x4610a7(_0x20f97c);});});}exports[_0x495f('0x13')]=function(_0x18eb80){var _0x12b102=this;return new Promise(function(_0x58bcc9,_0x11ff26){return db[_0x495f('0x14')][_0x495f('0x15')](_0x18eb80[_0x495f('0x16')],{'raw':_0x18eb80['options']?_0x18eb80[_0x495f('0x17')][_0x495f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x401fed){logger['info'](_0x495f('0x13'),_0x18eb80);logger[_0x495f('0x19')](_0x495f('0x13'),_0x18eb80,JSON[_0x495f('0xd')](_0x401fed));_0x58bcc9(_0x401fed);})['catch'](function(_0x5d3d92){logger[_0x495f('0xe')]('CreateSquareDetailsReport',_0x5d3d92[_0x495f('0x11')],_0x18eb80);_0x11ff26(_0x12b102[_0x495f('0xe')](0x1f4,_0x5d3d92['message']));});});};