b0bb0ad1e236ed97432a9673e81986586ca578b8
[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 _0x3885=['ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x199558,_0x2cf6a6){var _0x4d7c0e=function(_0x3baed3){while(--_0x3baed3){_0x199558['push'](_0x199558['shift']());}};_0x4d7c0e(++_0x2cf6a6);}(_0x3885,0x1c2));var _0x5388=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3885[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5388('0x0'));var util=require('util');var moment=require(_0x5388('0x1'));var BPromise=require(_0x5388('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5388('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5388('0x4'));var logger=require(_0x5388('0x5'))(_0x5388('0x6'));var config=require(_0x5388('0x7'));var jayson=require(_0x5388('0x8'));var client=jayson['client'][_0x5388('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10f3f9,_0x539073,_0x35b908){return new BPromise(function(_0x39b584,_0x341bba){return client['request'](_0x10f3f9,_0x35b908)[_0x5388('0xa')](function(_0x4479ef){logger[_0x5388('0xb')](_0x5388('0xc'),_0x539073,'request\x20sent');logger['debug'](_0x5388('0xd'),_0x539073,'request\x20sent',JSON[_0x5388('0xe')](_0x4479ef));if(_0x4479ef[_0x5388('0xf')]){if(_0x4479ef[_0x5388('0xf')][_0x5388('0x10')]===0x1f4){logger[_0x5388('0xf')](_0x5388('0xc'),_0x539073,_0x4479ef['error']['message']);return _0x341bba(_0x4479ef[_0x5388('0xf')][_0x5388('0x11')]);}logger[_0x5388('0xf')](_0x5388('0xc'),_0x539073,_0x4479ef[_0x5388('0xf')][_0x5388('0x11')]);return _0x39b584(_0x4479ef[_0x5388('0xf')][_0x5388('0x11')]);}else{logger[_0x5388('0xb')](_0x5388('0xc'),_0x539073,_0x5388('0x12'));_0x39b584(_0x4479ef[_0x5388('0x13')][_0x5388('0x11')]);}})[_0x5388('0x14')](function(_0x24ea90){logger['error'](_0x5388('0xc'),_0x539073,_0x24ea90);_0x341bba(_0x24ea90);});});}