Built motion from commit ddca4d0d.|2.5.47
[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 _0x770e=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x16b29b,_0x30775b){var _0x16a89c=function(_0x3529e2){while(--_0x3529e2){_0x16b29b['push'](_0x16b29b['shift']());}};_0x16a89c(++_0x30775b);}(_0x770e,0xef));var _0xe770=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x770e[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0xe770('0x0'));var util=require('util');var moment=require(_0xe770('0x1'));var BPromise=require(_0xe770('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe770('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe770('0x4'));var logger=require(_0xe770('0x5'))(_0xe770('0x6'));var config=require(_0xe770('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe770('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5454bc,_0x41c725,_0x443a84){return new BPromise(function(_0x442e97,_0x8f4307){return client[_0xe770('0x9')](_0x5454bc,_0x443a84)[_0xe770('0xa')](function(_0x277ab4){logger['info'](_0xe770('0xb'),_0x41c725,_0xe770('0xc'));logger[_0xe770('0xd')](_0xe770('0xe'),_0x41c725,_0xe770('0xc'),JSON[_0xe770('0xf')](_0x277ab4));if(_0x277ab4[_0xe770('0x10')]){if(_0x277ab4[_0xe770('0x10')][_0xe770('0x11')]===0x1f4){logger[_0xe770('0x10')](_0xe770('0xb'),_0x41c725,_0x277ab4['error']['message']);return _0x8f4307(_0x277ab4[_0xe770('0x10')]['message']);}logger[_0xe770('0x10')](_0xe770('0xb'),_0x41c725,_0x277ab4[_0xe770('0x10')]['message']);return _0x442e97(_0x277ab4[_0xe770('0x10')][_0xe770('0x12')]);}else{logger['info'](_0xe770('0xb'),_0x41c725,_0xe770('0xc'));_0x442e97(_0x277ab4['result']['message']);}})[_0xe770('0x13')](function(_0x46cddb){logger[_0xe770('0x10')](_0xe770('0xb'),_0x41c725,_0x46cddb);_0x8f4307(_0x46cddb);});});}