Built motion from commit (unavailable).|2.5.10
[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 _0x746b=['info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x542e14,_0x5dfd4b){var _0xe3bbb=function(_0x5c2ac7){while(--_0x5c2ac7){_0x542e14['push'](_0x542e14['shift']());}};_0xe3bbb(++_0x5dfd4b);}(_0x746b,0x1d5));var _0xb746=function(_0x28bf7b,_0x37d5f7){_0x28bf7b=_0x28bf7b-0x0;var _0x25e2e1=_0x746b[_0x28bf7b];return _0x25e2e1;};'use strict';var _=require(_0xb746('0x0'));var util=require(_0xb746('0x1'));var moment=require(_0xb746('0x2'));var BPromise=require('bluebird');var rs=require(_0xb746('0x3'));var fs=require('fs');var Redis=require(_0xb746('0x4'));var db=require(_0xb746('0x5'))['db'];var utils=require(_0xb746('0x6'));var logger=require(_0xb746('0x7'))(_0xb746('0x8'));var config=require(_0xb746('0x9'));var jayson=require(_0xb746('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3aeb93,_0x3b4297,_0x337b05){return new BPromise(function(_0x4095a3,_0x1aa2d4){return client['request'](_0x3aeb93,_0x337b05)['then'](function(_0x543a72){logger[_0xb746('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3b4297,'request\x20sent');logger[_0xb746('0xc')](_0xb746('0xd'),_0x3b4297,'request\x20sent',JSON[_0xb746('0xe')](_0x543a72));if(_0x543a72['error']){if(_0x543a72[_0xb746('0xf')][_0xb746('0x10')]===0x1f4){logger[_0xb746('0xf')](_0xb746('0x11'),_0x3b4297,_0x543a72[_0xb746('0xf')][_0xb746('0x12')]);return _0x1aa2d4(_0x543a72[_0xb746('0xf')]['message']);}logger[_0xb746('0xf')](_0xb746('0x11'),_0x3b4297,_0x543a72[_0xb746('0xf')][_0xb746('0x12')]);return _0x4095a3(_0x543a72[_0xb746('0xf')][_0xb746('0x12')]);}else{logger[_0xb746('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3b4297,'request\x20sent');_0x4095a3(_0x543a72[_0xb746('0x13')]['message']);}})['catch'](function(_0x3fd704){logger['error'](_0xb746('0x11'),_0x3b4297,_0x3fd704);_0x1aa2d4(_0x3fd704);});});}