Built motion from commit (unavailable).|2.5.1
[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 _0x5c1f=['result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','request\x20sent'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x5c1f,0x1dc));var _0xf5c1=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x5c1f[_0x328534];return _0x2796c0;};'use strict';var _=require(_0xf5c1('0x0'));var util=require('util');var moment=require(_0xf5c1('0x1'));var BPromise=require(_0xf5c1('0x2'));var rs=require(_0xf5c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf5c1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5c1('0x5'));var jayson=require(_0xf5c1('0x6'));var client=jayson[_0xf5c1('0x7')][_0xf5c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32d085,_0x4a2b18,_0xf08b1e){return new BPromise(function(_0x4d9c2e,_0x1ed626){return client[_0xf5c1('0x9')](_0x32d085,_0xf08b1e)[_0xf5c1('0xa')](function(_0x429b93){logger[_0xf5c1('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4a2b18,'request\x20sent');logger[_0xf5c1('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4a2b18,'request\x20sent',JSON['stringify'](_0x429b93));if(_0x429b93[_0xf5c1('0xd')]){if(_0x429b93[_0xf5c1('0xd')][_0xf5c1('0xe')]===0x1f4){logger[_0xf5c1('0xd')](_0xf5c1('0xf'),_0x4a2b18,_0x429b93[_0xf5c1('0xd')]['message']);return _0x1ed626(_0x429b93[_0xf5c1('0xd')]['message']);}logger['error'](_0xf5c1('0xf'),_0x4a2b18,_0x429b93[_0xf5c1('0xd')]['message']);return _0x4d9c2e(_0x429b93['error'][_0xf5c1('0x10')]);}else{logger[_0xf5c1('0xb')](_0xf5c1('0xf'),_0x4a2b18,_0xf5c1('0x11'));_0x4d9c2e(_0x429b93[_0xf5c1('0x12')][_0xf5c1('0x10')]);}})['catch'](function(_0x305379){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4a2b18,_0x305379);_0x1ed626(_0x305379);});});}