Built motion from commit 44377920.|2.6.11
[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 _0xad1c=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad1c,0x1c8));var _0xcad1=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xad1c[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xcad1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcad1('0x1'));var fs=require('fs');var Redis=require(_0xcad1('0x2'));var db=require(_0xcad1('0x3'))['db'];var utils=require(_0xcad1('0x4'));var logger=require(_0xcad1('0x5'))(_0xcad1('0x6'));var config=require('../../config/environment');var jayson=require(_0xcad1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57dafe,_0x192649,_0x5d78d3){return new BPromise(function(_0x1ef1e3,_0x1ea1d8){return client['request'](_0x57dafe,_0x5d78d3)[_0xcad1('0x8')](function(_0x54132d){logger[_0xcad1('0x9')](_0xcad1('0xa'),_0x192649,_0xcad1('0xb'));logger[_0xcad1('0xc')](_0xcad1('0xd'),_0x192649,_0xcad1('0xb'),JSON['stringify'](_0x54132d));if(_0x54132d[_0xcad1('0xe')]){if(_0x54132d['error']['code']===0x1f4){logger['error'](_0xcad1('0xa'),_0x192649,_0x54132d['error'][_0xcad1('0xf')]);return _0x1ea1d8(_0x54132d['error'][_0xcad1('0xf')]);}logger[_0xcad1('0xe')](_0xcad1('0xa'),_0x192649,_0x54132d['error'][_0xcad1('0xf')]);return _0x1ef1e3(_0x54132d['error']['message']);}else{logger[_0xcad1('0x9')](_0xcad1('0xa'),_0x192649,_0xcad1('0xb'));_0x1ef1e3(_0x54132d[_0xcad1('0x10')]['message']);}})[_0xcad1('0x11')](function(_0x1c9ceb){logger[_0xcad1('0xe')](_0xcad1('0xa'),_0x192649,_0x1c9ceb);_0x1ea1d8(_0x1c9ceb);});});}