Built motion from commit f3da74b7.|2.5.36
[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 _0x8a63=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x8a63,0x1dd));var _0x38a6=function(_0x421a99,_0x239c08){_0x421a99=_0x421a99-0x0;var _0x16a86c=_0x8a63[_0x421a99];return _0x16a86c;};'use strict';var _=require(_0x38a6('0x0'));var util=require('util');var moment=require(_0x38a6('0x1'));var BPromise=require(_0x38a6('0x2'));var rs=require(_0x38a6('0x3'));var fs=require('fs');var Redis=require(_0x38a6('0x4'));var db=require(_0x38a6('0x5'))['db'];var utils=require(_0x38a6('0x6'));var logger=require('../../config/logger')(_0x38a6('0x7'));var config=require(_0x38a6('0x8'));var jayson=require(_0x38a6('0x9'));var client=jayson[_0x38a6('0xa')][_0x38a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226537,_0x2d4664,_0x55152d){return new BPromise(function(_0x2e8d68,_0x487237){return client['request'](_0x226537,_0x55152d)[_0x38a6('0xc')](function(_0x3f9083){logger[_0x38a6('0xd')](_0x38a6('0xe'),_0x2d4664,_0x38a6('0xf'));logger[_0x38a6('0x10')](_0x38a6('0x11'),_0x2d4664,_0x38a6('0xf'),JSON[_0x38a6('0x12')](_0x3f9083));if(_0x3f9083[_0x38a6('0x13')]){if(_0x3f9083[_0x38a6('0x13')][_0x38a6('0x14')]===0x1f4){logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x3f9083[_0x38a6('0x13')][_0x38a6('0x15')]);return _0x487237(_0x3f9083['error'][_0x38a6('0x15')]);}logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x3f9083['error'][_0x38a6('0x15')]);return _0x2e8d68(_0x3f9083['error']['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x2d4664,_0x38a6('0xf'));_0x2e8d68(_0x3f9083['result'][_0x38a6('0x15')]);}})[_0x38a6('0x16')](function(_0x22b8c9){logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x22b8c9);_0x487237(_0x22b8c9);});});}