Built motion from commit 00bf23f6.|2.6.16
[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 _0x1a43=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x1a43,0xb0));var _0x31a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x31a4('0x0'));var util=require('util');var moment=require(_0x31a4('0x1'));var BPromise=require('bluebird');var rs=require(_0x31a4('0x2'));var fs=require('fs');var Redis=require(_0x31a4('0x3'));var db=require(_0x31a4('0x4'))['db'];var utils=require(_0x31a4('0x5'));var logger=require(_0x31a4('0x6'))(_0x31a4('0x7'));var config=require(_0x31a4('0x8'));var jayson=require(_0x31a4('0x9'));var client=jayson[_0x31a4('0xa')][_0x31a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe938e8,_0x22d7fc,_0x5eb35c){return new BPromise(function(_0x4ae87d,_0x2d94eb){return client[_0x31a4('0xc')](_0xe938e8,_0x5eb35c)[_0x31a4('0xd')](function(_0x4592a8){logger[_0x31a4('0xe')](_0x31a4('0xf'),_0x22d7fc,'request\x20sent');logger[_0x31a4('0x10')](_0x31a4('0x11'),_0x22d7fc,_0x31a4('0x12'),JSON[_0x31a4('0x13')](_0x4592a8));if(_0x4592a8[_0x31a4('0x14')]){if(_0x4592a8['error'][_0x31a4('0x15')]===0x1f4){logger[_0x31a4('0x14')]('License,\x20%s,\x20%s',_0x22d7fc,_0x4592a8[_0x31a4('0x14')][_0x31a4('0x16')]);return _0x2d94eb(_0x4592a8[_0x31a4('0x14')]['message']);}logger[_0x31a4('0x14')](_0x31a4('0xf'),_0x22d7fc,_0x4592a8[_0x31a4('0x14')][_0x31a4('0x16')]);return _0x4ae87d(_0x4592a8[_0x31a4('0x14')][_0x31a4('0x16')]);}else{logger[_0x31a4('0xe')](_0x31a4('0xf'),_0x22d7fc,_0x31a4('0x12'));_0x4ae87d(_0x4592a8[_0x31a4('0x17')][_0x31a4('0x16')]);}})[_0x31a4('0x18')](function(_0x5c11b3){logger['error'](_0x31a4('0xf'),_0x22d7fc,_0x5c11b3);_0x2d94eb(_0x5c11b3);});});}