ab386578c6e638edde8f877cd024d2eff0392913
[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 _0xa299=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x77538f,_0x3a6649){var _0x27c63f=function(_0x2176f6){while(--_0x2176f6){_0x77538f['push'](_0x77538f['shift']());}};_0x27c63f(++_0x3a6649);}(_0xa299,0xe3));var _0x9a29=function(_0x3cdcd1,_0x30c965){_0x3cdcd1=_0x3cdcd1-0x0;var _0x5ef8bb=_0xa299[_0x3cdcd1];return _0x5ef8bb;};'use strict';var _=require(_0x9a29('0x0'));var util=require(_0x9a29('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a29('0x2'));var fs=require('fs');var Redis=require(_0x9a29('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a29('0x4'));var logger=require(_0x9a29('0x5'))(_0x9a29('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a29('0x7'));var client=jayson[_0x9a29('0x8')][_0x9a29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ef3ba,_0x183775,_0x58954f){return new BPromise(function(_0x34f2e6,_0x291afa){return client[_0x9a29('0xa')](_0x3ef3ba,_0x58954f)[_0x9a29('0xb')](function(_0x2186e9){logger[_0x9a29('0xc')](_0x9a29('0xd'),_0x183775,_0x9a29('0xe'));logger[_0x9a29('0xf')](_0x9a29('0x10'),_0x183775,'request\x20sent',JSON[_0x9a29('0x11')](_0x2186e9));if(_0x2186e9[_0x9a29('0x12')]){if(_0x2186e9[_0x9a29('0x12')]['code']===0x1f4){logger[_0x9a29('0x12')](_0x9a29('0xd'),_0x183775,_0x2186e9['error']['message']);return _0x291afa(_0x2186e9[_0x9a29('0x12')][_0x9a29('0x13')]);}logger[_0x9a29('0x12')](_0x9a29('0xd'),_0x183775,_0x2186e9[_0x9a29('0x12')][_0x9a29('0x13')]);return _0x34f2e6(_0x2186e9[_0x9a29('0x12')][_0x9a29('0x13')]);}else{logger[_0x9a29('0xc')](_0x9a29('0xd'),_0x183775,_0x9a29('0xe'));_0x34f2e6(_0x2186e9[_0x9a29('0x14')][_0x9a29('0x13')]);}})[_0x9a29('0x15')](function(_0x2a941e){logger[_0x9a29('0x12')](_0x9a29('0xd'),_0x183775,_0x2a941e);_0x291afa(_0x2a941e);});});}