Built motion from commit 753c950e.|2.5.42
[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 _0x60b1=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x289a56,_0x1d3256){var _0x3e9c3e=function(_0x3a4bfc){while(--_0x3a4bfc){_0x289a56['push'](_0x289a56['shift']());}};_0x3e9c3e(++_0x1d3256);}(_0x60b1,0x116));var _0x160b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x60b1[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x160b('0x0'));var util=require(_0x160b('0x1'));var moment=require(_0x160b('0x2'));var BPromise=require('bluebird');var rs=require(_0x160b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x160b('0x4'))['db'];var utils=require(_0x160b('0x5'));var logger=require('../../config/logger')(_0x160b('0x6'));var config=require(_0x160b('0x7'));var jayson=require(_0x160b('0x8'));var client=jayson[_0x160b('0x9')][_0x160b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbd88cc,_0x5af5e4,_0x1ee53c){return new BPromise(function(_0x5dde78,_0x400646){return client['request'](_0xbd88cc,_0x1ee53c)[_0x160b('0xb')](function(_0x2bec35){logger[_0x160b('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5af5e4,_0x160b('0xd'));logger['debug'](_0x160b('0xe'),_0x5af5e4,'request\x20sent',JSON['stringify'](_0x2bec35));if(_0x2bec35[_0x160b('0xf')]){if(_0x2bec35[_0x160b('0xf')][_0x160b('0x10')]===0x1f4){logger[_0x160b('0xf')](_0x160b('0x11'),_0x5af5e4,_0x2bec35[_0x160b('0xf')]['message']);return _0x400646(_0x2bec35[_0x160b('0xf')][_0x160b('0x12')]);}logger[_0x160b('0xf')](_0x160b('0x11'),_0x5af5e4,_0x2bec35[_0x160b('0xf')][_0x160b('0x12')]);return _0x5dde78(_0x2bec35[_0x160b('0xf')][_0x160b('0x12')]);}else{logger[_0x160b('0xc')](_0x160b('0x11'),_0x5af5e4,_0x160b('0xd'));_0x5dde78(_0x2bec35['result'][_0x160b('0x12')]);}})[_0x160b('0x13')](function(_0x2da3ff){logger[_0x160b('0xf')](_0x160b('0x11'),_0x5af5e4,_0x2da3ff);_0x400646(_0x2da3ff);});});}