Built motion from commit bab6f49e.|2.6.17
[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 _0x254e=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4940ce,_0x1714df){var _0x5bc34b=function(_0x503bde){while(--_0x503bde){_0x4940ce['push'](_0x4940ce['shift']());}};_0x5bc34b(++_0x1714df);}(_0x254e,0x175));var _0xe254=function(_0x4ab489,_0x4d389d){_0x4ab489=_0x4ab489-0x0;var _0x16e07b=_0x254e[_0x4ab489];return _0x16e07b;};'use strict';var _=require(_0xe254('0x0'));var util=require('util');var moment=require(_0xe254('0x1'));var BPromise=require(_0xe254('0x2'));var rs=require(_0xe254('0x3'));var fs=require('fs');var Redis=require(_0xe254('0x4'));var db=require(_0xe254('0x5'))['db'];var utils=require(_0xe254('0x6'));var logger=require(_0xe254('0x7'))(_0xe254('0x8'));var config=require(_0xe254('0x9'));var jayson=require(_0xe254('0xa'));var client=jayson[_0xe254('0xb')][_0xe254('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b0636,_0x46edd5,_0x177ccb){return new BPromise(function(_0x1eac43,_0x4d08f8){return client['request'](_0x5b0636,_0x177ccb)[_0xe254('0xd')](function(_0x3c0a2f){logger[_0xe254('0xe')](_0xe254('0xf'),_0x46edd5,_0xe254('0x10'));logger['debug'](_0xe254('0x11'),_0x46edd5,'request\x20sent',JSON['stringify'](_0x3c0a2f));if(_0x3c0a2f[_0xe254('0x12')]){if(_0x3c0a2f[_0xe254('0x12')][_0xe254('0x13')]===0x1f4){logger[_0xe254('0x12')](_0xe254('0xf'),_0x46edd5,_0x3c0a2f[_0xe254('0x12')]['message']);return _0x4d08f8(_0x3c0a2f[_0xe254('0x12')][_0xe254('0x14')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x46edd5,_0x3c0a2f[_0xe254('0x12')]['message']);return _0x1eac43(_0x3c0a2f['error'][_0xe254('0x14')]);}else{logger[_0xe254('0xe')](_0xe254('0xf'),_0x46edd5,_0xe254('0x10'));_0x1eac43(_0x3c0a2f[_0xe254('0x15')][_0xe254('0x14')]);}})[_0xe254('0x16')](function(_0x43acf9){logger[_0xe254('0x12')](_0xe254('0xf'),_0x46edd5,_0x43acf9);_0x4d08f8(_0x43acf9);});});}