Built motion from commit (unavailable).|2.4.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 _0x511e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0xb41dd0,_0x335cfa){var _0x2148b7=function(_0x58d456){while(--_0x58d456){_0xb41dd0['push'](_0xb41dd0['shift']());}};_0x2148b7(++_0x335cfa);}(_0x511e,0x156));var _0xe511=function(_0x50068c,_0x38a87a){_0x50068c=_0x50068c-0x0;var _0x11826a=_0x511e[_0x50068c];return _0x11826a;};'use strict';var _=require('lodash');var util=require(_0xe511('0x0'));var moment=require(_0xe511('0x1'));var BPromise=require(_0xe511('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe511('0x3'));var db=require(_0xe511('0x4'))['db'];var utils=require(_0xe511('0x5'));var logger=require(_0xe511('0x6'))('rpc');var config=require(_0xe511('0x7'));var jayson=require(_0xe511('0x8'));var client=jayson[_0xe511('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5f3f,_0x375197,_0x3fcddf){return new BPromise(function(_0x4a5871,_0x48173f){return client[_0xe511('0xa')](_0x3e5f3f,_0x3fcddf)[_0xe511('0xb')](function(_0x687e5f){logger['info'](_0xe511('0xc'),_0x375197,_0xe511('0xd'));logger[_0xe511('0xe')](_0xe511('0xf'),_0x375197,_0xe511('0xd'),JSON[_0xe511('0x10')](_0x687e5f));if(_0x687e5f[_0xe511('0x11')]){if(_0x687e5f[_0xe511('0x11')][_0xe511('0x12')]===0x1f4){logger['error'](_0xe511('0xc'),_0x375197,_0x687e5f[_0xe511('0x11')]['message']);return _0x48173f(_0x687e5f['error'][_0xe511('0x13')]);}logger[_0xe511('0x11')](_0xe511('0xc'),_0x375197,_0x687e5f[_0xe511('0x11')]['message']);return _0x4a5871(_0x687e5f[_0xe511('0x11')]['message']);}else{logger[_0xe511('0x14')](_0xe511('0xc'),_0x375197,'request\x20sent');_0x4a5871(_0x687e5f[_0xe511('0x15')][_0xe511('0x13')]);}})[_0xe511('0x16')](function(_0x46ad2e){logger[_0xe511('0x11')](_0xe511('0xc'),_0x375197,_0x46ad2e);_0x48173f(_0x46ad2e);});});}