@termix-ssh/plugin-sdk 1.0.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 +52 -0
- package/cli/commands/build.mjs +246 -0
- package/cli/commands/migrations.mjs +248 -0
- package/cli/commands/pack.mjs +42 -0
- package/cli/commands/sign.mjs +83 -0
- package/cli/commands/test.mjs +33 -0
- package/cli/commands/validate.mjs +215 -0
- package/cli/index.mjs +65 -0
- package/cli/lib/changelog.mjs +126 -0
- package/cli/lib/externals.mjs +46 -0
- package/cli/lib/plugin-dir.mjs +29 -0
- package/cli/lib/signing.mjs +86 -0
- package/cli/lib/static-url-imports.mjs +54 -0
- package/cli/lib/tmxplug.mjs +106 -0
- package/cli/patches/guacamole-common-js-flush.cjs +76 -0
- package/cli/patches/xterm-android-ime.cjs +130 -0
- package/client.d.ts +13 -0
- package/dist/backend.d.ts +1777 -0
- package/dist/backend.js +84 -0
- package/dist/capabilities.d.ts +38 -0
- package/dist/capabilities.js +71 -0
- package/dist/db.d.ts +112 -0
- package/dist/db.js +189 -0
- package/dist/ddl.d.ts +76 -0
- package/dist/ddl.js +678 -0
- package/dist/desktop.d.ts +346 -0
- package/dist/desktop.js +5 -0
- package/dist/frontend.d.ts +1206 -0
- package/dist/frontend.js +388 -0
- package/dist/host/chunk-F3SDZDDG.js +6017 -0
- package/dist/host/chunk-XGWE7BTJ.js +90 -0
- package/dist/host/chunk-XH5NXL6Y.js +56314 -0
- package/dist/host/chunk-YC2MAKSP.js +14 -0
- package/dist/host/linked-server-FZGWQW32.js +12 -0
- package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
- package/dist/host/testing-host.js +414 -0
- package/dist/host/theme.css +91 -0
- package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
- package/dist/host/types/src/types/connection-log.d.ts +13 -0
- package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
- package/dist/host/types/src/types/host-defaults.d.ts +60 -0
- package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
- package/dist/host/types/src/types/index.d.ts +298 -0
- package/dist/host/types/src/types/keybindings.d.ts +27 -0
- package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
- package/dist/host/types/src/types/ui-types.d.ts +260 -0
- package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
- package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
- package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
- package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
- package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
- package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
- package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
- package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
- package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
- package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
- package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
- package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
- package/dist/host/types/src/ui/components/alert.d.ts +9 -0
- package/dist/host/types/src/ui/components/badge.d.ts +9 -0
- package/dist/host/types/src/ui/components/button.d.ts +13 -0
- package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
- package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
- package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
- package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
- package/dist/host/types/src/ui/components/card.d.ts +11 -0
- package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
- package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
- package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
- package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
- package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
- package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
- package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
- package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
- package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
- package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
- package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
- package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
- package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
- package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
- package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
- package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
- package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
- package/dist/host/types/src/ui/components/input.d.ts +3 -0
- package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
- package/dist/host/types/src/ui/components/label.d.ts +4 -0
- package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
- package/dist/host/types/src/ui/components/meter.d.ts +14 -0
- package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
- package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
- package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
- package/dist/host/types/src/ui/components/popover.d.ts +7 -0
- package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
- package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
- package/dist/host/types/src/ui/components/select.d.ts +15 -0
- package/dist/host/types/src/ui/components/select2.d.ts +8 -0
- package/dist/host/types/src/ui/components/separator.d.ts +4 -0
- package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
- package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
- package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
- package/dist/host/types/src/ui/components/slider.d.ts +4 -0
- package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
- package/dist/host/types/src/ui/components/switch.d.ts +4 -0
- package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
- package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
- package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
- package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
- package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
- package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
- package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
- package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
- package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
- package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
- package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
- package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
- package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
- package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
- package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
- package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
- package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
- package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
- package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
- package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
- package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
- package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
- package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
- package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
- package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
- package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
- package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
- package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
- package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
- package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
- package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
- package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
- package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
- package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
- package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
- package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
- package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
- package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
- package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
- package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
- package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
- package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
- package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
- package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
- package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
- package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
- package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
- package/dist/host/types/src/ui/main-axios.d.ts +170 -0
- package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
- package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
- package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
- package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
- package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
- package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
- package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
- package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
- package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
- package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
- package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
- package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
- package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
- package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
- package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
- package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
- package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
- package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
- package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
- package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
- package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
- package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
- package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
- package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
- package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
- package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
- package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
- package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
- package/dist/host/ui.d.ts +1 -0
- package/dist/host/ui.js +31754 -0
- package/dist/host/use-permissions-NULZL43J.js +18 -0
- package/dist/host-commands.d.ts +89 -0
- package/dist/host-commands.js +387 -0
- package/dist/manifest.d.ts +461 -0
- package/dist/manifest.js +1499 -0
- package/dist/settings.d.ts +43 -0
- package/dist/settings.js +168 -0
- package/dist/ssh-certs.d.ts +25 -0
- package/dist/ssh-certs.js +234 -0
- package/dist/ssh-options.d.ts +23 -0
- package/dist/ssh-options.js +1 -0
- package/dist/table-builder.d.ts +26 -0
- package/dist/table-builder.js +87 -0
- package/dist/testing/safe-ports.d.ts +10 -0
- package/dist/testing/safe-ports.js +59 -0
- package/dist/testing/setup.d.ts +7 -0
- package/dist/testing/setup.js +146 -0
- package/dist/testing.d.ts +537 -0
- package/dist/testing.js +1451 -0
- package/dist/vitest-preset.d.ts +54 -0
- package/dist/vitest-preset.js +96 -0
- package/package.json +143 -0
- package/schema/changelog.schema.json +67 -0
- package/schema/manifest.schema.json +1160 -0
- package/tsconfig.plugin.json +31 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { type AccessRecord, type Role, type UserRole } from "../main-axios";
|
|
2
|
+
import type { AuthOverrideProtocol } from "../../types/auth-protocols";
|
|
3
|
+
export declare function getRoles(): Promise<{
|
|
4
|
+
roles: Role[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function createRole(roleData: {
|
|
7
|
+
name: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
description?: string | null;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
role: Role;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function updateRole(roleId: number, roleData: {
|
|
14
|
+
displayName?: string;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
permissions?: string[];
|
|
17
|
+
}): Promise<{
|
|
18
|
+
role: Role;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function deleteRole(roleId: number): Promise<{
|
|
21
|
+
success: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function getUserRoles(userId: string): Promise<{
|
|
24
|
+
roles: UserRole[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare function assignRoleToUser(userId: string, roleId: number): Promise<{
|
|
27
|
+
success: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function removeRoleFromUser(userId: string, roleId: number): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
export interface RoleMember {
|
|
33
|
+
userId: string;
|
|
34
|
+
username: string;
|
|
35
|
+
grantedAt: string;
|
|
36
|
+
grantedBy: string | null;
|
|
37
|
+
}
|
|
38
|
+
export declare function getRoleMembers(roleId: number): Promise<{
|
|
39
|
+
members: RoleMember[];
|
|
40
|
+
}>;
|
|
41
|
+
export type SharePermissionLevel = "connect" | "view" | "edit" | "manage";
|
|
42
|
+
export interface ShareTarget {
|
|
43
|
+
type: "user" | "role";
|
|
44
|
+
id: string | number;
|
|
45
|
+
}
|
|
46
|
+
export declare function shareHost(hostId: number, shareData: {
|
|
47
|
+
targets: ShareTarget[];
|
|
48
|
+
permissionLevel: SharePermissionLevel;
|
|
49
|
+
durationHours?: number;
|
|
50
|
+
}, syncId?: string | null): Promise<{
|
|
51
|
+
success: boolean;
|
|
52
|
+
expiresAt: string | null;
|
|
53
|
+
results: Array<{
|
|
54
|
+
type: "user" | "role";
|
|
55
|
+
id: string | number;
|
|
56
|
+
accessId: number;
|
|
57
|
+
created: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
export declare function shareFolder(folder: string, shareData: {
|
|
61
|
+
targets: ShareTarget[];
|
|
62
|
+
permissionLevel: SharePermissionLevel;
|
|
63
|
+
durationHours?: number;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
success: boolean;
|
|
66
|
+
expiresAt: string | null;
|
|
67
|
+
hostsShared: number;
|
|
68
|
+
hostsTotal: number;
|
|
69
|
+
hostResults: Array<{
|
|
70
|
+
hostId: number;
|
|
71
|
+
shared: boolean;
|
|
72
|
+
reason?: string;
|
|
73
|
+
}>;
|
|
74
|
+
}>;
|
|
75
|
+
export interface FolderAccessRule {
|
|
76
|
+
id: number;
|
|
77
|
+
folder: string;
|
|
78
|
+
targetType: "user" | "role";
|
|
79
|
+
userId: string | null;
|
|
80
|
+
roleId: number | null;
|
|
81
|
+
username: string | null;
|
|
82
|
+
roleName: string | null;
|
|
83
|
+
roleDisplayName: string | null;
|
|
84
|
+
permissionLevel: SharePermissionLevel;
|
|
85
|
+
expiresAt: string | null;
|
|
86
|
+
createdAt: string;
|
|
87
|
+
}
|
|
88
|
+
/** Standing shares on a folder - what hosts added to it later inherit. */
|
|
89
|
+
export declare function getFolderAccess(folder: string): Promise<{
|
|
90
|
+
rules: FolderAccessRule[];
|
|
91
|
+
}>;
|
|
92
|
+
export declare function revokeFolderAccess(ruleId: number): Promise<void>;
|
|
93
|
+
export declare function updateHostAccess(hostId: number, accessId: number, update: {
|
|
94
|
+
permissionLevel?: SharePermissionLevel;
|
|
95
|
+
durationHours?: number | null;
|
|
96
|
+
}, syncId?: string | null): Promise<{
|
|
97
|
+
success: boolean;
|
|
98
|
+
expiresAt: string | null;
|
|
99
|
+
}>;
|
|
100
|
+
export declare function getHostAccess(hostId: number, syncId?: string | null): Promise<{
|
|
101
|
+
accessList: AccessRecord[];
|
|
102
|
+
isOwner?: boolean;
|
|
103
|
+
}>;
|
|
104
|
+
export interface PermissionCatalogItem {
|
|
105
|
+
permission: string;
|
|
106
|
+
/** Plugin-relative keys; resolve them with pluginKey(). */
|
|
107
|
+
titleKey: string;
|
|
108
|
+
descriptionKey: string;
|
|
109
|
+
}
|
|
110
|
+
export interface PermissionCatalogEntry {
|
|
111
|
+
group: string;
|
|
112
|
+
permissions: string[];
|
|
113
|
+
/** Set for a group a plugin contributed. */
|
|
114
|
+
pluginId?: string;
|
|
115
|
+
/** Core groups carry an i18n key, plugin groups their display name. */
|
|
116
|
+
labelKey?: string;
|
|
117
|
+
label?: string;
|
|
118
|
+
icon?: string;
|
|
119
|
+
/** False once the owning plugin is disabled or gone. */
|
|
120
|
+
enabled?: boolean;
|
|
121
|
+
items?: PermissionCatalogItem[];
|
|
122
|
+
}
|
|
123
|
+
export declare function getPermissionsCatalog(): Promise<{
|
|
124
|
+
catalog: PermissionCatalogEntry[];
|
|
125
|
+
}>;
|
|
126
|
+
export interface MyPermissions {
|
|
127
|
+
permissions: string[];
|
|
128
|
+
isAdmin: boolean;
|
|
129
|
+
}
|
|
130
|
+
/** The current user's own grants, for hiding UI they could not use. */
|
|
131
|
+
export declare function getMyPermissions(): Promise<MyPermissions>;
|
|
132
|
+
export declare function getSharedHosts(): Promise<{
|
|
133
|
+
sharedHosts: Array<{
|
|
134
|
+
id: number;
|
|
135
|
+
name: string | null;
|
|
136
|
+
ip: string;
|
|
137
|
+
port: number;
|
|
138
|
+
username: string;
|
|
139
|
+
folder: string | null;
|
|
140
|
+
tags: string | null;
|
|
141
|
+
permissionLevel: SharePermissionLevel;
|
|
142
|
+
expiresAt: string | null;
|
|
143
|
+
grantedBy: string;
|
|
144
|
+
ownerUsername: string;
|
|
145
|
+
}>;
|
|
146
|
+
}>;
|
|
147
|
+
export declare function revokeHostAccess(hostId: number, accessId: number, syncId?: string | null): Promise<{
|
|
148
|
+
success: boolean;
|
|
149
|
+
}>;
|
|
150
|
+
export declare function getHostAuthOverride(hostId: number, protocol: AuthOverrideProtocol, sharedCopySyncId?: string | null): Promise<{
|
|
151
|
+
protocol: AuthOverrideProtocol;
|
|
152
|
+
credentialId: number | null;
|
|
153
|
+
}>;
|
|
154
|
+
export declare function setHostAuthOverride(hostId: number, protocol: AuthOverrideProtocol, credentialId: number | null, sharedCopySyncId?: string | null): Promise<{
|
|
155
|
+
success: boolean;
|
|
156
|
+
protocol: AuthOverrideProtocol;
|
|
157
|
+
credentialId: number | null;
|
|
158
|
+
}>;
|
|
159
|
+
export type CredentialPermissionLevel = "use" | "manage";
|
|
160
|
+
export declare function shareCredential(credentialId: number, targets: ShareTarget[], permissionLevel: CredentialPermissionLevel, durationHours?: number): Promise<{
|
|
161
|
+
success: boolean;
|
|
162
|
+
expiresAt: string | null;
|
|
163
|
+
}>;
|
|
164
|
+
export declare function getCredentialAccess(credentialId: number): Promise<{
|
|
165
|
+
access: AccessRecord[];
|
|
166
|
+
}>;
|
|
167
|
+
export declare function revokeCredentialAccess(credentialId: number, accessId: number): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function getLogLevel(): Promise<{
|
|
2
|
+
level: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare function updateLogLevel(level: string): Promise<void>;
|
|
5
|
+
export declare function getSessionTimeout(): Promise<{
|
|
6
|
+
timeoutHours: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function updateSessionTimeout(timeoutHours: number): Promise<void>;
|
|
9
|
+
export interface BrandingSettings {
|
|
10
|
+
appName: string;
|
|
11
|
+
tagline: string;
|
|
12
|
+
/** PNG data URL, or null when no custom logo is configured. */
|
|
13
|
+
logo: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface BrandingSettingsUpdate {
|
|
16
|
+
appName?: string;
|
|
17
|
+
tagline?: string;
|
|
18
|
+
logo?: string | null;
|
|
19
|
+
}
|
|
20
|
+
/** Public endpoint -- no auth required, so the login screen can read it. */
|
|
21
|
+
export declare function getBranding(): Promise<BrandingSettings>;
|
|
22
|
+
export declare function updateBranding(update: BrandingSettingsUpdate): Promise<BrandingSettings>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SSHHost, SSHHostData, ProxyNode } from "../../types/index";
|
|
2
|
+
import type { SSHHostWithStatus } from "../main-axios";
|
|
3
|
+
/** Host config only. Live status comes from ServerStatusContext. */
|
|
4
|
+
export declare function getSSHHosts(): Promise<SSHHostWithStatus[]>;
|
|
5
|
+
export declare function createSSHHost(hostData: SSHHostData): Promise<SSHHost>;
|
|
6
|
+
export declare function updateSSHHost(hostId: number, hostData: SSHHostData): Promise<SSHHost>;
|
|
7
|
+
export declare function bulkImportSSHHosts(hosts: SSHHostData[], overwrite?: boolean, credentials?: Record<string, unknown>[]): Promise<{
|
|
8
|
+
message: string;
|
|
9
|
+
success: number;
|
|
10
|
+
updated: number;
|
|
11
|
+
skipped: number;
|
|
12
|
+
failed: number;
|
|
13
|
+
errors: string[];
|
|
14
|
+
}>;
|
|
15
|
+
export declare function importSSHConfigHosts(content: string, overwrite?: boolean): Promise<{
|
|
16
|
+
message: string;
|
|
17
|
+
success: number;
|
|
18
|
+
updated: number;
|
|
19
|
+
skipped: number;
|
|
20
|
+
failed: number;
|
|
21
|
+
errors: string[];
|
|
22
|
+
}>;
|
|
23
|
+
export declare function bulkUpdateSSHHosts(hostIds: number[], updates: Record<string, unknown>): Promise<{
|
|
24
|
+
updated: number;
|
|
25
|
+
failed: number;
|
|
26
|
+
errors: string[];
|
|
27
|
+
}>;
|
|
28
|
+
export declare function reorderSSHHosts(positions: {
|
|
29
|
+
id: number;
|
|
30
|
+
sortOrder: number;
|
|
31
|
+
}[]): Promise<{
|
|
32
|
+
updated: number;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function deleteSSHHost(hostId: number): Promise<Record<string, unknown>>;
|
|
35
|
+
export declare function getSSHHostById(hostId: number): Promise<SSHHost>;
|
|
36
|
+
export declare function exportSSHHostWithCredentials(hostId: number): Promise<SSHHost>;
|
|
37
|
+
export declare function exportAllSSHHosts(): Promise<{
|
|
38
|
+
hosts: SSHHost[];
|
|
39
|
+
}>;
|
|
40
|
+
export declare function exportAllSSHHosts(options: {
|
|
41
|
+
share: true;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
version: string;
|
|
44
|
+
exportedAt: string;
|
|
45
|
+
credentials: Record<string, unknown>[];
|
|
46
|
+
hosts: SSHHost[];
|
|
47
|
+
}>;
|
|
48
|
+
export declare function testProxyConnection(options: {
|
|
49
|
+
singleProxy?: {
|
|
50
|
+
host: string;
|
|
51
|
+
port: number;
|
|
52
|
+
type?: 4 | 5 | "http";
|
|
53
|
+
username?: string;
|
|
54
|
+
password?: string;
|
|
55
|
+
};
|
|
56
|
+
proxyChain?: ProxyNode[];
|
|
57
|
+
testTarget?: {
|
|
58
|
+
host: string;
|
|
59
|
+
port: number;
|
|
60
|
+
};
|
|
61
|
+
}): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
latencyMs?: number;
|
|
64
|
+
error?: string;
|
|
65
|
+
}>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export type SyncState = "idle" | "syncing" | "offline" | "error" | "signed_out";
|
|
2
|
+
export interface SyncProxyHeader {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
/** A saved header whose value is not sent back. */
|
|
6
|
+
set?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SyncBasicAuth {
|
|
9
|
+
username: string;
|
|
10
|
+
password: string;
|
|
11
|
+
set?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SyncEntityInfo {
|
|
14
|
+
type: string;
|
|
15
|
+
owner: string;
|
|
16
|
+
ownerName: string | null;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
onServer: boolean;
|
|
19
|
+
onDevice: boolean;
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SyncStatus {
|
|
23
|
+
linked: boolean;
|
|
24
|
+
serverUrl?: string;
|
|
25
|
+
serverName?: string | null;
|
|
26
|
+
serverVersion?: string | null;
|
|
27
|
+
account?: {
|
|
28
|
+
username?: string;
|
|
29
|
+
isAdmin?: boolean;
|
|
30
|
+
roles?: string[];
|
|
31
|
+
permissions?: string[];
|
|
32
|
+
};
|
|
33
|
+
status?: SyncState;
|
|
34
|
+
lastError?: string | null;
|
|
35
|
+
linkedAt?: string;
|
|
36
|
+
lastSyncAt?: string | null;
|
|
37
|
+
pending?: number;
|
|
38
|
+
conflicts?: number;
|
|
39
|
+
errors?: number;
|
|
40
|
+
firstSyncDone?: boolean;
|
|
41
|
+
allowInvalidCertificate?: boolean;
|
|
42
|
+
customHeaders?: SyncProxyHeader[];
|
|
43
|
+
basicAuth?: SyncBasicAuth | null;
|
|
44
|
+
entities: SyncEntityInfo[];
|
|
45
|
+
}
|
|
46
|
+
export type ProbeProblem = "invalid_url" | "unreachable" | "tls_untrusted" | "basic_auth_required" | "proxy_login" | "not_termix" | "version_mismatch" | "different_account";
|
|
47
|
+
export interface ProbeResult {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
serverUrl?: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
version?: string | null;
|
|
52
|
+
problem?: ProbeProblem;
|
|
53
|
+
message?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ServerTarget {
|
|
56
|
+
serverUrl: string;
|
|
57
|
+
customHeaders?: SyncProxyHeader[];
|
|
58
|
+
basicAuth?: SyncBasicAuth | null;
|
|
59
|
+
allowInvalidCertificate?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface SyncConflictItem {
|
|
62
|
+
id: number;
|
|
63
|
+
entityType: string;
|
|
64
|
+
syncId: string;
|
|
65
|
+
name: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
}
|
|
68
|
+
export interface SyncErrorItem {
|
|
69
|
+
entityType: string;
|
|
70
|
+
syncId: string;
|
|
71
|
+
reason: string | null;
|
|
72
|
+
}
|
|
73
|
+
export declare function getSyncStatus(): Promise<SyncStatus>;
|
|
74
|
+
export declare function probeServer(target: ServerTarget): Promise<ProbeResult>;
|
|
75
|
+
export declare function getLinkPreview(): Promise<Record<string, number>>;
|
|
76
|
+
export declare function completeLink(input: ServerTarget & {
|
|
77
|
+
token: string;
|
|
78
|
+
mode: "merge" | "replace";
|
|
79
|
+
serverName?: string;
|
|
80
|
+
}): Promise<SyncStatus>;
|
|
81
|
+
export declare function reloginLink(token: string): Promise<SyncStatus>;
|
|
82
|
+
export declare function unlinkServer(keepData: boolean): Promise<SyncStatus>;
|
|
83
|
+
export declare function syncNow(): Promise<SyncStatus>;
|
|
84
|
+
export declare function updateSyncSettings(settings: {
|
|
85
|
+
disabledTypes?: string[];
|
|
86
|
+
customHeaders?: SyncProxyHeader[];
|
|
87
|
+
basicAuth?: SyncBasicAuth | null;
|
|
88
|
+
allowInvalidCertificate?: boolean;
|
|
89
|
+
}): Promise<SyncStatus>;
|
|
90
|
+
export declare function getSyncConflicts(): Promise<SyncConflictItem[]>;
|
|
91
|
+
export declare function settleSyncConflict(id: number, keep: "mine" | "server"): Promise<void>;
|
|
92
|
+
export declare function getSyncErrors(): Promise<SyncErrorItem[]>;
|
|
93
|
+
export declare function retrySyncErrors(): Promise<SyncStatus>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface ReleaseItem {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
link: string;
|
|
6
|
+
pubDate: string;
|
|
7
|
+
version: string;
|
|
8
|
+
isPrerelease: boolean;
|
|
9
|
+
isDraft: boolean;
|
|
10
|
+
assets: Array<{
|
|
11
|
+
name: string;
|
|
12
|
+
size: number;
|
|
13
|
+
download_count: number;
|
|
14
|
+
download_url: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface ReleasesRSSResponse {
|
|
18
|
+
feed: {
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
link: string;
|
|
22
|
+
updated: string;
|
|
23
|
+
};
|
|
24
|
+
items: ReleaseItem[];
|
|
25
|
+
total_count: number;
|
|
26
|
+
cached: boolean;
|
|
27
|
+
cache_age?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function getReleasesRSS(perPage?: number): Promise<ReleasesRSSResponse>;
|
|
30
|
+
export interface VersionInfo {
|
|
31
|
+
status?: "up_to_date" | "requires_update" | "beta" | "unknown";
|
|
32
|
+
/** Same value as remoteVersion; the endpoint sends both. */
|
|
33
|
+
version?: string;
|
|
34
|
+
localVersion?: string;
|
|
35
|
+
remoteVersion?: string;
|
|
36
|
+
latest_release?: {
|
|
37
|
+
tag_name?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
published_at?: string;
|
|
40
|
+
html_url?: string;
|
|
41
|
+
body?: string;
|
|
42
|
+
};
|
|
43
|
+
cached?: boolean;
|
|
44
|
+
cache_age?: number;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
export declare function releaseUrlFrom(info: VersionInfo | null | undefined): string;
|
|
48
|
+
export declare function getVersionInfo(checkRemote?: boolean): Promise<VersionInfo>;
|
|
49
|
+
export declare function getDatabaseHealth(): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UiPreferences } from "../../types/ui-preferences";
|
|
2
|
+
export declare function getUiPreferences(): Promise<UiPreferences>;
|
|
3
|
+
/**
|
|
4
|
+
* Sends a partial document. The backend merges overrides two levels deep, so
|
|
5
|
+
* only changed keys need to be sent; a null clears an override and hands the
|
|
6
|
+
* knob back to the preset.
|
|
7
|
+
*/
|
|
8
|
+
export declare function saveUiPreferences(preferences: Partial<UiPreferences> & Record<string, unknown>): Promise<void>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type UserInfo } from "../main-axios";
|
|
2
|
+
export type UserListOptions = {
|
|
3
|
+
/** Case-insensitive username substring filter. */
|
|
4
|
+
search?: string;
|
|
5
|
+
/** Page size. Omit to fetch every user (what the share pickers want). */
|
|
6
|
+
limit?: number;
|
|
7
|
+
offset?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function getUserList(options?: UserListOptions): Promise<{
|
|
10
|
+
users: UserInfo[];
|
|
11
|
+
total?: number;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function getSessions(): Promise<{
|
|
14
|
+
sessions: {
|
|
15
|
+
id: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
username?: string;
|
|
18
|
+
deviceType: string;
|
|
19
|
+
deviceInfo: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
expiresAt: string;
|
|
22
|
+
lastActiveAt: string;
|
|
23
|
+
isRevoked?: boolean;
|
|
24
|
+
isCurrentSession?: boolean;
|
|
25
|
+
}[];
|
|
26
|
+
}>;
|
|
27
|
+
export declare function revokeSession(sessionId: string): Promise<{
|
|
28
|
+
success: boolean;
|
|
29
|
+
message: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function revokeAllUserSessions(userId: string): Promise<{
|
|
32
|
+
success: boolean;
|
|
33
|
+
message: string;
|
|
34
|
+
}>;
|
|
35
|
+
export interface ApiKey {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
userId: string;
|
|
39
|
+
username: string | null;
|
|
40
|
+
tokenPrefix: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
expiresAt: string | null;
|
|
43
|
+
lastUsedAt: string | null;
|
|
44
|
+
isActive: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface CreatedApiKey extends ApiKey {
|
|
47
|
+
token: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function createApiKey(name: string, userId: string, expiresAt?: string): Promise<CreatedApiKey>;
|
|
50
|
+
export declare function getApiKeys(): Promise<{
|
|
51
|
+
apiKeys: ApiKey[];
|
|
52
|
+
}>;
|
|
53
|
+
export declare function deleteApiKey(keyId: string): Promise<{
|
|
54
|
+
success: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
export declare function makeUserAdmin(userId: string): Promise<Record<string, unknown>>;
|
|
57
|
+
export declare function removeAdminStatus(userId: string): Promise<Record<string, unknown>>;
|
|
58
|
+
export declare function deleteUser(username: string, successorUserId?: string | "none"): Promise<Record<string, unknown>>;
|
|
59
|
+
export declare function deleteAccount(password: string): Promise<Record<string, unknown>>;
|
|
60
|
+
export declare function adminResetUserPassword(userId: string, newPassword: string, confirmDataWipe?: boolean): Promise<{
|
|
61
|
+
message: string;
|
|
62
|
+
dataWiped?: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
export declare function adminExportUserData(userId: string): Promise<Record<string, unknown>>;
|
|
65
|
+
export declare function updateRegistrationAllowed(allowed: boolean): Promise<Record<string, unknown>>;
|
|
66
|
+
export declare function getExternalAutoProvision(): Promise<{
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
export declare function updateExternalAutoProvision(enabled: boolean): Promise<Record<string, unknown>>;
|
|
70
|
+
export declare function getSecondFactorAfterExternalLogin(): Promise<{
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
export declare function updateSecondFactorAfterExternalLogin(enabled: boolean): Promise<Record<string, unknown>>;
|
|
74
|
+
export declare function updatePasswordLoginAllowed(allowed: boolean): Promise<{
|
|
75
|
+
allowed: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
export declare function getPasswordResetAllowed(): Promise<boolean>;
|
|
78
|
+
export declare function updatePasswordResetAllowed(allowed: boolean): Promise<{
|
|
79
|
+
allowed: boolean;
|
|
80
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function getStoredAuth(): {
|
|
2
|
+
loggedIn: boolean;
|
|
3
|
+
username: string;
|
|
4
|
+
} | null;
|
|
5
|
+
export declare function clearStoredAuth(): void;
|
|
6
|
+
export declare function markDesktopManualLogout(): void;
|
|
7
|
+
export declare function clearDesktopManualLogout(): void;
|
|
8
|
+
interface AuthProps {
|
|
9
|
+
onLogin: (username: string, userId?: string, isAdmin?: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function Auth({ onLogin }: AuthProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The left half of the sign-in screen: brand mark, tagline, a rule. */
|
|
2
|
+
export declare function BrandPanel({ logo, appName, tagline, }: {
|
|
3
|
+
logo?: string | null;
|
|
4
|
+
appName: string;
|
|
5
|
+
tagline: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
/** The brand line shown above the form when the brand panel is hidden. */
|
|
8
|
+
export declare function CompactBrand({ logo, appName, }: {
|
|
9
|
+
logo?: string | null;
|
|
10
|
+
appName: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SSHHost } from "../../types";
|
|
3
|
+
export type FullScreenAppPhase = "loading" | "not-found" | "ready";
|
|
4
|
+
interface FullScreenAppWrapperProps {
|
|
5
|
+
hostId?: string;
|
|
6
|
+
children: (hostConfig: SSHHost | null, phase: FullScreenAppPhase) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const FullScreenAppWrapper: React.FC<FullScreenAppWrapperProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): React.JSX.Element;
|
|
7
|
+
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
|
|
8
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
11
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
12
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): React.JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): React.JSX.Element;
|
|
14
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: (props?: {
|
|
4
|
+
variant?: "default" | "destructive";
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: {
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary";
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: {
|
|
4
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost";
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { GridSlot, GridCardCatalogEntry } from "./types";
|
|
3
|
+
interface CardGridCanvasProps {
|
|
4
|
+
slots: GridSlot[];
|
|
5
|
+
columns: number;
|
|
6
|
+
editMode: boolean;
|
|
7
|
+
/** Render the card body for a given slot id. */
|
|
8
|
+
renderCard: (id: string) => ReactNode;
|
|
9
|
+
/** Cards available to add in edit mode (already-present ones are filtered out). */
|
|
10
|
+
cardCatalog: GridCardCatalogEntry[];
|
|
11
|
+
onChange: (slots: GridSlot[], columns: number) => void;
|
|
12
|
+
/** Human label lookup for a card id (used by remove/add chrome). */
|
|
13
|
+
cardLabel?: (id: string) => string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function CardGridCanvas({ slots, columns, editMode, renderCard, cardCatalog, onChange, cardLabel, className, }: CardGridCanvasProps): import("react").JSX.Element;
|
|
17
|
+
/** Small stepper to change the masonry column count, for an edit toolbar. */
|
|
18
|
+
export declare function ColumnCountStepper({ columns, onChange, }: {
|
|
19
|
+
columns: number;
|
|
20
|
+
onChange: (columns: number) => void;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GridSlot, GridColSpan, GridCardCatalogEntry } from "./types";
|
|
2
|
+
export declare const MIN_TILE_HEIGHT = 80;
|
|
3
|
+
export declare const MAX_COLUMNS = 4;
|
|
4
|
+
export declare const MIN_COLUMNS = 1;
|
|
5
|
+
export declare function clampColumns(n: number): number;
|
|
6
|
+
/** Cycle a tile width 1 -> 2 -> 3 -> 1, capped at the available column count. */
|
|
7
|
+
export declare function nextColSpan(current: GridColSpan, columns: number): GridColSpan;
|
|
8
|
+
/** Sort slots by order ascending (stable copy). */
|
|
9
|
+
export declare function sortSlots(slots: GridSlot[]): GridSlot[];
|
|
10
|
+
/**
|
|
11
|
+
* Move the dragged slot so it lands at `targetOrder`, then renumber every slot's
|
|
12
|
+
* order to a dense 0..n-1 sequence (the masonry placement is derived from order).
|
|
13
|
+
*/
|
|
14
|
+
export declare function reorderSlots(slots: GridSlot[], draggedId: string, targetOrder: number): GridSlot[];
|
|
15
|
+
/** Append a catalog card as a new slot, clamping its width to the column count. */
|
|
16
|
+
export declare function addSlot(slots: GridSlot[], entry: GridCardCatalogEntry, columns: number): GridSlot[];
|
|
17
|
+
export declare function removeSlot(slots: GridSlot[], id: string): GridSlot[];
|
|
18
|
+
export declare function setColSpan(slots: GridSlot[], id: string, colSpan: GridColSpan): GridSlot[];
|
|
19
|
+
export declare function setHeight(slots: GridSlot[], id: string, height: number): GridSlot[];
|
|
20
|
+
/**
|
|
21
|
+
* Convert a tile pixel height into the number of grid rows it should span for
|
|
22
|
+
* the masonry (row-span) layout. The grid uses `rowUnit`px rows separated by
|
|
23
|
+
* `rowGap`px, so a tile of height H occupies ceil((H + gap) / (unit + gap))
|
|
24
|
+
* rows. Kept pure for unit testing the packing math.
|
|
25
|
+
*/
|
|
26
|
+
export declare function heightToRowSpan(height: number, rowUnit: number, rowGap: number): number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the CardGridCanvas: a content-agnostic, N-column masonry of
|
|
3
|
+
* movable, variable-width, resizable tiles. The dashboard and Host Metrics both
|
|
4
|
+
* describe their layout with these primitives.
|
|
5
|
+
*/
|
|
6
|
+
export type GridColSpan = 1 | 2 | 3;
|
|
7
|
+
export interface GridSlot {
|
|
8
|
+
/** Stable card identifier (the consumer's card id). */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Global order across the masonry; column placement is derived from order. */
|
|
11
|
+
order: number;
|
|
12
|
+
/** Tile width in grid columns (the "tetris" piece width). */
|
|
13
|
+
colSpan: GridColSpan;
|
|
14
|
+
/** Fixed pixel height, or null for content/auto height. */
|
|
15
|
+
height: number | null;
|
|
16
|
+
}
|
|
17
|
+
export interface GridLayout {
|
|
18
|
+
slots: GridSlot[];
|
|
19
|
+
/** Number of masonry columns (1..4). */
|
|
20
|
+
columns: number;
|
|
21
|
+
}
|
|
22
|
+
/** Catalog entry describing an addable card, used by the edit-mode Add tray. */
|
|
23
|
+
export interface GridCardCatalogEntry {
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
defaultColSpan?: GridColSpan;
|
|
28
|
+
defaultHeight?: number | null;
|
|
29
|
+
}
|