Built motion from commit f25620e4.|2.6.30
[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 _0x7a67=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','moment'];(function(_0x1f8d25,_0x36cc4d){var _0x330b34=function(_0x211bf0){while(--_0x211bf0){_0x1f8d25['push'](_0x1f8d25['shift']());}};_0x330b34(++_0x36cc4d);}(_0x7a67,0x76));var _0x77a6=function(_0x1ce2bd,_0x4506fa){_0x1ce2bd=_0x1ce2bd-0x0;var _0x28062b=_0x7a67[_0x1ce2bd];return _0x28062b;};'use strict';var _=require(_0x77a6('0x0'));var util=require('util');var moment=require(_0x77a6('0x1'));var BPromise=require(_0x77a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77a6('0x4'));var logger=require(_0x77a6('0x5'))(_0x77a6('0x6'));var config=require(_0x77a6('0x7'));var jayson=require(_0x77a6('0x8'));var client=jayson[_0x77a6('0x9')][_0x77a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34b3f4,_0x54ac98,_0x51dc34){return new BPromise(function(_0x5baa8d,_0x13fc3f){return client[_0x77a6('0xb')](_0x34b3f4,_0x51dc34)[_0x77a6('0xc')](function(_0x2b7c68){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x54ac98,_0x77a6('0xd'));logger['debug'](_0x77a6('0xe'),_0x54ac98,_0x77a6('0xd'),JSON[_0x77a6('0xf')](_0x2b7c68));if(_0x2b7c68[_0x77a6('0x10')]){if(_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x11')]===0x1f4){logger[_0x77a6('0x10')](_0x77a6('0x12'),_0x54ac98,_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);return _0x13fc3f(_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);}logger[_0x77a6('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x54ac98,_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);return _0x5baa8d(_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);}else{logger['info'](_0x77a6('0x12'),_0x54ac98,_0x77a6('0xd'));_0x5baa8d(_0x2b7c68['result']['message']);}})['catch'](function(_0x2141e2){logger['error'](_0x77a6('0x12'),_0x54ac98,_0x2141e2);_0x13fc3f(_0x2141e2);});});}