Built motion from commit (unavailable).|2.5.10
[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 _0x48fa=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x480014,_0x329449){var _0x3b276b=function(_0x3accd0){while(--_0x3accd0){_0x480014['push'](_0x480014['shift']());}};_0x3b276b(++_0x329449);}(_0x48fa,0xf3));var _0xa48f=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x48fa[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xa48f('0x0'));var util=require(_0xa48f('0x1'));var moment=require(_0xa48f('0x2'));var BPromise=require(_0xa48f('0x3'));var rs=require(_0xa48f('0x4'));var fs=require('fs');var Redis=require(_0xa48f('0x5'));var db=require(_0xa48f('0x6'))['db'];var utils=require(_0xa48f('0x7'));var logger=require('../../config/logger')(_0xa48f('0x8'));var config=require(_0xa48f('0x9'));var jayson=require(_0xa48f('0xa'));var client=jayson[_0xa48f('0xb')][_0xa48f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b4148,_0x4a5e0e,_0x4e1440){return new BPromise(function(_0x448791,_0xc158e8){return client[_0xa48f('0xd')](_0x3b4148,_0x4e1440)[_0xa48f('0xe')](function(_0x2ae780){logger['info'](_0xa48f('0xf'),_0x4a5e0e,_0xa48f('0x10'));logger[_0xa48f('0x11')](_0xa48f('0x12'),_0x4a5e0e,_0xa48f('0x10'),JSON[_0xa48f('0x13')](_0x2ae780));if(_0x2ae780['error']){if(_0x2ae780[_0xa48f('0x14')][_0xa48f('0x15')]===0x1f4){logger[_0xa48f('0x14')](_0xa48f('0xf'),_0x4a5e0e,_0x2ae780[_0xa48f('0x14')][_0xa48f('0x16')]);return _0xc158e8(_0x2ae780[_0xa48f('0x14')][_0xa48f('0x16')]);}logger['error'](_0xa48f('0xf'),_0x4a5e0e,_0x2ae780[_0xa48f('0x14')][_0xa48f('0x16')]);return _0x448791(_0x2ae780[_0xa48f('0x14')][_0xa48f('0x16')]);}else{logger[_0xa48f('0x17')](_0xa48f('0xf'),_0x4a5e0e,_0xa48f('0x10'));_0x448791(_0x2ae780[_0xa48f('0x18')][_0xa48f('0x16')]);}})[_0xa48f('0x19')](function(_0x40c733){logger[_0xa48f('0x14')](_0xa48f('0xf'),_0x4a5e0e,_0x40c733);_0xc158e8(_0x40c733);});});}exports[_0xa48f('0x1a')]=function(_0x596b45){var _0x19d9ad=this;return new Promise(function(_0x209491,_0x198b85){return db[_0xa48f('0x1b')][_0xa48f('0x1c')](_0x596b45['body'],{'raw':_0x596b45[_0xa48f('0x1d')]?_0x596b45['options'][_0xa48f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x43e3f8){logger[_0xa48f('0x17')]('CreateSquareDetailsReport',_0x596b45);logger['debug']('CreateSquareDetailsReport',_0x596b45,JSON[_0xa48f('0x13')](_0x43e3f8));_0x209491(_0x43e3f8);})[_0xa48f('0x19')](function(_0x29d360){logger[_0xa48f('0x14')](_0xa48f('0x1a'),_0x29d360[_0xa48f('0x16')],_0x596b45);_0x198b85(_0x19d9ad[_0xa48f('0x14')](0x1f4,_0x29d360[_0xa48f('0x16')]));});});};