unpeek 3.0.0 → 4.0.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 +27 -13
- package/README.tr.md +37 -23
- package/dist/adapters/esbuild.cjs +5 -5
- package/dist/adapters/esbuild.d.cts +3 -1
- package/dist/adapters/esbuild.d.ts +2 -2
- package/dist/adapters/esbuild.js +5 -3
- package/dist/adapters/next/adapter.cjs +7 -6
- package/dist/adapters/next/adapter.d.cts +1 -1
- package/dist/adapters/next/adapter.d.ts +1 -1
- package/dist/adapters/next/adapter.js +6 -5
- package/dist/adapters/next/index.cjs +7 -6
- package/dist/adapters/next/index.js +6 -5
- package/dist/adapters/rollup.cjs +5 -5
- package/dist/adapters/rollup.d.cts +3 -1
- package/dist/adapters/rollup.d.ts +2 -2
- package/dist/adapters/rollup.js +5 -3
- package/dist/adapters/rspack.cjs +5 -4
- package/dist/adapters/rspack.d.cts +1 -1
- package/dist/adapters/rspack.d.ts +1 -1
- package/dist/adapters/rspack.js +3 -2
- package/dist/adapters/vite.cjs +5 -5
- package/dist/adapters/vite.d.cts +3 -1
- package/dist/adapters/vite.d.ts +2 -2
- package/dist/adapters/vite.js +5 -3
- package/dist/adapters/webpack.cjs +5 -5
- package/dist/adapters/webpack.d.cts +3 -1
- package/dist/adapters/webpack.d.ts +2 -2
- package/dist/adapters/webpack.js +5 -3
- package/dist/browser.cjs +3 -3
- package/dist/browser.d.cts +20 -17
- package/dist/browser.d.ts +20 -17
- package/dist/browser.js +2 -2
- package/dist/{chunk-BPRSCRUZ.js → chunk-2JU3V7HW.js} +6 -3
- package/dist/chunk-3LWXEJU6.cjs +1054 -0
- package/dist/{chunk-IZIWDJRF.js → chunk-4FNZNIBW.js} +2675 -651
- package/dist/chunk-7HXLHLLQ.cjs +503 -0
- package/dist/chunk-ADKRENAP.js +1054 -0
- package/dist/{chunk-FCF2EGPM.js → chunk-EN6QVR6P.js} +12 -3
- package/dist/chunk-HHC7BUCK.js +503 -0
- package/dist/{chunk-IAD5DV3D.cjs → chunk-KLYFNMKS.cjs} +2812 -788
- package/dist/{chunk-IEBVL5BT.cjs → chunk-URPPSTHZ.cjs} +12 -3
- package/dist/chunk-VG4Y26ZN.cjs +429 -0
- package/dist/{chunk-IICVBTR2.js → chunk-W77DAC3H.js} +22 -3
- package/dist/{chunk-ONM2CSTU.cjs → chunk-X6EETCO6.cjs} +64 -45
- package/dist/chunk-YCRMTXOE.js +429 -0
- package/dist/{chunk-6TDCSIRZ.cjs → chunk-ZG7BIAUI.cjs} +9 -6
- package/dist/cli/index.js +3693 -1141
- package/dist/{config-CfXY_iDD.d.ts → config-Y6JwVGwX.d.cts} +15 -1
- package/dist/{config-CfXY_iDD.d.cts → config-Y6JwVGwX.d.ts} +15 -1
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -2
- package/dist/{index-CjRTNPlj.d.cts → index-0O1WSfVP.d.ts} +7 -1
- package/dist/{index-Cm1IloVm.d.ts → index-COVHErnx.d.cts} +7 -1
- package/dist/index.cjs +65 -264
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +59 -258
- package/dist/plugins/unplugin.cjs +4 -3
- package/dist/plugins/unplugin.js +3 -2
- package/dist/{types-DYQIzGf6.d.cts → types-CMtZnV8C.d.ts} +3 -3
- package/dist/{types-ZHAFdOd3.d.ts → types-D93PuOOl.d.cts} +3 -3
- package/package.json +1 -1
- package/dist/chunk-APWMNVAZ.js +0 -764
- package/dist/chunk-DUK2SECY.js +0 -83
- package/dist/chunk-I6GXEHFR.cjs +0 -764
- package/dist/chunk-RXUY3MPH.cjs +0 -83
package/dist/adapters/webpack.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
webpackPlugin
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-YCRMTXOE.js";
|
|
4
|
+
import "../chunk-ADKRENAP.js";
|
|
5
|
+
import "../chunk-4FNZNIBW.js";
|
|
5
6
|
import "../chunk-LA6J3BT3.js";
|
|
6
7
|
|
|
7
8
|
// src/adapters/webpack.ts
|
|
8
9
|
var webpack_default = webpackPlugin;
|
|
9
10
|
export {
|
|
10
|
-
webpack_default as default
|
|
11
|
+
webpack_default as default,
|
|
12
|
+
webpackPlugin as unpeekWebpack
|
|
11
13
|
};
|
package/dist/browser.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkURPPSTHZcjs = require('./chunk-URPPSTHZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ var _chunkIEBVL5BTcjs = require('./chunk-IEBVL5BT.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkKLYFNMKScjs = require('./chunk-KLYFNMKS.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -25,4 +25,4 @@ var _chunkL6BOM5VScjs = require('./chunk-L6BOM5VS.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
exports.PRESETS =
|
|
28
|
+
exports.PRESETS = _chunkURPPSTHZcjs.PRESETS; exports.UnpeekError = _chunkL6BOM5VScjs.UnpeekError; exports.computeFnv1aHash = _chunkKLYFNMKScjs.computeFnv1aHash; exports.computeIntegrityHash = _chunkKLYFNMKScjs.computeIntegrityHash; exports.createDeterrentSnippet = _chunkKLYFNMKScjs.createDeterrentSnippet; exports.detectHotPaths = _chunkKLYFNMKScjs.detectHotPaths; exports.generateRuntimeShield = _chunkKLYFNMKScjs.generateRuntimeShield; exports.isUnpeekError = _chunkL6BOM5VScjs.isUnpeekError; exports.transformJavaScript = _chunkKLYFNMKScjs.transformJavaScript; exports.verifyCodeIntegrity = _chunkKLYFNMKScjs.verifyCodeIntegrity;
|
package/dist/browser.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { U as UnpeekConfig, S as ShieldConfig, a as ShieldPayload } from './config-
|
|
2
|
-
export { B as BaseProtectionOptions, C as ConfigTarget, D as DeterrentMode, F as FilterConfig, H as HotPathConfig, M as ManglerConfig, N as NextConfigOptions, P as PRESETS, b as PatternInput, c as SemanticAnchorsConfig, d as ShieldOptionsConfig, e as SourcemapsConfig, f as UnpeekFramework, g as UnpeekPluginOptions, h as UnpeekProfile, V as VaultConfig, i as ViteConfigOptions } from './config-
|
|
3
|
-
import { H as HotPathReport } from './index-
|
|
4
|
-
export { S as ScrubberOptions, T as TransformOptions, a as TransformResult, b as TransformSkippedReason, U as UnpeekError, c as UnpeekErrorCode, i as isUnpeekError, t as transformJavaScript } from './index-
|
|
1
|
+
import { U as UnpeekConfig, S as ShieldConfig, a as ShieldPayload } from './config-Y6JwVGwX.cjs';
|
|
2
|
+
export { B as BaseProtectionOptions, C as ConfigTarget, D as DeterrentMode, F as FilterConfig, H as HotPathConfig, M as ManglerConfig, N as NextConfigOptions, P as PRESETS, b as PatternInput, c as SemanticAnchorsConfig, d as ShieldOptionsConfig, e as SourcemapsConfig, f as UnpeekFramework, g as UnpeekPluginOptions, h as UnpeekProfile, V as VaultConfig, i as ViteConfigOptions } from './config-Y6JwVGwX.cjs';
|
|
3
|
+
import { H as HotPathReport } from './index-COVHErnx.cjs';
|
|
4
|
+
export { S as ScrubberOptions, T as TransformOptions, a as TransformResult, b as TransformSkippedReason, U as UnpeekError, c as UnpeekErrorCode, i as isUnpeekError, t as transformJavaScript } from './index-COVHErnx.cjs';
|
|
5
5
|
|
|
6
6
|
declare function computeFnv1aHash(input: string, seed?: number): number;
|
|
7
7
|
|
|
@@ -14,25 +14,28 @@ declare function detectHotPaths(code: string, config?: UnpeekConfig): HotPathRep
|
|
|
14
14
|
*/
|
|
15
15
|
declare function computeIntegrityHash(source: string, seed?: number): number;
|
|
16
16
|
/**
|
|
17
|
-
* Verifies that a function or source string has not been pretty-printed
|
|
18
|
-
* by comparing its
|
|
17
|
+
* Verifies that a function or source string has not been pretty-printed,
|
|
18
|
+
* spoofed (`{ toString() {} }`), or modified by comparing its FNV-1a hash
|
|
19
|
+
* after validating native `Reflect.apply` invariants.
|
|
19
20
|
*/
|
|
20
|
-
declare function verifyCodeIntegrity(fnOrSource: ((...args: unknown[]) => unknown) | string, expectedHash: number, seed?: number): boolean;
|
|
21
|
+
declare function verifyCodeIntegrity(fnOrSource: ((...args: unknown[]) => unknown) | string, expectedHash: number, seed?: number, normalized?: boolean): boolean;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* Generates a single-line, self-executing (IIFE), polymorphic, synchronous, SSR-safe (<1.5 KB)
|
|
24
|
-
* anti-tamper deterrent snippet that calculates a synchronous 32-bit FNV-1a hash of its own
|
|
25
|
-
* Function.prototype.toString() representation
|
|
26
|
-
*
|
|
24
|
+
* Generates a single-line, self-executing (IIFE), polymorphic, synchronous, SSR- & Worker-safe (<1.5 KB)
|
|
25
|
+
* anti-tamper deterrent snippet that calculates a normalized synchronous 32-bit FNV-1a hash of its own
|
|
26
|
+
* Function.prototype.toString() representation, writes the 16-bit key component (expectedDelta) to
|
|
27
|
+
* globalThis[windowKeySymbol], and records the v4 non-poisoning state tuple
|
|
28
|
+
* globalThis[windowKeySymbol + '_s'] = [status, k0, k1, epoch, nonce] (status: 1=VERIFIED, 2=TAMPERED).
|
|
27
29
|
*
|
|
28
30
|
* Freedom To Operate (FTO) Compliance:
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* US9979726B2 covers server-mediated intervention combined with a DOM sweeping loop, while
|
|
32
|
+
* US10380382B2 covers periodic debugger console polling. unpeek strictly avoids both mechanisms
|
|
33
|
+
* and operates purely client-side and build-time synchronously within the expired US7757097B2
|
|
34
|
+
* (Expired - Lifetime) public prior-art domain.
|
|
32
35
|
*
|
|
33
|
-
* When tampering is detected (
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
+
* When tampering is detected (webdriver when enabled, toString/Reflect/descriptor spoofing, or code alteration):
|
|
37
|
+
* globalThis.__unpeek_tampered is set to true, state status is pinned to 2, String.prototype._u is poisoned to 14,
|
|
38
|
+
* globalThis[sym] is poisoned to expectedDelta ^ mask, and CustomEvent('unpeek:tamper') is dispatched.
|
|
36
39
|
*/
|
|
37
40
|
declare function createDeterrentSnippet(config: ShieldConfig): string;
|
|
38
41
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { U as UnpeekConfig, S as ShieldConfig, a as ShieldPayload } from './config-
|
|
2
|
-
export { B as BaseProtectionOptions, C as ConfigTarget, D as DeterrentMode, F as FilterConfig, H as HotPathConfig, M as ManglerConfig, N as NextConfigOptions, P as PRESETS, b as PatternInput, c as SemanticAnchorsConfig, d as ShieldOptionsConfig, e as SourcemapsConfig, f as UnpeekFramework, g as UnpeekPluginOptions, h as UnpeekProfile, V as VaultConfig, i as ViteConfigOptions } from './config-
|
|
3
|
-
import { H as HotPathReport } from './index-
|
|
4
|
-
export { S as ScrubberOptions, T as TransformOptions, a as TransformResult, b as TransformSkippedReason, U as UnpeekError, c as UnpeekErrorCode, i as isUnpeekError, t as transformJavaScript } from './index-
|
|
1
|
+
import { U as UnpeekConfig, S as ShieldConfig, a as ShieldPayload } from './config-Y6JwVGwX.js';
|
|
2
|
+
export { B as BaseProtectionOptions, C as ConfigTarget, D as DeterrentMode, F as FilterConfig, H as HotPathConfig, M as ManglerConfig, N as NextConfigOptions, P as PRESETS, b as PatternInput, c as SemanticAnchorsConfig, d as ShieldOptionsConfig, e as SourcemapsConfig, f as UnpeekFramework, g as UnpeekPluginOptions, h as UnpeekProfile, V as VaultConfig, i as ViteConfigOptions } from './config-Y6JwVGwX.js';
|
|
3
|
+
import { H as HotPathReport } from './index-0O1WSfVP.js';
|
|
4
|
+
export { S as ScrubberOptions, T as TransformOptions, a as TransformResult, b as TransformSkippedReason, U as UnpeekError, c as UnpeekErrorCode, i as isUnpeekError, t as transformJavaScript } from './index-0O1WSfVP.js';
|
|
5
5
|
|
|
6
6
|
declare function computeFnv1aHash(input: string, seed?: number): number;
|
|
7
7
|
|
|
@@ -14,25 +14,28 @@ declare function detectHotPaths(code: string, config?: UnpeekConfig): HotPathRep
|
|
|
14
14
|
*/
|
|
15
15
|
declare function computeIntegrityHash(source: string, seed?: number): number;
|
|
16
16
|
/**
|
|
17
|
-
* Verifies that a function or source string has not been pretty-printed
|
|
18
|
-
* by comparing its
|
|
17
|
+
* Verifies that a function or source string has not been pretty-printed,
|
|
18
|
+
* spoofed (`{ toString() {} }`), or modified by comparing its FNV-1a hash
|
|
19
|
+
* after validating native `Reflect.apply` invariants.
|
|
19
20
|
*/
|
|
20
|
-
declare function verifyCodeIntegrity(fnOrSource: ((...args: unknown[]) => unknown) | string, expectedHash: number, seed?: number): boolean;
|
|
21
|
+
declare function verifyCodeIntegrity(fnOrSource: ((...args: unknown[]) => unknown) | string, expectedHash: number, seed?: number, normalized?: boolean): boolean;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* Generates a single-line, self-executing (IIFE), polymorphic, synchronous, SSR-safe (<1.5 KB)
|
|
24
|
-
* anti-tamper deterrent snippet that calculates a synchronous 32-bit FNV-1a hash of its own
|
|
25
|
-
* Function.prototype.toString() representation
|
|
26
|
-
*
|
|
24
|
+
* Generates a single-line, self-executing (IIFE), polymorphic, synchronous, SSR- & Worker-safe (<1.5 KB)
|
|
25
|
+
* anti-tamper deterrent snippet that calculates a normalized synchronous 32-bit FNV-1a hash of its own
|
|
26
|
+
* Function.prototype.toString() representation, writes the 16-bit key component (expectedDelta) to
|
|
27
|
+
* globalThis[windowKeySymbol], and records the v4 non-poisoning state tuple
|
|
28
|
+
* globalThis[windowKeySymbol + '_s'] = [status, k0, k1, epoch, nonce] (status: 1=VERIFIED, 2=TAMPERED).
|
|
27
29
|
*
|
|
28
30
|
* Freedom To Operate (FTO) Compliance:
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* US9979726B2 covers server-mediated intervention combined with a DOM sweeping loop, while
|
|
32
|
+
* US10380382B2 covers periodic debugger console polling. unpeek strictly avoids both mechanisms
|
|
33
|
+
* and operates purely client-side and build-time synchronously within the expired US7757097B2
|
|
34
|
+
* (Expired - Lifetime) public prior-art domain.
|
|
32
35
|
*
|
|
33
|
-
* When tampering is detected (
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
+
* When tampering is detected (webdriver when enabled, toString/Reflect/descriptor spoofing, or code alteration):
|
|
37
|
+
* globalThis.__unpeek_tampered is set to true, state status is pinned to 2, String.prototype._u is poisoned to 14,
|
|
38
|
+
* globalThis[sym] is poisoned to expectedDelta ^ mask, and CustomEvent('unpeek:tamper') is dispatched.
|
|
36
39
|
*/
|
|
37
40
|
declare function createDeterrentSnippet(config: ShieldConfig): string;
|
|
38
41
|
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRESETS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EN6QVR6P.js";
|
|
4
4
|
import {
|
|
5
5
|
computeFnv1aHash,
|
|
6
6
|
computeIntegrityHash,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
generateRuntimeShield,
|
|
10
10
|
transformJavaScript,
|
|
11
11
|
verifyCodeIntegrity
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4FNZNIBW.js";
|
|
13
13
|
import {
|
|
14
14
|
UnpeekError,
|
|
15
15
|
isUnpeekError
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
protectProject,
|
|
3
3
|
serializeNextOptions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HHC7BUCK.js";
|
|
5
|
+
import {
|
|
6
|
+
safeDecodeURIComponent
|
|
7
|
+
} from "./chunk-ADKRENAP.js";
|
|
5
8
|
import {
|
|
6
9
|
computeFnv1aHash
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4FNZNIBW.js";
|
|
8
11
|
import {
|
|
9
12
|
UnpeekError,
|
|
10
13
|
__dirname,
|
|
@@ -112,7 +115,7 @@ function createUnpeekNextAdapter(options = {}) {
|
|
|
112
115
|
if (!rawFilePath) continue;
|
|
113
116
|
let absPath = path.isAbsolute(rawFilePath) ? rawFilePath : path.resolve(cwd, rawFilePath);
|
|
114
117
|
if (!fs.existsSync(absPath)) {
|
|
115
|
-
const relClean = rawFilePath.replace(/\\/g, "/").replace(/^\/?(?:_next\/|\.next\/)/, "");
|
|
118
|
+
const relClean = safeDecodeURIComponent(rawFilePath).replace(/\\/g, "/").replace(/^\/?(?:_next\/|\.next\/)/, "");
|
|
116
119
|
const fromDist = path.resolve(distDir, relClean);
|
|
117
120
|
if (fs.existsSync(fromDist)) {
|
|
118
121
|
absPath = fromDist;
|