20a4b07025b29dab18a3ca9f3678fa641acfa35b
[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 _0x350d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x398d85,_0x2465d7){var _0x33c2bb=function(_0x4aa229){while(--_0x4aa229){_0x398d85['push'](_0x398d85['shift']());}};_0x33c2bb(++_0x2465d7);}(_0x350d,0x165));var _0xd350=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x350d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd350('0x0'));var moment=require('moment');var BPromise=require(_0xd350('0x1'));var rs=require(_0xd350('0x2'));var fs=require('fs');var Redis=require(_0xd350('0x3'));var db=require(_0xd350('0x4'))['db'];var utils=require(_0xd350('0x5'));var logger=require(_0xd350('0x6'))(_0xd350('0x7'));var config=require(_0xd350('0x8'));var jayson=require(_0xd350('0x9'));var client=jayson[_0xd350('0xa')][_0xd350('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xef0685,_0x9ce623,_0x1ce833){return new BPromise(function(_0x3d9cc9,_0x28ed45){return client['request'](_0xef0685,_0x1ce833)[_0xd350('0xc')](function(_0x392e45){logger[_0xd350('0xd')](_0xd350('0xe'),_0x9ce623,_0xd350('0xf'));logger[_0xd350('0x10')](_0xd350('0x11'),_0x9ce623,'request\x20sent',JSON[_0xd350('0x12')](_0x392e45));if(_0x392e45[_0xd350('0x13')]){if(_0x392e45[_0xd350('0x13')][_0xd350('0x14')]===0x1f4){logger[_0xd350('0x13')](_0xd350('0xe'),_0x9ce623,_0x392e45[_0xd350('0x13')][_0xd350('0x15')]);return _0x28ed45(_0x392e45[_0xd350('0x13')][_0xd350('0x15')]);}logger['error'](_0xd350('0xe'),_0x9ce623,_0x392e45[_0xd350('0x13')][_0xd350('0x15')]);return _0x3d9cc9(_0x392e45[_0xd350('0x13')][_0xd350('0x15')]);}else{logger[_0xd350('0xd')](_0xd350('0xe'),_0x9ce623,'request\x20sent');_0x3d9cc9(_0x392e45[_0xd350('0x16')][_0xd350('0x15')]);}})[_0xd350('0x17')](function(_0x4d411f){logger[_0xd350('0x13')](_0xd350('0xe'),_0x9ce623,_0x4d411f);_0x28ed45(_0x4d411f);});});}