Built motion from commit (unavailable).|2.5.30
[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 _0x8a67=['client','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x25c00a,_0x2416cd){var _0x683295=function(_0x434756){while(--_0x434756){_0x25c00a['push'](_0x25c00a['shift']());}};_0x683295(++_0x2416cd);}(_0x8a67,0x1c4));var _0x78a6=function(_0xf229e,_0x55c35e){_0xf229e=_0xf229e-0x0;var _0x5bf64b=_0x8a67[_0xf229e];return _0x5bf64b;};'use strict';var _=require('lodash');var util=require(_0x78a6('0x0'));var moment=require(_0x78a6('0x1'));var BPromise=require(_0x78a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78a6('0x3'));var db=require(_0x78a6('0x4'))['db'];var utils=require(_0x78a6('0x5'));var logger=require(_0x78a6('0x6'))(_0x78a6('0x7'));var config=require(_0x78a6('0x8'));var jayson=require(_0x78a6('0x9'));var client=jayson[_0x78a6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x107b3d,_0x5a3965,_0x5d0c02){return new BPromise(function(_0x43401c,_0xab80e0){return client['request'](_0x107b3d,_0x5d0c02)[_0x78a6('0xb')](function(_0x38c77a){logger[_0x78a6('0xc')](_0x78a6('0xd'),_0x5a3965,'request\x20sent');logger[_0x78a6('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5a3965,_0x78a6('0xf'),JSON[_0x78a6('0x10')](_0x38c77a));if(_0x38c77a[_0x78a6('0x11')]){if(_0x38c77a[_0x78a6('0x11')][_0x78a6('0x12')]===0x1f4){logger['error'](_0x78a6('0xd'),_0x5a3965,_0x38c77a[_0x78a6('0x11')][_0x78a6('0x13')]);return _0xab80e0(_0x38c77a['error'][_0x78a6('0x13')]);}logger[_0x78a6('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x5a3965,_0x38c77a['error']['message']);return _0x43401c(_0x38c77a[_0x78a6('0x11')][_0x78a6('0x13')]);}else{logger[_0x78a6('0xc')](_0x78a6('0xd'),_0x5a3965,_0x78a6('0xf'));_0x43401c(_0x38c77a['result']['message']);}})[_0x78a6('0x14')](function(_0x272f70){logger[_0x78a6('0x11')](_0x78a6('0xd'),_0x5a3965,_0x272f70);_0xab80e0(_0x272f70);});});}