Built motion from commit (unavailable).|2.2.0
[motion2.git] / server / api / license / license.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 _0xa5e6=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','License,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa5e6,0x1be));var _0x6a5e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa5e6[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x6a5e('0x0'));var util=require(_0x6a5e('0x1'));var moment=require(_0x6a5e('0x2'));var BPromise=require(_0x6a5e('0x3'));var rs=require(_0x6a5e('0x4'));var fs=require('fs');var Redis=require(_0x6a5e('0x5'));var db=require(_0x6a5e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a5e('0x7'))('rpc');var config=require(_0x6a5e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a5e('0x9')][_0x6a5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a4f6,_0x280824,_0x251174){return new BPromise(function(_0x5666c8,_0xf93968){return client[_0x6a5e('0xb')](_0x13a4f6,_0x251174)[_0x6a5e('0xc')](function(_0x4a19c0){logger['info'](_0x6a5e('0xd'),_0x280824,_0x6a5e('0xe'));logger[_0x6a5e('0xf')](_0x6a5e('0x10'),_0x280824,_0x6a5e('0xe'),JSON[_0x6a5e('0x11')](_0x4a19c0));if(_0x4a19c0[_0x6a5e('0x12')]){if(_0x4a19c0[_0x6a5e('0x12')]['code']===0x1f4){logger[_0x6a5e('0x12')]('License,\x20%s,\x20%s',_0x280824,_0x4a19c0[_0x6a5e('0x12')][_0x6a5e('0x13')]);return _0xf93968(_0x4a19c0[_0x6a5e('0x12')]['message']);}logger[_0x6a5e('0x12')](_0x6a5e('0xd'),_0x280824,_0x4a19c0[_0x6a5e('0x12')][_0x6a5e('0x13')]);return _0x5666c8(_0x4a19c0[_0x6a5e('0x12')][_0x6a5e('0x13')]);}else{logger[_0x6a5e('0x14')](_0x6a5e('0xd'),_0x280824,_0x6a5e('0xe'));_0x5666c8(_0x4a19c0[_0x6a5e('0x15')]['message']);}})[_0x6a5e('0x16')](function(_0x1a0690){logger[_0x6a5e('0x12')]('License,\x20%s,\x20%s',_0x280824,_0x1a0690);_0xf93968(_0x1a0690);});});}