jso-protector 0.4.6 → 0.4.8
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/CHANGELOG.md +31 -0
- package/bin/jso-protector.js +16 -6
- package/credentials.js +5 -1
- package/examples/README.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.8 - 2026-09-01
|
|
4
|
+
|
|
5
|
+
The rate-limit message a first run actually sees.
|
|
6
|
+
|
|
7
|
+
- A keyless run that tripped the free-tier cap used to print
|
|
8
|
+
`API returned non-JSON response (429): The custom error module does not
|
|
9
|
+
recognize this error.` That sentence was IIS's, not ours: the server writes a
|
|
10
|
+
proper JSON body, and IIS's custom-error module was discarding it before it
|
|
11
|
+
left the machine. Fixed server-side; the message now says which of the two
|
|
12
|
+
ceilings was hit and how to raise it.
|
|
13
|
+
- The CLI no longer appends its paid-plan hint to a 429. The word "limit" in a
|
|
14
|
+
rate-limit message matched the billing regexp, so someone with no account was
|
|
15
|
+
being told to go check their subscription state.
|
|
16
|
+
- `--help` now shows the positional form. `jso-protector app.js` has always
|
|
17
|
+
worked and writes `app-obfuscated.js` beside the input - the same default the
|
|
18
|
+
competitor's CLI uses - but nothing in the help output said so, so anyone
|
|
19
|
+
arriving with that muscle memory had no way to find it.
|
|
20
|
+
|
|
21
|
+
## 0.4.7 - 2026-08-31
|
|
22
|
+
|
|
23
|
+
Attribution only. No behaviour changes.
|
|
24
|
+
|
|
25
|
+
- The dashboard links the CLI opens now carry a source tag: `src=cli-login`
|
|
26
|
+
from `login`, and `src=cli-nokey` / `src=cli-nopwd` from the missing-credential
|
|
27
|
+
errors. A sign-up that starts at the CLI was previously indistinguishable from
|
|
28
|
+
a web sign-up, which made the free first run impossible to measure.
|
|
29
|
+
- Held back until the site could actually read the tag. It was being lost twice
|
|
30
|
+
on the way: the dashboard bounced signed-out visitors to sign-in without the
|
|
31
|
+
query string, and the sign-in page then hardcoded its own tag over whatever
|
|
32
|
+
arrived. Both are fixed and live, verified end to end before this release.
|
|
33
|
+
|
|
3
34
|
## 0.4.6 - 2026-08-31
|
|
4
35
|
|
|
5
36
|
Documentation only. No behaviour changes.
|
package/bin/jso-protector.js
CHANGED
|
@@ -889,6 +889,9 @@ function printHelp() {
|
|
|
889
889
|
process.stdout.write(`jso-protector
|
|
890
890
|
|
|
891
891
|
Usage:
|
|
892
|
+
jso-protector app.js Writes app-obfuscated.js beside it
|
|
893
|
+
jso-protector app.js protected/app.js Input and output as positional paths
|
|
894
|
+
jso-protector app.js --output protected.js
|
|
892
895
|
jso-protector --config jso.config.json
|
|
893
896
|
jso-protector --input dist --output dist-protected
|
|
894
897
|
jso-protector --stdin --stdout --file-name app.js
|
|
@@ -4645,6 +4648,13 @@ function formatApiFailure(details = {}, secrets = []) {
|
|
|
4645
4648
|
}
|
|
4646
4649
|
|
|
4647
4650
|
function apiFailureHint(details = {}) {
|
|
4651
|
+
// A 429 already carries a complete, actionable message from the server
|
|
4652
|
+
// (which ceiling was hit, how long to wait, and that signing in raises it).
|
|
4653
|
+
// Appending the billing hint on top of it was actively misleading: the
|
|
4654
|
+
// word "limit" in a rate-limit message matched the paid-plan regexp below,
|
|
4655
|
+
// so a keyless first run was told to "check account status, plan limits,
|
|
4656
|
+
// credits, or subscription state" for a quota no account would fix.
|
|
4657
|
+
if (details.status === 429) return "";
|
|
4648
4658
|
const text = `${details.status || ""} ${details.type || ""} ${details.message || ""}`.toLowerCase();
|
|
4649
4659
|
if (/payment|paid|plan|subscription|credit|quota|limit|expired|billing|over[- ]?limit/.test(text)) {
|
|
4650
4660
|
return "Paid API access is enforced by the hosted API; check account status, plan limits, credits, or subscription state.";
|
|
@@ -4702,8 +4712,8 @@ function isAnonymousRun(config) {
|
|
|
4702
4712
|
|
|
4703
4713
|
function assertReady(config) {
|
|
4704
4714
|
if (isAnonymousRun(config)) return;
|
|
4705
|
-
if (!config.apiKey) throw new Error("Missing API key. Run `javascriptobfuscator login` to sign in and save credentials, or create a key at https://javascriptobfuscator.com/dashboard/APIKeys.aspx and set JSO_API_KEY.");
|
|
4706
|
-
if (!config.apiPassword) throw new Error("Missing API password. Run `javascriptobfuscator login` to sign in and save credentials, or copy it from https://javascriptobfuscator.com/dashboard/APIKeys.aspx and set JSO_API_PASSWORD.");
|
|
4715
|
+
if (!config.apiKey) throw new Error("Missing API key. Run `javascriptobfuscator login` to sign in and save credentials, or create a key at https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-nokey and set JSO_API_KEY.");
|
|
4716
|
+
if (!config.apiPassword) throw new Error("Missing API password. Run `javascriptobfuscator login` to sign in and save credentials, or copy it from https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-nopwd and set JSO_API_PASSWORD.");
|
|
4707
4717
|
}
|
|
4708
4718
|
|
|
4709
4719
|
function sha256(value) {
|
|
@@ -4884,8 +4894,8 @@ async function runDoctor(config, args = {}) {
|
|
|
4884
4894
|
const checks = [];
|
|
4885
4895
|
const limitations = collectCompetitorLimitations(args.rawConfig && typeof args.rawConfig === "object" ? args.rawConfig : config, args);
|
|
4886
4896
|
addDoctorCheck(checks, "endpoint", isValidUrl(config.endpoint), `Endpoint: ${config.endpoint}`, "Endpoint must be a valid URL.");
|
|
4887
|
-
addDoctorCheck(checks, "apiKey", !!config.apiKey, "API key is present.", "Missing API key. Run `javascriptobfuscator login` to sign in and save credentials, or create a key at https://javascriptobfuscator.com/dashboard/APIKeys.aspx and set JSO_API_KEY.");
|
|
4888
|
-
addDoctorCheck(checks, "apiPassword", !!config.apiPassword, "API password is present.", "Missing API password. Run `javascriptobfuscator login` to sign in and save credentials, or copy it from https://javascriptobfuscator.com/dashboard/APIKeys.aspx and set JSO_API_PASSWORD.");
|
|
4897
|
+
addDoctorCheck(checks, "apiKey", !!config.apiKey, "API key is present.", "Missing API key. Run `javascriptobfuscator login` to sign in and save credentials, or create a key at https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-nokey and set JSO_API_KEY.");
|
|
4898
|
+
addDoctorCheck(checks, "apiPassword", !!config.apiPassword, "API password is present.", "Missing API password. Run `javascriptobfuscator login` to sign in and save credentials, or copy it from https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-nopwd and set JSO_API_PASSWORD.");
|
|
4889
4899
|
addDoctorCheck(checks, "preset", true, `Preset: ${config.preset}`);
|
|
4890
4900
|
addDoctorCheck(checks, "options", Object.keys(config.options || {}).length > 0, `${Object.keys(config.options || {}).length} option(s) enabled.`, "No protection options are enabled.");
|
|
4891
4901
|
|
|
@@ -7154,8 +7164,8 @@ function validateProtectionConfig(config, args = {}) {
|
|
|
7154
7164
|
}
|
|
7155
7165
|
|
|
7156
7166
|
addValidationCheck(checks, "endpoint", isValidUrl(resolved.endpoint) ? "ok" : "error", isValidUrl(resolved.endpoint) ? `Endpoint: ${resolved.endpoint}` : "Endpoint must be a valid HTTP or HTTPS URL.");
|
|
7157
|
-
addValidationCheck(checks, "apiKey", resolved.apiKey ? "ok" : "error", resolved.apiKey ? "API key is present." : "Missing API key. Run `javascriptobfuscator login` to sign in and save credentials, or create a key at https://javascriptobfuscator.com/dashboard/APIKeys.aspx and set JSO_API_KEY.");
|
|
7158
|
-
addValidationCheck(checks, "apiPassword", resolved.apiPassword ? "ok" : "error", resolved.apiPassword ? "API password is present." : "Missing API password. Run `javascriptobfuscator login` to sign in and save credentials, or copy it from https://javascriptobfuscator.com/dashboard/APIKeys.aspx and set JSO_API_PASSWORD.");
|
|
7167
|
+
addValidationCheck(checks, "apiKey", resolved.apiKey ? "ok" : "error", resolved.apiKey ? "API key is present." : "Missing API key. Run `javascriptobfuscator login` to sign in and save credentials, or create a key at https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-nokey and set JSO_API_KEY.");
|
|
7168
|
+
addValidationCheck(checks, "apiPassword", resolved.apiPassword ? "ok" : "error", resolved.apiPassword ? "API password is present." : "Missing API password. Run `javascriptobfuscator login` to sign in and save credentials, or copy it from https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-nopwd and set JSO_API_PASSWORD.");
|
|
7159
7169
|
addCredentialStorageValidation(checks, config, args);
|
|
7160
7170
|
addValidationCheck(checks, "preset", "ok", `Preset: ${resolved.preset}`);
|
|
7161
7171
|
addValidationCheck(checks, "paths", resolved.input && resolved.output ? "ok" : "error", resolved.input && resolved.output ? "Input and output paths are configured." : "Input and output paths must be configured.");
|
package/credentials.js
CHANGED
|
@@ -22,7 +22,11 @@ const path = require("path");
|
|
|
22
22
|
const readline = require("readline");
|
|
23
23
|
const { spawn } = require("child_process");
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
// ?src= is attribution, not decoration: a signup that starts at `login` is
|
|
26
|
+
// otherwise indistinguishable from a web signup, and the CLI is the entry
|
|
27
|
+
// point whose value we are trying to measure. register.aspx carries plan/src/deal
|
|
28
|
+
// forward from the referrer, so the tag survives the sign-in hop.
|
|
29
|
+
const DASHBOARD_URL = "https://javascriptobfuscator.com/dashboard/APIKeys.aspx?src=cli-login";
|
|
26
30
|
const STORE_DIR = path.join(os.homedir() || ".", ".jso-protector");
|
|
27
31
|
const STORE_FILE = path.join(STORE_DIR, "credentials.json");
|
|
28
32
|
|
package/examples/README.md
CHANGED
|
@@ -39,7 +39,7 @@ published as `javascriptobfuscator-com`; `jso-protector` is the former name and
|
|
|
39
39
|
is deprecated but still updated:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npm install --save-dev javascriptobfuscator-com@0.4.
|
|
42
|
+
npm install --save-dev javascriptobfuscator-com@0.4.7
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Repository contributors can instead use the existing `file:../..` development
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jso-protector",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Obfuscate and protect JavaScript in your build or CI: dependency-free CLI, Node API, and webpack/Vite/Rollup/esbuild/Next.js/Metro plugins, with one-command migration from javascript-obfuscator and JS-Confuser configs.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "JavaScript Obfuscator",
|