Built motion from commit 9d1906d1.|2.5.40
[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 _0xab66=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then'];(function(_0x5f066d,_0x337571){var _0x4d4965=function(_0x144ae8){while(--_0x144ae8){_0x5f066d['push'](_0x5f066d['shift']());}};_0x4d4965(++_0x337571);}(_0xab66,0x135));var _0x6ab6=function(_0x88342f,_0x3b2650){_0x88342f=_0x88342f-0x0;var _0x41eda2=_0xab66[_0x88342f];return _0x41eda2;};'use strict';var _=require(_0x6ab6('0x0'));var util=require(_0x6ab6('0x1'));var moment=require(_0x6ab6('0x2'));var BPromise=require(_0x6ab6('0x3'));var rs=require(_0x6ab6('0x4'));var fs=require('fs');var Redis=require(_0x6ab6('0x5'));var db=require(_0x6ab6('0x6'))['db'];var utils=require(_0x6ab6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ab6('0x8'));var jayson=require(_0x6ab6('0x9'));var client=jayson[_0x6ab6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232f87,_0x42ef7c,_0x1137c2){return new BPromise(function(_0x14dd59,_0x37ee4d){return client[_0x6ab6('0xb')](_0x232f87,_0x1137c2)[_0x6ab6('0xc')](function(_0x1602e8){logger[_0x6ab6('0xd')](_0x6ab6('0xe'),_0x42ef7c,_0x6ab6('0xf'));logger[_0x6ab6('0x10')](_0x6ab6('0x11'),_0x42ef7c,_0x6ab6('0xf'),JSON[_0x6ab6('0x12')](_0x1602e8));if(_0x1602e8['error']){if(_0x1602e8[_0x6ab6('0x13')][_0x6ab6('0x14')]===0x1f4){logger[_0x6ab6('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x42ef7c,_0x1602e8[_0x6ab6('0x13')][_0x6ab6('0x15')]);return _0x37ee4d(_0x1602e8[_0x6ab6('0x13')]['message']);}logger[_0x6ab6('0x13')](_0x6ab6('0xe'),_0x42ef7c,_0x1602e8['error'][_0x6ab6('0x15')]);return _0x14dd59(_0x1602e8[_0x6ab6('0x13')][_0x6ab6('0x15')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x42ef7c,_0x6ab6('0xf'));_0x14dd59(_0x1602e8[_0x6ab6('0x16')][_0x6ab6('0x15')]);}})['catch'](function(_0x4bb419){logger['error'](_0x6ab6('0xe'),_0x42ef7c,_0x4bb419);_0x37ee4d(_0x4bb419);});});}