Built motion from commit fda31434.|2.5.44
[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 _0x30b3=['http','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2484ad,_0x1b7050){var _0x432e28=function(_0x22dbc4){while(--_0x22dbc4){_0x2484ad['push'](_0x2484ad['shift']());}};_0x432e28(++_0x1b7050);}(_0x30b3,0x1c4));var _0x330b=function(_0x39b316,_0x3def1e){_0x39b316=_0x39b316-0x0;var _0x182ab1=_0x30b3[_0x39b316];return _0x182ab1;};'use strict';var _=require('lodash');var util=require(_0x330b('0x0'));var moment=require('moment');var BPromise=require(_0x330b('0x1'));var rs=require(_0x330b('0x2'));var fs=require('fs');var Redis=require(_0x330b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x330b('0x4'));var logger=require(_0x330b('0x5'))(_0x330b('0x6'));var config=require(_0x330b('0x7'));var jayson=require(_0x330b('0x8'));var client=jayson[_0x330b('0x9')][_0x330b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d23e0,_0x46e078,_0xdb0025){return new BPromise(function(_0x4eea77,_0x2b5de1){return client[_0x330b('0xb')](_0x4d23e0,_0xdb0025)['then'](function(_0x2df215){logger['info'](_0x330b('0xc'),_0x46e078,_0x330b('0xd'));logger[_0x330b('0xe')](_0x330b('0xf'),_0x46e078,'request\x20sent',JSON[_0x330b('0x10')](_0x2df215));if(_0x2df215[_0x330b('0x11')]){if(_0x2df215[_0x330b('0x11')][_0x330b('0x12')]===0x1f4){logger[_0x330b('0x11')](_0x330b('0xc'),_0x46e078,_0x2df215[_0x330b('0x11')][_0x330b('0x13')]);return _0x2b5de1(_0x2df215['error']['message']);}logger[_0x330b('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x46e078,_0x2df215[_0x330b('0x11')][_0x330b('0x13')]);return _0x4eea77(_0x2df215[_0x330b('0x11')]['message']);}else{logger['info'](_0x330b('0xc'),_0x46e078,_0x330b('0xd'));_0x4eea77(_0x2df215[_0x330b('0x14')][_0x330b('0x13')]);}})[_0x330b('0x15')](function(_0x3c5b74){logger[_0x330b('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x46e078,_0x3c5b74);_0x2b5de1(_0x3c5b74);});});}