Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.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 _0x3059=['result','lodash','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3059,0xd2));var _0x9305=function(_0x4e0fbb,_0x2af896){_0x4e0fbb=_0x4e0fbb-0x0;var _0x22dffc=_0x3059[_0x4e0fbb];return _0x22dffc;};'use strict';var _=require(_0x9305('0x0'));var util=require('util');var moment=require(_0x9305('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9305('0x2'))['db'];var utils=require(_0x9305('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9305('0x4'));var jayson=require(_0x9305('0x5'));var client=jayson[_0x9305('0x6')][_0x9305('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23ec50,_0xf1af94,_0x3e792d){return new BPromise(function(_0x264193,_0x59c2cc){return client[_0x9305('0x8')](_0x23ec50,_0x3e792d)[_0x9305('0x9')](function(_0x55819e){logger[_0x9305('0xa')](_0x9305('0xb'),_0xf1af94,_0x9305('0xc'));logger['debug'](_0x9305('0xd'),_0xf1af94,_0x9305('0xc'),JSON[_0x9305('0xe')](_0x55819e));if(_0x55819e[_0x9305('0xf')]){if(_0x55819e[_0x9305('0xf')][_0x9305('0x10')]===0x1f4){logger[_0x9305('0xf')](_0x9305('0xb'),_0xf1af94,_0x55819e[_0x9305('0xf')][_0x9305('0x11')]);return _0x59c2cc(_0x55819e[_0x9305('0xf')][_0x9305('0x11')]);}logger[_0x9305('0xf')](_0x9305('0xb'),_0xf1af94,_0x55819e['error']['message']);return _0x264193(_0x55819e['error']['message']);}else{logger[_0x9305('0xa')](_0x9305('0xb'),_0xf1af94,_0x9305('0xc'));_0x264193(_0x55819e[_0x9305('0x12')]['message']);}})['catch'](function(_0x5abc5c){logger[_0x9305('0xf')](_0x9305('0xb'),_0xf1af94,_0x5abc5c);_0x59c2cc(_0x5abc5c);});});}