33c4939577e313ee4ecb6f5fee2926213164c0b7
[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 _0x448c=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x498743,_0x32572e){var _0x5acc2d=function(_0x267a30){while(--_0x267a30){_0x498743['push'](_0x498743['shift']());}};_0x5acc2d(++_0x32572e);}(_0x448c,0xca));var _0xc448=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x448c[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xc448('0x0'));var util=require(_0xc448('0x1'));var moment=require(_0xc448('0x2'));var BPromise=require(_0xc448('0x3'));var rs=require(_0xc448('0x4'));var fs=require('fs');var Redis=require(_0xc448('0x5'));var db=require(_0xc448('0x6'))['db'];var utils=require(_0xc448('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc448('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc448('0x9')][_0xc448('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3364b4,_0x47756b,_0x435227){return new BPromise(function(_0x2185b5,_0x1c4f05){return client[_0xc448('0xb')](_0x3364b4,_0x435227)[_0xc448('0xc')](function(_0x1433df){logger[_0xc448('0xd')](_0xc448('0xe'),_0x47756b,_0xc448('0xf'));logger[_0xc448('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x47756b,_0xc448('0xf'),JSON['stringify'](_0x1433df));if(_0x1433df[_0xc448('0x11')]){if(_0x1433df[_0xc448('0x11')][_0xc448('0x12')]===0x1f4){logger[_0xc448('0x11')]('License,\x20%s,\x20%s',_0x47756b,_0x1433df[_0xc448('0x11')][_0xc448('0x13')]);return _0x1c4f05(_0x1433df[_0xc448('0x11')][_0xc448('0x13')]);}logger[_0xc448('0x11')]('License,\x20%s,\x20%s',_0x47756b,_0x1433df[_0xc448('0x11')]['message']);return _0x2185b5(_0x1433df['error'][_0xc448('0x13')]);}else{logger['info']('License,\x20%s,\x20%s',_0x47756b,_0xc448('0xf'));_0x2185b5(_0x1433df[_0xc448('0x14')]['message']);}})[_0xc448('0x15')](function(_0x5353d0){logger[_0xc448('0x11')](_0xc448('0xe'),_0x47756b,_0x5353d0);_0x1c4f05(_0x5353d0);});});}