Built motion from commit (unavailable).|2.4.18
[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 _0xe667=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e3d0f,_0x91f49){var _0x482801=function(_0x556d7b){while(--_0x556d7b){_0x1e3d0f['push'](_0x1e3d0f['shift']());}};_0x482801(++_0x91f49);}(_0xe667,0x79));var _0x7e66=function(_0x4ff3d1,_0x4cb2fa){_0x4ff3d1=_0x4ff3d1-0x0;var _0x375e59=_0xe667[_0x4ff3d1];return _0x375e59;};'use strict';var _=require(_0x7e66('0x0'));var util=require(_0x7e66('0x1'));var moment=require(_0x7e66('0x2'));var BPromise=require(_0x7e66('0x3'));var rs=require(_0x7e66('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e66('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e66('0x6'))('rpc');var config=require(_0x7e66('0x7'));var jayson=require(_0x7e66('0x8'));var client=jayson[_0x7e66('0x9')][_0x7e66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db444,_0x2a239d,_0x3741ae){return new BPromise(function(_0x4e7f32,_0x34e1d9){return client[_0x7e66('0xb')](_0x2db444,_0x3741ae)[_0x7e66('0xc')](function(_0x5207ee){logger[_0x7e66('0xd')](_0x7e66('0xe'),_0x2a239d,_0x7e66('0xf'));logger[_0x7e66('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2a239d,'request\x20sent',JSON[_0x7e66('0x11')](_0x5207ee));if(_0x5207ee[_0x7e66('0x12')]){if(_0x5207ee['error'][_0x7e66('0x13')]===0x1f4){logger[_0x7e66('0x12')](_0x7e66('0xe'),_0x2a239d,_0x5207ee[_0x7e66('0x12')][_0x7e66('0x14')]);return _0x34e1d9(_0x5207ee[_0x7e66('0x12')][_0x7e66('0x14')]);}logger['error'](_0x7e66('0xe'),_0x2a239d,_0x5207ee['error']['message']);return _0x4e7f32(_0x5207ee[_0x7e66('0x12')]['message']);}else{logger['info'](_0x7e66('0xe'),_0x2a239d,_0x7e66('0xf'));_0x4e7f32(_0x5207ee[_0x7e66('0x15')][_0x7e66('0x14')]);}})[_0x7e66('0x16')](function(_0x551dea){logger[_0x7e66('0x12')](_0x7e66('0xe'),_0x2a239d,_0x551dea);_0x34e1d9(_0x551dea);});});}