Built motion from commit 9d7072cc.|2.5.39
[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 _0x4974=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2e3ebb,_0x5afc59){var _0x8f027f=function(_0x29b2f3){while(--_0x29b2f3){_0x2e3ebb['push'](_0x2e3ebb['shift']());}};_0x8f027f(++_0x5afc59);}(_0x4974,0x113));var _0x4497=function(_0x6fbc80,_0x355ace){_0x6fbc80=_0x6fbc80-0x0;var _0x57c2ff=_0x4974[_0x6fbc80];return _0x57c2ff;};'use strict';var _=require(_0x4497('0x0'));var util=require(_0x4497('0x1'));var moment=require('moment');var BPromise=require(_0x4497('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4497('0x3'));var db=require(_0x4497('0x4'))['db'];var utils=require(_0x4497('0x5'));var logger=require('../../config/logger')(_0x4497('0x6'));var config=require(_0x4497('0x7'));var jayson=require(_0x4497('0x8'));var client=jayson[_0x4497('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52c0b4,_0x58583b,_0x486379){return new BPromise(function(_0x1f6ec9,_0x16d9eb){return client[_0x4497('0xa')](_0x52c0b4,_0x486379)[_0x4497('0xb')](function(_0x57e4af){logger['info'](_0x4497('0xc'),_0x58583b,_0x4497('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x58583b,_0x4497('0xd'),JSON[_0x4497('0xe')](_0x57e4af));if(_0x57e4af['error']){if(_0x57e4af[_0x4497('0xf')][_0x4497('0x10')]===0x1f4){logger[_0x4497('0xf')](_0x4497('0xc'),_0x58583b,_0x57e4af['error']['message']);return _0x16d9eb(_0x57e4af[_0x4497('0xf')]['message']);}logger['error'](_0x4497('0xc'),_0x58583b,_0x57e4af[_0x4497('0xf')][_0x4497('0x11')]);return _0x1f6ec9(_0x57e4af['error'][_0x4497('0x11')]);}else{logger['info'](_0x4497('0xc'),_0x58583b,_0x4497('0xd'));_0x1f6ec9(_0x57e4af[_0x4497('0x12')][_0x4497('0x11')]);}})[_0x4497('0x13')](function(_0x2c8779){logger[_0x4497('0xf')](_0x4497('0xc'),_0x58583b,_0x2c8779);_0x16d9eb(_0x2c8779);});});}