Built motion from commit 449495f6.|2.6.27
[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 _0x57eb=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request'];(function(_0x5c9016,_0x3a1d03){var _0x5cb789=function(_0x3683b3){while(--_0x3683b3){_0x5c9016['push'](_0x5c9016['shift']());}};_0x5cb789(++_0x3a1d03);}(_0x57eb,0xf2));var _0xb57e=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x57eb[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require(_0xb57e('0x0'));var moment=require(_0xb57e('0x1'));var BPromise=require('bluebird');var rs=require(_0xb57e('0x2'));var fs=require('fs');var Redis=require(_0xb57e('0x3'));var db=require(_0xb57e('0x4'))['db'];var utils=require(_0xb57e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb57e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb57e('0x7')][_0xb57e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d0b12,_0x54c654,_0x45df59){return new BPromise(function(_0x5bbcaa,_0x22f749){return client[_0xb57e('0x9')](_0x5d0b12,_0x45df59)[_0xb57e('0xa')](function(_0x4cfa7a){logger[_0xb57e('0xb')](_0xb57e('0xc'),_0x54c654,_0xb57e('0xd'));logger[_0xb57e('0xe')](_0xb57e('0xf'),_0x54c654,_0xb57e('0xd'),JSON[_0xb57e('0x10')](_0x4cfa7a));if(_0x4cfa7a[_0xb57e('0x11')]){if(_0x4cfa7a[_0xb57e('0x11')]['code']===0x1f4){logger['error'](_0xb57e('0xc'),_0x54c654,_0x4cfa7a[_0xb57e('0x11')][_0xb57e('0x12')]);return _0x22f749(_0x4cfa7a['error'][_0xb57e('0x12')]);}logger['error'](_0xb57e('0xc'),_0x54c654,_0x4cfa7a[_0xb57e('0x11')][_0xb57e('0x12')]);return _0x5bbcaa(_0x4cfa7a['error']['message']);}else{logger[_0xb57e('0xb')]('VtigerField,\x20%s,\x20%s',_0x54c654,_0xb57e('0xd'));_0x5bbcaa(_0x4cfa7a[_0xb57e('0x13')]['message']);}})[_0xb57e('0x14')](function(_0x2abdd5){logger[_0xb57e('0x11')]('VtigerField,\x20%s,\x20%s',_0x54c654,_0x2abdd5);_0x22f749(_0x2abdd5);});});}