54e2808ac957c9c2977dd7c845d292a582dc4fee
[motion2.git] / server / api / intServicenowConfiguration / intServicenowConfiguration.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 _0xb578=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x313d69,_0x5d092a){var _0x4f2598=function(_0x4293ae){while(--_0x4293ae){_0x313d69['push'](_0x313d69['shift']());}};_0x4f2598(++_0x5d092a);}(_0xb578,0xfc));var _0x8b57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb578[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8b57('0x0'));var util=require(_0x8b57('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8b57('0x2'));var fs=require('fs');var Redis=require(_0x8b57('0x3'));var db=require(_0x8b57('0x4'))['db'];var utils=require(_0x8b57('0x5'));var logger=require(_0x8b57('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b57('0x7'));var client=jayson['client'][_0x8b57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfb46b8,_0x364864,_0xbf48a1){return new BPromise(function(_0x18bfc1,_0x232a3c){return client[_0x8b57('0x9')](_0xfb46b8,_0xbf48a1)[_0x8b57('0xa')](function(_0xefc040){logger['info'](_0x8b57('0xb'),_0x364864,_0x8b57('0xc'));logger[_0x8b57('0xd')](_0x8b57('0xe'),_0x364864,_0x8b57('0xc'),JSON['stringify'](_0xefc040));if(_0xefc040[_0x8b57('0xf')]){if(_0xefc040[_0x8b57('0xf')]['code']===0x1f4){logger[_0x8b57('0xf')](_0x8b57('0xb'),_0x364864,_0xefc040[_0x8b57('0xf')][_0x8b57('0x10')]);return _0x232a3c(_0xefc040[_0x8b57('0xf')][_0x8b57('0x10')]);}logger[_0x8b57('0xf')](_0x8b57('0xb'),_0x364864,_0xefc040[_0x8b57('0xf')]['message']);return _0x18bfc1(_0xefc040['error'][_0x8b57('0x10')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x364864,_0x8b57('0xc'));_0x18bfc1(_0xefc040[_0x8b57('0x11')][_0x8b57('0x10')]);}})[_0x8b57('0x12')](function(_0x16f210){logger[_0x8b57('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x364864,_0x16f210);_0x232a3c(_0x16f210);});});}