c22b435edcdbc488f7dfc4ae90b0a01c05b993c9
[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 _0x9ad0=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9ad0,0xbf));var _0x09ad=function(_0x562942,_0x5e94e4){_0x562942=_0x562942-0x0;var _0x783b1b=_0x9ad0[_0x562942];return _0x783b1b;};'use strict';var _=require(_0x09ad('0x0'));var util=require(_0x09ad('0x1'));var moment=require(_0x09ad('0x2'));var BPromise=require(_0x09ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09ad('0x4'));var db=require(_0x09ad('0x5'))['db'];var utils=require(_0x09ad('0x6'));var logger=require(_0x09ad('0x7'))(_0x09ad('0x8'));var config=require(_0x09ad('0x9'));var jayson=require(_0x09ad('0xa'));var client=jayson[_0x09ad('0xb')][_0x09ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6882ae,_0x2f2836,_0x5e0974){return new BPromise(function(_0xe4a92,_0x511b5f){return client[_0x09ad('0xd')](_0x6882ae,_0x5e0974)['then'](function(_0x28f713){logger[_0x09ad('0xe')](_0x09ad('0xf'),_0x2f2836,_0x09ad('0x10'));logger[_0x09ad('0x11')](_0x09ad('0x12'),_0x2f2836,_0x09ad('0x10'),JSON['stringify'](_0x28f713));if(_0x28f713[_0x09ad('0x13')]){if(_0x28f713['error'][_0x09ad('0x14')]===0x1f4){logger[_0x09ad('0x13')](_0x09ad('0xf'),_0x2f2836,_0x28f713[_0x09ad('0x13')][_0x09ad('0x15')]);return _0x511b5f(_0x28f713[_0x09ad('0x13')][_0x09ad('0x15')]);}logger[_0x09ad('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2f2836,_0x28f713[_0x09ad('0x13')][_0x09ad('0x15')]);return _0xe4a92(_0x28f713[_0x09ad('0x13')][_0x09ad('0x15')]);}else{logger[_0x09ad('0xe')](_0x09ad('0xf'),_0x2f2836,'request\x20sent');_0xe4a92(_0x28f713[_0x09ad('0x16')][_0x09ad('0x15')]);}})['catch'](function(_0x3c7150){logger[_0x09ad('0x13')](_0x09ad('0xf'),_0x2f2836,_0x3c7150);_0x511b5f(_0x3c7150);});});}