Built motion from commit b5413ace.|2.6.9
[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 _0x434a=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x340c09,_0xc08941){var _0x1cc1b6=function(_0x193f75){while(--_0x193f75){_0x340c09['push'](_0x340c09['shift']());}};_0x1cc1b6(++_0xc08941);}(_0x434a,0x92));var _0xa434=function(_0x31efc8,_0x1950ad){_0x31efc8=_0x31efc8-0x0;var _0x196e29=_0x434a[_0x31efc8];return _0x196e29;};'use strict';var _=require(_0xa434('0x0'));var util=require('util');var moment=require(_0xa434('0x1'));var BPromise=require(_0xa434('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa434('0x3'));var db=require(_0xa434('0x4'))['db'];var utils=require(_0xa434('0x5'));var logger=require(_0xa434('0x6'))(_0xa434('0x7'));var config=require('../../config/environment');var jayson=require(_0xa434('0x8'));var client=jayson[_0xa434('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a64b8,_0x28b07c,_0x54ee56){return new BPromise(function(_0x3566dd,_0x5439d1){return client['request'](_0x3a64b8,_0x54ee56)[_0xa434('0xa')](function(_0x4e647e){logger[_0xa434('0xb')](_0xa434('0xc'),_0x28b07c,_0xa434('0xd'));logger[_0xa434('0xe')](_0xa434('0xf'),_0x28b07c,_0xa434('0xd'),JSON[_0xa434('0x10')](_0x4e647e));if(_0x4e647e['error']){if(_0x4e647e[_0xa434('0x11')][_0xa434('0x12')]===0x1f4){logger['error'](_0xa434('0xc'),_0x28b07c,_0x4e647e[_0xa434('0x11')]['message']);return _0x5439d1(_0x4e647e[_0xa434('0x11')][_0xa434('0x13')]);}logger[_0xa434('0x11')](_0xa434('0xc'),_0x28b07c,_0x4e647e[_0xa434('0x11')][_0xa434('0x13')]);return _0x3566dd(_0x4e647e[_0xa434('0x11')]['message']);}else{logger[_0xa434('0xb')](_0xa434('0xc'),_0x28b07c,_0xa434('0xd'));_0x3566dd(_0x4e647e[_0xa434('0x14')]['message']);}})['catch'](function(_0x2c050a){logger[_0xa434('0x11')](_0xa434('0xc'),_0x28b07c,_0x2c050a);_0x5439d1(_0x2c050a);});});}