d142e141a1c2469b7e56fe6e9488c590ae7503d2
[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 _0x18d7=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../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','message','catch'];(function(_0x11f31f,_0x9e6e07){var _0x4fbeee=function(_0x3485e1){while(--_0x3485e1){_0x11f31f['push'](_0x11f31f['shift']());}};_0x4fbeee(++_0x9e6e07);}(_0x18d7,0xcf));var _0x718d=function(_0xf23ae0,_0x13041f){_0xf23ae0=_0xf23ae0-0x0;var _0x441c81=_0x18d7[_0xf23ae0];return _0x441c81;};'use strict';var _=require(_0x718d('0x0'));var util=require(_0x718d('0x1'));var moment=require(_0x718d('0x2'));var BPromise=require(_0x718d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x718d('0x4'));var db=require(_0x718d('0x5'))['db'];var utils=require(_0x718d('0x6'));var logger=require(_0x718d('0x7'))(_0x718d('0x8'));var config=require(_0x718d('0x9'));var jayson=require(_0x718d('0xa'));var client=jayson[_0x718d('0xb')][_0x718d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a8139,_0x843057,_0x2c7ecb){return new BPromise(function(_0x375644,_0x798eb7){return client[_0x718d('0xd')](_0x1a8139,_0x2c7ecb)[_0x718d('0xe')](function(_0xa495de){logger[_0x718d('0xf')](_0x718d('0x10'),_0x843057,'request\x20sent');logger['debug'](_0x718d('0x11'),_0x843057,_0x718d('0x12'),JSON[_0x718d('0x13')](_0xa495de));if(_0xa495de[_0x718d('0x14')]){if(_0xa495de[_0x718d('0x14')]['code']===0x1f4){logger[_0x718d('0x14')]('License,\x20%s,\x20%s',_0x843057,_0xa495de[_0x718d('0x14')]['message']);return _0x798eb7(_0xa495de[_0x718d('0x14')][_0x718d('0x15')]);}logger[_0x718d('0x14')](_0x718d('0x10'),_0x843057,_0xa495de[_0x718d('0x14')][_0x718d('0x15')]);return _0x375644(_0xa495de[_0x718d('0x14')][_0x718d('0x15')]);}else{logger[_0x718d('0xf')](_0x718d('0x10'),_0x843057,_0x718d('0x12'));_0x375644(_0xa495de['result'][_0x718d('0x15')]);}})[_0x718d('0x16')](function(_0x3a5424){logger[_0x718d('0x14')](_0x718d('0x10'),_0x843057,_0x3a5424);_0x798eb7(_0x3a5424);});});}