Built motion from commit (unavailable).|2.5.6
[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 _0x4a55=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x20006a,_0x30e3a9){var _0x5e26ac=function(_0x16ca0a){while(--_0x16ca0a){_0x20006a['push'](_0x20006a['shift']());}};_0x5e26ac(++_0x30e3a9);}(_0x4a55,0x14b));var _0x54a5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4a55[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x54a5('0x0'));var util=require(_0x54a5('0x1'));var moment=require(_0x54a5('0x2'));var BPromise=require(_0x54a5('0x3'));var rs=require(_0x54a5('0x4'));var fs=require('fs');var Redis=require(_0x54a5('0x5'));var db=require(_0x54a5('0x6'))['db'];var utils=require(_0x54a5('0x7'));var logger=require(_0x54a5('0x8'))(_0x54a5('0x9'));var config=require(_0x54a5('0xa'));var jayson=require(_0x54a5('0xb'));var client=jayson[_0x54a5('0xc')][_0x54a5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x49c612,_0x261167,_0x5d952d){return new BPromise(function(_0x4f847e,_0x45bab8){return client['request'](_0x49c612,_0x5d952d)[_0x54a5('0xe')](function(_0x4e17b4){logger[_0x54a5('0xf')](_0x54a5('0x10'),_0x261167,'request\x20sent');logger[_0x54a5('0x11')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x261167,_0x54a5('0x12'),JSON['stringify'](_0x4e17b4));if(_0x4e17b4[_0x54a5('0x13')]){if(_0x4e17b4['error']['code']===0x1f4){logger[_0x54a5('0x13')](_0x54a5('0x10'),_0x261167,_0x4e17b4[_0x54a5('0x13')][_0x54a5('0x14')]);return _0x45bab8(_0x4e17b4[_0x54a5('0x13')][_0x54a5('0x14')]);}logger[_0x54a5('0x13')](_0x54a5('0x10'),_0x261167,_0x4e17b4[_0x54a5('0x13')][_0x54a5('0x14')]);return _0x4f847e(_0x4e17b4['error'][_0x54a5('0x14')]);}else{logger['info'](_0x54a5('0x10'),_0x261167,'request\x20sent');_0x4f847e(_0x4e17b4['result'][_0x54a5('0x14')]);}})[_0x54a5('0x15')](function(_0x4af313){logger['error'](_0x54a5('0x10'),_0x261167,_0x4af313);_0x45bab8(_0x4af313);});});}