Built motion from commit (unavailable).|2.5.11
[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 _0xafe6=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x5e9aca,_0x1bfeeb){var _0x22b7c2=function(_0x3dfdbc){while(--_0x3dfdbc){_0x5e9aca['push'](_0x5e9aca['shift']());}};_0x22b7c2(++_0x1bfeeb);}(_0xafe6,0x181));var _0x6afe=function(_0x4dad7b,_0x4a17b0){_0x4dad7b=_0x4dad7b-0x0;var _0xc04d92=_0xafe6[_0x4dad7b];return _0xc04d92;};'use strict';var _=require('lodash');var util=require(_0x6afe('0x0'));var moment=require(_0x6afe('0x1'));var BPromise=require(_0x6afe('0x2'));var rs=require(_0x6afe('0x3'));var fs=require('fs');var Redis=require(_0x6afe('0x4'));var db=require(_0x6afe('0x5'))['db'];var utils=require(_0x6afe('0x6'));var logger=require(_0x6afe('0x7'))('rpc');var config=require(_0x6afe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6afe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1547,_0x13e443,_0x1cd94c){return new BPromise(function(_0x3296bc,_0x1a4bdd){return client[_0x6afe('0xa')](_0x3a1547,_0x1cd94c)[_0x6afe('0xb')](function(_0x199005){logger[_0x6afe('0xc')](_0x6afe('0xd'),_0x13e443,_0x6afe('0xe'));logger[_0x6afe('0xf')](_0x6afe('0x10'),_0x13e443,_0x6afe('0xe'),JSON['stringify'](_0x199005));if(_0x199005['error']){if(_0x199005[_0x6afe('0x11')][_0x6afe('0x12')]===0x1f4){logger[_0x6afe('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x13e443,_0x199005['error'][_0x6afe('0x13')]);return _0x1a4bdd(_0x199005[_0x6afe('0x11')][_0x6afe('0x13')]);}logger[_0x6afe('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x13e443,_0x199005[_0x6afe('0x11')][_0x6afe('0x13')]);return _0x3296bc(_0x199005[_0x6afe('0x11')][_0x6afe('0x13')]);}else{logger[_0x6afe('0xc')](_0x6afe('0xd'),_0x13e443,_0x6afe('0xe'));_0x3296bc(_0x199005[_0x6afe('0x14')][_0x6afe('0x13')]);}})[_0x6afe('0x15')](function(_0xb2744f){logger[_0x6afe('0x11')](_0x6afe('0xd'),_0x13e443,_0xb2744f);_0x1a4bdd(_0xb2744f);});});}