Built motion from commit (unavailable).|2.3.1
[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 _0xedc9=['License,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d3c10,_0x451e74){var _0x5e8578=function(_0x57b3ee){while(--_0x57b3ee){_0x4d3c10['push'](_0x4d3c10['shift']());}};_0x5e8578(++_0x451e74);}(_0xedc9,0x17f));var _0x9edc=function(_0x5162ed,_0x386cb7){_0x5162ed=_0x5162ed-0x0;var _0x4c579b=_0xedc9[_0x5162ed];return _0x4c579b;};'use strict';var _=require(_0x9edc('0x0'));var util=require(_0x9edc('0x1'));var moment=require(_0x9edc('0x2'));var BPromise=require('bluebird');var rs=require(_0x9edc('0x3'));var fs=require('fs');var Redis=require(_0x9edc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9edc('0x5'))('rpc');var config=require(_0x9edc('0x6'));var jayson=require(_0x9edc('0x7'));var client=jayson[_0x9edc('0x8')][_0x9edc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9a5f0e,_0x10dbcb,_0x48bce8){return new BPromise(function(_0x34e12e,_0x1c190a){return client[_0x9edc('0xa')](_0x9a5f0e,_0x48bce8)[_0x9edc('0xb')](function(_0x28e97c){logger[_0x9edc('0xc')]('License,\x20%s,\x20%s',_0x10dbcb,_0x9edc('0xd'));logger['debug'](_0x9edc('0xe'),_0x10dbcb,_0x9edc('0xd'),JSON[_0x9edc('0xf')](_0x28e97c));if(_0x28e97c[_0x9edc('0x10')]){if(_0x28e97c[_0x9edc('0x10')]['code']===0x1f4){logger[_0x9edc('0x10')](_0x9edc('0x11'),_0x10dbcb,_0x28e97c['error'][_0x9edc('0x12')]);return _0x1c190a(_0x28e97c[_0x9edc('0x10')][_0x9edc('0x12')]);}logger[_0x9edc('0x10')](_0x9edc('0x11'),_0x10dbcb,_0x28e97c[_0x9edc('0x10')][_0x9edc('0x12')]);return _0x34e12e(_0x28e97c[_0x9edc('0x10')][_0x9edc('0x12')]);}else{logger[_0x9edc('0xc')]('License,\x20%s,\x20%s',_0x10dbcb,_0x9edc('0xd'));_0x34e12e(_0x28e97c[_0x9edc('0x13')]['message']);}})['catch'](function(_0x4cb975){logger[_0x9edc('0x10')](_0x9edc('0x11'),_0x10dbcb,_0x4cb975);_0x1c190a(_0x4cb975);});});}