feat(appstore): use shared resolver
This commit is contained in:
@@ -1,125 +1,77 @@
|
||||
import type * as servezoneInterfaces from '@serve.zone/interfaces';
|
||||
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 type IAppStoreApp = servezoneInterfaces.appstore.IAppStoreApp;
|
||||
export type IAppStoreVersionConfig = servezoneInterfaces.appstore.IAppStoreVersionConfig;
|
||||
export type IAppStoreAppMeta = servezoneInterfaces.appstore.IAppStoreAppMeta;
|
||||
export type IUpgradeableAppStoreService = servezoneInterfaces.appstore.IUpgradeableAppStoreService;
|
||||
|
||||
export interface IAppVersionConfig {
|
||||
image: string;
|
||||
port: number;
|
||||
envVars?: Array<{ key: string; value: string; description: string; required?: boolean }>;
|
||||
volumes?: Array<string | data.IServiceVolume>;
|
||||
publishedPorts?: data.IServicePublishedPort[];
|
||||
platformRequirements?: {
|
||||
mongodb?: boolean;
|
||||
s3?: boolean;
|
||||
clickhouse?: boolean;
|
||||
redis?: boolean;
|
||||
mariadb?: boolean;
|
||||
};
|
||||
minOneboxVersion?: string;
|
||||
}
|
||||
|
||||
export interface IAppInstallOptions {
|
||||
appId: string;
|
||||
version?: string;
|
||||
serviceName: string;
|
||||
domain?: string;
|
||||
port?: number;
|
||||
publishedPorts?: data.IServicePublishedPort[];
|
||||
envVars?: Record<string, string>;
|
||||
export interface IAppStoreInstallOptions extends servezoneInterfaces.appstore.IAppStoreInstallRequest {
|
||||
autoDNS?: boolean;
|
||||
}
|
||||
|
||||
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<
|
||||
export interface IReq_GetAppStoreTemplates extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAppTemplates
|
||||
IReq_GetAppStoreTemplates
|
||||
> {
|
||||
method: 'getAppTemplates';
|
||||
method: 'getAppStoreTemplates';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
apps: ICatalogApp[];
|
||||
apps: IAppStoreApp[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetAppConfig extends plugins.typedrequestInterfaces.implementsTR<
|
||||
export interface IReq_GetAppStoreConfig extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAppConfig
|
||||
IReq_GetAppStoreConfig
|
||||
> {
|
||||
method: 'getAppConfig';
|
||||
method: 'getAppStoreConfig';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
appId: string;
|
||||
version: string;
|
||||
};
|
||||
response: {
|
||||
config: IAppVersionConfig;
|
||||
appMeta: IAppMeta;
|
||||
config: IAppStoreVersionConfig;
|
||||
appMeta: IAppStoreAppMeta;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_InstallAppTemplate extends plugins.typedrequestInterfaces.implementsTR<
|
||||
export interface IReq_InstallAppStoreApp extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_InstallAppTemplate
|
||||
IReq_InstallAppStoreApp
|
||||
> {
|
||||
method: 'installAppTemplate';
|
||||
method: 'installAppStoreApp';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
install: IAppInstallOptions;
|
||||
install: IAppStoreInstallOptions;
|
||||
};
|
||||
response: {
|
||||
service: data.IService;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetUpgradeableServices extends plugins.typedrequestInterfaces.implementsTR<
|
||||
export interface IReq_GetUpgradeableAppStoreServices extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetUpgradeableServices
|
||||
IReq_GetUpgradeableAppStoreServices
|
||||
> {
|
||||
method: 'getUpgradeableServices';
|
||||
method: 'getUpgradeableAppStoreServices';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
services: IUpgradeableService[];
|
||||
services: IUpgradeableAppStoreService[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpgradeService extends plugins.typedrequestInterfaces.implementsTR<
|
||||
export interface IReq_UpgradeAppStoreService extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpgradeService
|
||||
IReq_UpgradeAppStoreService
|
||||
> {
|
||||
method: 'upgradeService';
|
||||
method: 'upgradeAppStoreService';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
serviceName: string;
|
||||
|
||||
Reference in New Issue
Block a user