feat(appstore): add remote app store templates with service upgrades and Redis/MariaDB platform support
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Platform service data shapes for Onebox
|
||||
*/
|
||||
|
||||
export type TPlatformServiceType = 'mongodb' | 'minio' | 'redis' | 'postgresql' | 'rabbitmq' | 'caddy' | 'clickhouse';
|
||||
export type TPlatformServiceType = 'mongodb' | 'minio' | 'redis' | 'postgresql' | 'rabbitmq' | 'caddy' | 'clickhouse' | 'mariadb';
|
||||
export type TPlatformServiceStatus = 'not-deployed' | 'stopped' | 'starting' | 'running' | 'stopping' | 'failed';
|
||||
export type TPlatformResourceType = 'database' | 'bucket' | 'cache' | 'queue';
|
||||
|
||||
@@ -10,6 +10,8 @@ export interface IPlatformRequirements {
|
||||
mongodb?: boolean;
|
||||
s3?: boolean;
|
||||
clickhouse?: boolean;
|
||||
redis?: boolean;
|
||||
mariadb?: boolean;
|
||||
}
|
||||
|
||||
export interface IPlatformService {
|
||||
|
||||
@@ -28,6 +28,9 @@ export interface IService {
|
||||
platformRequirements?: IPlatformRequirements;
|
||||
// Backup settings
|
||||
includeImageInBackup?: boolean;
|
||||
// App Store template tracking
|
||||
appTemplateId?: string;
|
||||
appTemplateVersion?: string;
|
||||
}
|
||||
|
||||
export interface IServiceCreate {
|
||||
@@ -42,6 +45,10 @@ export interface IServiceCreate {
|
||||
enableMongoDB?: boolean;
|
||||
enableS3?: boolean;
|
||||
enableClickHouse?: boolean;
|
||||
enableRedis?: boolean;
|
||||
enableMariaDB?: boolean;
|
||||
appTemplateId?: string;
|
||||
appTemplateVersion?: string;
|
||||
}
|
||||
|
||||
export interface IServiceUpdate {
|
||||
|
||||
106
ts_interfaces/requests/appstore.ts
Normal file
106
ts_interfaces/requests/appstore.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface ICatalogApp {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
category: string;
|
||||
iconName?: string;
|
||||
iconUrl?: string;
|
||||
latestVersion: string;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export interface IAppVersionConfig {
|
||||
image: string;
|
||||
port: number;
|
||||
envVars?: Array<{ key: string; value: string; description: string; required?: boolean }>;
|
||||
volumes?: string[];
|
||||
platformRequirements?: {
|
||||
mongodb?: boolean;
|
||||
s3?: boolean;
|
||||
clickhouse?: boolean;
|
||||
redis?: boolean;
|
||||
mariadb?: boolean;
|
||||
};
|
||||
minOneboxVersion?: string;
|
||||
}
|
||||
|
||||
export interface IAppMeta {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
category: string;
|
||||
iconName?: string;
|
||||
latestVersion: string;
|
||||
versions: string[];
|
||||
maintainer?: string;
|
||||
links?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface IUpgradeableService {
|
||||
serviceName: string;
|
||||
appTemplateId: string;
|
||||
currentVersion: string;
|
||||
latestVersion: string;
|
||||
hasMigration: boolean;
|
||||
}
|
||||
|
||||
export interface IReq_GetAppTemplates extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAppTemplates
|
||||
> {
|
||||
method: 'getAppTemplates';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
apps: ICatalogApp[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetAppConfig extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAppConfig
|
||||
> {
|
||||
method: 'getAppConfig';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
appId: string;
|
||||
version: string;
|
||||
};
|
||||
response: {
|
||||
config: IAppVersionConfig;
|
||||
appMeta: IAppMeta;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetUpgradeableServices extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetUpgradeableServices
|
||||
> {
|
||||
method: 'getUpgradeableServices';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
services: IUpgradeableService[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpgradeService extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpgradeService
|
||||
> {
|
||||
method: 'upgradeService';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
serviceName: string;
|
||||
targetVersion: string;
|
||||
};
|
||||
response: {
|
||||
service: data.IService;
|
||||
warnings: string[];
|
||||
};
|
||||
}
|
||||
@@ -12,3 +12,4 @@ export * from './backup-schedules.ts';
|
||||
export * from './settings.ts';
|
||||
export * from './logs.ts';
|
||||
export * from './workspace.ts';
|
||||
export * from './appstore.ts';
|
||||
|
||||
Reference in New Issue
Block a user