Built motion from commit (unavailable).|2.5.24
[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 _0x9bc6=['../../config/logger','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4fa424,_0x3c3523){var _0x49d042=function(_0x499829){while(--_0x499829){_0x4fa424['push'](_0x4fa424['shift']());}};_0x49d042(++_0x3c3523);}(_0x9bc6,0x136));var _0x69bc=function(_0x3af392,_0xe5e91f){_0x3af392=_0x3af392-0x0;var _0x33be9f=_0x9bc6[_0x3af392];return _0x33be9f;};'use strict';var _=require(_0x69bc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x69bc('0x1'));var fs=require('fs');var Redis=require(_0x69bc('0x2'));var db=require(_0x69bc('0x3'))['db'];var utils=require(_0x69bc('0x4'));var logger=require(_0x69bc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x69bc('0x6'));var client=jayson['client'][_0x69bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2da89b,_0x157758,_0x24580d){return new BPromise(function(_0x1874c4,_0x254d69){return client[_0x69bc('0x8')](_0x2da89b,_0x24580d)[_0x69bc('0x9')](function(_0x5f58ef){logger[_0x69bc('0xa')](_0x69bc('0xb'),_0x157758,'request\x20sent');logger[_0x69bc('0xc')](_0x69bc('0xd'),_0x157758,_0x69bc('0xe'),JSON[_0x69bc('0xf')](_0x5f58ef));if(_0x5f58ef[_0x69bc('0x10')]){if(_0x5f58ef['error'][_0x69bc('0x11')]===0x1f4){logger[_0x69bc('0x10')](_0x69bc('0xb'),_0x157758,_0x5f58ef[_0x69bc('0x10')]['message']);return _0x254d69(_0x5f58ef['error'][_0x69bc('0x12')]);}logger['error'](_0x69bc('0xb'),_0x157758,_0x5f58ef['error']['message']);return _0x1874c4(_0x5f58ef[_0x69bc('0x10')][_0x69bc('0x12')]);}else{logger[_0x69bc('0xa')](_0x69bc('0xb'),_0x157758,_0x69bc('0xe'));_0x1874c4(_0x5f58ef[_0x69bc('0x13')]['message']);}})[_0x69bc('0x14')](function(_0x13d4a4){logger[_0x69bc('0x10')](_0x69bc('0xb'),_0x157758,_0x13d4a4);_0x254d69(_0x13d4a4);});});}