Built motion from commit (unavailable).|2.2.1
[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 _0xf3b8=['jayson/promise','client','http','request','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','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x10a71a,_0x27990a){var _0x5446fa=function(_0x54d866){while(--_0x54d866){_0x10a71a['push'](_0x10a71a['shift']());}};_0x5446fa(++_0x27990a);}(_0xf3b8,0x130));var _0x8f3b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf3b8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8f3b('0x0'));var util=require(_0x8f3b('0x1'));var moment=require(_0x8f3b('0x2'));var BPromise=require(_0x8f3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f3b('0x4'))['db'];var utils=require(_0x8f3b('0x5'));var logger=require(_0x8f3b('0x6'))('rpc');var config=require(_0x8f3b('0x7'));var jayson=require(_0x8f3b('0x8'));var client=jayson[_0x8f3b('0x9')][_0x8f3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x282b97,_0x1c4112,_0x2c61f3){return new BPromise(function(_0x49059c,_0x3fbee2){return client[_0x8f3b('0xb')](_0x282b97,_0x2c61f3)[_0x8f3b('0xc')](function(_0x5e88e7){logger[_0x8f3b('0xd')](_0x8f3b('0xe'),_0x1c4112,_0x8f3b('0xf'));logger[_0x8f3b('0x10')](_0x8f3b('0x11'),_0x1c4112,_0x8f3b('0xf'),JSON[_0x8f3b('0x12')](_0x5e88e7));if(_0x5e88e7[_0x8f3b('0x13')]){if(_0x5e88e7[_0x8f3b('0x13')][_0x8f3b('0x14')]===0x1f4){logger['error'](_0x8f3b('0xe'),_0x1c4112,_0x5e88e7['error'][_0x8f3b('0x15')]);return _0x3fbee2(_0x5e88e7['error'][_0x8f3b('0x15')]);}logger[_0x8f3b('0x13')]('License,\x20%s,\x20%s',_0x1c4112,_0x5e88e7[_0x8f3b('0x13')]['message']);return _0x49059c(_0x5e88e7[_0x8f3b('0x13')][_0x8f3b('0x15')]);}else{logger[_0x8f3b('0xd')]('License,\x20%s,\x20%s',_0x1c4112,'request\x20sent');_0x49059c(_0x5e88e7[_0x8f3b('0x16')][_0x8f3b('0x15')]);}})[_0x8f3b('0x17')](function(_0x961a05){logger[_0x8f3b('0x13')](_0x8f3b('0xe'),_0x1c4112,_0x961a05);_0x3fbee2(_0x961a05);});});}