a6bc8646d7c6dd4075e3c888fd6c5c5b9a507df7
[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 _0xf111=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xf111,0x15b));var _0x1f11=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xf111[_0xcf4569];return _0x7fef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f11('0x0'));var BPromise=require(_0x1f11('0x1'));var rs=require(_0x1f11('0x2'));var fs=require('fs');var Redis=require(_0x1f11('0x3'));var db=require(_0x1f11('0x4'))['db'];var utils=require(_0x1f11('0x5'));var logger=require(_0x1f11('0x6'))(_0x1f11('0x7'));var config=require('../../config/environment');var jayson=require(_0x1f11('0x8'));var client=jayson[_0x1f11('0x9')][_0x1f11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f91de,_0x2fdfb6,_0x29d456){return new BPromise(function(_0x4fd816,_0x1995dc){return client['request'](_0x2f91de,_0x29d456)[_0x1f11('0xb')](function(_0x22e28c){logger[_0x1f11('0xc')](_0x1f11('0xd'),_0x2fdfb6,_0x1f11('0xe'));logger[_0x1f11('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x2fdfb6,_0x1f11('0xe'),JSON[_0x1f11('0x10')](_0x22e28c));if(_0x22e28c[_0x1f11('0x11')]){if(_0x22e28c[_0x1f11('0x11')][_0x1f11('0x12')]===0x1f4){logger[_0x1f11('0x11')]('License,\x20%s,\x20%s',_0x2fdfb6,_0x22e28c[_0x1f11('0x11')][_0x1f11('0x13')]);return _0x1995dc(_0x22e28c[_0x1f11('0x11')][_0x1f11('0x13')]);}logger[_0x1f11('0x11')](_0x1f11('0xd'),_0x2fdfb6,_0x22e28c[_0x1f11('0x11')][_0x1f11('0x13')]);return _0x4fd816(_0x22e28c[_0x1f11('0x11')]['message']);}else{logger[_0x1f11('0xc')](_0x1f11('0xd'),_0x2fdfb6,_0x1f11('0xe'));_0x4fd816(_0x22e28c[_0x1f11('0x14')]['message']);}})[_0x1f11('0x15')](function(_0x5a55f0){logger[_0x1f11('0x11')]('License,\x20%s,\x20%s',_0x2fdfb6,_0x5a55f0);_0x1995dc(_0x5a55f0);});});}