Built motion from commit 5293bb2a.|2.6.30
[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 _0x1ccb=['result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3f7e8b,_0x7291d1){var _0x4eb892=function(_0x4ed54e){while(--_0x4ed54e){_0x3f7e8b['push'](_0x3f7e8b['shift']());}};_0x4eb892(++_0x7291d1);}(_0x1ccb,0x105));var _0xb1cc=function(_0x4552a7,_0x180e56){_0x4552a7=_0x4552a7-0x0;var _0x130232=_0x1ccb[_0x4552a7];return _0x130232;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb1cc('0x0'));var BPromise=require(_0xb1cc('0x1'));var rs=require(_0xb1cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1cc('0x3'))['db'];var utils=require(_0xb1cc('0x4'));var logger=require(_0xb1cc('0x5'))('rpc');var config=require(_0xb1cc('0x6'));var jayson=require(_0xb1cc('0x7'));var client=jayson[_0xb1cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5062c1,_0xba68c9,_0x8a7855){return new BPromise(function(_0x1028d5,_0x173bbd){return client[_0xb1cc('0x9')](_0x5062c1,_0x8a7855)[_0xb1cc('0xa')](function(_0x33d3a3){logger['info'](_0xb1cc('0xb'),_0xba68c9,_0xb1cc('0xc'));logger[_0xb1cc('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xba68c9,_0xb1cc('0xc'),JSON[_0xb1cc('0xe')](_0x33d3a3));if(_0x33d3a3[_0xb1cc('0xf')]){if(_0x33d3a3[_0xb1cc('0xf')][_0xb1cc('0x10')]===0x1f4){logger[_0xb1cc('0xf')](_0xb1cc('0xb'),_0xba68c9,_0x33d3a3[_0xb1cc('0xf')][_0xb1cc('0x11')]);return _0x173bbd(_0x33d3a3[_0xb1cc('0xf')][_0xb1cc('0x11')]);}logger[_0xb1cc('0xf')](_0xb1cc('0xb'),_0xba68c9,_0x33d3a3['error'][_0xb1cc('0x11')]);return _0x1028d5(_0x33d3a3['error'][_0xb1cc('0x11')]);}else{logger[_0xb1cc('0x12')](_0xb1cc('0xb'),_0xba68c9,_0xb1cc('0xc'));_0x1028d5(_0x33d3a3[_0xb1cc('0x13')][_0xb1cc('0x11')]);}})['catch'](function(_0x232ad3){logger[_0xb1cc('0xf')](_0xb1cc('0xb'),_0xba68c9,_0x232ad3);_0x173bbd(_0x232ad3);});});}