Built motion from commit (unavailable).|2.5.6
[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 _0x726f=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message'];(function(_0x5af4d2,_0x17b53f){var _0x2a01ac=function(_0x4fe90c){while(--_0x4fe90c){_0x5af4d2['push'](_0x5af4d2['shift']());}};_0x2a01ac(++_0x17b53f);}(_0x726f,0xa2));var _0xf726=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x726f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xf726('0x0'));var util=require(_0xf726('0x1'));var moment=require('moment');var BPromise=require(_0xf726('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf726('0x3'))['db'];var utils=require(_0xf726('0x4'));var logger=require(_0xf726('0x5'))(_0xf726('0x6'));var config=require(_0xf726('0x7'));var jayson=require(_0xf726('0x8'));var client=jayson[_0xf726('0x9')][_0xf726('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dd6b8,_0x2ed93b,_0x43449d){return new BPromise(function(_0x3ec084,_0xe56ebc){return client[_0xf726('0xb')](_0x2dd6b8,_0x43449d)[_0xf726('0xc')](function(_0x45c2a3){logger[_0xf726('0xd')]('VtigerField,\x20%s,\x20%s',_0x2ed93b,'request\x20sent');logger['debug'](_0xf726('0xe'),_0x2ed93b,'request\x20sent',JSON['stringify'](_0x45c2a3));if(_0x45c2a3[_0xf726('0xf')]){if(_0x45c2a3[_0xf726('0xf')]['code']===0x1f4){logger[_0xf726('0xf')](_0xf726('0x10'),_0x2ed93b,_0x45c2a3[_0xf726('0xf')][_0xf726('0x11')]);return _0xe56ebc(_0x45c2a3[_0xf726('0xf')][_0xf726('0x11')]);}logger[_0xf726('0xf')](_0xf726('0x10'),_0x2ed93b,_0x45c2a3['error'][_0xf726('0x11')]);return _0x3ec084(_0x45c2a3['error']['message']);}else{logger[_0xf726('0xd')](_0xf726('0x10'),_0x2ed93b,'request\x20sent');_0x3ec084(_0x45c2a3[_0xf726('0x12')][_0xf726('0x11')]);}})[_0xf726('0x13')](function(_0x545e84){logger[_0xf726('0xf')](_0xf726('0x10'),_0x2ed93b,_0x545e84);_0xe56ebc(_0x545e84);});});}