Built motion from commit (unavailable).|2.5.4
[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 _0x8aae=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x8aae,0xd7));var _0xe8aa=function(_0x16e68d,_0x1427b7){_0x16e68d=_0x16e68d-0x0;var _0xdedb97=_0x8aae[_0x16e68d];return _0xdedb97;};'use strict';var _=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var moment=require('moment');var BPromise=require(_0xe8aa('0x2'));var rs=require(_0xe8aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8aa('0x4'))['db'];var utils=require(_0xe8aa('0x5'));var logger=require(_0xe8aa('0x6'))(_0xe8aa('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8aa('0x8'));var client=jayson['client'][_0xe8aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2efc9d,_0x42a86f,_0x4662c3){return new BPromise(function(_0x5b235d,_0x45c35e){return client[_0xe8aa('0xa')](_0x2efc9d,_0x4662c3)[_0xe8aa('0xb')](function(_0x56e759){logger['info'](_0xe8aa('0xc'),_0x42a86f,'request\x20sent');logger[_0xe8aa('0xd')](_0xe8aa('0xe'),_0x42a86f,_0xe8aa('0xf'),JSON[_0xe8aa('0x10')](_0x56e759));if(_0x56e759['error']){if(_0x56e759[_0xe8aa('0x11')][_0xe8aa('0x12')]===0x1f4){logger[_0xe8aa('0x11')](_0xe8aa('0xc'),_0x42a86f,_0x56e759['error'][_0xe8aa('0x13')]);return _0x45c35e(_0x56e759['error'][_0xe8aa('0x13')]);}logger[_0xe8aa('0x11')](_0xe8aa('0xc'),_0x42a86f,_0x56e759[_0xe8aa('0x11')][_0xe8aa('0x13')]);return _0x5b235d(_0x56e759[_0xe8aa('0x11')][_0xe8aa('0x13')]);}else{logger[_0xe8aa('0x14')](_0xe8aa('0xc'),_0x42a86f,'request\x20sent');_0x5b235d(_0x56e759[_0xe8aa('0x15')]['message']);}})[_0xe8aa('0x16')](function(_0x45ce35){logger[_0xe8aa('0x11')](_0xe8aa('0xc'),_0x42a86f,_0x45ce35);_0x45c35e(_0x45ce35);});});}