Built motion from commit (unavailable).|2.4.17
[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 _0xa19e=['client','http','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa19e,0x99));var _0xea19=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xa19e[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0xea19('0x0'));var util=require(_0xea19('0x1'));var moment=require(_0xea19('0x2'));var BPromise=require(_0xea19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea19('0x4'));var db=require(_0xea19('0x5'))['db'];var utils=require(_0xea19('0x6'));var logger=require('../../config/logger')(_0xea19('0x7'));var config=require(_0xea19('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xea19('0x9')][_0xea19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5735ab,_0x30c702,_0xb31d3a){return new BPromise(function(_0x4abbea,_0x5abaad){return client['request'](_0x5735ab,_0xb31d3a)[_0xea19('0xb')](function(_0x10e780){logger['info'](_0xea19('0xc'),_0x30c702,'request\x20sent');logger[_0xea19('0xd')](_0xea19('0xe'),_0x30c702,_0xea19('0xf'),JSON['stringify'](_0x10e780));if(_0x10e780[_0xea19('0x10')]){if(_0x10e780[_0xea19('0x10')]['code']===0x1f4){logger[_0xea19('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x30c702,_0x10e780[_0xea19('0x10')][_0xea19('0x11')]);return _0x5abaad(_0x10e780[_0xea19('0x10')]['message']);}logger[_0xea19('0x10')](_0xea19('0xc'),_0x30c702,_0x10e780[_0xea19('0x10')][_0xea19('0x11')]);return _0x4abbea(_0x10e780[_0xea19('0x10')][_0xea19('0x11')]);}else{logger[_0xea19('0x12')](_0xea19('0xc'),_0x30c702,_0xea19('0xf'));_0x4abbea(_0x10e780[_0xea19('0x13')][_0xea19('0x11')]);}})[_0xea19('0x14')](function(_0xd08874){logger[_0xea19('0x10')](_0xea19('0xc'),_0x30c702,_0xd08874);_0x5abaad(_0xd08874);});});}exports[_0xea19('0x15')]=function(_0x499656){var _0x31efbd=this;return new Promise(function(_0x32c051,_0x145067){return db[_0xea19('0x16')][_0xea19('0x17')](_0x499656[_0xea19('0x18')],{'raw':_0x499656[_0xea19('0x19')]?_0x499656[_0xea19('0x19')][_0xea19('0x1a')]===undefined?!![]:![]:!![]})[_0xea19('0xb')](function(_0x3dd8dc){logger[_0xea19('0x12')](_0xea19('0x15'),_0x499656);logger[_0xea19('0xd')](_0xea19('0x15'),_0x499656,JSON['stringify'](_0x3dd8dc));_0x32c051(_0x3dd8dc);})[_0xea19('0x14')](function(_0x13b6c0){logger[_0xea19('0x10')](_0xea19('0x15'),_0x13b6c0[_0xea19('0x11')],_0x499656);_0x145067(_0x31efbd[_0xea19('0x10')](0x1f4,_0x13b6c0[_0xea19('0x11')]));});});};