Built motion from commit c0cdc9d8.|2.6.28
[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 _0xd548=['info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0xbe4161,_0x23f99d){var _0x2ec1c2=function(_0xadcd2d){while(--_0xadcd2d){_0xbe4161['push'](_0xbe4161['shift']());}};_0x2ec1c2(++_0x23f99d);}(_0xd548,0xff));var _0x8d54=function(_0x2f77ee,_0x2bff02){_0x2f77ee=_0x2f77ee-0x0;var _0x38d29a=_0xd548[_0x2f77ee];return _0x38d29a;};'use strict';var _=require('lodash');var util=require(_0x8d54('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8d54('0x1'));var fs=require('fs');var Redis=require(_0x8d54('0x2'));var db=require(_0x8d54('0x3'))['db'];var utils=require(_0x8d54('0x4'));var logger=require('../../config/logger')(_0x8d54('0x5'));var config=require(_0x8d54('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8d54('0x7')][_0x8d54('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x408b8d,_0x3c35b0,_0x411894){return new BPromise(function(_0x5489f5,_0x2b4096){return client['request'](_0x408b8d,_0x411894)[_0x8d54('0x9')](function(_0x2aed4d){logger['info'](_0x8d54('0xa'),_0x3c35b0,'request\x20sent');logger[_0x8d54('0xb')](_0x8d54('0xc'),_0x3c35b0,_0x8d54('0xd'),JSON[_0x8d54('0xe')](_0x2aed4d));if(_0x2aed4d['error']){if(_0x2aed4d['error'][_0x8d54('0xf')]===0x1f4){logger[_0x8d54('0x10')](_0x8d54('0xa'),_0x3c35b0,_0x2aed4d['error'][_0x8d54('0x11')]);return _0x2b4096(_0x2aed4d['error']['message']);}logger['error'](_0x8d54('0xa'),_0x3c35b0,_0x2aed4d[_0x8d54('0x10')][_0x8d54('0x11')]);return _0x5489f5(_0x2aed4d[_0x8d54('0x10')][_0x8d54('0x11')]);}else{logger[_0x8d54('0x12')](_0x8d54('0xa'),_0x3c35b0,'request\x20sent');_0x5489f5(_0x2aed4d[_0x8d54('0x13')][_0x8d54('0x11')]);}})[_0x8d54('0x14')](function(_0x23303c){logger[_0x8d54('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3c35b0,_0x23303c);_0x2b4096(_0x23303c);});});}