Built motion from commit 3c2ce842.|2.6.31
[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 _0x5c7c=['rpc','client','http','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4759ac,_0x16651a){var _0xae0e15=function(_0x1e2fec){while(--_0x1e2fec){_0x4759ac['push'](_0x4759ac['shift']());}};_0xae0e15(++_0x16651a);}(_0x5c7c,0x172));var _0xc5c7=function(_0x68a64c,_0x4fa1e1){_0x68a64c=_0x68a64c-0x0;var _0x3acf1f=_0x5c7c[_0x68a64c];return _0x3acf1f;};'use strict';var _=require(_0xc5c7('0x0'));var util=require(_0xc5c7('0x1'));var moment=require(_0xc5c7('0x2'));var BPromise=require(_0xc5c7('0x3'));var rs=require(_0xc5c7('0x4'));var fs=require('fs');var Redis=require(_0xc5c7('0x5'));var db=require(_0xc5c7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5c7('0x7'))(_0xc5c7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5c7('0x9')][_0xc5c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59e252,_0x393fc7,_0x1714a0){return new BPromise(function(_0x35f991,_0x43520f){return client['request'](_0x59e252,_0x1714a0)[_0xc5c7('0xb')](function(_0xb6831f){logger['info'](_0xc5c7('0xc'),_0x393fc7,_0xc5c7('0xd'));logger[_0xc5c7('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x393fc7,'request\x20sent',JSON['stringify'](_0xb6831f));if(_0xb6831f[_0xc5c7('0xf')]){if(_0xb6831f[_0xc5c7('0xf')]['code']===0x1f4){logger[_0xc5c7('0xf')](_0xc5c7('0xc'),_0x393fc7,_0xb6831f[_0xc5c7('0xf')][_0xc5c7('0x10')]);return _0x43520f(_0xb6831f[_0xc5c7('0xf')][_0xc5c7('0x10')]);}logger[_0xc5c7('0xf')](_0xc5c7('0xc'),_0x393fc7,_0xb6831f['error'][_0xc5c7('0x10')]);return _0x35f991(_0xb6831f[_0xc5c7('0xf')]['message']);}else{logger['info'](_0xc5c7('0xc'),_0x393fc7,_0xc5c7('0xd'));_0x35f991(_0xb6831f[_0xc5c7('0x11')][_0xc5c7('0x10')]);}})['catch'](function(_0x2552ef){logger[_0xc5c7('0xf')](_0xc5c7('0xc'),_0x393fc7,_0x2552ef);_0x43520f(_0x2552ef);});});}