Built motion from commit (unavailable).|2.4.4
[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 _0x7a16=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a16,0x7f));var _0x67a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a16[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x67a1('0x0'));var moment=require(_0x67a1('0x1'));var BPromise=require(_0x67a1('0x2'));var rs=require(_0x67a1('0x3'));var fs=require('fs');var Redis=require(_0x67a1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67a1('0x5'))(_0x67a1('0x6'));var config=require(_0x67a1('0x7'));var jayson=require(_0x67a1('0x8'));var client=jayson[_0x67a1('0x9')][_0x67a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17d159,_0x1b674b,_0x25c62d){return new BPromise(function(_0x34a7b5,_0xee43f6){return client[_0x67a1('0xb')](_0x17d159,_0x25c62d)[_0x67a1('0xc')](function(_0x4f08bc){logger[_0x67a1('0xd')](_0x67a1('0xe'),_0x1b674b,'request\x20sent');logger['debug'](_0x67a1('0xf'),_0x1b674b,_0x67a1('0x10'),JSON[_0x67a1('0x11')](_0x4f08bc));if(_0x4f08bc[_0x67a1('0x12')]){if(_0x4f08bc[_0x67a1('0x12')][_0x67a1('0x13')]===0x1f4){logger[_0x67a1('0x12')](_0x67a1('0xe'),_0x1b674b,_0x4f08bc[_0x67a1('0x12')]['message']);return _0xee43f6(_0x4f08bc[_0x67a1('0x12')][_0x67a1('0x14')]);}logger[_0x67a1('0x12')]('License,\x20%s,\x20%s',_0x1b674b,_0x4f08bc[_0x67a1('0x12')][_0x67a1('0x14')]);return _0x34a7b5(_0x4f08bc['error'][_0x67a1('0x14')]);}else{logger[_0x67a1('0xd')](_0x67a1('0xe'),_0x1b674b,_0x67a1('0x10'));_0x34a7b5(_0x4f08bc[_0x67a1('0x15')][_0x67a1('0x14')]);}})['catch'](function(_0x3d38c8){logger[_0x67a1('0x12')](_0x67a1('0xe'),_0x1b674b,_0x3d38c8);_0xee43f6(_0x3d38c8);});});}