Built motion from commit (unavailable).|2.5.13
[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 _0x8164=['debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','request','then','info','License,\x20%s,\x20%s'];(function(_0x2c77de,_0x7d7e03){var _0x282e28=function(_0x3a500d){while(--_0x3a500d){_0x2c77de['push'](_0x2c77de['shift']());}};_0x282e28(++_0x7d7e03);}(_0x8164,0x170));var _0x4816=function(_0x321cc3,_0xd7325c){_0x321cc3=_0x321cc3-0x0;var _0x5d4df2=_0x8164[_0x321cc3];return _0x5d4df2;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var moment=require(_0x4816('0x2'));var BPromise=require('bluebird');var rs=require(_0x4816('0x3'));var fs=require('fs');var Redis=require(_0x4816('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4816('0x5'));var logger=require('../../config/logger')(_0x4816('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4816('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51ab08,_0x2ddb3b,_0x437b8b){return new BPromise(function(_0x170e7a,_0x383974){return client[_0x4816('0x8')](_0x51ab08,_0x437b8b)[_0x4816('0x9')](function(_0x285cab){logger[_0x4816('0xa')](_0x4816('0xb'),_0x2ddb3b,'request\x20sent');logger[_0x4816('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x2ddb3b,_0x4816('0xd'),JSON[_0x4816('0xe')](_0x285cab));if(_0x285cab['error']){if(_0x285cab[_0x4816('0xf')]['code']===0x1f4){logger['error'](_0x4816('0xb'),_0x2ddb3b,_0x285cab['error']['message']);return _0x383974(_0x285cab[_0x4816('0xf')]['message']);}logger[_0x4816('0xf')](_0x4816('0xb'),_0x2ddb3b,_0x285cab[_0x4816('0xf')][_0x4816('0x10')]);return _0x170e7a(_0x285cab[_0x4816('0xf')][_0x4816('0x10')]);}else{logger[_0x4816('0xa')](_0x4816('0xb'),_0x2ddb3b,_0x4816('0xd'));_0x170e7a(_0x285cab[_0x4816('0x11')][_0x4816('0x10')]);}})[_0x4816('0x12')](function(_0x6119f){logger[_0x4816('0xf')](_0x4816('0xb'),_0x2ddb3b,_0x6119f);_0x383974(_0x6119f);});});}