Built motion from commit (unavailable).|2.5.19
[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 _0xda6f=['client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xda6f,0x195));var _0xfda6=function(_0x1158b0,_0x5f50c3){_0x1158b0=_0x1158b0-0x0;var _0x42fad3=_0xda6f[_0x1158b0];return _0x42fad3;};'use strict';var _=require('lodash');var util=require(_0xfda6('0x0'));var moment=require(_0xfda6('0x1'));var BPromise=require(_0xfda6('0x2'));var rs=require(_0xfda6('0x3'));var fs=require('fs');var Redis=require(_0xfda6('0x4'));var db=require(_0xfda6('0x5'))['db'];var utils=require(_0xfda6('0x6'));var logger=require(_0xfda6('0x7'))('rpc');var config=require(_0xfda6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfda6('0x9')][_0xfda6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8b52,_0xcb561d,_0x52a05a){return new BPromise(function(_0x34a931,_0x372417){return client[_0xfda6('0xb')](_0x2b8b52,_0x52a05a)[_0xfda6('0xc')](function(_0x3e39d7){logger[_0xfda6('0xd')](_0xfda6('0xe'),_0xcb561d,_0xfda6('0xf'));logger[_0xfda6('0x10')](_0xfda6('0x11'),_0xcb561d,_0xfda6('0xf'),JSON[_0xfda6('0x12')](_0x3e39d7));if(_0x3e39d7[_0xfda6('0x13')]){if(_0x3e39d7['error']['code']===0x1f4){logger[_0xfda6('0x13')](_0xfda6('0xe'),_0xcb561d,_0x3e39d7[_0xfda6('0x13')][_0xfda6('0x14')]);return _0x372417(_0x3e39d7[_0xfda6('0x13')][_0xfda6('0x14')]);}logger[_0xfda6('0x13')](_0xfda6('0xe'),_0xcb561d,_0x3e39d7[_0xfda6('0x13')][_0xfda6('0x14')]);return _0x34a931(_0x3e39d7[_0xfda6('0x13')][_0xfda6('0x14')]);}else{logger[_0xfda6('0xd')](_0xfda6('0xe'),_0xcb561d,'request\x20sent');_0x34a931(_0x3e39d7[_0xfda6('0x15')]['message']);}})[_0xfda6('0x16')](function(_0x4444ea){logger[_0xfda6('0x13')](_0xfda6('0xe'),_0xcb561d,_0x4444ea);_0x372417(_0x4444ea);});});}