Built motion from commit (unavailable).|2.5.12
[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 _0xc6da=['client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x24a093,_0x47bde9){var _0xcf8e1=function(_0x5691dd){while(--_0x5691dd){_0x24a093['push'](_0x24a093['shift']());}};_0xcf8e1(++_0x47bde9);}(_0xc6da,0xae));var _0xac6d=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xc6da[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xac6d('0x0'));var util=require(_0xac6d('0x1'));var moment=require(_0xac6d('0x2'));var BPromise=require(_0xac6d('0x3'));var rs=require(_0xac6d('0x4'));var fs=require('fs');var Redis=require(_0xac6d('0x5'));var db=require(_0xac6d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac6d('0x7'));var config=require(_0xac6d('0x8'));var jayson=require(_0xac6d('0x9'));var client=jayson[_0xac6d('0xa')][_0xac6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5654df,_0x180f8f,_0x4714b3){return new BPromise(function(_0x4ae7e1,_0x18b45f){return client[_0xac6d('0xc')](_0x5654df,_0x4714b3)[_0xac6d('0xd')](function(_0x36776a){logger[_0xac6d('0xe')](_0xac6d('0xf'),_0x180f8f,_0xac6d('0x10'));logger[_0xac6d('0x11')](_0xac6d('0x12'),_0x180f8f,_0xac6d('0x10'),JSON[_0xac6d('0x13')](_0x36776a));if(_0x36776a[_0xac6d('0x14')]){if(_0x36776a[_0xac6d('0x14')][_0xac6d('0x15')]===0x1f4){logger[_0xac6d('0x14')](_0xac6d('0xf'),_0x180f8f,_0x36776a[_0xac6d('0x14')][_0xac6d('0x16')]);return _0x18b45f(_0x36776a[_0xac6d('0x14')]['message']);}logger[_0xac6d('0x14')](_0xac6d('0xf'),_0x180f8f,_0x36776a['error'][_0xac6d('0x16')]);return _0x4ae7e1(_0x36776a['error']['message']);}else{logger[_0xac6d('0xe')](_0xac6d('0xf'),_0x180f8f,_0xac6d('0x10'));_0x4ae7e1(_0x36776a['result'][_0xac6d('0x16')]);}})['catch'](function(_0x2ec7ba){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x180f8f,_0x2ec7ba);_0x18b45f(_0x2ec7ba);});});}