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 _0x2e0b=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x2e0b,0x171));var _0xb2e0=function(_0x57784b,_0x49a858){_0x57784b=_0x57784b-0x0;var _0x4505fa=_0x2e0b[_0x57784b];return _0x4505fa;};'use strict';var _=require(_0xb2e0('0x0'));var util=require(_0xb2e0('0x1'));var moment=require(_0xb2e0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2e0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2e0('0x4'))(_0xb2e0('0x5'));var config=require(_0xb2e0('0x6'));var jayson=require(_0xb2e0('0x7'));var client=jayson[_0xb2e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47951b,_0x4628dc,_0x51d8b6){return new BPromise(function(_0x3088bf,_0x47cf80){return client[_0xb2e0('0x9')](_0x47951b,_0x51d8b6)[_0xb2e0('0xa')](function(_0x1043a6){logger[_0xb2e0('0xb')](_0xb2e0('0xc'),_0x4628dc,_0xb2e0('0xd'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4628dc,_0xb2e0('0xd'),JSON[_0xb2e0('0xe')](_0x1043a6));if(_0x1043a6[_0xb2e0('0xf')]){if(_0x1043a6[_0xb2e0('0xf')]['code']===0x1f4){logger[_0xb2e0('0xf')](_0xb2e0('0xc'),_0x4628dc,_0x1043a6['error'][_0xb2e0('0x10')]);return _0x47cf80(_0x1043a6[_0xb2e0('0xf')][_0xb2e0('0x10')]);}logger[_0xb2e0('0xf')](_0xb2e0('0xc'),_0x4628dc,_0x1043a6['error'][_0xb2e0('0x10')]);return _0x3088bf(_0x1043a6[_0xb2e0('0xf')]['message']);}else{logger[_0xb2e0('0xb')](_0xb2e0('0xc'),_0x4628dc,_0xb2e0('0xd'));_0x3088bf(_0x1043a6[_0xb2e0('0x11')]['message']);}})[_0xb2e0('0x12')](function(_0x3965d7){logger[_0xb2e0('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4628dc,_0x3965d7);_0x47cf80(_0x3965d7);});});}