Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / intVtigerField / intVtigerField.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 _0x851a=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x400646,_0x2cd440){var _0x3126a5=function(_0x177540){while(--_0x177540){_0x400646['push'](_0x400646['shift']());}};_0x3126a5(++_0x2cd440);}(_0x851a,0x19b));var _0xa851=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x851a[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0xa851('0x0'));var util=require('util');var moment=require(_0xa851('0x1'));var BPromise=require(_0xa851('0x2'));var rs=require(_0xa851('0x3'));var fs=require('fs');var Redis=require(_0xa851('0x4'));var db=require(_0xa851('0x5'))['db'];var utils=require(_0xa851('0x6'));var logger=require(_0xa851('0x7'))(_0xa851('0x8'));var config=require('../../config/environment');var jayson=require(_0xa851('0x9'));var client=jayson['client'][_0xa851('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fc0e0,_0x2f1f42,_0x551e16){return new BPromise(function(_0x3e1e9d,_0xa2162e){return client[_0xa851('0xb')](_0x2fc0e0,_0x551e16)[_0xa851('0xc')](function(_0x51f1be){logger[_0xa851('0xd')](_0xa851('0xe'),_0x2f1f42,'request\x20sent');logger[_0xa851('0xf')](_0xa851('0x10'),_0x2f1f42,_0xa851('0x11'),JSON[_0xa851('0x12')](_0x51f1be));if(_0x51f1be[_0xa851('0x13')]){if(_0x51f1be[_0xa851('0x13')][_0xa851('0x14')]===0x1f4){logger[_0xa851('0x13')](_0xa851('0xe'),_0x2f1f42,_0x51f1be[_0xa851('0x13')][_0xa851('0x15')]);return _0xa2162e(_0x51f1be[_0xa851('0x13')][_0xa851('0x15')]);}logger[_0xa851('0x13')](_0xa851('0xe'),_0x2f1f42,_0x51f1be[_0xa851('0x13')][_0xa851('0x15')]);return _0x3e1e9d(_0x51f1be[_0xa851('0x13')]['message']);}else{logger[_0xa851('0xd')](_0xa851('0xe'),_0x2f1f42,_0xa851('0x11'));_0x3e1e9d(_0x51f1be[_0xa851('0x16')]['message']);}})[_0xa851('0x17')](function(_0x1f38da){logger[_0xa851('0x13')](_0xa851('0xe'),_0x2f1f42,_0x1f38da);_0xa2162e(_0x1f38da);});});}