Built motion from commit (unavailable).|2.5.22
[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 _0x2bd9=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x19a741,_0x237fb5){var _0x465d18=function(_0x2ee5e7){while(--_0x2ee5e7){_0x19a741['push'](_0x19a741['shift']());}};_0x465d18(++_0x237fb5);}(_0x2bd9,0x90));var _0x92bd=function(_0x2981bb,_0xbaee9a){_0x2981bb=_0x2981bb-0x0;var _0x1f8292=_0x2bd9[_0x2981bb];return _0x1f8292;};'use strict';var _=require(_0x92bd('0x0'));var util=require(_0x92bd('0x1'));var moment=require(_0x92bd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92bd('0x3'));var db=require(_0x92bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x92bd('0x5'))(_0x92bd('0x6'));var config=require(_0x92bd('0x7'));var jayson=require(_0x92bd('0x8'));var client=jayson[_0x92bd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b3359,_0x4feb99,_0x2c1672){return new BPromise(function(_0x32b265,_0x70294f){return client[_0x92bd('0xa')](_0x4b3359,_0x2c1672)[_0x92bd('0xb')](function(_0x2397e1){logger[_0x92bd('0xc')](_0x92bd('0xd'),_0x4feb99,_0x92bd('0xe'));logger[_0x92bd('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4feb99,'request\x20sent',JSON[_0x92bd('0x10')](_0x2397e1));if(_0x2397e1[_0x92bd('0x11')]){if(_0x2397e1[_0x92bd('0x11')][_0x92bd('0x12')]===0x1f4){logger['error'](_0x92bd('0xd'),_0x4feb99,_0x2397e1['error'][_0x92bd('0x13')]);return _0x70294f(_0x2397e1[_0x92bd('0x11')][_0x92bd('0x13')]);}logger[_0x92bd('0x11')](_0x92bd('0xd'),_0x4feb99,_0x2397e1['error']['message']);return _0x32b265(_0x2397e1[_0x92bd('0x11')][_0x92bd('0x13')]);}else{logger[_0x92bd('0xc')](_0x92bd('0xd'),_0x4feb99,_0x92bd('0xe'));_0x32b265(_0x2397e1[_0x92bd('0x14')][_0x92bd('0x13')]);}})[_0x92bd('0x15')](function(_0x177c02){logger[_0x92bd('0x11')](_0x92bd('0xd'),_0x4feb99,_0x177c02);_0x70294f(_0x177c02);});});}