@aientrophy/sdk 0.3.1 → 0.3.3
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/dist/anti-debug-BWiEU1_V.cjs +1 -0
- package/dist/{anti-debug-CRuvY4WC.js → anti-debug-Cf0ePnTv.js} +65 -0
- package/dist/console-DYd8RaPC.cjs +1 -0
- package/dist/{console-DbZZ4Ctg.js → console-n38-3CrG.js} +2 -1
- package/dist/core.js +1 -1
- package/dist/npm/index.cjs.js +1 -1
- package/dist/npm/index.es.js +528 -3
- package/dist/sri-hashes.json +2 -2
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/detectors/ScriptInjectionDetector.d.ts +56 -0
- package/dist/types/detectors/WorkerIntegrityDetector.d.ts +26 -0
- package/dist/types/protection/anti-debug.d.ts +7 -0
- package/package.json +1 -1
- package/dist/anti-debug-CYwG4s7P.cjs +0 -1
- package/dist/console-aIpHQlgP.cjs +0 -1
- package/dist/index.d.ts +0 -21
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__publicField=(e,t,o)=>((e,t,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o)(e,"symbol"!=typeof t?t+"":t,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _originalConsole={};class AntiDebug{static start(){this.saveConsole(),this.disableConsole(),this.preventDevTools()}static stop(){this.intervalId&&clearInterval(this.intervalId)}static getOriginalConsole(){return _originalConsole}static saveConsole(){const e=["log","debug","info","warn","error","table","trace","dir","clear"];try{const t=window.console;if(!t)return;for(const o of e)"function"==typeof t[o]&&(_originalConsole[o]=t[o].bind(t))}catch(t){}}static preventDevTools(){this.intervalId=setInterval(()=>{this.debuggerCheck()},this.checkInterval)}static debuggerCheck(){!function(){try{(function(){}).constructor("debugger")()}catch(e){}}()}static disableConsole(){const e=()=>{},t=["log","debug","info","warn","error","table","trace","dir"];try{const o=window.console;if(!o)return;for(const i of t)o[i]&&(o[i]=e)}catch(o){}}}__publicField(AntiDebug,"checkInterval",1e3),__publicField(AntiDebug,"intervalId"),exports.AntiDebug=AntiDebug;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__publicField=(t,e,i)=>((t,e,i)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const antiDebug=require("./anti-debug-CYwG4s7P.cjs");exports.ConsoleDetector=class{constructor(t){__publicField(this,"onDetect"),__publicField(this,"intervals",[]),__publicField(this,"detected",!1),this.onDetect=t}start(){this.startGetterTrap(),this.startSizeDetection()}stop(){for(const t of this.intervals)clearInterval(t);this.intervals=[]}triggerDetect(){this.detected||(this.detected=!0,this.onDetect(),setTimeout(()=>{this.detected=!1},5e3))}startGetterTrap(){const t=antiDebug.AntiDebug.getOriginalConsole(),e=t.log,i=t.clear;if(!e)return;const r=document.createElement("div");Object.defineProperty(r,"id",{get:()=>(this.triggerDetect(),"")});const n=/./;n.toString=()=>(this.triggerDetect(),"");const s=setInterval(()=>{try{e(r),e(n),i&&i()}catch(t){}},1500);this.intervals.push(s)}startSizeDetection(){if(navigator.maxTouchPoints>0||/Mobile|Android|iPhone|iPad/i.test(navigator.userAgent))return;const t=setInterval(()=>{const t=window.outerWidth-window.innerWidth>160,e=window.outerHeight-window.innerHeight>160;(t||e)&&this.triggerDetect()},2e3);this.intervals.push(t)}};
|
package/dist/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface CrawlProtectConfig {
|
|
2
|
-
protectSelectors?: string[];
|
|
3
|
-
insertHoneypot?: boolean;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface AientropyConfig {
|
|
7
|
-
clientKey: string;
|
|
8
|
-
endpoint?: string;
|
|
9
|
-
debug?: boolean;
|
|
10
|
-
crawlProtect?: CrawlProtectConfig;
|
|
11
|
-
callbacks?: Record<string, (...args: any[]) => void>;
|
|
12
|
-
serverConfig?: Record<string, any>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export declare class Aientrophy {
|
|
16
|
-
constructor(config: AientropyConfig);
|
|
17
|
-
protect(): void;
|
|
18
|
-
on(event: string, handler: (...args: any[]) => void): void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default Aientrophy;
|