Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.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 _0x6773=['error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56edd1,_0x170be8){var _0x8926fc=function(_0x5aeefa){while(--_0x5aeefa){_0x56edd1['push'](_0x56edd1['shift']());}};_0x8926fc(++_0x170be8);}(_0x6773,0x137));var _0x3677=function(_0x44e843,_0x18e958){_0x44e843=_0x44e843-0x0;var _0x4f0a2d=_0x6773[_0x44e843];return _0x4f0a2d;};'use strict';var _=require(_0x3677('0x0'));var util=require(_0x3677('0x1'));var moment=require(_0x3677('0x2'));var BPromise=require(_0x3677('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3677('0x4'));var db=require(_0x3677('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3677('0x6'))(_0x3677('0x7'));var config=require(_0x3677('0x8'));var jayson=require(_0x3677('0x9'));var client=jayson['client'][_0x3677('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x70f596,_0x4b9937,_0x10ea5e){return new BPromise(function(_0x278d44,_0x75341d){return client[_0x3677('0xb')](_0x70f596,_0x10ea5e)[_0x3677('0xc')](function(_0x59119c){logger[_0x3677('0xd')](_0x3677('0xe'),_0x4b9937,_0x3677('0xf'));logger[_0x3677('0x10')](_0x3677('0x11'),_0x4b9937,_0x3677('0xf'),JSON[_0x3677('0x12')](_0x59119c));if(_0x59119c[_0x3677('0x13')]){if(_0x59119c[_0x3677('0x13')]['code']===0x1f4){logger[_0x3677('0x13')](_0x3677('0xe'),_0x4b9937,_0x59119c[_0x3677('0x13')][_0x3677('0x14')]);return _0x75341d(_0x59119c[_0x3677('0x13')][_0x3677('0x14')]);}logger[_0x3677('0x13')](_0x3677('0xe'),_0x4b9937,_0x59119c['error'][_0x3677('0x14')]);return _0x278d44(_0x59119c[_0x3677('0x13')][_0x3677('0x14')]);}else{logger[_0x3677('0xd')](_0x3677('0xe'),_0x4b9937,_0x3677('0xf'));_0x278d44(_0x59119c[_0x3677('0x15')][_0x3677('0x14')]);}})['catch'](function(_0x1d7400){logger[_0x3677('0x13')](_0x3677('0xe'),_0x4b9937,_0x1d7400);_0x75341d(_0x1d7400);});});}