Built motion from commit (unavailable).|2.3.93
[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 _0x26a1=['request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x37b93a,_0x469f5f){var _0x182bfb=function(_0x294310){while(--_0x294310){_0x37b93a['push'](_0x37b93a['shift']());}};_0x182bfb(++_0x469f5f);}(_0x26a1,0xbb));var _0x126a=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x26a1[_0x166742];return _0xb7814a;};'use strict';var _=require(_0x126a('0x0'));var util=require(_0x126a('0x1'));var moment=require(_0x126a('0x2'));var BPromise=require(_0x126a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x126a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x126a('0x5'));var logger=require(_0x126a('0x6'))(_0x126a('0x7'));var config=require(_0x126a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x126a('0x9')][_0x126a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1cc8,_0x1f6fda,_0x23ec72){return new BPromise(function(_0x5aa9f4,_0x2ac3c3){return client[_0x126a('0xb')](_0x5c1cc8,_0x23ec72)[_0x126a('0xc')](function(_0x23646e){logger[_0x126a('0xd')](_0x126a('0xe'),_0x1f6fda,_0x126a('0xf'));logger[_0x126a('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1f6fda,_0x126a('0xf'),JSON[_0x126a('0x11')](_0x23646e));if(_0x23646e['error']){if(_0x23646e[_0x126a('0x12')]['code']===0x1f4){logger[_0x126a('0x12')](_0x126a('0xe'),_0x1f6fda,_0x23646e['error'][_0x126a('0x13')]);return _0x2ac3c3(_0x23646e[_0x126a('0x12')][_0x126a('0x13')]);}logger['error'](_0x126a('0xe'),_0x1f6fda,_0x23646e['error'][_0x126a('0x13')]);return _0x5aa9f4(_0x23646e[_0x126a('0x12')][_0x126a('0x13')]);}else{logger[_0x126a('0xd')](_0x126a('0xe'),_0x1f6fda,_0x126a('0xf'));_0x5aa9f4(_0x23646e[_0x126a('0x14')]['message']);}})[_0x126a('0x15')](function(_0x5189d3){logger[_0x126a('0x12')](_0x126a('0xe'),_0x1f6fda,_0x5189d3);_0x2ac3c3(_0x5189d3);});});}