Built motion from commit (unavailable).|2.5.23
[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 _0x2ef5=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x47c309,_0x54c00e){var _0x328593=function(_0x787f16){while(--_0x787f16){_0x47c309['push'](_0x47c309['shift']());}};_0x328593(++_0x54c00e);}(_0x2ef5,0x10c));var _0x52ef=function(_0x59c693,_0x1c5324){_0x59c693=_0x59c693-0x0;var _0x3853af=_0x2ef5[_0x59c693];return _0x3853af;};'use strict';var _=require(_0x52ef('0x0'));var util=require('util');var moment=require(_0x52ef('0x1'));var BPromise=require(_0x52ef('0x2'));var rs=require(_0x52ef('0x3'));var fs=require('fs');var Redis=require(_0x52ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x52ef('0x5'));var logger=require(_0x52ef('0x6'))(_0x52ef('0x7'));var config=require('../../config/environment');var jayson=require(_0x52ef('0x8'));var client=jayson[_0x52ef('0x9')][_0x52ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x83e645,_0xb1d953,_0x5be9d8){return new BPromise(function(_0x3ea44e,_0x28e17e){return client[_0x52ef('0xb')](_0x83e645,_0x5be9d8)[_0x52ef('0xc')](function(_0x2b4b68){logger[_0x52ef('0xd')](_0x52ef('0xe'),_0xb1d953,_0x52ef('0xf'));logger['debug'](_0x52ef('0x10'),_0xb1d953,_0x52ef('0xf'),JSON[_0x52ef('0x11')](_0x2b4b68));if(_0x2b4b68[_0x52ef('0x12')]){if(_0x2b4b68['error']['code']===0x1f4){logger[_0x52ef('0x12')](_0x52ef('0xe'),_0xb1d953,_0x2b4b68[_0x52ef('0x12')]['message']);return _0x28e17e(_0x2b4b68[_0x52ef('0x12')][_0x52ef('0x13')]);}logger[_0x52ef('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0xb1d953,_0x2b4b68[_0x52ef('0x12')]['message']);return _0x3ea44e(_0x2b4b68[_0x52ef('0x12')][_0x52ef('0x13')]);}else{logger[_0x52ef('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0xb1d953,_0x52ef('0xf'));_0x3ea44e(_0x2b4b68['result'][_0x52ef('0x13')]);}})['catch'](function(_0x12c3a8){logger[_0x52ef('0x12')](_0x52ef('0xe'),_0xb1d953,_0x12c3a8);_0x28e17e(_0x12c3a8);});});}