javascript-obfuscator 4.2.2 → 5.0.1
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/.eslintrc.js +1 -1
- package/CHANGELOG.md +5 -1
- package/README.md +203 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cli.js +1 -1
- package/dist/index.cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/typings/index.d.ts +7 -0
- package/typings/src/JavaScriptObfuscatorFacade.d.ts +4 -0
- package/typings/src/interfaces/pro-api/IProApiClient.d.ts +22 -0
- package/typings/src/pro-api/ApiError.d.ts +5 -0
- package/typings/src/pro-api/ProApiClient.d.ts +9 -0
- package/typings/src/pro-api/ProApiObfuscationResult.d.ts +11 -0
- /package/typings/src/{constants/ProAdvertiseMessage.d.ts → pro-api/constants.d.ts} +0 -0
package/package.json
CHANGED
package/typings/index.d.ts
CHANGED
|
@@ -3,10 +3,17 @@ import { TInputOptions } from './src/types/options/TInputOptions';
|
|
|
3
3
|
import { TObfuscationResultsObject } from './src/types/TObfuscationResultsObject';
|
|
4
4
|
import { TOptionsPreset } from './src/types/options/TOptionsPreset';
|
|
5
5
|
import { IObfuscationResult } from './src/interfaces/source-code/IObfuscationResult';
|
|
6
|
+
import { IProApiConfig, IProObfuscationResult, TProApiProgressCallback } from './src/interfaces/pro-api/IProApiClient';
|
|
7
|
+
import { ApiError } from './src/JavaScriptObfuscatorFacade';
|
|
6
8
|
export type ObfuscatorOptions = TInputOptions;
|
|
7
9
|
export interface ObfuscationResult extends IObfuscationResult {
|
|
8
10
|
}
|
|
11
|
+
export interface ProObfuscationResult extends IProObfuscationResult {
|
|
12
|
+
}
|
|
13
|
+
export type { IProApiConfig, TProApiProgressCallback };
|
|
14
|
+
export { ApiError };
|
|
9
15
|
export declare function obfuscate(sourceCode: string, inputOptions?: ObfuscatorOptions): ObfuscationResult;
|
|
10
16
|
export declare function obfuscateMultiple<TSourceCodesObject extends TDictionary<string>>(sourceCodesObject: TSourceCodesObject, inputOptions?: TInputOptions): TObfuscationResultsObject<TSourceCodesObject>;
|
|
17
|
+
export declare function obfuscatePro(sourceCode: string, inputOptions: ObfuscatorOptions, proApiConfig: IProApiConfig, onProgress?: TProApiProgressCallback): Promise<ProObfuscationResult>;
|
|
11
18
|
export declare function getOptionsByPreset(optionsPreset: TOptionsPreset): TInputOptions;
|
|
12
19
|
export declare const version: string;
|
|
@@ -4,10 +4,14 @@ import { TInputOptions } from './types/options/TInputOptions';
|
|
|
4
4
|
import { TObfuscationResultsObject } from './types/TObfuscationResultsObject';
|
|
5
5
|
import { TOptionsPreset } from './types/options/TOptionsPreset';
|
|
6
6
|
import { IObfuscationResult } from './interfaces/source-code/IObfuscationResult';
|
|
7
|
+
import { IProApiConfig, IProObfuscationResult, TProApiProgressCallback } from './interfaces/pro-api/IProApiClient';
|
|
7
8
|
declare class JavaScriptObfuscatorFacade {
|
|
8
9
|
static version: string;
|
|
9
10
|
static obfuscate(sourceCode: string, inputOptions?: TInputOptions): IObfuscationResult;
|
|
10
11
|
static obfuscateMultiple<TSourceCodesObject extends TDictionary<string>>(sourceCodesObject: TSourceCodesObject, inputOptions?: TInputOptions): TObfuscationResultsObject<TSourceCodesObject>;
|
|
11
12
|
static getOptionsByPreset(optionsPreset: TOptionsPreset): TInputOptions;
|
|
13
|
+
static obfuscatePro(sourceCode: string, inputOptions: TInputOptions, proApiConfig: IProApiConfig, onProgress?: TProApiProgressCallback): Promise<IProObfuscationResult>;
|
|
12
14
|
}
|
|
13
15
|
export { JavaScriptObfuscatorFacade as JavaScriptObfuscator };
|
|
16
|
+
export { ApiError } from './pro-api/ApiError';
|
|
17
|
+
export type { IProApiConfig, TProApiProgressCallback } from './interfaces/pro-api/IProApiClient';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TIdentifierNamesCache } from '../../types/TIdentifierNamesCache';
|
|
2
|
+
export interface IProObfuscationResult {
|
|
3
|
+
getIdentifierNamesCache(): TIdentifierNamesCache;
|
|
4
|
+
getObfuscatedCode(): string;
|
|
5
|
+
getSourceMap(): string;
|
|
6
|
+
toString(): string;
|
|
7
|
+
}
|
|
8
|
+
export interface IProApiConfig {
|
|
9
|
+
apiToken: string;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
}
|
|
12
|
+
export type TProApiProgressCallback = (message: string) => void;
|
|
13
|
+
export interface IProApiStreamMessage {
|
|
14
|
+
type: 'progress' | 'result' | 'chunk' | 'chunk_end' | 'error';
|
|
15
|
+
message?: string;
|
|
16
|
+
code?: string;
|
|
17
|
+
sourceMap?: string;
|
|
18
|
+
field?: 'code' | 'sourceMap';
|
|
19
|
+
data?: string;
|
|
20
|
+
index?: number;
|
|
21
|
+
total?: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TInputOptions } from '../types/options/TInputOptions';
|
|
2
|
+
import { IProApiConfig, IProObfuscationResult, TProApiProgressCallback } from '../interfaces/pro-api/IProApiClient';
|
|
3
|
+
export declare class ProApiClient {
|
|
4
|
+
private readonly config;
|
|
5
|
+
constructor(config: IProApiConfig);
|
|
6
|
+
obfuscate(sourceCode: string, options?: TInputOptions, onProgress?: TProApiProgressCallback): Promise<IProObfuscationResult>;
|
|
7
|
+
private handleStreamingResponse;
|
|
8
|
+
private reassembleChunkedResponse;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TIdentifierNamesCache } from '../types/TIdentifierNamesCache';
|
|
2
|
+
import { IProObfuscationResult } from '../interfaces/pro-api/IProApiClient';
|
|
3
|
+
export declare class ProApiObfuscationResult implements IProObfuscationResult {
|
|
4
|
+
private readonly obfuscatedCode;
|
|
5
|
+
private readonly sourceMapValue;
|
|
6
|
+
constructor(code: string, sourceMap?: string);
|
|
7
|
+
getObfuscatedCode(): string;
|
|
8
|
+
getSourceMap(): string;
|
|
9
|
+
getIdentifierNamesCache(): TIdentifierNamesCache;
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
File without changes
|