Built motion from commit 47436d59.|2.6.7
[motion2.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.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 _0x8fc9=['client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8fc9,0xa4));var _0x98fc=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8fc9[_0x2df507];return _0x1f7167;};'use strict';var _=require('lodash');var util=require(_0x98fc('0x0'));var moment=require('moment');var BPromise=require(_0x98fc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98fc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x98fc('0x3'));var logger=require('../../config/logger')(_0x98fc('0x4'));var config=require(_0x98fc('0x5'));var jayson=require(_0x98fc('0x6'));var client=jayson[_0x98fc('0x7')][_0x98fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xba2d07,_0x286618,_0x2147a6){return new BPromise(function(_0x27f761,_0x454f38){return client[_0x98fc('0x9')](_0xba2d07,_0x2147a6)[_0x98fc('0xa')](function(_0x7fc5d5){logger[_0x98fc('0xb')](_0x98fc('0xc'),_0x286618,'request\x20sent');logger['debug'](_0x98fc('0xd'),_0x286618,_0x98fc('0xe'),JSON['stringify'](_0x7fc5d5));if(_0x7fc5d5['error']){if(_0x7fc5d5['error'][_0x98fc('0xf')]===0x1f4){logger[_0x98fc('0x10')](_0x98fc('0xc'),_0x286618,_0x7fc5d5['error'][_0x98fc('0x11')]);return _0x454f38(_0x7fc5d5[_0x98fc('0x10')]['message']);}logger[_0x98fc('0x10')](_0x98fc('0xc'),_0x286618,_0x7fc5d5['error'][_0x98fc('0x11')]);return _0x27f761(_0x7fc5d5[_0x98fc('0x10')]['message']);}else{logger['info'](_0x98fc('0xc'),_0x286618,_0x98fc('0xe'));_0x27f761(_0x7fc5d5[_0x98fc('0x12')]['message']);}})['catch'](function(_0x50959d){logger[_0x98fc('0x10')](_0x98fc('0xc'),_0x286618,_0x50959d);_0x454f38(_0x50959d);});});}