Built motion from commit (unavailable).|2.4.4
[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 _0x6cc5=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s'];(function(_0x24f85b,_0x2bf466){var _0x578211=function(_0x3a2b16){while(--_0x3a2b16){_0x24f85b['push'](_0x24f85b['shift']());}};_0x578211(++_0x2bf466);}(_0x6cc5,0x95));var _0x56cc=function(_0x4311f0,_0x46863d){_0x4311f0=_0x4311f0-0x0;var _0x26c762=_0x6cc5[_0x4311f0];return _0x26c762;};'use strict';var _=require(_0x56cc('0x0'));var util=require(_0x56cc('0x1'));var moment=require(_0x56cc('0x2'));var BPromise=require(_0x56cc('0x3'));var rs=require(_0x56cc('0x4'));var fs=require('fs');var Redis=require(_0x56cc('0x5'));var db=require(_0x56cc('0x6'))['db'];var utils=require(_0x56cc('0x7'));var logger=require(_0x56cc('0x8'))('rpc');var config=require(_0x56cc('0x9'));var jayson=require(_0x56cc('0xa'));var client=jayson[_0x56cc('0xb')][_0x56cc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c1203,_0x4737d4,_0x2afbc0){return new BPromise(function(_0x21abad,_0x35574d){return client[_0x56cc('0xd')](_0x1c1203,_0x2afbc0)[_0x56cc('0xe')](function(_0x3f87c2){logger[_0x56cc('0xf')](_0x56cc('0x10'),_0x4737d4,_0x56cc('0x11'));logger['debug'](_0x56cc('0x12'),_0x4737d4,_0x56cc('0x11'),JSON['stringify'](_0x3f87c2));if(_0x3f87c2[_0x56cc('0x13')]){if(_0x3f87c2['error'][_0x56cc('0x14')]===0x1f4){logger[_0x56cc('0x13')]('License,\x20%s,\x20%s',_0x4737d4,_0x3f87c2['error'][_0x56cc('0x15')]);return _0x35574d(_0x3f87c2[_0x56cc('0x13')]['message']);}logger[_0x56cc('0x13')](_0x56cc('0x10'),_0x4737d4,_0x3f87c2[_0x56cc('0x13')][_0x56cc('0x15')]);return _0x21abad(_0x3f87c2[_0x56cc('0x13')][_0x56cc('0x15')]);}else{logger[_0x56cc('0xf')]('License,\x20%s,\x20%s',_0x4737d4,'request\x20sent');_0x21abad(_0x3f87c2[_0x56cc('0x16')][_0x56cc('0x15')]);}})[_0x56cc('0x17')](function(_0x53c4a3){logger['error'](_0x56cc('0x10'),_0x4737d4,_0x53c4a3);_0x35574d(_0x53c4a3);});});}