Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.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 _0x01a9=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x295f0a,_0x561ed7){var _0x6b1b4f=function(_0x20337d){while(--_0x20337d){_0x295f0a['push'](_0x295f0a['shift']());}};_0x6b1b4f(++_0x561ed7);}(_0x01a9,0x8b));var _0x901a=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x01a9[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x901a('0x0'));var util=require(_0x901a('0x1'));var moment=require('moment');var BPromise=require(_0x901a('0x2'));var rs=require(_0x901a('0x3'));var fs=require('fs');var Redis=require(_0x901a('0x4'));var db=require(_0x901a('0x5'))['db'];var utils=require(_0x901a('0x6'));var logger=require('../../config/logger')(_0x901a('0x7'));var config=require(_0x901a('0x8'));var jayson=require(_0x901a('0x9'));var client=jayson[_0x901a('0xa')][_0x901a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x541e50,_0x4d2696,_0x295f8a){return new BPromise(function(_0x4c26a4,_0x34e29e){return client[_0x901a('0xc')](_0x541e50,_0x295f8a)[_0x901a('0xd')](function(_0x526c9){logger[_0x901a('0xe')](_0x901a('0xf'),_0x4d2696,_0x901a('0x10'));logger[_0x901a('0x11')](_0x901a('0x12'),_0x4d2696,_0x901a('0x10'),JSON['stringify'](_0x526c9));if(_0x526c9[_0x901a('0x13')]){if(_0x526c9[_0x901a('0x13')]['code']===0x1f4){logger[_0x901a('0x13')](_0x901a('0xf'),_0x4d2696,_0x526c9[_0x901a('0x13')][_0x901a('0x14')]);return _0x34e29e(_0x526c9['error']['message']);}logger[_0x901a('0x13')](_0x901a('0xf'),_0x4d2696,_0x526c9[_0x901a('0x13')]['message']);return _0x4c26a4(_0x526c9[_0x901a('0x13')]['message']);}else{logger[_0x901a('0xe')](_0x901a('0xf'),_0x4d2696,_0x901a('0x10'));_0x4c26a4(_0x526c9[_0x901a('0x15')][_0x901a('0x14')]);}})['catch'](function(_0x1de4dd){logger[_0x901a('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d2696,_0x1de4dd);_0x34e29e(_0x1de4dd);});});}