Built motion from commit 994c64e1.|2.6.1
[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 _0x79ba=['../../config/logger','../../config/environment','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5cbb32,_0x375d08){var _0x2d18bf=function(_0x30bdcf){while(--_0x30bdcf){_0x5cbb32['push'](_0x5cbb32['shift']());}};_0x2d18bf(++_0x375d08);}(_0x79ba,0x13e));var _0xa79b=function(_0x38e261,_0x4db54a){_0x38e261=_0x38e261-0x0;var _0x5921f8=_0x79ba[_0x38e261];return _0x5921f8;};'use strict';var _=require('lodash');var util=require(_0xa79b('0x0'));var moment=require('moment');var BPromise=require(_0xa79b('0x1'));var rs=require(_0xa79b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa79b('0x3'))['db'];var utils=require(_0xa79b('0x4'));var logger=require(_0xa79b('0x5'))('rpc');var config=require(_0xa79b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa79b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d39e4,_0x50fdda,_0x3eb4eb){return new BPromise(function(_0x2cab8c,_0x53fe6c){return client[_0xa79b('0x8')](_0x1d39e4,_0x3eb4eb)[_0xa79b('0x9')](function(_0x456599){logger[_0xa79b('0xa')](_0xa79b('0xb'),_0x50fdda,_0xa79b('0xc'));logger['debug'](_0xa79b('0xd'),_0x50fdda,'request\x20sent',JSON[_0xa79b('0xe')](_0x456599));if(_0x456599[_0xa79b('0xf')]){if(_0x456599[_0xa79b('0xf')][_0xa79b('0x10')]===0x1f4){logger[_0xa79b('0xf')](_0xa79b('0xb'),_0x50fdda,_0x456599['error'][_0xa79b('0x11')]);return _0x53fe6c(_0x456599['error'][_0xa79b('0x11')]);}logger['error'](_0xa79b('0xb'),_0x50fdda,_0x456599['error'][_0xa79b('0x11')]);return _0x2cab8c(_0x456599[_0xa79b('0xf')][_0xa79b('0x11')]);}else{logger[_0xa79b('0xa')](_0xa79b('0xb'),_0x50fdda,_0xa79b('0xc'));_0x2cab8c(_0x456599['result']['message']);}})[_0xa79b('0x12')](function(_0x13f275){logger[_0xa79b('0xf')](_0xa79b('0xb'),_0x50fdda,_0x13f275);_0x53fe6c(_0x13f275);});});}