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 _0xcc98=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xcc98,0x180));var _0x8cc9=function(_0x32a1ee,_0x3373b9){_0x32a1ee=_0x32a1ee-0x0;var _0x2c8083=_0xcc98[_0x32a1ee];return _0x2c8083;};'use strict';var _=require(_0x8cc9('0x0'));var util=require(_0x8cc9('0x1'));var moment=require('moment');var BPromise=require(_0x8cc9('0x2'));var rs=require(_0x8cc9('0x3'));var fs=require('fs');var Redis=require(_0x8cc9('0x4'));var db=require(_0x8cc9('0x5'))['db'];var utils=require(_0x8cc9('0x6'));var logger=require(_0x8cc9('0x7'))(_0x8cc9('0x8'));var config=require(_0x8cc9('0x9'));var jayson=require(_0x8cc9('0xa'));var client=jayson[_0x8cc9('0xb')][_0x8cc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d42c1,_0x44f1b5,_0x34e5a2){return new BPromise(function(_0x219eb0,_0x47ad21){return client[_0x8cc9('0xd')](_0x1d42c1,_0x34e5a2)[_0x8cc9('0xe')](function(_0x557c5d){logger[_0x8cc9('0xf')](_0x8cc9('0x10'),_0x44f1b5,_0x8cc9('0x11'));logger[_0x8cc9('0x12')](_0x8cc9('0x13'),_0x44f1b5,_0x8cc9('0x11'),JSON[_0x8cc9('0x14')](_0x557c5d));if(_0x557c5d[_0x8cc9('0x15')]){if(_0x557c5d[_0x8cc9('0x15')]['code']===0x1f4){logger[_0x8cc9('0x15')](_0x8cc9('0x10'),_0x44f1b5,_0x557c5d[_0x8cc9('0x15')][_0x8cc9('0x16')]);return _0x47ad21(_0x557c5d[_0x8cc9('0x15')]['message']);}logger[_0x8cc9('0x15')](_0x8cc9('0x10'),_0x44f1b5,_0x557c5d['error'][_0x8cc9('0x16')]);return _0x219eb0(_0x557c5d[_0x8cc9('0x15')]['message']);}else{logger[_0x8cc9('0xf')](_0x8cc9('0x10'),_0x44f1b5,_0x8cc9('0x11'));_0x219eb0(_0x557c5d[_0x8cc9('0x17')]['message']);}})['catch'](function(_0x4b7019){logger[_0x8cc9('0x15')]('ServicenowConfiguration,\x20%s,\x20%s',_0x44f1b5,_0x4b7019);_0x47ad21(_0x4b7019);});});}