Built motion from commit (unavailable).|2.5.7
[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 _0xaefa=['stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xaefa,0x175));var _0xaaef=function(_0x4a4c90,_0x6c6946){_0x4a4c90=_0x4a4c90-0x0;var _0x13add8=_0xaefa[_0x4a4c90];return _0x13add8;};'use strict';var _=require(_0xaaef('0x0'));var util=require(_0xaaef('0x1'));var moment=require(_0xaaef('0x2'));var BPromise=require('bluebird');var rs=require(_0xaaef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaef('0x4'))['db'];var utils=require(_0xaaef('0x5'));var logger=require(_0xaaef('0x6'))('rpc');var config=require(_0xaaef('0x7'));var jayson=require(_0xaaef('0x8'));var client=jayson[_0xaaef('0x9')][_0xaaef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x561992,_0x3c4501,_0x5d80fc){return new BPromise(function(_0x2e8a27,_0x37e75c){return client[_0xaaef('0xb')](_0x561992,_0x5d80fc)[_0xaaef('0xc')](function(_0xe0f750){logger[_0xaaef('0xd')](_0xaaef('0xe'),_0x3c4501,'request\x20sent');logger[_0xaaef('0xf')](_0xaaef('0x10'),_0x3c4501,_0xaaef('0x11'),JSON[_0xaaef('0x12')](_0xe0f750));if(_0xe0f750[_0xaaef('0x13')]){if(_0xe0f750[_0xaaef('0x13')]['code']===0x1f4){logger[_0xaaef('0x13')](_0xaaef('0xe'),_0x3c4501,_0xe0f750[_0xaaef('0x13')][_0xaaef('0x14')]);return _0x37e75c(_0xe0f750[_0xaaef('0x13')][_0xaaef('0x14')]);}logger[_0xaaef('0x13')](_0xaaef('0xe'),_0x3c4501,_0xe0f750[_0xaaef('0x13')]['message']);return _0x2e8a27(_0xe0f750[_0xaaef('0x13')][_0xaaef('0x14')]);}else{logger[_0xaaef('0xd')](_0xaaef('0xe'),_0x3c4501,'request\x20sent');_0x2e8a27(_0xe0f750[_0xaaef('0x15')]['message']);}})[_0xaaef('0x16')](function(_0x2cff5e){logger[_0xaaef('0x13')](_0xaaef('0xe'),_0x3c4501,_0x2cff5e);_0x37e75c(_0x2cff5e);});});}