Built motion from commit (unavailable).|2.4.21
[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 _0x3c8b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x2aa660,_0x45c25b){_0x2aa660=_0x2aa660-0x0;var _0xd5184b=_0x3c8b[_0x2aa660];return _0xd5184b;};'use strict';var _=require('lodash');var util=require(_0xb3c8('0x0'));var moment=require('moment');var BPromise=require(_0xb3c8('0x1'));var rs=require(_0xb3c8('0x2'));var fs=require('fs');var Redis=require(_0xb3c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c8('0x4'));var logger=require(_0xb3c8('0x5'))(_0xb3c8('0x6'));var config=require(_0xb3c8('0x7'));var jayson=require(_0xb3c8('0x8'));var client=jayson[_0xb3c8('0x9')][_0xb3c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375af0,_0x47aa5b,_0x13c8f3){return new BPromise(function(_0x5ec6a7,_0x460956){return client[_0xb3c8('0xb')](_0x375af0,_0x13c8f3)['then'](function(_0x5cb72f){logger['info'](_0xb3c8('0xc'),_0x47aa5b,_0xb3c8('0xd'));logger[_0xb3c8('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x47aa5b,_0xb3c8('0xd'),JSON[_0xb3c8('0xf')](_0x5cb72f));if(_0x5cb72f[_0xb3c8('0x10')]){if(_0x5cb72f[_0xb3c8('0x10')]['code']===0x1f4){logger[_0xb3c8('0x10')]('VtigerField,\x20%s,\x20%s',_0x47aa5b,_0x5cb72f[_0xb3c8('0x10')]['message']);return _0x460956(_0x5cb72f[_0xb3c8('0x10')][_0xb3c8('0x11')]);}logger[_0xb3c8('0x10')]('VtigerField,\x20%s,\x20%s',_0x47aa5b,_0x5cb72f['error'][_0xb3c8('0x11')]);return _0x5ec6a7(_0x5cb72f[_0xb3c8('0x10')][_0xb3c8('0x11')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x47aa5b,_0xb3c8('0xd'));_0x5ec6a7(_0x5cb72f[_0xb3c8('0x12')][_0xb3c8('0x11')]);}})['catch'](function(_0x2ecca3){logger[_0xb3c8('0x10')](_0xb3c8('0xc'),_0x47aa5b,_0x2ecca3);_0x460956(_0x2ecca3);});});}