e88e4cef66fd3fcba047066e958423a58f275a2b
[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 _0x3fd8=['catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','code','License,\x20%s,\x20%s','error','message','result'];(function(_0x4451d3,_0x41168c){var _0x1def91=function(_0x19ffd8){while(--_0x19ffd8){_0x4451d3['push'](_0x4451d3['shift']());}};_0x1def91(++_0x41168c);}(_0x3fd8,0x14b));var _0x83fd=function(_0x412e82,_0x141780){_0x412e82=_0x412e82-0x0;var _0x211212=_0x3fd8[_0x412e82];return _0x211212;};'use strict';var _=require('lodash');var util=require(_0x83fd('0x0'));var moment=require(_0x83fd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83fd('0x2'));var db=require(_0x83fd('0x3'))['db'];var utils=require(_0x83fd('0x4'));var logger=require(_0x83fd('0x5'))('rpc');var config=require(_0x83fd('0x6'));var jayson=require(_0x83fd('0x7'));var client=jayson[_0x83fd('0x8')][_0x83fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe8dc52,_0x3bd394,_0x5ac094){return new BPromise(function(_0x1a7b01,_0x38ef73){return client[_0x83fd('0xa')](_0xe8dc52,_0x5ac094)[_0x83fd('0xb')](function(_0x5c6ab8){logger[_0x83fd('0xc')]('License,\x20%s,\x20%s',_0x3bd394,_0x83fd('0xd'));logger['debug'](_0x83fd('0xe'),_0x3bd394,_0x83fd('0xd'),JSON[_0x83fd('0xf')](_0x5c6ab8));if(_0x5c6ab8['error']){if(_0x5c6ab8['error'][_0x83fd('0x10')]===0x1f4){logger['error'](_0x83fd('0x11'),_0x3bd394,_0x5c6ab8[_0x83fd('0x12')][_0x83fd('0x13')]);return _0x38ef73(_0x5c6ab8[_0x83fd('0x12')][_0x83fd('0x13')]);}logger[_0x83fd('0x12')](_0x83fd('0x11'),_0x3bd394,_0x5c6ab8[_0x83fd('0x12')][_0x83fd('0x13')]);return _0x1a7b01(_0x5c6ab8['error'][_0x83fd('0x13')]);}else{logger[_0x83fd('0xc')](_0x83fd('0x11'),_0x3bd394,_0x83fd('0xd'));_0x1a7b01(_0x5c6ab8[_0x83fd('0x14')][_0x83fd('0x13')]);}})[_0x83fd('0x15')](function(_0x923329){logger[_0x83fd('0x12')](_0x83fd('0x11'),_0x3bd394,_0x923329);_0x38ef73(_0x923329);});});}