Built motion from commit 85328c08.|2.5.50
[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 _0xf6ec=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x55e677,_0x4a1157){var _0x5d0798=function(_0x65a609){while(--_0x65a609){_0x55e677['push'](_0x55e677['shift']());}};_0x5d0798(++_0x4a1157);}(_0xf6ec,0x198));var _0xcf6e=function(_0x24aefa,_0x473eef){_0x24aefa=_0x24aefa-0x0;var _0x51ccaa=_0xf6ec[_0x24aefa];return _0x51ccaa;};'use strict';var _=require('lodash');var util=require(_0xcf6e('0x0'));var moment=require(_0xcf6e('0x1'));var BPromise=require(_0xcf6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf6e('0x3'));var db=require(_0xcf6e('0x4'))['db'];var utils=require(_0xcf6e('0x5'));var logger=require(_0xcf6e('0x6'))(_0xcf6e('0x7'));var config=require(_0xcf6e('0x8'));var jayson=require(_0xcf6e('0x9'));var client=jayson[_0xcf6e('0xa')][_0xcf6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15d212,_0x48b426,_0x3c8df1){return new BPromise(function(_0x36a925,_0x191531){return client['request'](_0x15d212,_0x3c8df1)[_0xcf6e('0xc')](function(_0x24b15a){logger['info'](_0xcf6e('0xd'),_0x48b426,_0xcf6e('0xe'));logger[_0xcf6e('0xf')](_0xcf6e('0x10'),_0x48b426,'request\x20sent',JSON[_0xcf6e('0x11')](_0x24b15a));if(_0x24b15a[_0xcf6e('0x12')]){if(_0x24b15a[_0xcf6e('0x12')][_0xcf6e('0x13')]===0x1f4){logger['error'](_0xcf6e('0xd'),_0x48b426,_0x24b15a[_0xcf6e('0x12')][_0xcf6e('0x14')]);return _0x191531(_0x24b15a[_0xcf6e('0x12')]['message']);}logger[_0xcf6e('0x12')](_0xcf6e('0xd'),_0x48b426,_0x24b15a[_0xcf6e('0x12')][_0xcf6e('0x14')]);return _0x36a925(_0x24b15a['error'][_0xcf6e('0x14')]);}else{logger[_0xcf6e('0x15')](_0xcf6e('0xd'),_0x48b426,_0xcf6e('0xe'));_0x36a925(_0x24b15a[_0xcf6e('0x16')]['message']);}})[_0xcf6e('0x17')](function(_0x475837){logger[_0xcf6e('0x12')](_0xcf6e('0xd'),_0x48b426,_0x475837);_0x191531(_0x475837);});});}