Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsreport/jsreport-licensing

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsreport/jsreport-licensing - npm Package Compare versions

Comparing version 3.0.3 to 4.0.0

6

package.json
{
"name": "@jsreport/jsreport-licensing",
"version": "3.0.3",
"version": "4.0.0",
"description": "jsreport extension for enterprise license verification ",

@@ -32,3 +32,3 @@ "keywords": [

"devDependencies": {
"@jsreport/jsreport-core": "3.11.0",
"@jsreport/jsreport-core": "4.0.0",
"@jsreport/studio-dev": "3.2.1",

@@ -41,3 +41,3 @@ "mocha": "7.2.0",

"engines": {
"node": ">=16.11"
"node": ">=18.15"
},

@@ -44,0 +44,0 @@ "standard": {

@@ -6,2 +6,7 @@ # @jsreport/jsreport-licensing

### 4.0.0
- minimum node.js version is now `18.15.0`
- update studio build against new webpack and babel
### 3.0.3

@@ -8,0 +13,0 @@

@@ -1,413 +0,216 @@

/******/ (function(modules) { // webpackBootstrap
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/***/ ((module) => {
module.exports = Studio;
/***/ }),
/* 2 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// extracted by mini-css-extract-plugin
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"developmentLicense":"x-licensing-style-developmentLicense"});
/***/ })
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/******/
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var jsreport_studio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
/* harmony import */ var jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jsreport_studio__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
"use strict";
var _jsreportStudio = __webpack_require__(1);
var _jsreportStudio2 = _interopRequireDefault(_jsreportStudio);
var _style = __webpack_require__(2);
var _style2 = _interopRequireDefault(_style);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
function renderLicenseType(licensingInfo) {
if (licensingInfo.unreachable) {
return React.createElement(
'p',
null,
'The licensing server was not reachable during the instance startup. The instance now runs in the enterprise mode and the license validation will be performed again during the next restart.'
);
return /*#__PURE__*/React.createElement("p", null, "The licensing server was not reachable during the instance startup. The instance now runs in the enterprise mode and the license validation will be performed again during the next restart.");
}
if (licensingInfo.type === 'subscription') {
if (licensingInfo.pendingExpiration === true) {
return React.createElement(
'div',
null,
React.createElement(
'p',
null,
'The subscription is no longer active probably due to failed payment or cancellation. The subscription can be used for maximum one month in inactive state.'
),
React.createElement(PaymentNote, { paymentType: licensingInfo.paymentType })
);
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "The subscription is no longer active probably due to failed payment or cancellation. The subscription can be used for maximum one month in inactive state."), /*#__PURE__*/React.createElement(PaymentNote, {
paymentType: licensingInfo.paymentType
}));
}
return React.createElement(
'div',
null,
React.createElement(
'p',
null,
'The subscription renewal is planned on ',
licensingInfo.expiresOn.toLocaleDateString(),
' and the license will be again validated afterwards.'
),
React.createElement(PaymentNote, { paymentType: licensingInfo.paymentType })
);
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "The subscription renewal is planned on ", licensingInfo.expiresOn.toLocaleDateString(), " and the license will be again validated afterwards."), /*#__PURE__*/React.createElement(PaymentNote, {
paymentType: licensingInfo.paymentType
}));
}
if (licensingInfo.type === 'perpetual') {
return React.createElement(
'p',
null,
'Perpetual license is validated for the version ',
licensingInfo.validatedForVersion,
' with free upgrades to the versions released before ',
licensingInfo.expiresOn.toLocaleDateString(),
'. The license will be remotely validated again if the instance is upgraded to a different version.'
);
return /*#__PURE__*/React.createElement("p", null, "Perpetual license is validated for the version ", licensingInfo.validatedForVersion, " with free upgrades to the versions released before ", licensingInfo.expiresOn.toLocaleDateString(), ". The license will be remotely validated again if the instance is upgraded to a different version.");
}
if (licensingInfo.type === 'trial') {
return React.createElement(
'p',
null,
'The trial license expires on ',
licensingInfo.expiresOn.toLocaleDateString(),
'. You will need to purchase enterprise license to be able to store more than 5 templates afterwards.'
);
return /*#__PURE__*/React.createElement("p", null, "The trial license expires on ", licensingInfo.expiresOn.toLocaleDateString(), ". You will need to purchase enterprise license to be able to store more than 5 templates afterwards.");
}
if (licensingInfo.type === 'free') {
return React.createElement(
'p',
null,
'You can use up to 5 templates for free.'
);
return /*#__PURE__*/React.createElement("p", null, "You can use up to 5 templates for free.");
}
}
function PaymentNote(_ref) {
var paymentType = _ref.paymentType;
let {
paymentType
} = _ref;
if (paymentType === 'gumroad') {
return React.createElement(
'p',
null,
'You can find further information about payments in the ',
React.createElement(
'a',
{ href: 'https://gumroad.com/library', target: '_blank', rel: 'noreferrer' },
'gumroad library'
),
'.`'
);
return /*#__PURE__*/React.createElement("p", null, "You can find further information about payments in the ", /*#__PURE__*/React.createElement("a", {
href: "https://gumroad.com/library",
target: "_blank",
rel: "noreferrer"
}, "gumroad library"), ".`");
}
if (paymentType === 'manual') {
return React.createElement(
'p',
null,
'The license is payed through manual invoices and bank transfers. Please contact ',
React.createElement(
'a',
{ href: 'mailto: support@jsreport.net' },
'support@jsreport.net'
),
' to get further information.'
);
return /*#__PURE__*/React.createElement("p", null, "The license is payed through manual invoices and bank transfers. Please contact ", /*#__PURE__*/React.createElement("a", {
href: "mailto: support@jsreport.net"
}, "support@jsreport.net"), " to get further information.");
}
if (paymentType === 'braintree') {
return React.createElement(
'p',
null,
'You can find further information about payments in the ',
React.createElement(
'a',
{ href: 'https://jsreport.net/payments/customer', target: '_blank', rel: 'noreferrer' },
'customer portal'
),
'.'
);
return /*#__PURE__*/React.createElement("p", null, "You can find further information about payments in the ", /*#__PURE__*/React.createElement("a", {
href: "https://jsreport.net/payments/customer",
target: "_blank",
rel: "noreferrer"
}, "customer portal"), ".");
}
return React.createElement('span', null);
return /*#__PURE__*/React.createElement("span", null);
}
_jsreportStudio2.default.readyListeners.push(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
var licensingInfo, trialModal, licenseInfoModal, pendingExpirationModal, interval;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
licensingInfo = _jsreportStudio2.default.extensions.licensing.options;
if (licensingInfo.development) {
_jsreportStudio2.default.addStartupComponent(function (props) {
return React.createElement(
'div',
{ className: _style2.default.developmentLicense },
'Development only license applied'
);
});
jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().readyListeners.push(async () => {
const licensingInfo = (jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().extensions).licensing.options;
if (licensingInfo.development) {
jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().addStartupComponent(props => /*#__PURE__*/React.createElement("div", {
className: _style_css__WEBPACK_IMPORTED_MODULE_1__["default"].developmentLicense
}, "Development only license applied"));
}
if (licensingInfo.usageCheckFailureInfo) {
jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().openModal(() => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, licensingInfo.usageCheckFailureInfo.message), /*#__PURE__*/React.createElement("p", null, "The development instances should use config license.development=true and every production instance should have its own enterprise license key. The deployment with several production jsreport instances should use enterprise scale license which doesn't limit the license key usage.")));
}
const trialModal = () => jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().openModal(() => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "Free license is limited to maximum 5 templates. Your jsreport instance is now running in one month trial. Please buy the enterprise license if you want to continue using jsreport after the trial expires."), /*#__PURE__*/React.createElement("p", null, "The instructions for buying enterprise license can be found ", /*#__PURE__*/React.createElement("a", {
href: "http://jsreport.net/buy",
target: "_blank",
rel: "noreferrer"
}, "here"), ".")));
const licenseInfoModal = () => jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().openModal(() => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, licensingInfo.license, " license", licensingInfo.development ? ' (development)' : ''), renderLicenseType(licensingInfo), /*#__PURE__*/React.createElement("p", null, "More information about licensing and pricing can be found ", /*#__PURE__*/React.createElement("a", {
href: "http://jsreport.net/buy",
target: "_blank",
rel: "noreferrer"
}, "here"), ".")));
const pendingExpirationModal = () => jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().openModal(() => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "subscription has expired"), /*#__PURE__*/React.createElement("p", null, "The subscription is no longer active probably due to failed payment or cancellation. The subscription can be used for maximum one month in inactive state."), /*#__PURE__*/React.createElement(PaymentNote, {
paymentType: licensingInfo.paymentType
})));
if (licensingInfo.type === 'trial' && jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().getAllEntities().filter(e => e.__entitySet === 'templates' && !e.__isNew).length > 5) {
trialModal();
}
if (licensingInfo.type === 'subscription' && licensingInfo.pendingExpiration === true) {
pendingExpirationModal();
}
if (licensingInfo.license === 'free') {
const interval = setInterval(() => {
if (jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().getAllEntities().filter(e => e.__entitySet === 'templates' && !e.__isNew).length > 5) {
clearInterval(interval);
trialModal();
licensingInfo.type = licensingInfo.license = 'trial';
const now = new Date();
now.setDate(now.getDate() + 30);
licensingInfo.expiresOn = now;
jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().api.post('/api/licensing/trial', {}).then(m => {
if (m.status === 1) {
setTimeout(() => jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().openModal(() => /*#__PURE__*/React.createElement("div", null, m.message)), 5000);
}
if (licensingInfo.usageCheckFailureInfo) {
_jsreportStudio2.default.openModal(function () {
return React.createElement(
'div',
null,
React.createElement(
'p',
null,
licensingInfo.usageCheckFailureInfo.message
),
React.createElement(
'p',
null,
'The development instances should use config license.development=true and every production instance should have its own enterprise license key. The deployment with several production jsreport instances should use enterprise scale license which doesn\'t limit the license key usage.'
)
);
});
}
trialModal = function trialModal() {
return _jsreportStudio2.default.openModal(function () {
return React.createElement(
'div',
null,
React.createElement(
'p',
null,
'Free license is limited to maximum 5 templates. Your jsreport instance is now running in one month trial. Please buy the enterprise license if you want to continue using jsreport after the trial expires.'
),
React.createElement(
'p',
null,
'The instructions for buying enterprise license can be found ',
React.createElement(
'a',
{ href: 'http://jsreport.net/buy', target: '_blank', rel: 'noreferrer' },
'here'
),
'.'
)
);
});
};
licenseInfoModal = function licenseInfoModal() {
return _jsreportStudio2.default.openModal(function () {
return React.createElement(
'div',
null,
React.createElement(
'h2',
null,
licensingInfo.license,
' license',
licensingInfo.development ? ' (development)' : ''
),
renderLicenseType(licensingInfo),
React.createElement(
'p',
null,
'More information about licensing and pricing can be found ',
React.createElement(
'a',
{ href: 'http://jsreport.net/buy', target: '_blank', rel: 'noreferrer' },
'here'
),
'.'
)
);
});
};
pendingExpirationModal = function pendingExpirationModal() {
return _jsreportStudio2.default.openModal(function () {
return React.createElement(
'div',
null,
React.createElement(
'h2',
null,
'subscription has expired'
),
React.createElement(
'p',
null,
'The subscription is no longer active probably due to failed payment or cancellation. The subscription can be used for maximum one month in inactive state.'
),
React.createElement(PaymentNote, { paymentType: licensingInfo.paymentType })
);
});
};
if (licensingInfo.type === 'trial' && _jsreportStudio2.default.getAllEntities().filter(function (e) {
return e.__entitySet === 'templates' && !e.__isNew;
}).length > 5) {
trialModal();
}
if (licensingInfo.type === 'subscription' && licensingInfo.pendingExpiration === true) {
pendingExpirationModal();
}
if (licensingInfo.license === 'free') {
interval = setInterval(function () {
if (_jsreportStudio2.default.getAllEntities().filter(function (e) {
return e.__entitySet === 'templates' && !e.__isNew;
}).length > 5) {
clearInterval(interval);
trialModal();
licensingInfo.type = licensingInfo.license = 'trial';
var now = new Date();
now.setDate(now.getDate() + 30);
licensingInfo.expiresOn = now;
_jsreportStudio2.default.api.post('/api/licensing/trial', {}).then(function (m) {
if (m.status === 1) {
setTimeout(function () {
return _jsreportStudio2.default.openModal(function () {
return React.createElement(
'div',
null,
m.message
);
});
}, 5000);
}
});
}
}, 10000);
}
_jsreportStudio2.default.addToolbarComponent(function (props) {
return React.createElement(
'div',
{
className: 'toolbar-button',
onClick: function onClick() {
licenseInfoModal();
props.closeMenu();
}
},
React.createElement(
'div',
{ style: { textTransform: 'capitalize' } },
React.createElement('i', { className: 'fa fa-gavel' }),
licensingInfo.license,
' ',
React.createElement('i', { className: 'fa fa-info-circle', style: { marginRight: 0 } })
)
);
}, 'settings');
case 10:
case 'end':
return _context.stop();
});
}
}, 10000);
}
jsreport_studio__WEBPACK_IMPORTED_MODULE_0___default().addToolbarComponent(props => /*#__PURE__*/React.createElement("div", {
className: "toolbar-button",
onClick: () => {
licenseInfoModal();
props.closeMenu();
}
}, _callee, undefined);
})));
}, /*#__PURE__*/React.createElement("div", {
style: {
textTransform: 'capitalize'
}
}, /*#__PURE__*/React.createElement("i", {
className: "fa fa-gavel"
}), licensingInfo.license, " ", /*#__PURE__*/React.createElement("i", {
className: "fa fa-info-circle",
style: {
marginRight: 0
}
}))), 'settings');
});
})();
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = Studio;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"developmentLicense":"x-licensing-style-developmentLicense"};
/***/ })
/******/ ]);
/******/ })()
;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc