kokorobox-native 0.1.0 → 0.2.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 +6 -3
- package/index.d.ts +29 -0
- package/index.js +3 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Native Node.js APIs used by KokoroBox Desktop.
|
|
4
4
|
|
|
5
|
-
The package
|
|
6
|
-
|
|
7
|
-
runtime.
|
|
5
|
+
The package exposes file/icon helpers, asynchronous application inspection, Windows executable
|
|
6
|
+
directory scanning, rule conversion, Windows elevation and SID queries, and Windows Firewall rule
|
|
7
|
+
management. Platform-specific N-API binaries are selected at runtime.
|
|
8
|
+
|
|
9
|
+
Use `getNativeCapabilities()` before offering optional platform features. Windows-only calls fail
|
|
10
|
+
with an `UNSUPPORTED_PLATFORM:` error outside Windows rather than reporting a no-op success.
|
|
8
11
|
|
|
9
12
|
This project is derived from
|
|
10
13
|
[`UruhaLushia/sparkle-native`](https://github.com/UruhaLushia/sparkle-native) and remains licensed
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,28 @@ export interface FirewallRule {
|
|
|
3
3
|
applicationPath: string;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
export interface NativeCapabilities {
|
|
7
|
+
applicationInspection: boolean;
|
|
8
|
+
windowsApplicationScan: boolean;
|
|
9
|
+
windowsAccount: boolean;
|
|
10
|
+
windowsElevation: boolean;
|
|
11
|
+
windowsFirewall: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ApplicationInfo {
|
|
15
|
+
executablePath: string;
|
|
16
|
+
executableName: string;
|
|
17
|
+
identifier: string;
|
|
18
|
+
identifierKind: "windows-executable" | "macos-signing-identifier" | "linux-executable";
|
|
19
|
+
iconDataUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ApplicationScanResult {
|
|
23
|
+
applications: ApplicationInfo[];
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
unreadableDirectoryCount: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
6
28
|
export interface RuleConvertOptions {
|
|
7
29
|
inputTarget?: "mihomo" | "general" | "egern" | "sing-box";
|
|
8
30
|
inputFormat?:
|
|
@@ -52,6 +74,13 @@ export function fileToStr(
|
|
|
52
74
|
options?: RuleConvertOptions | null,
|
|
53
75
|
): RuleStringResult;
|
|
54
76
|
export function getAppName(path: string): string;
|
|
77
|
+
export function getNativeCapabilities(): NativeCapabilities;
|
|
78
|
+
export function inspectApplication(path: string): Promise<ApplicationInfo>;
|
|
79
|
+
export function scanWindowsApplications(
|
|
80
|
+
directory: string,
|
|
81
|
+
maximumResults?: number | null,
|
|
82
|
+
excludedExecutableNames?: string[] | null,
|
|
83
|
+
): Promise<ApplicationScanResult>;
|
|
55
84
|
export function getCurrentUserSid(): string;
|
|
56
85
|
export function isRunningAsAdmin(): boolean;
|
|
57
86
|
export function runElevated(command: string, args?: string[]): number;
|
package/index.js
CHANGED
|
@@ -82,6 +82,9 @@ export default nativeBinding;
|
|
|
82
82
|
export const fileToDataUrl = nativeBinding.fileToDataUrl;
|
|
83
83
|
export const fileToStr = nativeBinding.fileToStr;
|
|
84
84
|
export const getAppName = nativeBinding.getAppName;
|
|
85
|
+
export const getNativeCapabilities = nativeBinding.getNativeCapabilities;
|
|
86
|
+
export const inspectApplication = nativeBinding.inspectApplication;
|
|
87
|
+
export const scanWindowsApplications = nativeBinding.scanWindowsApplications;
|
|
85
88
|
export const getCurrentUserSid = nativeBinding.getCurrentUserSid;
|
|
86
89
|
export const isRunningAsAdmin = nativeBinding.isRunningAsAdmin;
|
|
87
90
|
export const runElevated = nativeBinding.runElevated;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kokorobox-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "KokoroBox native bridge",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"kokorobox-native-win32-x64-msvc": "0.
|
|
53
|
-
"kokorobox-native-win32-ia32-msvc": "0.
|
|
54
|
-
"kokorobox-native-win32-arm64-msvc": "0.
|
|
55
|
-
"kokorobox-native-darwin-x64": "0.
|
|
56
|
-
"kokorobox-native-darwin-arm64": "0.
|
|
57
|
-
"kokorobox-native-linux-x64-gnu": "0.
|
|
58
|
-
"kokorobox-native-linux-arm64-gnu": "0.
|
|
59
|
-
"kokorobox-native-linux-loong64-gnu": "0.
|
|
52
|
+
"kokorobox-native-win32-x64-msvc": "0.2.0",
|
|
53
|
+
"kokorobox-native-win32-ia32-msvc": "0.2.0",
|
|
54
|
+
"kokorobox-native-win32-arm64-msvc": "0.2.0",
|
|
55
|
+
"kokorobox-native-darwin-x64": "0.2.0",
|
|
56
|
+
"kokorobox-native-darwin-arm64": "0.2.0",
|
|
57
|
+
"kokorobox-native-linux-x64-gnu": "0.2.0",
|
|
58
|
+
"kokorobox-native-linux-arm64-gnu": "0.2.0",
|
|
59
|
+
"kokorobox-native-linux-loong64-gnu": "0.2.0"
|
|
60
60
|
}
|
|
61
61
|
}
|