ac1f3e16ef0cf65200f621b7bb00c5f2f3bc404d
[motion2.git] / server / api / intZohoConfiguration / intZohoConfiguration.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 _0xab22=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x282dc9,_0x565f16){var _0x1aa4c8=function(_0x78fbf0){while(--_0x78fbf0){_0x282dc9['push'](_0x282dc9['shift']());}};_0x1aa4c8(++_0x565f16);}(_0xab22,0x1b7));var _0x2ab2=function(_0xb21919,_0x5dab4e){_0xb21919=_0xb21919-0x0;var _0xd4bed3=_0xab22[_0xb21919];return _0xd4bed3;};'use strict';var _=require(_0x2ab2('0x0'));var util=require(_0x2ab2('0x1'));var moment=require(_0x2ab2('0x2'));var BPromise=require(_0x2ab2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ab2('0x5'));var logger=require(_0x2ab2('0x6'))(_0x2ab2('0x7'));var config=require(_0x2ab2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ab2('0x9')][_0x2ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49042c,_0x21e442,_0xbf7abe){return new BPromise(function(_0x399edd,_0xc20e5b){return client[_0x2ab2('0xb')](_0x49042c,_0xbf7abe)['then'](function(_0x50c828){logger[_0x2ab2('0xc')](_0x2ab2('0xd'),_0x21e442,_0x2ab2('0xe'));logger['debug'](_0x2ab2('0xf'),_0x21e442,_0x2ab2('0xe'),JSON[_0x2ab2('0x10')](_0x50c828));if(_0x50c828[_0x2ab2('0x11')]){if(_0x50c828[_0x2ab2('0x11')]['code']===0x1f4){logger[_0x2ab2('0x11')](_0x2ab2('0xd'),_0x21e442,_0x50c828[_0x2ab2('0x11')]['message']);return _0xc20e5b(_0x50c828[_0x2ab2('0x11')][_0x2ab2('0x12')]);}logger[_0x2ab2('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x21e442,_0x50c828[_0x2ab2('0x11')][_0x2ab2('0x12')]);return _0x399edd(_0x50c828[_0x2ab2('0x11')][_0x2ab2('0x12')]);}else{logger[_0x2ab2('0xc')](_0x2ab2('0xd'),_0x21e442,'request\x20sent');_0x399edd(_0x50c828[_0x2ab2('0x13')]['message']);}})[_0x2ab2('0x14')](function(_0x1d1c26){logger[_0x2ab2('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x21e442,_0x1d1c26);_0xc20e5b(_0x1d1c26);});});}