Built motion from commit 1fa89557.|2.6.10
[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 _0xa73e=['error','VtigerField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x43fc5d,_0x24f9bd){var _0x1a5881=function(_0xf9ba90){while(--_0xf9ba90){_0x43fc5d['push'](_0x43fc5d['shift']());}};_0x1a5881(++_0x24f9bd);}(_0xa73e,0x90));var _0xea73=function(_0x27f465,_0x3dae38){_0x27f465=_0x27f465-0x0;var _0xb1a445=_0xa73e[_0x27f465];return _0xb1a445;};'use strict';var _=require(_0xea73('0x0'));var util=require(_0xea73('0x1'));var moment=require(_0xea73('0x2'));var BPromise=require(_0xea73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea73('0x4'));var db=require(_0xea73('0x5'))['db'];var utils=require(_0xea73('0x6'));var logger=require(_0xea73('0x7'))(_0xea73('0x8'));var config=require(_0xea73('0x9'));var jayson=require(_0xea73('0xa'));var client=jayson['client'][_0xea73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17b47a,_0xa930bc,_0xba590b){return new BPromise(function(_0x119bee,_0x3e0a3a){return client['request'](_0x17b47a,_0xba590b)['then'](function(_0x27f140){logger[_0xea73('0xc')]('VtigerField,\x20%s,\x20%s',_0xa930bc,_0xea73('0xd'));logger['debug'](_0xea73('0xe'),_0xa930bc,_0xea73('0xd'),JSON[_0xea73('0xf')](_0x27f140));if(_0x27f140[_0xea73('0x10')]){if(_0x27f140[_0xea73('0x10')]['code']===0x1f4){logger[_0xea73('0x10')](_0xea73('0x11'),_0xa930bc,_0x27f140[_0xea73('0x10')][_0xea73('0x12')]);return _0x3e0a3a(_0x27f140['error']['message']);}logger[_0xea73('0x10')]('VtigerField,\x20%s,\x20%s',_0xa930bc,_0x27f140['error'][_0xea73('0x12')]);return _0x119bee(_0x27f140[_0xea73('0x10')][_0xea73('0x12')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0xa930bc,_0xea73('0xd'));_0x119bee(_0x27f140[_0xea73('0x13')]['message']);}})['catch'](function(_0x1e168a){logger['error']('VtigerField,\x20%s,\x20%s',_0xa930bc,_0x1e168a);_0x3e0a3a(_0x1e168a);});});}