Built motion from commit (unavailable).|2.5.23
[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 _0x59ed=['error','message','ZohoConfiguration,\x20%s,\x20%s','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a8b00,_0x953217){var _0x247a96=function(_0x47125e){while(--_0x47125e){_0x2a8b00['push'](_0x2a8b00['shift']());}};_0x247a96(++_0x953217);}(_0x59ed,0xf4));var _0xd59e=function(_0x1c36a8,_0x49c835){_0x1c36a8=_0x1c36a8-0x0;var _0xb622c5=_0x59ed[_0x1c36a8];return _0xb622c5;};'use strict';var _=require('lodash');var util=require(_0xd59e('0x0'));var moment=require(_0xd59e('0x1'));var BPromise=require(_0xd59e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd59e('0x3'))['db'];var utils=require(_0xd59e('0x4'));var logger=require(_0xd59e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd59e('0x6'));var client=jayson[_0xd59e('0x7')][_0xd59e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x212319,_0x3ee5c3,_0x4ed46e){return new BPromise(function(_0x2e4511,_0x5b2660){return client[_0xd59e('0x9')](_0x212319,_0x4ed46e)[_0xd59e('0xa')](function(_0x4285ab){logger[_0xd59e('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ee5c3,_0xd59e('0xc'));logger[_0xd59e('0xd')](_0xd59e('0xe'),_0x3ee5c3,_0xd59e('0xc'),JSON[_0xd59e('0xf')](_0x4285ab));if(_0x4285ab[_0xd59e('0x10')]){if(_0x4285ab[_0xd59e('0x10')]['code']===0x1f4){logger[_0xd59e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ee5c3,_0x4285ab['error']['message']);return _0x5b2660(_0x4285ab[_0xd59e('0x10')][_0xd59e('0x11')]);}logger[_0xd59e('0x10')](_0xd59e('0x12'),_0x3ee5c3,_0x4285ab[_0xd59e('0x10')][_0xd59e('0x11')]);return _0x2e4511(_0x4285ab[_0xd59e('0x10')][_0xd59e('0x11')]);}else{logger[_0xd59e('0xb')](_0xd59e('0x12'),_0x3ee5c3,_0xd59e('0xc'));_0x2e4511(_0x4285ab[_0xd59e('0x13')][_0xd59e('0x11')]);}})['catch'](function(_0x310bc4){logger[_0xd59e('0x10')](_0xd59e('0x12'),_0x3ee5c3,_0x310bc4);_0x5b2660(_0x310bc4);});});}