feat(appstore): use shared resolver
This commit is contained in:
@@ -1,202 +0,0 @@
|
||||
/**
|
||||
* App Store type definitions
|
||||
*/
|
||||
|
||||
export interface ICatalog {
|
||||
schemaVersion: number;
|
||||
updatedAt: string;
|
||||
apps: ICatalogApp[];
|
||||
resolvedAt?: string;
|
||||
}
|
||||
|
||||
export type TAppCatalogSourceType = 'inline' | 'repoManifest' | 'dockerImage';
|
||||
export type TAppCatalogTrackingMode = 'tag' | 'digest';
|
||||
export type TAppUpgradeStrategy = 'semver' | 'branch' | 'dockerDigest';
|
||||
|
||||
export interface IAppCatalogInlineSource {
|
||||
type: 'inline';
|
||||
}
|
||||
|
||||
export interface IAppCatalogRepoManifestSource {
|
||||
type: 'repoManifest';
|
||||
url: string;
|
||||
ref?: string;
|
||||
}
|
||||
|
||||
export interface IAppCatalogDockerImageSource {
|
||||
type: 'dockerImage';
|
||||
image: string;
|
||||
tracking?: TAppCatalogTrackingMode;
|
||||
}
|
||||
|
||||
export type TAppCatalogSource =
|
||||
| IAppCatalogInlineSource
|
||||
| IAppCatalogRepoManifestSource
|
||||
| IAppCatalogDockerImageSource;
|
||||
|
||||
export interface IResolvedCatalogSource {
|
||||
type: TAppCatalogSourceType;
|
||||
url?: string;
|
||||
ref?: string;
|
||||
image?: string;
|
||||
manifestHash?: string;
|
||||
imageDigest?: string;
|
||||
resolvedAt: string;
|
||||
}
|
||||
|
||||
export interface ICatalogApp {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
category: string;
|
||||
iconName?: string;
|
||||
iconUrl?: string;
|
||||
latestVersion: string;
|
||||
versions?: string[];
|
||||
tags?: string[];
|
||||
source?: TAppCatalogSource;
|
||||
runtime?: IAppVersionConfig;
|
||||
channel?: string;
|
||||
upgradeStrategy?: TAppUpgradeStrategy;
|
||||
resolvedSource?: IResolvedCatalogSource;
|
||||
}
|
||||
|
||||
export interface IAppCatalogVolume {
|
||||
name?: string;
|
||||
source?: string;
|
||||
mountPath: string;
|
||||
driver?: string;
|
||||
readOnly?: boolean;
|
||||
backup?: boolean;
|
||||
options?: Record<string, string>;
|
||||
}
|
||||
|
||||
export type TAppCatalogVolumeSpec = string | IAppCatalogVolume;
|
||||
|
||||
export interface IAppCatalogPublishedPort {
|
||||
targetPort: number;
|
||||
targetPortEnd?: number;
|
||||
publishedPort?: number;
|
||||
publishedPortEnd?: number;
|
||||
protocol?: 'tcp' | 'udp';
|
||||
hostIp?: string;
|
||||
}
|
||||
|
||||
export interface IAppMeta {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
category: string;
|
||||
iconName?: string;
|
||||
latestVersion: string;
|
||||
versions: string[];
|
||||
maintainer?: string;
|
||||
links?: Record<string, string>;
|
||||
tags?: string[];
|
||||
source?: TAppCatalogSource;
|
||||
resolvedSource?: IResolvedCatalogSource;
|
||||
}
|
||||
|
||||
export interface IAppVersionConfig {
|
||||
image: string;
|
||||
port: number;
|
||||
envVars?: Array<{ key: string; value: string; description: string; required?: boolean }>;
|
||||
volumes?: TAppCatalogVolumeSpec[];
|
||||
publishedPorts?: IAppCatalogPublishedPort[];
|
||||
platformRequirements?: {
|
||||
mongodb?: boolean;
|
||||
s3?: boolean;
|
||||
clickhouse?: boolean;
|
||||
redis?: boolean;
|
||||
mariadb?: boolean;
|
||||
};
|
||||
minOneboxVersion?: string;
|
||||
catalogVersion?: string;
|
||||
upgradeStrategy?: TAppUpgradeStrategy;
|
||||
source?: TAppCatalogSource;
|
||||
resolvedSource?: IResolvedCatalogSource;
|
||||
resolvedImageDigest?: string;
|
||||
changelog?: string;
|
||||
breaking?: boolean;
|
||||
requiresManualReview?: boolean;
|
||||
migrationRequired?: boolean;
|
||||
backupBeforeUpgrade?: boolean;
|
||||
requiresFeatures?: string[];
|
||||
healthCheck?: {
|
||||
path?: string;
|
||||
port?: number;
|
||||
expectedStatus?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IServezoneCatalogAppInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
category: string;
|
||||
iconName?: string;
|
||||
iconUrl?: string;
|
||||
tags?: string[];
|
||||
maintainer?: string;
|
||||
links?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface IServezoneCatalogVersion extends IAppVersionConfig {
|
||||
version: string;
|
||||
}
|
||||
|
||||
export interface IServezoneCatalogManifest {
|
||||
schemaVersion: number;
|
||||
app: IServezoneCatalogAppInfo;
|
||||
latestVersion?: string;
|
||||
channel?: string;
|
||||
channels?: Record<string, string>;
|
||||
source?: TAppCatalogSource;
|
||||
runtime?: IAppVersionConfig;
|
||||
versions?: IServezoneCatalogVersion[];
|
||||
policy?: {
|
||||
allowMutableImage?: boolean;
|
||||
defaultChannel?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IAppInstallOptions {
|
||||
appId: string;
|
||||
version?: string;
|
||||
serviceName: string;
|
||||
domain?: string;
|
||||
port?: number;
|
||||
publishedPorts?: IAppCatalogPublishedPort[];
|
||||
envVars?: Record<string, string>;
|
||||
autoDNS?: boolean;
|
||||
}
|
||||
|
||||
export interface IMigrationContext {
|
||||
service: {
|
||||
name: string;
|
||||
image: string;
|
||||
envVars: Record<string, string>;
|
||||
port: number;
|
||||
};
|
||||
fromVersion: string;
|
||||
toVersion: string;
|
||||
}
|
||||
|
||||
export interface IMigrationResult {
|
||||
success: boolean;
|
||||
envVars?: Record<string, string>;
|
||||
image?: string;
|
||||
imageDigest?: string;
|
||||
port?: number;
|
||||
volumes?: IAppCatalogVolume[];
|
||||
publishedPorts?: IAppCatalogPublishedPort[];
|
||||
warnings: string[];
|
||||
}
|
||||
|
||||
export interface IUpgradeableService {
|
||||
serviceName: string;
|
||||
appTemplateId: string;
|
||||
currentVersion: string;
|
||||
latestVersion: string;
|
||||
hasMigration: boolean;
|
||||
}
|
||||
+158
-750
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user