Built motion from commit d9028345.|2.5.43
[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=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring'];(function(_0x302932,_0x286093){var _0x4a3309=function(_0x31d673){while(--_0x31d673){_0x302932['push'](_0x302932['shift']());}};_0x4a3309(++_0x286093);}(_0x3885,0x10e));var _0x5388=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3885[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5388('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5388('0x1'));var rs=require(_0x5388('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5388('0x3'))['db'];var utils=require(_0x5388('0x4'));var logger=require('../../config/logger')(_0x5388('0x5'));var config=require('../../config/environment');var jayson=require(_0x5388('0x6'));var client=jayson[_0x5388('0x7')][_0x5388('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1082e,_0x230fd3,_0x69bd94){return new BPromise(function(_0x389221,_0x1eee24){return client[_0x5388('0x9')](_0xe1082e,_0x69bd94)[_0x5388('0xa')](function(_0x545998){logger[_0x5388('0xb')](_0x5388('0xc'),_0x230fd3,'request\x20sent');logger[_0x5388('0xd')](_0x5388('0xe'),_0x230fd3,_0x5388('0xf'),JSON[_0x5388('0x10')](_0x545998));if(_0x545998[_0x5388('0x11')]){if(_0x545998[_0x5388('0x11')]['code']===0x1f4){logger[_0x5388('0x11')](_0x5388('0xc'),_0x230fd3,_0x545998[_0x5388('0x11')][_0x5388('0x12')]);return _0x1eee24(_0x545998[_0x5388('0x11')][_0x5388('0x12')]);}logger[_0x5388('0x11')](_0x5388('0xc'),_0x230fd3,_0x545998['error'][_0x5388('0x12')]);return _0x389221(_0x545998['error']['message']);}else{logger[_0x5388('0xb')](_0x5388('0xc'),_0x230fd3,'request\x20sent');_0x389221(_0x545998[_0x5388('0x13')][_0x5388('0x12')]);}})[_0x5388('0x14')](function(_0x3c0e77){logger[_0x5388('0x11')](_0x5388('0xc'),_0x230fd3,_0x3c0e77);_0x1eee24(_0x3c0e77);});});}