1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x4522=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4c902f,_0x50b8a5){var _0x4ba147=function(_0xa89aa4){while(--_0xa89aa4){_0x4c902f['push'](_0x4c902f['shift']());}};_0x4ba147(++_0x50b8a5);}(_0x4522,0xc0));var _0x2452=function(_0x3fbe87,_0x56c42e){_0x3fbe87=_0x3fbe87-0x0;var _0x219501=_0x4522[_0x3fbe87];return _0x219501;};'use strict';var _=require(_0x2452('0x0'));var util=require(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require(_0x2452('0x3'));var rs=require(_0x2452('0x4'));var fs=require('fs');var Redis=require(_0x2452('0x5'));var db=require(_0x2452('0x6'))['db'];var utils=require(_0x2452('0x7'));var logger=require(_0x2452('0x8'))(_0x2452('0x9'));var config=require(_0x2452('0xa'));var jayson=require(_0x2452('0xb'));var client=jayson[_0x2452('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2582,_0x1e1b9c,_0x12256c){return new BPromise(function(_0x1c00c2,_0x389ddc){return client['request'](_0x5b2582,_0x12256c)['then'](function(_0xb13823){logger[_0x2452('0xd')](_0x2452('0xe'),_0x1e1b9c,'request\x20sent');logger['debug'](_0x2452('0xf'),_0x1e1b9c,'request\x20sent',JSON['stringify'](_0xb13823));if(_0xb13823[_0x2452('0x10')]){if(_0xb13823['error']['code']===0x1f4){logger['error'](_0x2452('0xe'),_0x1e1b9c,_0xb13823['error'][_0x2452('0x11')]);return _0x389ddc(_0xb13823[_0x2452('0x10')][_0x2452('0x11')]);}logger[_0x2452('0x10')](_0x2452('0xe'),_0x1e1b9c,_0xb13823['error'][_0x2452('0x11')]);return _0x1c00c2(_0xb13823[_0x2452('0x10')][_0x2452('0x11')]);}else{logger[_0x2452('0xd')](_0x2452('0xe'),_0x1e1b9c,'request\x20sent');_0x1c00c2(_0xb13823['result'][_0x2452('0x11')]);}})['catch'](function(_0x25a1ae){logger['error']('ServicenowField,\x20%s,\x20%s',_0x1e1b9c,_0x25a1ae);_0x389ddc(_0x25a1ae);});});}