kokorobox-native 0.8.3 → 0.9.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.
Files changed (3) hide show
  1. package/index.d.ts +45 -0
  2. package/index.js +4 -0
  3. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -12,8 +12,10 @@ export interface NativeCapabilities {
12
12
  windowsFirewall: boolean;
13
13
  launchAtLogin: boolean;
14
14
  networkContext: boolean;
15
+ networkMonitor: boolean;
15
16
  macosServiceManagement: boolean;
16
17
  coreFilePrivileges: boolean;
18
+ serviceIdentity: boolean;
17
19
  }
18
20
 
19
21
  export interface ExecutableSearchOptions {
@@ -57,6 +59,8 @@ export interface LaunchAtLoginStatus {
57
59
 
58
60
  /** Best-effort active-network state. Unavailable fields are omitted instead of guessed. */
59
61
  export interface NetworkContext {
62
+ /** Whether the operating system currently has a usable default route. */
63
+ online: boolean;
60
64
  defaultInterface?: string;
61
65
  /** Active network-service name. Currently populated on macOS and Linux. */
62
66
  defaultService?: string;
@@ -71,6 +75,42 @@ export interface CorePrivilegeStatus {
71
75
  granted: boolean;
72
76
  }
73
77
 
78
+ export interface ServiceIdentityOptions {
79
+ /** OS credential namespace, for example `com.amamiyakokoro.KokoroBox`. */
80
+ service: string;
81
+ account: string;
82
+ /** Mode-0600 fallback used only when Linux Secret Service is unavailable. */
83
+ linuxFallbackPath?: string;
84
+ }
85
+
86
+ export interface LegacyServiceIdentity {
87
+ keyId?: string;
88
+ publicKey: string;
89
+ privateKey: string;
90
+ }
91
+
92
+ export interface ServiceIdentityInfo {
93
+ keyId: string;
94
+ publicKey: string;
95
+ backend:
96
+ | "windows-credential-manager"
97
+ | "macos-keychain"
98
+ | "linux-secret-service"
99
+ | "linux-protected-file";
100
+ }
101
+
102
+ /** Opaque native signer. Private key material is never exposed by this object. */
103
+ export class ServiceIdentity {
104
+ getInfo(): ServiceIdentityInfo;
105
+ sign(data: string): string;
106
+ }
107
+
108
+ export function openServiceIdentity(
109
+ options: ServiceIdentityOptions,
110
+ legacy?: LegacyServiceIdentity,
111
+ ): Promise<ServiceIdentity>;
112
+ export function deleteServiceIdentity(options: ServiceIdentityOptions): Promise<void>;
113
+
74
114
  export interface ApplicationInfo {
75
115
  executablePath: string;
76
116
  executableName: string;
@@ -144,6 +184,11 @@ export function setLaunchAtLogin(
144
184
  enabled: boolean,
145
185
  ): Promise<LaunchAtLoginStatus>;
146
186
  export function getNetworkContext(): Promise<NetworkContext>;
187
+ /** Resolve when the native network snapshot changes, or `undefined` on timeout. */
188
+ export function waitForNetworkContextChange(
189
+ previous: NetworkContext,
190
+ timeoutMs?: number,
191
+ ): Promise<NetworkContext | null>;
147
192
  /** Query a LaunchDaemon plist embedded in the calling macOS application. */
148
193
  export function getMacosManagedServiceStatus(plistName: string): MacOSManagedServiceStatus;
149
194
  export function registerMacosManagedService(plistName: string): MacOSManagedServiceStatus;
package/index.js CHANGED
@@ -104,6 +104,7 @@ export const findExecutables = nativeBinding.findExecutables;
104
104
  export const getLaunchAtLogin = nativeBinding.getLaunchAtLogin;
105
105
  export const setLaunchAtLogin = nativeBinding.setLaunchAtLogin;
106
106
  export const getNetworkContext = nativeBinding.getNetworkContext;
107
+ export const waitForNetworkContextChange = nativeBinding.waitForNetworkContextChange;
107
108
  export const getMacosManagedServiceStatus = nativeBinding.getMacosManagedServiceStatus;
108
109
  export const registerMacosManagedService = nativeBinding.registerMacosManagedService;
109
110
  export const unregisterMacosManagedService = nativeBinding.unregisterMacosManagedService;
@@ -119,3 +120,6 @@ export const runElevated = nativeBinding.runElevated;
119
120
  export const launchElevated = nativeBinding.launchElevated;
120
121
  export const launchUnelevated = nativeBinding.launchUnelevated;
121
122
  export const setupFirewallRules = nativeBinding.setupFirewallRules;
123
+ export const ServiceIdentity = nativeBinding.ServiceIdentity;
124
+ export const openServiceIdentity = nativeBinding.openServiceIdentity;
125
+ export const deleteServiceIdentity = nativeBinding.deleteServiceIdentity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kokorobox-native",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "KokoroBox native bridge",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -48,11 +48,11 @@
48
48
  "access": "public"
49
49
  },
50
50
  "optionalDependencies": {
51
- "kokorobox-native-win32-x64-msvc": "0.8.3",
52
- "kokorobox-native-win32-arm64-msvc": "0.8.3",
53
- "kokorobox-native-darwin-x64": "0.8.3",
54
- "kokorobox-native-darwin-arm64": "0.8.3",
55
- "kokorobox-native-linux-x64-gnu": "0.8.3",
56
- "kokorobox-native-linux-arm64-gnu": "0.8.3"
51
+ "kokorobox-native-win32-x64-msvc": "0.9.0",
52
+ "kokorobox-native-win32-arm64-msvc": "0.9.0",
53
+ "kokorobox-native-darwin-x64": "0.9.0",
54
+ "kokorobox-native-darwin-arm64": "0.9.0",
55
+ "kokorobox-native-linux-x64-gnu": "0.9.0",
56
+ "kokorobox-native-linux-arm64-gnu": "0.9.0"
57
57
  }
58
58
  }