Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
976d0aa
feat: add event tracking type definitions and helper
jerodfritz Nov 16, 2025
74b971a
new interfaces
jerodfritz Nov 16, 2025
8cf4b08
new admin type for app catalog display
jerodfritz Nov 16, 2025
dd3b4d5
admin catalog response tweak
jerodfritz Nov 16, 2025
5f27424
relate ServerDrive to drives table
jerodfritz Nov 16, 2025
84b8f68
stats wip poc on drives and apps in admin
jerodfritz Nov 16, 2025
f612909
more detailed per app stats
jerodfritz Nov 17, 2025
b9d0c4b
simplified AppListing
jerodfritz Nov 17, 2025
83b0c48
train stable or community
jerodfritz Nov 17, 2025
f9e6a24
new fresh flag passed through to implement "recently curated"
jerodfritz Nov 17, 2025
f8a7ba9
New interfaces for endpoints to support apps overhaul requests
jerodfritz Nov 18, 2025
a412672
Update routes.ts
jerodfritz Nov 19, 2025
acc3210
Adds app_discovery event
eschultz Nov 19, 2025
1676dd5
Update catalog status response to differentiate totals with deprecation
jerodfritz Nov 20, 2025
96afab8
server schema to include driveId from drives table
jerodfritz Nov 21, 2025
7897e72
Merge pull request #75 from eshtek/feature/apps-overhaul
jerodfritz Nov 30, 2025
e204066
Adds installsDiscovered to CatalogApp
eschultz Dec 2, 2025
a044aae
Merge pull request #76 from eshtek/feature/installsDiscovered
eschultz Dec 2, 2025
3419337
Adds ServerVersion interface
eschultz Dec 3, 2025
7e2d628
npm run generate-schemas
eschultz Dec 3, 2025
e60647e
Merge pull request #77 from eshtek/feature/add-server-version
eschultz Dec 3, 2025
5145142
Adds ACME-related global error codes
eschultz Dec 3, 2025
754246c
Merge pull request #78 from eshtek/feature/acme-global-errors
eschultz Dec 3, 2025
5f358c2
script v3 changes
jerodfritz Dec 4, 2025
d48f87e
script v3 continuation / app updates / analysis wip
jerodfritz Dec 8, 2025
9464795
convert types for easier use in config get endpoint
jerodfritz Dec 8, 2025
687734b
interface changes to support gpu macro implementation
jerodfritz Dec 9, 2025
4cc0bda
remove apps-schema
jerodfritz Dec 9, 2025
a5e69b3
preserve added to resource change action
jerodfritz Dec 10, 2025
dd5e7b8
Adds app recommendation and config error handling
jerodfritz Dec 16, 2025
0762c46
Merge branch 'dev' into feature/app-scripts-v3
jerodfritz Dec 16, 2025
ccca696
Merge pull request #79 from eshtek/feature/app-scripts-v3
jerodfritz Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions eshtek/admin.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/**
* Admin API Types and Interfaces
*/

/**
* Response from the catalog status endpoint
*/
export interface CatalogStatusResponse {
totalApps: number;
totalNonDeprecated: number;
totalWithScripts: number;
totalWithScriptsNonDeprecated: number;
totalDeprecated: number;
lastSync: Date | null;
}

/**
* Individual app in the catalog
*/
export interface CatalogApp {
id: number;
name: string;
train: string | null;
version: string | null;
appVersion: string | null;
title: string | null;
description: string | null;
home: string | null;
iconUrl: string | null;
screenshots: string[];
sources: string[];
categories: string[];
keywords: string[];
maintainers: any[];
supported: boolean;
deprecated: boolean;
installScript: string | null;
requirements: any;
compatibility: string | null;
lastCatalogSync: Date | null;
metadata: any;
// Event statistics (detailed)
installsDiscovered?: number;
installsCompleted?: number;
installsFailed?: number;
uninstallsCompleted?: number;
uninstallsFailed?: number;
upgradesCompleted?: number;
upgradesFailed?: number;
updatesCompleted?: number;
updatesFailed?: number;
}

/**
* Response from the catalog data endpoint
*/
export interface AppsCatalogResponse {
apps: CatalogApp[];
totalApps: number;
totalWithScripts: number;
totalDeprecated: number;
lastSync: Date | null;
}

/**
* Drive data with event statistics
*/
export interface DriveData {
id: number;
manufacturer: string;
model: string;
name: string | null;
type: string | null;
size: number | null;
smr: boolean;
notes: string | null;
isUserDiscovered: boolean;
createdAt: Date;
updatedAt: Date;
// Event statistics
utilized: number;
replaced: number;
removed: number;
failed: number;
discovered: number;
}

/**
* Response from the drives data endpoint
*/
export interface DrivesResponse {
drives: DriveData[];
totalDrives: number;
totalSMR: number;
totalUtilized: number;
totalFailed: number;
totalRemoved: number;
}
201 changes: 0 additions & 201 deletions eshtek/apps-schema.ts

This file was deleted.

45 changes: 42 additions & 3 deletions eshtek/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,28 @@ export interface AppRequirementsCheck {
};
}

export interface AppListing extends AvailableApp {
hexos: boolean;
export interface AppMaintainer {
name: string;
email: string;
}

export interface AppListing {
appId: string;
name: string;
train: "stable" | "community";
version: string;
appVersion: string;
description: string;
icon: string;
categories: string[];
keywords: string[];
maintainers: AppMaintainer[];
screenshots: string[];
sources: string[];
homepage: string;
recommended: boolean;
supported: boolean;
fresh: boolean;
installScript?: string;
requirements?: AppRequirements;
}
Expand All @@ -69,7 +89,9 @@ export interface AppInfo extends AppBasics {
status: AppState;
url_webui: string;
upgradeAvailable: boolean;
updatedScriptAvailable: boolean;
latestVersion: string;
recommended: boolean;
}
export interface AppInfoDetailed extends AppInfo {
data: number[][];
Expand Down Expand Up @@ -120,6 +142,7 @@ export interface InstallationQuestion {

interface AppsInstallScriptV1 {
version: 1;
requirements?: AppRequirements;
ensure_directories_exists?: Array<string | { path: string; network_share?: boolean; posix?: boolean }>;
ensure_permissions_exists?: Array<{
path: string;
Expand All @@ -132,6 +155,7 @@ interface AppsInstallScriptV1 {

interface AppsInstallScriptV2 {
version: 2;
requirements?: AppRequirements;
installation_questions?: InstallationQuestion[];
ensure_directories_exists?: Array<string | { path: string; network_share?: boolean; posix?: boolean }>;
ensure_permissions_exists?: Array<{
Expand All @@ -143,7 +167,22 @@ interface AppsInstallScriptV2 {
app_values: Record<string, ChartFormValue>;
}

export type AppsInstallScript = AppsInstallScriptV1 | AppsInstallScriptV2;
interface AppsInstallScriptV3 extends Omit<AppsInstallScriptV2, 'version' | 'requirements'> {
version: 3;
script: {
version: string;
updateCompatibility?: string;
changeLog?: string;
};
requirements: AppRequirements; // Required in V3
}

export type AppsInstallScript = AppsInstallScriptV1 | AppsInstallScriptV2 | AppsInstallScriptV3;

export interface AppConfiguration {
installScript?: AppsInstallScript | null;
questionResponses?: Record<string, string | number | boolean>;
}

export interface InstallScriptCuration {
name: string;
Expand Down
13 changes: 13 additions & 0 deletions eshtek/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,16 @@ export function getStepSize(range: number, steps: number = 10, acceptableSteps:
return Math.abs(curr - rawStep) < Math.abs(prev - rawStep) ? curr : prev;
});
}

import type { HexTaskType } from './tasks';
import type { EventState, TaskEventName } from './events';

/**
* Generates a task event name from a task type and event state.
* @param {HexTaskType} taskType - The type of the task.
* @param {EventState} state - The state of the event (started, completed, failed).
* @returns {TaskEventName} - Returns the generated event name (e.g., 'app_install_started').
*/
export function getTaskEventName(taskType: HexTaskType, state: EventState): TaskEventName {
return `${taskType.toLowerCase()}_${state}` as TaskEventName;
}
Loading
Loading