Built motion from commit (unavailable).|2.5.20
[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 _0x7b6b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x5b70f0,_0x189655){var _0x49a246=function(_0x25cd5c){while(--_0x25cd5c){_0x5b70f0['push'](_0x5b70f0['shift']());}};_0x49a246(++_0x189655);}(_0x7b6b,0xac));var _0xb7b6=function(_0x5a8d5f,_0x138128){_0x5a8d5f=_0x5a8d5f-0x0;var _0x2bf509=_0x7b6b[_0x5a8d5f];return _0x2bf509;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var moment=require(_0xb7b6('0x1'));var BPromise=require(_0xb7b6('0x2'));var rs=require(_0xb7b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7b6('0x5'))(_0xb7b6('0x6'));var config=require(_0xb7b6('0x7'));var jayson=require(_0xb7b6('0x8'));var client=jayson[_0xb7b6('0x9')][_0xb7b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e81f,_0x318dfb,_0x36cd51){return new BPromise(function(_0x31809b,_0xb5b26f){return client[_0xb7b6('0xb')](_0x19e81f,_0x36cd51)[_0xb7b6('0xc')](function(_0x313aa8){logger[_0xb7b6('0xd')](_0xb7b6('0xe'),_0x318dfb,_0xb7b6('0xf'));logger[_0xb7b6('0x10')](_0xb7b6('0x11'),_0x318dfb,_0xb7b6('0xf'),JSON['stringify'](_0x313aa8));if(_0x313aa8[_0xb7b6('0x12')]){if(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x13')]===0x1f4){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);return _0xb5b26f(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);}logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')]['message']);return _0x31809b(_0x313aa8['error'][_0xb7b6('0x14')]);}else{logger['info']('License,\x20%s,\x20%s',_0x318dfb,_0xb7b6('0xf'));_0x31809b(_0x313aa8['result'][_0xb7b6('0x14')]);}})[_0xb7b6('0x15')](function(_0xa99f35){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0xa99f35);_0xb5b26f(_0xa99f35);});});}