Built motion from commit e1760111.|2.6.18
[motion2.git] / server / api / intZohoField / intZohoField.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 _0x1a2e=['info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x35a6be,_0x1faa83){var _0x2d8011=function(_0x492777){while(--_0x492777){_0x35a6be['push'](_0x35a6be['shift']());}};_0x2d8011(++_0x1faa83);}(_0x1a2e,0xbc));var _0xe1a2=function(_0x322c2f,_0x254da0){_0x322c2f=_0x322c2f-0x0;var _0x33994f=_0x1a2e[_0x322c2f];return _0x33994f;};'use strict';var _=require(_0xe1a2('0x0'));var util=require(_0xe1a2('0x1'));var moment=require(_0xe1a2('0x2'));var BPromise=require(_0xe1a2('0x3'));var rs=require(_0xe1a2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1a2('0x5'))['db'];var utils=require(_0xe1a2('0x6'));var logger=require(_0xe1a2('0x7'))(_0xe1a2('0x8'));var config=require(_0xe1a2('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44c7df,_0x38bb15,_0x48c6fb){return new BPromise(function(_0x31f075,_0x38871d){return client[_0xe1a2('0xa')](_0x44c7df,_0x48c6fb)[_0xe1a2('0xb')](function(_0x206422){logger[_0xe1a2('0xc')](_0xe1a2('0xd'),_0x38bb15,'request\x20sent');logger['debug'](_0xe1a2('0xe'),_0x38bb15,_0xe1a2('0xf'),JSON[_0xe1a2('0x10')](_0x206422));if(_0x206422['error']){if(_0x206422['error'][_0xe1a2('0x11')]===0x1f4){logger[_0xe1a2('0x12')](_0xe1a2('0xd'),_0x38bb15,_0x206422[_0xe1a2('0x12')]['message']);return _0x38871d(_0x206422['error']['message']);}logger[_0xe1a2('0x12')](_0xe1a2('0xd'),_0x38bb15,_0x206422[_0xe1a2('0x12')][_0xe1a2('0x13')]);return _0x31f075(_0x206422[_0xe1a2('0x12')][_0xe1a2('0x13')]);}else{logger[_0xe1a2('0xc')](_0xe1a2('0xd'),_0x38bb15,_0xe1a2('0xf'));_0x31f075(_0x206422['result'][_0xe1a2('0x13')]);}})['catch'](function(_0x25e8ee){logger[_0xe1a2('0x12')](_0xe1a2('0xd'),_0x38bb15,_0x25e8ee);_0x38871d(_0x25e8ee);});});}