Built motion from commit 1fa89557.|2.6.10
[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 _0x3d7b=['rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x3d7b,0xcc));var _0xb3d7=function(_0xc4cc56,_0x8e32b1){_0xc4cc56=_0xc4cc56-0x0;var _0x2956ed=_0x3d7b[_0xc4cc56];return _0x2956ed;};'use strict';var _=require('lodash');var util=require(_0xb3d7('0x0'));var moment=require('moment');var BPromise=require(_0xb3d7('0x1'));var rs=require(_0xb3d7('0x2'));var fs=require('fs');var Redis=require(_0xb3d7('0x3'));var db=require(_0xb3d7('0x4'))['db'];var utils=require(_0xb3d7('0x5'));var logger=require('../../config/logger')(_0xb3d7('0x6'));var config=require(_0xb3d7('0x7'));var jayson=require(_0xb3d7('0x8'));var client=jayson[_0xb3d7('0x9')][_0xb3d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58a3b6,_0x230e39,_0x104291){return new BPromise(function(_0x1ec4aa,_0x23dddd){return client['request'](_0x58a3b6,_0x104291)[_0xb3d7('0xb')](function(_0x2ef042){logger[_0xb3d7('0xc')](_0xb3d7('0xd'),_0x230e39,_0xb3d7('0xe'));logger[_0xb3d7('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x230e39,_0xb3d7('0xe'),JSON[_0xb3d7('0x10')](_0x2ef042));if(_0x2ef042['error']){if(_0x2ef042['error'][_0xb3d7('0x11')]===0x1f4){logger[_0xb3d7('0x12')](_0xb3d7('0xd'),_0x230e39,_0x2ef042['error'][_0xb3d7('0x13')]);return _0x23dddd(_0x2ef042[_0xb3d7('0x12')][_0xb3d7('0x13')]);}logger[_0xb3d7('0x12')](_0xb3d7('0xd'),_0x230e39,_0x2ef042[_0xb3d7('0x12')][_0xb3d7('0x13')]);return _0x1ec4aa(_0x2ef042['error']['message']);}else{logger[_0xb3d7('0xc')](_0xb3d7('0xd'),_0x230e39,_0xb3d7('0xe'));_0x1ec4aa(_0x2ef042['result'][_0xb3d7('0x13')]);}})[_0xb3d7('0x14')](function(_0x26a01f){logger['error'](_0xb3d7('0xd'),_0x230e39,_0x26a01f);_0x23dddd(_0x26a01f);});});}