akanjs 3.0.0-beta.27 → 3.0.0-beta.28
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/base/baseEnv.ts +19 -5
- package/client/device.ts +22 -6
- package/client/index.ts +1 -0
- package/client/native/accessibility.ts +1 -0
- package/client/native/app-state.ts +1 -0
- package/client/native/app.ts +1 -0
- package/client/native/appearance.ts +1 -0
- package/client/native/auth-session.ts +1 -0
- package/client/native/autostart.ts +1 -0
- package/client/native/badge.ts +1 -0
- package/client/native/biometric.ts +1 -0
- package/client/native/browser.ts +1 -0
- package/client/native/camera.ts +1 -0
- package/client/native/clipboard.ts +1 -0
- package/client/native/contacts.ts +1 -0
- package/client/native/device.ts +1 -0
- package/client/native/dialog.ts +1 -0
- package/client/native/dock.ts +1 -0
- package/client/native/file-picker.ts +1 -0
- package/client/native/filesystem.ts +1 -0
- package/client/native/geolocation.ts +1 -0
- package/client/native/global-shortcut.ts +1 -0
- package/client/native/haptics.ts +1 -0
- package/client/native/http.ts +1 -0
- package/client/native/iap.ts +1 -0
- package/client/native/keep-awake.ts +1 -0
- package/client/native/keyboard.ts +1 -0
- package/client/native/local-notifications.ts +1 -0
- package/client/native/menu.ts +1 -0
- package/client/native/network.ts +1 -0
- package/client/native/opener.ts +1 -0
- package/client/native/preferences.ts +1 -0
- package/client/native/push.ts +1 -0
- package/client/native/screen-orientation.ts +1 -0
- package/client/native/screen.ts +1 -0
- package/client/native/secure-storage.ts +1 -0
- package/client/native/share.ts +1 -0
- package/client/native/single-instance.ts +1 -0
- package/client/native/splash-screen.ts +1 -0
- package/client/native/sqlite.ts +1 -0
- package/client/native/toast.ts +1 -0
- package/client/native/tray.ts +1 -0
- package/client/native/updates.ts +1 -0
- package/client/native/volume.ts +1 -0
- package/client/native/window-state.ts +1 -0
- package/client/native/window.ts +1 -0
- package/client/native.ts +31 -1
- package/client/resolveServerUrl.ts +11 -0
- package/client/router.ts +8 -0
- package/index.ts +115 -6
- package/native/desktop.ts +5 -0
- package/package.json +11 -1
- package/server/akanApp.ts +23 -3
- package/server/akanAppHeaders.ts +4 -1
- package/server/akanServer.ts +27 -7
- package/server/index.ts +1 -0
- package/server/lifecycle/orphanGroup.ts +21 -0
- package/server/nativeFile.ts +107 -0
- package/server/ops/opsRoute.ts +3 -2
- package/server/routing/apiRouter.ts +26 -3
- package/server/routing/hostAllowlist.ts +24 -0
- package/server/selfExec.ts +25 -0
- package/server/types.tsx +3 -1
- package/server/webRouter.ts +7 -4
- package/service/ipcTypes.ts +4 -0
- package/signal/CrossSiteGuard.ts +7 -0
- package/test/signalTestRuntime.ts +8 -2
- package/types/base/baseEnv.d.ts +1 -0
- package/types/client/index.d.ts +1 -0
- package/types/client/native/accessibility.d.ts +1 -0
- package/types/client/native/app-state.d.ts +1 -0
- package/types/client/native/app.d.ts +1 -0
- package/types/client/native/appearance.d.ts +1 -0
- package/types/client/native/auth-session.d.ts +1 -0
- package/types/client/native/autostart.d.ts +1 -0
- package/types/client/native/badge.d.ts +1 -0
- package/types/client/native/biometric.d.ts +1 -0
- package/types/client/native/browser.d.ts +1 -0
- package/types/client/native/camera.d.ts +1 -0
- package/types/client/native/clipboard.d.ts +1 -0
- package/types/client/native/contacts.d.ts +1 -0
- package/types/client/native/device.d.ts +1 -0
- package/types/client/native/dialog.d.ts +1 -0
- package/types/client/native/dock.d.ts +1 -0
- package/types/client/native/file-picker.d.ts +1 -0
- package/types/client/native/filesystem.d.ts +1 -0
- package/types/client/native/geolocation.d.ts +1 -0
- package/types/client/native/global-shortcut.d.ts +1 -0
- package/types/client/native/haptics.d.ts +1 -0
- package/types/client/native/http.d.ts +1 -0
- package/types/client/native/iap.d.ts +1 -0
- package/types/client/native/keep-awake.d.ts +1 -0
- package/types/client/native/keyboard.d.ts +1 -0
- package/types/client/native/local-notifications.d.ts +1 -0
- package/types/client/native/menu.d.ts +1 -0
- package/types/client/native/network.d.ts +1 -0
- package/types/client/native/opener.d.ts +1 -0
- package/types/client/native/preferences.d.ts +1 -0
- package/types/client/native/push.d.ts +1 -0
- package/types/client/native/screen-orientation.d.ts +1 -0
- package/types/client/native/screen.d.ts +1 -0
- package/types/client/native/secure-storage.d.ts +1 -0
- package/types/client/native/share.d.ts +1 -0
- package/types/client/native/single-instance.d.ts +1 -0
- package/types/client/native/splash-screen.d.ts +1 -0
- package/types/client/native/sqlite.d.ts +1 -0
- package/types/client/native/toast.d.ts +1 -0
- package/types/client/native/tray.d.ts +1 -0
- package/types/client/native/updates.d.ts +1 -0
- package/types/client/native/volume.d.ts +1 -0
- package/types/client/native/window-state.d.ts +1 -0
- package/types/client/native/window.d.ts +1 -0
- package/types/client/native.d.ts +14 -2
- package/types/client/resolveServerUrl.d.ts +1 -0
- package/types/client/router.d.ts +3 -0
- package/types/index.d.ts +112 -6
- package/types/native/desktop.d.ts +3 -0
- package/types/server/akanAppHeaders.d.ts +2 -0
- package/types/server/index.d.ts +1 -0
- package/types/server/lifecycle/orphanGroup.d.ts +7 -0
- package/types/server/nativeFile.d.ts +10 -0
- package/types/server/routing/apiRouter.d.ts +3 -1
- package/types/server/routing/hostAllowlist.d.ts +8 -0
- package/types/server/selfExec.d.ts +8 -0
- package/types/server/types.d.ts +3 -1
- package/types/service/ipcTypes.d.ts +16 -0
- package/types/signal/CrossSiteGuard.d.ts +1 -0
- package/types/ui/recipe/buttonRecipe.d.ts +2 -2
- package/types/vendor/@akanjs/native/packages/cli/src/api.d.ts +57 -4
- package/types/vendor/@akanjs/native/packages/cli/src/config.d.ts +48 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/desktop-server.d.ts +8 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/prepare.d.ts +8 -2
- package/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +10 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/publish.d.ts +24 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/updates.d.ts +24 -0
- package/types/vendor/@akanjs/native/packages/cli/src/platforms/desktop-update.d.ts +4 -1
- package/types/vendor/@akanjs/native/packages/cli/src/platforms/macos.d.ts +5 -0
- package/types/vendor/@akanjs/native/packages/cli/src/platforms/windows-installer.d.ts +38 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/dispatcher.d.ts +8 -1
- package/types/vendor/@akanjs/native/packages/desktop/src/grants.d.ts +11 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/main.d.ts +11 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/paths.d.ts +13 -2
- package/types/vendor/@akanjs/native/packages/desktop/src/plugin.d.ts +27 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/relaunch.d.ts +21 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/server.d.ts +79 -0
- package/types/vendor/@akanjs/native/plugins/app/src/index.d.ts +5 -0
- package/types/vendor/@akanjs/native/plugins/file-picker/src/index.d.ts +20 -1
- package/types/vendor/@akanjs/native/plugins/push/src/index.d.ts +9 -0
- package/types/vendor/@akanjs/native/plugins/updates/src/desktop.d.ts +28 -0
- package/types/vendor/@akanjs/native/plugins/volume/src/common.d.ts +10 -0
- package/types/vendor/@akanjs/native/plugins/volume/src/desktop.d.ts +18 -0
- package/types/vendor/@akanjs/native/plugins/volume/src/index.d.ts +28 -0
- package/types/vendor/@akanjs/native/plugins/volume/src.d.ts +1 -0
- package/types/webkit/csrFrameDump.d.ts +42 -0
- package/types/webkit/nativeNavigation.d.ts +1 -0
- package/types/webkit/nativePurchase.d.ts +6 -2
- package/types/webkit/nativeUpdates.d.ts +8 -0
- package/ui/Agent/Attach.tsx +6 -2
- package/ui/CsrImage.tsx +3 -2
- package/ui/System/CSR.tsx +4 -0
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeActivity.kt +2 -0
- package/vendor/@akanjs/native/native/desktop/Cargo.toml +1 -1
- package/vendor/@akanjs/native/native/desktop/src/lib.rs +161 -25
- package/vendor/@akanjs/native/native/desktop/src/volume.rs +184 -0
- package/vendor/@akanjs/native/native/desktop/src/win/mod.rs +3 -1
- package/vendor/@akanjs/native/native/desktop/src/win/volume.rs +71 -0
- package/vendor/@akanjs/native/packages/cli/src/api.ts +142 -12
- package/vendor/@akanjs/native/packages/cli/src/commands/build.ts +5 -3
- package/vendor/@akanjs/native/packages/cli/src/commands/update.ts +10 -71
- package/vendor/@akanjs/native/packages/cli/src/config.ts +41 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/configkeys.ts +9 -2
- package/vendor/@akanjs/native/packages/cli/src/lib/desktop-server.ts +58 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/hmr.ts +2 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/prepare.ts +10 -2
- package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +38 -2
- package/vendor/@akanjs/native/packages/cli/src/lib/publish.ts +104 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/updates.ts +85 -5
- package/vendor/@akanjs/native/packages/cli/src/platforms/android.ts +1 -0
- package/vendor/@akanjs/native/packages/cli/src/platforms/desktop-update.ts +6 -4
- package/vendor/@akanjs/native/packages/cli/src/platforms/desktop.ts +16 -0
- package/vendor/@akanjs/native/packages/cli/src/platforms/macos.ts +44 -1
- package/vendor/@akanjs/native/packages/cli/src/platforms/windows-installer.ts +436 -0
- package/vendor/@akanjs/native/packages/cli/src/platforms/windows.ts +2 -0
- package/vendor/@akanjs/native/packages/desktop/src/dispatcher.ts +20 -0
- package/vendor/@akanjs/native/packages/desktop/src/grants.ts +47 -0
- package/vendor/@akanjs/native/packages/desktop/src/host.ts +97 -11
- package/vendor/@akanjs/native/packages/desktop/src/main.ts +59 -11
- package/vendor/@akanjs/native/packages/desktop/src/paths.ts +38 -4
- package/vendor/@akanjs/native/packages/desktop/src/plugin.ts +28 -0
- package/vendor/@akanjs/native/packages/desktop/src/relaunch.ts +159 -0
- package/vendor/@akanjs/native/packages/desktop/src/server.ts +493 -0
- package/vendor/@akanjs/native/plugins/app/android/AppPlugin.kt +14 -0
- package/vendor/@akanjs/native/plugins/app/native-plugin.json +2 -2
- package/vendor/@akanjs/native/plugins/app/src/desktop.ts +5 -0
- package/vendor/@akanjs/native/plugins/app/src/index.ts +6 -1
- package/vendor/@akanjs/native/plugins/app/src/web.ts +3 -0
- package/vendor/@akanjs/native/plugins/file-picker/src/desktop.ts +39 -2
- package/vendor/@akanjs/native/plugins/file-picker/src/index.ts +36 -1
- package/vendor/@akanjs/native/plugins/push/android/PushPlugin.kt +9 -1
- package/vendor/@akanjs/native/plugins/push/ios/PushPlugin.swift +4 -0
- package/vendor/@akanjs/native/plugins/push/src/index.ts +10 -0
- package/vendor/@akanjs/native/plugins/updates/src/desktop.ts +464 -452
- package/vendor/@akanjs/native/plugins/volume/android/VolumePlugin.kt +107 -0
- package/vendor/@akanjs/native/plugins/volume/native-plugin.json +14 -0
- package/vendor/@akanjs/native/plugins/volume/src/common.ts +28 -0
- package/vendor/@akanjs/native/plugins/volume/src/desktop.ts +185 -0
- package/vendor/@akanjs/native/plugins/volume/src/index.ts +32 -0
- package/webkit/RenderLayer.tsx +71 -6
- package/webkit/csrFrameDump.ts +67 -0
- package/webkit/nativeNavigation.ts +17 -0
- package/webkit/nativePurchase.ts +12 -2
- package/webkit/nativeUpdates.ts +55 -0
- package/webkit/useCsrValues.ts +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/auth-session/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/autostart/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/badge/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/biometric/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/browser/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/camera/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/clipboard/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/contacts/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/device/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/dialog/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/dock/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/file-picker/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/filesystem/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/geolocation/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/global-shortcut/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/haptics/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/http/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/iap/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/keep-awake/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/keyboard/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/local-notifications/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/menu/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/network/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/opener/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/preferences/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/push/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/screen-orientation/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/screen/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/secure-storage/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/share/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/single-instance/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/splash-screen/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/sqlite/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/toast/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/tray/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/updates/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/volume/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/window-state/src/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../vendor/@akanjs/native/plugins/window/src/index.d.ts";
|
package/types/client/native.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { browser } from "../vendor/@akanjs/native/plugins/browser/src/index.d.ts";
|
|
2
2
|
import { opener } from "../vendor/@akanjs/native/plugins/opener/src/index.d.ts";
|
|
3
|
-
export {
|
|
3
|
+
export type { LiveValue, Plugin } from "../vendor/@akanjs/native/packages/core/src/index.d.ts";
|
|
4
|
+
export { AkanNativeError, createLiveValue, definePlugin, defineWebPlugin, fileBlob, isAkanNativeError, releaseFile, shallowEqual, } from "../vendor/@akanjs/native/packages/core/src/index.d.ts";
|
|
4
5
|
export { app } from "../vendor/@akanjs/native/plugins/app/src/index.d.ts";
|
|
5
6
|
export { appState } from "../vendor/@akanjs/native/plugins/app-state/src/index.d.ts";
|
|
7
|
+
export type { AuthSessionApi } from "../vendor/@akanjs/native/plugins/auth-session/src/index.d.ts";
|
|
8
|
+
export { authSession } from "../vendor/@akanjs/native/plugins/auth-session/src/index.d.ts";
|
|
6
9
|
export type { Photo } from "../vendor/@akanjs/native/plugins/camera/src/index.d.ts";
|
|
7
10
|
export type { Contact } from "../vendor/@akanjs/native/plugins/contacts/src/index.d.ts";
|
|
8
11
|
export type { DeviceInfo } from "../vendor/@akanjs/native/plugins/device/src/index.d.ts";
|
|
9
12
|
export { device } from "../vendor/@akanjs/native/plugins/device/src/index.d.ts";
|
|
10
13
|
export { dialog } from "../vendor/@akanjs/native/plugins/dialog/src/index.d.ts";
|
|
14
|
+
export type { DirectoryFile, PickDirectoryOptions, PickDirectoryResult, PickedFile, PickFilesOptions, SaveFileOptions, SaveFileResult, } from "../vendor/@akanjs/native/plugins/file-picker/src/index.d.ts";
|
|
15
|
+
export { filePicker } from "../vendor/@akanjs/native/plugins/file-picker/src/index.d.ts";
|
|
11
16
|
export type { Position } from "../vendor/@akanjs/native/plugins/geolocation/src/index.d.ts";
|
|
12
17
|
export { haptics } from "../vendor/@akanjs/native/plugins/haptics/src/index.d.ts";
|
|
13
18
|
export type { IapProduct, IapTransaction } from "../vendor/@akanjs/native/plugins/iap/src/index.d.ts";
|
|
@@ -16,6 +21,11 @@ export { preferences } from "../vendor/@akanjs/native/plugins/preferences/src/in
|
|
|
16
21
|
export type { PushAction, PushMessage, PushPermissionState, PushToken as NativePushToken, } from "../vendor/@akanjs/native/plugins/push/src/index.d.ts";
|
|
17
22
|
export { push } from "../vendor/@akanjs/native/plugins/push/src/index.d.ts";
|
|
18
23
|
export { secureStorage } from "../vendor/@akanjs/native/plugins/secure-storage/src/index.d.ts";
|
|
24
|
+
export type { UpdateCheck, UpdateProgress, UpdateState } from "../vendor/@akanjs/native/plugins/updates/src/index.d.ts";
|
|
25
|
+
export { markReady, updates, useUpdateState } from "../vendor/@akanjs/native/plugins/updates/src/index.d.ts";
|
|
26
|
+
export type { VolumeState } from "../vendor/@akanjs/native/plugins/volume/src/index.d.ts";
|
|
27
|
+
export { volume } from "../vendor/@akanjs/native/plugins/volume/src/index.d.ts";
|
|
28
|
+
export { useLiveValue, usePluginEvent } from "../vendor/@akanjs/native/packages/react/src/index.d.ts";
|
|
19
29
|
export { browser, opener };
|
|
20
30
|
export declare const loadCamera: () => Promise<typeof import("../vendor/@akanjs/native/plugins/camera/src/index.d.ts")>;
|
|
21
31
|
export declare const loadContacts: () => Promise<typeof import("../vendor/@akanjs/native/plugins/contacts/src/index.d.ts")>;
|
|
@@ -23,7 +33,9 @@ export declare const loadGeolocation: () => Promise<typeof import("../vendor/@ak
|
|
|
23
33
|
export declare const loadIap: () => Promise<typeof import("../vendor/@akanjs/native/plugins/iap/src/index.d.ts")>;
|
|
24
34
|
/** Inside an iOS or Android shell of the native runtime; a mobile target opened in a browser is not. */
|
|
25
35
|
export declare const isNativeApp: () => boolean;
|
|
36
|
+
/** Inside any shell of the native runtime, desktop included. */
|
|
37
|
+
export declare const isNativeShell: () => boolean;
|
|
26
38
|
export declare const nativePlatform: () => "ios" | "android" | null;
|
|
27
|
-
export declare const desktopPlatform: () => "
|
|
39
|
+
export declare const desktopPlatform: () => "macos" | "windows" | "linux" | null;
|
|
28
40
|
/** http(s) in the in-app browser, anything else (mailto:, tel:) in the app the system picks. */
|
|
29
41
|
export declare const openExternalUrl: (url: string) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolveServerUrl: (url: string) => string;
|
package/types/client/router.d.ts
CHANGED
|
@@ -76,6 +76,9 @@ declare class Router {
|
|
|
76
76
|
backOrFallback(fallbackHref?: string, routeOptions?: RouteOptions): never;
|
|
77
77
|
back(routeOptions?: RouteOptions): never;
|
|
78
78
|
refresh(): never;
|
|
79
|
+
/** Client-side redirects so far: a render that saw this change while it ran redirected instead of drawing. A method
|
|
80
|
+
* for the reason `navigation()` is one. */
|
|
81
|
+
redirectCount(): number;
|
|
79
82
|
redirect(href: string, options?: RedirectOptions): never;
|
|
80
83
|
notFound(): never;
|
|
81
84
|
setLang(lang: string): never;
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AkanNativeConfig } from "./vendor/@akanjs/native/packages/cli/src/config.d.ts";
|
|
1
2
|
import type { AkanI18nConfig } from "akanjs/common";
|
|
2
3
|
import type { AkanImageConfig } from "akanjs/server";
|
|
3
4
|
export declare const archs: readonly ["amd64", "arm64"];
|
|
@@ -24,6 +25,31 @@ export interface LibDockerConfig {
|
|
|
24
25
|
preRuns: DockerRun[];
|
|
25
26
|
postRuns: DockerRun[];
|
|
26
27
|
}
|
|
28
|
+
/** `${process.platform}-${process.arch}` of the computer a desktop app is built on, which is the one it runs on. */
|
|
29
|
+
export declare const binPlatforms: readonly ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64", "win32-arm64", "win32-x64"];
|
|
30
|
+
export type BinPlatform = (typeof binPlatforms)[number];
|
|
31
|
+
/** Downloaded when the desktop app is built; the file must hash to `sha256`, so plain http is as safe as https. */
|
|
32
|
+
export interface AkanBinUrlSource {
|
|
33
|
+
url: string;
|
|
34
|
+
sha256: string;
|
|
35
|
+
/** The executable inside the archive `url` names (.zip, .tar.gz, .tgz, .tar.xz, .tar.bz2, .tar). */
|
|
36
|
+
file?: string;
|
|
37
|
+
}
|
|
38
|
+
/** A file on the building computer, relative to the `akan.config.ts` that declares it. */
|
|
39
|
+
export interface AkanBinPathSource {
|
|
40
|
+
path: string;
|
|
41
|
+
/** The executable inside the archive `path` names. */
|
|
42
|
+
file?: string;
|
|
43
|
+
}
|
|
44
|
+
export type AkanBinSource = AkanBinUrlSource | AkanBinPathSource;
|
|
45
|
+
/**
|
|
46
|
+
* Executables a desktop app carries, by the name its code spawns and then by platform. Their folder comes first on
|
|
47
|
+
* the app's PATH, so the carried server's `spawn("ffmpeg")` runs the carried file; a native plugin finds it in
|
|
48
|
+
* `ctx.binDir`.
|
|
49
|
+
*/
|
|
50
|
+
export type AkanBinConfig = Record<string, {
|
|
51
|
+
[platform in BinPlatform]?: AkanBinSource;
|
|
52
|
+
}>;
|
|
27
53
|
export interface AkanRouteDomains {
|
|
28
54
|
main?: string[];
|
|
29
55
|
develop?: string[];
|
|
@@ -59,8 +85,13 @@ export type DatabaseMode = "single" | "multiple" | "cluster";
|
|
|
59
85
|
export type MobileEnv = "local" | "debug" | "develop" | "main";
|
|
60
86
|
export type MobilePermission = "camera" | "contacts" | "location" | "push" | "speech";
|
|
61
87
|
export interface AkanMobileTargetAssets {
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
/** A square PNG, relative to the app folder, or it with the color behind its transparent areas. */
|
|
89
|
+
icon?: string | {
|
|
90
|
+
image: string;
|
|
91
|
+
backgroundColor?: string;
|
|
92
|
+
};
|
|
93
|
+
/** A PNG shown centered at launch, or the launch screen's color, image and when it hides. */
|
|
94
|
+
splash?: string | NonNullable<AkanNativeConfig["splash"]>;
|
|
64
95
|
}
|
|
65
96
|
export interface AkanMobileTargetDeepLinks {
|
|
66
97
|
schemes?: string[];
|
|
@@ -96,14 +127,77 @@ export interface AkanMobileNativeConfig {
|
|
|
96
127
|
activity?: string[];
|
|
97
128
|
/** The Firebase project's google-services.json, relative to the app folder, for FCM push on Android. */
|
|
98
129
|
googleServices?: string;
|
|
130
|
+
/** Media plays with sound without a tap first, as it does on iOS and the desktop: a signage screen. */
|
|
131
|
+
autoplay?: boolean;
|
|
132
|
+
};
|
|
133
|
+
/** Android's notification channel, status bar icon (relative to the app folder) and accent color. */
|
|
134
|
+
push?: AkanNativeConfig["push"];
|
|
135
|
+
/** The app's part of the iOS privacy manifest (PrivacyInfo.xcprivacy), which an App Store upload requires. */
|
|
136
|
+
privacy?: AkanNativeConfig["privacy"];
|
|
137
|
+
desktop?: {
|
|
138
|
+
/**
|
|
139
|
+
* The desktop app carries the app's server (API only, database mode single, on loopback) and its pages call
|
|
140
|
+
* nothing else. `build-desktop`, `start-desktop` and `publish-update` all read it, and an installed app refuses
|
|
141
|
+
* a release that carries a server when it has none, or none when it has one.
|
|
142
|
+
*/
|
|
143
|
+
server?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* `"reload"`: a window whose page's process ends (a crash, a hang) loads it again every time, waiting
|
|
146
|
+
* longer after each end in a row, and the app relaunches when the webview's browser process ends — for an
|
|
147
|
+
* app nobody attends. `"errorPage"` (default): one reload, then an error page, and a quit for the browser.
|
|
148
|
+
*/
|
|
149
|
+
recovery?: "errorPage" | "reload";
|
|
150
|
+
/** The main window from its first frame: borderless fullscreen, and no taskbar button (Windows, Linux). */
|
|
151
|
+
window?: {
|
|
152
|
+
fullscreen?: boolean;
|
|
153
|
+
skipTaskbar?: boolean;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Windows: `"auto"` answers getDisplayMedia() with the first screen at once, no picker or gesture — remote
|
|
157
|
+
* support on an unattended screen; it covers every media request, so not for an app that asks for a camera.
|
|
158
|
+
*/
|
|
159
|
+
screenCapture?: "picker" | "auto";
|
|
99
160
|
};
|
|
100
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Where an installed app looks for newer releases of itself (the native runtime's updates plugin): the whole app on a
|
|
164
|
+
* desktop, the web bundle on a phone. `akan publish-update` writes and signs a release with a key on this machine;
|
|
165
|
+
* `akan pack-update` writes an unsigned phone bundle for whoever holds the key to sign.
|
|
166
|
+
*/
|
|
167
|
+
export interface AkanMobileUpdatesConfig {
|
|
168
|
+
/**
|
|
169
|
+
* A static base URL, https in a release build: `<url>/<os>-<arch>/<channel>.json` (desktop) or `<url>/<platform>/…`
|
|
170
|
+
* (a phone's web bundle).
|
|
171
|
+
*/
|
|
172
|
+
url: string;
|
|
173
|
+
/** The update key's public half, the raw 32-byte Ed25519 key in base64 (`akan update-keygen` prints it). */
|
|
174
|
+
publicKey: string;
|
|
175
|
+
/**
|
|
176
|
+
* The manifest the app follows, e.g. a "pilot" target's "pilot". Default: the backend env the app is built for
|
|
177
|
+
* (`main`, `develop`, `debug`, `local`).
|
|
178
|
+
*/
|
|
179
|
+
channel?: string;
|
|
180
|
+
/** How long a newly applied release has to call notifyReady() before it is rolled back, ms. Default 10000. */
|
|
181
|
+
readyTimeout?: number;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* One bundle id, or one per platform, for an app whose store listings already carry different ids. A platform without
|
|
185
|
+
* its own takes `default`.
|
|
186
|
+
*/
|
|
187
|
+
export type AkanMobileAppId = string | {
|
|
188
|
+
default?: string;
|
|
189
|
+
ios?: string;
|
|
190
|
+
android?: string;
|
|
191
|
+
macos?: string;
|
|
192
|
+
windows?: string;
|
|
193
|
+
linux?: string;
|
|
194
|
+
};
|
|
101
195
|
export interface AkanMobileTargetConfig {
|
|
102
196
|
name: string;
|
|
103
197
|
basePath?: string;
|
|
104
198
|
indexPath?: string;
|
|
105
199
|
appName: string;
|
|
106
|
-
appId:
|
|
200
|
+
appId: AkanMobileAppId;
|
|
107
201
|
/** Executables, archives and the Swift module; letters, digits, `.`, `_` and `-`. Default: the app's folder name. */
|
|
108
202
|
fileName?: string;
|
|
109
203
|
version: string;
|
|
@@ -113,15 +207,18 @@ export interface AkanMobileTargetConfig {
|
|
|
113
207
|
deepLinks?: AkanMobileTargetDeepLinks;
|
|
114
208
|
files?: AkanMobileTargetFiles;
|
|
115
209
|
native?: AkanMobileNativeConfig;
|
|
210
|
+
/** Over mobile.updates, field by field: a pilot target names its own channel. */
|
|
211
|
+
updates?: Partial<AkanMobileUpdatesConfig>;
|
|
116
212
|
}
|
|
117
213
|
export interface AkanMobileConfig {
|
|
118
214
|
appName: string;
|
|
119
|
-
appId:
|
|
215
|
+
appId: AkanMobileAppId;
|
|
120
216
|
fileName?: string;
|
|
121
217
|
version: string;
|
|
122
218
|
buildNum: number;
|
|
123
219
|
files?: AkanMobileTargetFiles;
|
|
124
220
|
native?: AkanMobileNativeConfig;
|
|
221
|
+
updates?: AkanMobileUpdatesConfig;
|
|
125
222
|
targets: Record<string, AkanMobileTargetConfig>;
|
|
126
223
|
}
|
|
127
224
|
export interface AkanScanInfo {
|
|
@@ -219,6 +316,10 @@ export interface AppConfigResult {
|
|
|
219
316
|
*/
|
|
220
317
|
syncPageLibs?: string[] | boolean;
|
|
221
318
|
externalLibs: string[];
|
|
319
|
+
/** Dependencies whose install scripts `bun install --production` runs, in the image and in a desktop app's server. */
|
|
320
|
+
trustedDependencies: string[];
|
|
321
|
+
/** Every desktop build, run and dev session carries these, server or not; the image installs through `docker`. */
|
|
322
|
+
bin: AkanBinConfig;
|
|
222
323
|
barrelImports: string[];
|
|
223
324
|
optimizeImports: string[];
|
|
224
325
|
images: AkanImageConfig;
|
|
@@ -230,6 +331,9 @@ export interface AppConfigResult {
|
|
|
230
331
|
}
|
|
231
332
|
export interface LibConfigResult {
|
|
232
333
|
externalLibs: string[];
|
|
334
|
+
trustedDependencies: string[];
|
|
335
|
+
/** Carried by the desktop app of every app that depends on this lib; an app's own entry of the same name wins. */
|
|
336
|
+
bin: AkanBinConfig;
|
|
233
337
|
/** Image steps every app that mounts this lib inherits, unless that app declares a whole Dockerfile. */
|
|
234
338
|
docker: LibDockerConfig;
|
|
235
339
|
/** Which of this lib's own public fonts every app that mounts it must keep. */
|
|
@@ -246,12 +350,14 @@ export interface LibConfigContext {
|
|
|
246
350
|
readonly name: string;
|
|
247
351
|
readonly type: "lib";
|
|
248
352
|
}
|
|
249
|
-
export type AppConfigInput = Omit<DeepPartial<AppConfigResult>, "docker" | "web"> & {
|
|
353
|
+
export type AppConfigInput = Omit<DeepPartial<AppConfigResult>, "docker" | "web" | "bin"> & {
|
|
250
354
|
docker?: DockerOption;
|
|
251
355
|
web?: AkanWebOption;
|
|
356
|
+
bin?: AkanBinConfig;
|
|
252
357
|
plugins?: AkanPlugin[];
|
|
253
358
|
};
|
|
254
|
-
export type LibConfigInput = DeepPartial<LibConfigResult> & {
|
|
359
|
+
export type LibConfigInput = Omit<DeepPartial<LibConfigResult>, "bin"> & {
|
|
360
|
+
bin?: AkanBinConfig;
|
|
255
361
|
plugins?: AkanPlugin[];
|
|
256
362
|
};
|
|
257
363
|
export interface SubspaceDeclaration {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AkanNativeError, mimeFor } from "../vendor/@akanjs/native/packages/core/src/index.d.ts";
|
|
2
|
+
export type { DesktopContext, DesktopPlugin, NativeEvent } from "../vendor/@akanjs/native/packages/desktop/src/plugin.d.ts";
|
|
3
|
+
export { createPageVeto, defineDesktopPlugin, externalOpenAllowed } from "../vendor/@akanjs/native/packages/desktop/src/plugin.d.ts";
|
package/types/server/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./console.d.ts";
|
|
|
7
7
|
export * from "./decorators.d.ts";
|
|
8
8
|
export * from "./devtools.d.ts";
|
|
9
9
|
export type { ChangeBatch, ChangeKind } from "./hmr/wsHub.d.ts";
|
|
10
|
+
export * from "./nativeFile.d.ts";
|
|
10
11
|
export * from "./oauth.d.ts";
|
|
11
12
|
export * from "./processMetricsCollector.d.ts";
|
|
12
13
|
export * from "./proxy.d.ts";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type NativeFileMode = "read" | "write" | "folder";
|
|
2
|
+
export declare class NativeFile {
|
|
3
|
+
#private;
|
|
4
|
+
static timeoutMs: number;
|
|
5
|
+
static operationMode: () => string;
|
|
6
|
+
/** The path behind `grant`, which the user must have given for `mode`. */
|
|
7
|
+
static resolve(grant: string, mode: NativeFileMode): Promise<string>;
|
|
8
|
+
/** A path inside a folder grant; one that climbs out of the folder is refused. */
|
|
9
|
+
static resolveIn(grant: string, relative: string): Promise<string>;
|
|
10
|
+
}
|
|
@@ -4,6 +4,7 @@ import type { HmrWsHub } from "../hmr/wsHub.d.ts";
|
|
|
4
4
|
import { type WebProxyRunner } from "../proxy.d.ts";
|
|
5
5
|
import type { HttpRoutes, SignalRouteOptions, WebsocketRoutes } from "../types.d.ts";
|
|
6
6
|
import { AppWsData } from "./appWsData.d.ts";
|
|
7
|
+
import type { HostAllowlist } from "./hostAllowlist.d.ts";
|
|
7
8
|
export interface HmrStateSource {
|
|
8
9
|
readonly state: {
|
|
9
10
|
buildId: number;
|
|
@@ -32,6 +33,7 @@ export interface ApiRouteInputs {
|
|
|
32
33
|
renderEnvRoutes: HttpRoutes;
|
|
33
34
|
upgradeAppWs: (req: Request, data: AppWsData) => boolean;
|
|
34
35
|
webProxyRunner?: WebProxyRunner | null;
|
|
36
|
+
hostAllowlist?: HostAllowlist | null;
|
|
35
37
|
}
|
|
36
38
|
export interface WebsocketHandlersInputs {
|
|
37
39
|
wsRoutes: WebsocketRoutes;
|
|
@@ -47,7 +49,7 @@ type WsTaggedData = {
|
|
|
47
49
|
};
|
|
48
50
|
export declare class ApiRouter {
|
|
49
51
|
#private;
|
|
50
|
-
static buildRoutes({ prefix, websocketPrefix, routes, builtinRoutes, routeOptions, renderEnvRoutes, upgradeAppWs, webProxyRunner, }: ApiRouteInputs): NonNullHttpRoutes;
|
|
52
|
+
static buildRoutes({ prefix, websocketPrefix, routes, builtinRoutes, routeOptions, renderEnvRoutes, upgradeAppWs, webProxyRunner, hostAllowlist, }: ApiRouteInputs): NonNullHttpRoutes;
|
|
51
53
|
static buildWebsocketHandlers({ wsRoutes, registry, live, hmrHub, hmrState, logger, onDrain, }: WebsocketHandlersInputs): Bun.WebSocketHandler<WsTaggedData>;
|
|
52
54
|
static applyGlobalPrefix(prefix: string, path: string, options?: SignalRouteOptions): string;
|
|
53
55
|
static joinRoutePath(prefix: string, path: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class HostAllowlist {
|
|
2
|
+
#private;
|
|
3
|
+
constructor(hosts: Iterable<string>);
|
|
4
|
+
/** `AKAN_ALLOWED_HOSTS`: comma-separated `host:port` entries; unset or blank serves every Host. */
|
|
5
|
+
static fromEnv(env?: Record<string, string | undefined>): HostAllowlist | null;
|
|
6
|
+
allows(req: Request): boolean;
|
|
7
|
+
refuse(): Response;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class SelfExec {
|
|
2
|
+
#private;
|
|
3
|
+
static adopt(): void;
|
|
4
|
+
/** A desktop app's carried server: only its shell starts the app executable as Bun. */
|
|
5
|
+
static get carried(): boolean;
|
|
6
|
+
static env(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
7
|
+
static command(script: string, ...args: string[]): string[];
|
|
8
|
+
}
|
package/types/server/types.d.ts
CHANGED
|
@@ -72,7 +72,9 @@ export declare const resolveWebConfig: (web: Partial<AkanWebConfig> | undefined)
|
|
|
72
72
|
export declare const getWebConfigFromEnv: () => AkanWebConfig;
|
|
73
73
|
export interface MobileDeepLinkAssociation {
|
|
74
74
|
targetName: string;
|
|
75
|
-
|
|
75
|
+
/** Null when the target names no id for the platform; that platform then gets no association. */
|
|
76
|
+
iosAppId: string | null;
|
|
77
|
+
androidAppId: string | null;
|
|
76
78
|
domains: string[];
|
|
77
79
|
iosTeamId?: string;
|
|
78
80
|
androidSha256CertFingerprints?: string[];
|
|
@@ -155,6 +155,10 @@ export type AkanIpcMessage = {
|
|
|
155
155
|
type: "tcp";
|
|
156
156
|
}>;
|
|
157
157
|
healthPath?: string;
|
|
158
|
+
crossSite?: {
|
|
159
|
+
allowedOrigins: string[];
|
|
160
|
+
enabled: boolean;
|
|
161
|
+
};
|
|
158
162
|
} | {
|
|
159
163
|
type: "backend-ready";
|
|
160
164
|
pid: number;
|
|
@@ -233,6 +237,18 @@ export type AkanIpcMessage = {
|
|
|
233
237
|
} | {
|
|
234
238
|
type: "shutdown";
|
|
235
239
|
signal?: string;
|
|
240
|
+
}
|
|
241
|
+
/** Desktop server → the shell that started it: the path behind a file picker grant (forServer). */
|
|
242
|
+
| {
|
|
243
|
+
type: "file.resolve";
|
|
244
|
+
id: string;
|
|
245
|
+
grant: string;
|
|
246
|
+
} | {
|
|
247
|
+
type: "file.resolved";
|
|
248
|
+
id: string;
|
|
249
|
+
path?: string;
|
|
250
|
+
mode?: "read" | "write" | "folder";
|
|
251
|
+
error?: string;
|
|
236
252
|
} | {
|
|
237
253
|
type: "error";
|
|
238
254
|
message: string;
|
|
@@ -13,6 +13,7 @@ export declare class CrossSiteGuard {
|
|
|
13
13
|
static readonly nativeOrigins: readonly ["app://localhost", "https://app.localhost"];
|
|
14
14
|
/** Applied at boot from the mounting app's `option.ts`; the native shells stay allowed unless disabled. */
|
|
15
15
|
static configure({ allowedOrigins, enabled }: CrossSiteOption): void;
|
|
16
|
+
static option(): Required<CrossSiteOption>;
|
|
16
17
|
static reset(): void;
|
|
17
18
|
/** Call only where a JSON body is read: a multipart upload relies on `assertOrigin` alone. */
|
|
18
19
|
static assertJsonBody(contentType: string | null): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const buttonRecipe: (variants?: Omit<({
|
|
3
3
|
size?: "lg" | "md" | "sm" | "xs" | "icon" | undefined;
|
|
4
4
|
outline?: boolean | undefined;
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "default" | "link" | "info" | "warning" | "success" | "primary" | "secondary" | "accent" | "destructive" | "neutral" | "outline" | "ghost" | undefined;
|
|
6
6
|
shape?: "default" | "circle" | "square" | undefined;
|
|
7
7
|
} & {
|
|
8
8
|
class?: import("tailwind-variants").ClassValue;
|
|
@@ -10,7 +10,7 @@ export declare const buttonRecipe: (variants?: Omit<({
|
|
|
10
10
|
}) | ({
|
|
11
11
|
size?: "lg" | "md" | "sm" | "xs" | "icon" | undefined;
|
|
12
12
|
outline?: boolean | undefined;
|
|
13
|
-
variant?: "
|
|
13
|
+
variant?: "default" | "link" | "info" | "warning" | "success" | "primary" | "secondary" | "accent" | "destructive" | "neutral" | "outline" | "ghost" | undefined;
|
|
14
14
|
shape?: "default" | "circle" | "square" | undefined;
|
|
15
15
|
} & {
|
|
16
16
|
class?: never;
|