Built motion from commit 88aa8522.|2.5.37
[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 _0x6acc=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x6acc,0xfc));var _0xc6ac=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x6acc[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0xc6ac('0x0'));var util=require(_0xc6ac('0x1'));var moment=require(_0xc6ac('0x2'));var BPromise=require('bluebird');var rs=require(_0xc6ac('0x3'));var fs=require('fs');var Redis=require(_0xc6ac('0x4'));var db=require(_0xc6ac('0x5'))['db'];var utils=require(_0xc6ac('0x6'));var logger=require('../../config/logger')(_0xc6ac('0x7'));var config=require(_0xc6ac('0x8'));var jayson=require(_0xc6ac('0x9'));var client=jayson[_0xc6ac('0xa')][_0xc6ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b6caf,_0x7b3f20,_0x4c0445){return new BPromise(function(_0x36c909,_0x45bb33){return client[_0xc6ac('0xc')](_0x4b6caf,_0x4c0445)[_0xc6ac('0xd')](function(_0x55cd9f){logger[_0xc6ac('0xe')](_0xc6ac('0xf'),_0x7b3f20,_0xc6ac('0x10'));logger[_0xc6ac('0x11')](_0xc6ac('0x12'),_0x7b3f20,'request\x20sent',JSON['stringify'](_0x55cd9f));if(_0x55cd9f[_0xc6ac('0x13')]){if(_0x55cd9f[_0xc6ac('0x13')][_0xc6ac('0x14')]===0x1f4){logger[_0xc6ac('0x13')]('License,\x20%s,\x20%s',_0x7b3f20,_0x55cd9f['error']['message']);return _0x45bb33(_0x55cd9f['error'][_0xc6ac('0x15')]);}logger[_0xc6ac('0x13')](_0xc6ac('0xf'),_0x7b3f20,_0x55cd9f[_0xc6ac('0x13')][_0xc6ac('0x15')]);return _0x36c909(_0x55cd9f[_0xc6ac('0x13')][_0xc6ac('0x15')]);}else{logger[_0xc6ac('0xe')](_0xc6ac('0xf'),_0x7b3f20,_0xc6ac('0x10'));_0x36c909(_0x55cd9f['result']['message']);}})[_0xc6ac('0x16')](function(_0x72fd4e){logger[_0xc6ac('0x13')](_0xc6ac('0xf'),_0x7b3f20,_0x72fd4e);_0x45bb33(_0x72fd4e);});});}