24e7570476093e690aeb38fd40126addce821f59
[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 _0x286e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x523e71,_0x3554b2){var _0x324f32=function(_0x475b4f){while(--_0x475b4f){_0x523e71['push'](_0x523e71['shift']());}};_0x324f32(++_0x3554b2);}(_0x286e,0x124));var _0xe286=function(_0x26159c,_0x36fd8a){_0x26159c=_0x26159c-0x0;var _0xe9720d=_0x286e[_0x26159c];return _0xe9720d;};'use strict';var _=require('lodash');var util=require(_0xe286('0x0'));var moment=require('moment');var BPromise=require(_0xe286('0x1'));var rs=require(_0xe286('0x2'));var fs=require('fs');var Redis=require(_0xe286('0x3'));var db=require(_0xe286('0x4'))['db'];var utils=require(_0xe286('0x5'));var logger=require(_0xe286('0x6'))(_0xe286('0x7'));var config=require(_0xe286('0x8'));var jayson=require(_0xe286('0x9'));var client=jayson[_0xe286('0xa')][_0xe286('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e7102,_0x41c0b3,_0x478220){return new BPromise(function(_0x929d57,_0x45481b){return client[_0xe286('0xc')](_0x2e7102,_0x478220)[_0xe286('0xd')](function(_0x3375d7){logger[_0xe286('0xe')](_0xe286('0xf'),_0x41c0b3,'request\x20sent');logger[_0xe286('0x10')](_0xe286('0x11'),_0x41c0b3,_0xe286('0x12'),JSON['stringify'](_0x3375d7));if(_0x3375d7[_0xe286('0x13')]){if(_0x3375d7['error'][_0xe286('0x14')]===0x1f4){logger[_0xe286('0x13')](_0xe286('0xf'),_0x41c0b3,_0x3375d7['error'][_0xe286('0x15')]);return _0x45481b(_0x3375d7[_0xe286('0x13')][_0xe286('0x15')]);}logger['error'](_0xe286('0xf'),_0x41c0b3,_0x3375d7[_0xe286('0x13')][_0xe286('0x15')]);return _0x929d57(_0x3375d7[_0xe286('0x13')][_0xe286('0x15')]);}else{logger['info'](_0xe286('0xf'),_0x41c0b3,_0xe286('0x12'));_0x929d57(_0x3375d7[_0xe286('0x16')]['message']);}})['catch'](function(_0x358d33){logger[_0xe286('0x13')](_0xe286('0xf'),_0x41c0b3,_0x358d33);_0x45481b(_0x358d33);});});}