nsauditor-ai 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@ A modular, AI-assisted network security audit platform that scans, understands,
7
7
  [![npm](https://img.shields.io/npm/v/nsauditor-ai.svg)](https://www.npmjs.com/package/nsauditor-ai)
8
8
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![Node.js 20+](https://img.shields.io/badge/node-20%2B-green.svg)](https://nodejs.org)
10
- [![Tests](https://img.shields.io/badge/tests-493%20passing-brightgreen.svg)](#tests)
10
+ [![Tests](https://img.shields.io/badge/tests-506%20passing-brightgreen.svg)](#tests)
11
11
 
12
12
  ---
13
13
 
@@ -532,17 +532,13 @@ export default {
532
532
 
533
533
  ## Pro & Enterprise Activation
534
534
 
535
- Install the EE package alongside the CE platform:
535
+ After purchasing at [nsauditor.com/ai/pricing](https://www.nsauditor.com/ai/pricing), you'll receive an email with your license key and an npm install command. Two steps:
536
536
 
537
537
  ```bash
538
- npm install -g @nsasoft/nsauditor-ai-ee
539
- ```
540
-
541
- Set your license key:
538
+ # 1. Install EE package (one-time, token included in email)
539
+ npm install -g @nsasoft/nsauditor-ai-ee --//registry.npmjs.org/:_authToken=npm_xxxxx
542
540
 
543
- ```bash
544
- echo "NSAUDITOR_LICENSE_KEY=pro_eyJhbGci..." >> ~/.nsauditor/.env
545
- # or export directly
541
+ # 2. Set your license key
546
542
  export NSAUDITOR_LICENSE_KEY=pro_eyJhbGci...
547
543
  ```
548
544
 
@@ -556,6 +552,8 @@ nsauditor-ai license --capabilities
556
552
  # ✓ intelligenceEngine ✓ riskScoring ✓ proAI ✓ advancedCTEM ...
557
553
  ```
558
554
 
555
+ License keys are delivered automatically via Stripe webhook — no manual processing. Subscription renewals generate a fresh key and email it to you before the current one expires.
556
+
559
557
  No license key? Everything in this repository works perfectly without one. The CE is not crippled — it's a complete, production-ready security scanner.
560
558
 
561
559
  → [Pricing](https://www.nsauditor.com/ai/pricing) · [Start free trial](https://www.nsauditor.com/ai/trial) · [Enterprise contact](https://www.nsauditor.com/ai/enterprise)
@@ -564,7 +562,7 @@ No license key? Everything in this repository works perfectly without one. The C
564
562
 
565
563
  ## Tests
566
564
 
567
- Run all 487 tests:
565
+ Run all 506 tests:
568
566
 
569
567
  ```bash
570
568
  npm test
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsauditor-ai",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Modular AI-assisted network security audit platform — Community Edition",
5
5
  "type": "module",
6
6
  "private": false,
package/utils/license.mjs CHANGED
@@ -81,6 +81,21 @@ export async function loadLicense(keyStr) {
81
81
  // Cache verified tier for synchronous access
82
82
  _verifiedTier = payload.tier;
83
83
 
84
+ // Compute days until expiry for renewal warnings (air-gapped VPC support)
85
+ const expiresAt = new Date(payload.exp * 1000);
86
+ const daysUntilExpiry = Math.max(0, Math.floor((expiresAt - Date.now()) / 86_400_000));
87
+
88
+ let expiryWarning = null;
89
+ if (daysUntilExpiry <= 1) {
90
+ expiryWarning = 'License expires tomorrow — update NSAUDITOR_LICENSE_KEY now';
91
+ } else if (daysUntilExpiry <= 7) {
92
+ expiryWarning = `License expires in ${daysUntilExpiry} days — check email for renewal key`;
93
+ }
94
+
95
+ if (expiryWarning) {
96
+ console.warn(`\u26A0 ${expiryWarning}`);
97
+ }
98
+
84
99
  return {
85
100
  valid: true,
86
101
  tier: payload.tier,
@@ -88,7 +103,9 @@ export async function loadLicense(keyStr) {
88
103
  seats: payload.seats,
89
104
  licenseId: payload.licenseId,
90
105
  capabilities: payload.capabilities,
91
- expiresAt: new Date(payload.exp * 1000).toISOString(),
106
+ expiresAt: expiresAt.toISOString(),
107
+ daysUntilExpiry,
108
+ expiryWarning,
92
109
  };
93
110
  } catch {
94
111
  // Verification failure — actively downgrade to CE (prevents prefix spoofing).