Built motion from commit b0a9a629.|2.6.33
[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 _0x24f5=['stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3d46d2,_0x26464e){var _0x499bb6=function(_0x13a9ca){while(--_0x13a9ca){_0x3d46d2['push'](_0x3d46d2['shift']());}};_0x499bb6(++_0x26464e);}(_0x24f5,0x104));var _0x524f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x24f5[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x524f('0x0'));var util=require(_0x524f('0x1'));var moment=require(_0x524f('0x2'));var BPromise=require(_0x524f('0x3'));var rs=require(_0x524f('0x4'));var fs=require('fs');var Redis=require(_0x524f('0x5'));var db=require(_0x524f('0x6'))['db'];var utils=require(_0x524f('0x7'));var logger=require(_0x524f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x524f('0x9'));var client=jayson[_0x524f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x347d83,_0x28a907,_0x27f987){return new BPromise(function(_0x13ae3e,_0x379fa4){return client[_0x524f('0xb')](_0x347d83,_0x27f987)['then'](function(_0x3f969a){logger[_0x524f('0xc')]('VtigerField,\x20%s,\x20%s',_0x28a907,'request\x20sent');logger[_0x524f('0xd')](_0x524f('0xe'),_0x28a907,_0x524f('0xf'),JSON[_0x524f('0x10')](_0x3f969a));if(_0x3f969a[_0x524f('0x11')]){if(_0x3f969a[_0x524f('0x11')][_0x524f('0x12')]===0x1f4){logger[_0x524f('0x11')](_0x524f('0x13'),_0x28a907,_0x3f969a[_0x524f('0x11')][_0x524f('0x14')]);return _0x379fa4(_0x3f969a[_0x524f('0x11')][_0x524f('0x14')]);}logger[_0x524f('0x11')](_0x524f('0x13'),_0x28a907,_0x3f969a[_0x524f('0x11')][_0x524f('0x14')]);return _0x13ae3e(_0x3f969a[_0x524f('0x11')][_0x524f('0x14')]);}else{logger[_0x524f('0xc')](_0x524f('0x13'),_0x28a907,_0x524f('0xf'));_0x13ae3e(_0x3f969a[_0x524f('0x15')]['message']);}})[_0x524f('0x16')](function(_0x35d622){logger[_0x524f('0x11')]('VtigerField,\x20%s,\x20%s',_0x28a907,_0x35d622);_0x379fa4(_0x35d622);});});}