Built motion from commit 3c2ce842.|2.6.31
[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 _0xef09=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2c7724,_0x412497){var _0x7a23e6=function(_0x56d04e){while(--_0x56d04e){_0x2c7724['push'](_0x2c7724['shift']());}};_0x7a23e6(++_0x412497);}(_0xef09,0xa4));var _0x9ef0=function(_0x21fd8b,_0x45f411){_0x21fd8b=_0x21fd8b-0x0;var _0x51b266=_0xef09[_0x21fd8b];return _0x51b266;};'use strict';var _=require(_0x9ef0('0x0'));var util=require(_0x9ef0('0x1'));var moment=require(_0x9ef0('0x2'));var BPromise=require(_0x9ef0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ef0('0x4'));var db=require(_0x9ef0('0x5'))['db'];var utils=require(_0x9ef0('0x6'));var logger=require(_0x9ef0('0x7'))(_0x9ef0('0x8'));var config=require(_0x9ef0('0x9'));var jayson=require(_0x9ef0('0xa'));var client=jayson[_0x9ef0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52ee77,_0x47807b,_0x310ff9){return new BPromise(function(_0x1c69bd,_0x4e0581){return client['request'](_0x52ee77,_0x310ff9)[_0x9ef0('0xc')](function(_0x237590){logger[_0x9ef0('0xd')](_0x9ef0('0xe'),_0x47807b,_0x9ef0('0xf'));logger[_0x9ef0('0x10')](_0x9ef0('0x11'),_0x47807b,_0x9ef0('0xf'),JSON[_0x9ef0('0x12')](_0x237590));if(_0x237590['error']){if(_0x237590[_0x9ef0('0x13')][_0x9ef0('0x14')]===0x1f4){logger[_0x9ef0('0x13')](_0x9ef0('0xe'),_0x47807b,_0x237590[_0x9ef0('0x13')][_0x9ef0('0x15')]);return _0x4e0581(_0x237590[_0x9ef0('0x13')][_0x9ef0('0x15')]);}logger[_0x9ef0('0x13')](_0x9ef0('0xe'),_0x47807b,_0x237590[_0x9ef0('0x13')]['message']);return _0x1c69bd(_0x237590[_0x9ef0('0x13')][_0x9ef0('0x15')]);}else{logger[_0x9ef0('0xd')](_0x9ef0('0xe'),_0x47807b,_0x9ef0('0xf'));_0x1c69bd(_0x237590[_0x9ef0('0x16')][_0x9ef0('0x15')]);}})[_0x9ef0('0x17')](function(_0x5cada0){logger[_0x9ef0('0x13')](_0x9ef0('0xe'),_0x47807b,_0x5cada0);_0x4e0581(_0x5cada0);});});}