@mmo69/vmcode 1.0.0 → 1.1.0

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
@@ -72,10 +72,10 @@ console.log(result); // protected code — runs exactly like the original
72
72
 
73
73
  - **`low`** *(default)* — fastest, only `dynamicOpcodes`: plain VM bytecode,
74
74
  compact output. A 122KB file takes ~a few hundred ms.
75
- - **`medium`** — balanced: 9/21 options on. A 122KB file takes ~3s.
76
- - **`max`** — all 21 options. Strongest but slow — **cost scales with
77
- FUNCTION COUNT**; a many-function file (800+) can take minutes — raise
78
- `timeoutMs` when using it.
75
+ - **`medium`** — balanced: 9/21 options on. Roughly ~1s per MB of source.
76
+ - **`max`** — all 21 options. Strongest but slow — cost scales with
77
+ **function count and file size** (~6–7s per MB): a 3MB file takes ~20s,
78
+ a 20MB file can take several minutes — `timeoutMs` (21 min) already covers it.
79
79
 
80
80
  **Auto-enable** (the engine turns these on by itself, no need to declare):
81
81
  enabling `integrityBinding` / `vmShielding` / `opcodeMutation` /
@@ -157,8 +157,9 @@ unlocks every preset and all custom options:
157
157
  |---|---|:---:|---|
158
158
  | Anonymous (web) | low, medium | ✗ | 128KB |
159
159
  | Free | low, medium | ✗ | 268KB |
160
- | **Pro** | low, medium, max | ✓ | 1MB |
161
- | Team / Business | low, medium, max | ✓ + priority queue | 3MB |
160
+ | **Pro** | low, medium, max | ✓ | 5MB |
161
+ | Team | low, medium, max | ✓ + priority queue | 12MB |
162
+ | Business | low, medium, max | ✓ + priority queue | 20MB |
162
163
 
163
164
  ## API
164
165
 
@@ -169,7 +170,7 @@ unlocks every preset and all custom options:
169
170
  | `apiKey` | — | **required**, `tnvm_…` (Pro+) |
170
171
  | `baseUrl` | `https://JsVM.MMO69.Com` | change for a local server |
171
172
  | `pollMs` | `1000` | result polling interval |
172
- | `timeoutMs` | `600000` | max wait of `protect()` (preset `max` on many-function files can take minutes) |
173
+ | `timeoutMs` | `1260000` | max wait of `protect()` — the server compiles max-size files up to 20 min, default 21 min covers it |
173
174
  | `gzip` | `true` | gzip requests > 1KB |
174
175
 
175
176
  ### Methods
package/README_VI.md CHANGED
@@ -72,9 +72,10 @@ console.log(result); // mã đã bảo vệ — chạy y hệt bản gốc
72
72
 
73
73
  - **`low`** *(mặc định)* — nhanh nhất, chỉ `dynamicOpcodes`: bytecode VM thuần,
74
74
  output gọn. File 122KB ~vài trăm ms.
75
- - **`medium`** — cân bằng: 9/21 option bật. File 122KB ~3s.
76
- - **`max`** — tất cả 21 option. Mạnh nhất nhưng chậm — **thời gian tăng theo
77
- SỐ HÀM**, file nhiều hàm (800+) có thể mất vài phút; tăng `timeoutMs` khi dùng.
75
+ - **`medium`** — cân bằng: 9/21 option bật. Tốc độ ~1 giây mỗi MB mã nguồn.
76
+ - **`max`** — tất cả 21 option. Mạnh nhất nhưng chậm — thời gian tăng theo
77
+ **số hàm lẫn size file** (~6–7 giây mỗi MB): file 3MB ~20 giây,
78
+ file 20MB có thể mất vài phút — `timeoutMs` mặc định 21 phút đã đủ.
78
79
 
79
80
  **Auto-enable** (engine tự bật kèm, không cần khai báo):
80
81
  bật `integrityBinding` / `vmShielding` / `opcodeMutation` / `incrementalCipher` /
@@ -156,8 +157,9 @@ tuỳ biến đều mở:
156
157
  | --------------- | ---------------- | :------------------------: | -------------------- |
157
158
  | Ẩn danh (web) | low, medium | ✗ | 128KB |
158
159
  | Free | low, medium | ✗ | 268KB |
159
- | **Pro** | low, medium, max | ✓ | 1MB |
160
- | Team / Business | low, medium, max | ✓ + hàng đợi ưu tiên | 3MB |
160
+ | **Pro** | low, medium, max | ✓ | 5MB |
161
+ | Team | low, medium, max | ✓ + hàng đợi ưu tiên | 12MB |
162
+ | Business | low, medium, max | ✓ + hàng đợi ưu tiên | 20MB |
161
163
 
162
164
  ## API
163
165
 
@@ -168,7 +170,7 @@ tuỳ biến đều mở:
168
170
  | `apiKey` | — | **bắt buộc**, `tnvm_…` (Pro+) |
169
171
  | `baseUrl` | `https://JsVM.MMO69.Com` | đổi khi chạy server local |
170
172
  | `pollMs` | `1000` | nhịp poll kết quả |
171
- | `timeoutMs` | `600000` | thời gian chờ tối đa của `protect()` (preset `max` file nhiều hàm có thể mất vài phút) |
173
+ | `timeoutMs` | `1260000` | thời gian chờ tối đa của `protect()` — server compile file cỡ lớn tối đa 20 phút, mặc định 21 phút là đủ |
172
174
  | `gzip` | `true` | nén gzip request > 1KB |
173
175
 
174
176
  ### Phương thức
package/index.mjs CHANGED
@@ -24,10 +24,10 @@ export class VmCode {
24
24
  * @param {string} opts.apiKey tnvm_… API key (required — Pro plan or higher)
25
25
  * @param {string} [opts.baseUrl] default https://JsVM.MMO69.Com (change for local/dev)
26
26
  * @param {number} [opts.pollMs] result polling interval (default 1000)
27
- * @param {number} [opts.timeoutMs] max wait of protect() (default 10 minutes)
27
+ * @param {number} [opts.timeoutMs] max wait of protect() (default 21 minutes — the server compiles max-size files up to 20 min)
28
28
  * @param {boolean} [opts.gzip] gzip requests > 1KB (default true)
29
29
  */
30
- constructor({ apiKey, baseUrl, pollMs = 1000, timeoutMs = 10 * 60_000, gzip = true } = {}) {
30
+ constructor({ apiKey, baseUrl, pollMs = 1000, timeoutMs = 21 * 60_000, gzip = true } = {}) {
31
31
  if (!apiKey) throw new VmError('Missing apiKey (tnvm_…) — create one at /client/apikeys.html (Pro plan+)', 'apikey');
32
32
  this.apiKey = String(apiKey);
33
33
  this.base = String(baseUrl || DEFAULT_BASE).replace(/\/+$/, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmo69/vmcode",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "NodeJS SDK for the JsVM.MMO69.Com VMCode API — protect JavaScript with server-side TNVM VM bytecode (async task: submit → taskId → poll).",
5
5
  "type": "module",
6
6
  "main": "index.mjs",