feat(appstore): use shared resolver
This commit is contained in:
@@ -2,7 +2,12 @@
|
|||||||
|
|
||||||
## Pending
|
## Pending
|
||||||
|
|
||||||
|
### Breaking Changes
|
||||||
|
|
||||||
|
- switch Onebox App Store resolution to the shared appstore client
|
||||||
|
- Uses `@serve.zone/appstore` and `@serve.zone/interfaces` for App Store metadata, parsing, and Docker digest resolution
|
||||||
|
- Renames App Store typed request methods to `getAppStoreTemplates`, `getAppStoreConfig`, `installAppStoreApp`, and `getUpgradeableAppStoreServices`
|
||||||
|
- Removes local duplicated App Store DTO and resolver code while preserving Onebox install and upgrade behavior
|
||||||
|
|
||||||
## 2026-05-25 - 1.31.0
|
## 2026-05-25 - 1.31.0
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,9 @@
|
|||||||
"@push.rocks/smartguard": "npm:@push.rocks/smartguard@^3.1.0",
|
"@push.rocks/smartguard": "npm:@push.rocks/smartguard@^3.1.0",
|
||||||
"@push.rocks/smartjwt": "npm:@push.rocks/smartjwt@^2.2.2",
|
"@push.rocks/smartjwt": "npm:@push.rocks/smartjwt@^2.2.2",
|
||||||
"@api.global/typedsocket": "npm:@api.global/typedsocket@^4.1.3",
|
"@api.global/typedsocket": "npm:@api.global/typedsocket@^4.1.3",
|
||||||
"@serve.zone/containerarchive": "npm:@serve.zone/containerarchive@^0.1.3"
|
"@serve.zone/containerarchive": "npm:@serve.zone/containerarchive@^0.1.3",
|
||||||
|
"@serve.zone/interfaces": "npm:@serve.zone/interfaces@^6.0.0",
|
||||||
|
"@serve.zone/appstore": "npm:@serve.zone/appstore@^0.2.0"
|
||||||
},
|
},
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": [
|
"lib": [
|
||||||
|
|||||||
+3
-1
@@ -58,7 +58,9 @@
|
|||||||
"@api.global/typedsocket": "^4.1.3",
|
"@api.global/typedsocket": "^4.1.3",
|
||||||
"@design.estate/dees-catalog": "^3.81.0",
|
"@design.estate/dees-catalog": "^3.81.0",
|
||||||
"@design.estate/dees-element": "^2.2.4",
|
"@design.estate/dees-element": "^2.2.4",
|
||||||
"@serve.zone/catalog": "^2.12.6"
|
"@serve.zone/appstore": "^0.2.0",
|
||||||
|
"@serve.zone/catalog": "^2.12.6",
|
||||||
|
"@serve.zone/interfaces": "^6.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbundle": "^2.10.4",
|
"@git.zone/tsbundle": "^2.10.4",
|
||||||
|
|||||||
Generated
+22
@@ -20,9 +20,15 @@ importers:
|
|||||||
'@design.estate/dees-element':
|
'@design.estate/dees-element':
|
||||||
specifier: ^2.2.4
|
specifier: ^2.2.4
|
||||||
version: 2.2.4
|
version: 2.2.4
|
||||||
|
'@serve.zone/appstore':
|
||||||
|
specifier: ^0.2.0
|
||||||
|
version: 0.2.0
|
||||||
'@serve.zone/catalog':
|
'@serve.zone/catalog':
|
||||||
specifier: ^2.12.6
|
specifier: ^2.12.6
|
||||||
version: 2.12.6(@tiptap/pm@2.27.2)
|
version: 2.12.6(@tiptap/pm@2.27.2)
|
||||||
|
'@serve.zone/interfaces':
|
||||||
|
specifier: ^6.0.0
|
||||||
|
version: 6.0.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@git.zone/tsbundle':
|
'@git.zone/tsbundle':
|
||||||
specifier: ^2.10.4
|
specifier: ^2.10.4
|
||||||
@@ -977,9 +983,15 @@ packages:
|
|||||||
'@sec-ant/readable-stream@0.4.1':
|
'@sec-ant/readable-stream@0.4.1':
|
||||||
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
|
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
|
||||||
|
|
||||||
|
'@serve.zone/appstore@0.2.0':
|
||||||
|
resolution: {integrity: sha512-qt2LVaRpzfJdUywllm+F0njwnN3aHc2aZHEcjc9REn1VDT47UuUEGaKkfNiosGK0GJqb1hPI/GwyuGMe4H4q7w==}
|
||||||
|
|
||||||
'@serve.zone/catalog@2.12.6':
|
'@serve.zone/catalog@2.12.6':
|
||||||
resolution: {integrity: sha512-FjieZNCHTCHufMre8OSP8bFP9L4DPL9yNtd7UMwD1yQ8wublgAq6eWrx6Tfb+3k8Hyof33BBt4rbFyrvIEBk+A==}
|
resolution: {integrity: sha512-FjieZNCHTCHufMre8OSP8bFP9L4DPL9yNtd7UMwD1yQ8wublgAq6eWrx6Tfb+3k8Hyof33BBt4rbFyrvIEBk+A==}
|
||||||
|
|
||||||
|
'@serve.zone/interfaces@6.0.0':
|
||||||
|
resolution: {integrity: sha512-nCidhOH0XlX+7e6xaJDq6fwnwaWasB/4w2LHkV7A96G+m+7EXZqbbaKSboUlaiGDly0dWNajk2FrYFo64ZucPA==}
|
||||||
|
|
||||||
'@tempfix/lenis@1.3.20':
|
'@tempfix/lenis@1.3.20':
|
||||||
resolution: {integrity: sha512-ypeB0FuHLHOCQXW4d0RQ69txPJJH+1CHcpsZIUdcv2t1vR0IVyQr2vHihtde9UOXhjzqEnUphWon/UcJNsa0YA==}
|
resolution: {integrity: sha512-ypeB0FuHLHOCQXW4d0RQ69txPJJH+1CHcpsZIUdcv2t1vR0IVyQr2vHihtde9UOXhjzqEnUphWon/UcJNsa0YA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -3572,6 +3584,10 @@ snapshots:
|
|||||||
|
|
||||||
'@sec-ant/readable-stream@0.4.1': {}
|
'@sec-ant/readable-stream@0.4.1': {}
|
||||||
|
|
||||||
|
'@serve.zone/appstore@0.2.0':
|
||||||
|
dependencies:
|
||||||
|
'@serve.zone/interfaces': 6.0.0
|
||||||
|
|
||||||
'@serve.zone/catalog@2.12.6(@tiptap/pm@2.27.2)':
|
'@serve.zone/catalog@2.12.6(@tiptap/pm@2.27.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@design.estate/dees-catalog': 3.81.0(@tiptap/pm@2.27.2)
|
'@design.estate/dees-catalog': 3.81.0(@tiptap/pm@2.27.2)
|
||||||
@@ -3585,6 +3601,12 @@ snapshots:
|
|||||||
- supports-color
|
- supports-color
|
||||||
- vue
|
- vue
|
||||||
|
|
||||||
|
'@serve.zone/interfaces@6.0.0':
|
||||||
|
dependencies:
|
||||||
|
'@api.global/typedrequest-interfaces': 3.0.19
|
||||||
|
'@push.rocks/smartlog-interfaces': 3.0.2
|
||||||
|
'@tsclass/tsclass': 9.5.1
|
||||||
|
|
||||||
'@tempfix/lenis@1.3.20': {}
|
'@tempfix/lenis@1.3.20': {}
|
||||||
|
|
||||||
'@tempfix/webcontainer__api@1.6.1': {}
|
'@tempfix/webcontainer__api@1.6.1': {}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ onebox config set cloudflareZoneId zone-id
|
|||||||
|
|
||||||
## App Store
|
## App Store
|
||||||
|
|
||||||
The App Store manager fetches catalog data from `serve.zone/appstore-apptemplates` and caches it briefly. Templates can declare platform requirements, so installing an app can automatically provision MongoDB, S3-compatible storage, ClickHouse, Redis, or MariaDB resources and inject the resulting credentials as environment variables.
|
The App Store manager fetches metadata from `serve.zone/appstore` through `@serve.zone/appstore` and caches it briefly. Templates can declare platform requirements, so installing an app can automatically provision MongoDB, S3-compatible storage, ClickHouse, Redis, or MariaDB resources and inject the resulting credentials as environment variables.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
onebox appstore list
|
onebox appstore list
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ import { assertEquals, assertThrows } from '@std/assert';
|
|||||||
|
|
||||||
import { AppStoreManager } from '../ts/classes/appstore.ts';
|
import { AppStoreManager } from '../ts/classes/appstore.ts';
|
||||||
import { OneboxDockerManager } from '../ts/classes/docker.ts';
|
import { OneboxDockerManager } from '../ts/classes/docker.ts';
|
||||||
import type { IAppVersionConfig } from '../ts/classes/appstore-types.ts';
|
import type * as servezoneInterfaces from '@serve.zone/interfaces';
|
||||||
import type { IService } from '../ts/types.ts';
|
import type { IService } from '../ts/types.ts';
|
||||||
|
|
||||||
|
type IAppStoreVersionConfig = servezoneInterfaces.appstore.IAppStoreVersionConfig;
|
||||||
|
|
||||||
const createAppStore = () => new AppStoreManager({} as any);
|
const createAppStore = () => new AppStoreManager({} as any);
|
||||||
|
|
||||||
const baseConfig: IAppVersionConfig = {
|
const baseConfig: IAppStoreVersionConfig = {
|
||||||
image: 'example/app:1.0.0',
|
image: 'example/app:1.0.0',
|
||||||
port: 3000,
|
port: 3000,
|
||||||
envVars: [
|
envVars: [
|
||||||
@@ -82,19 +84,19 @@ Deno.test('appstore rejects invalid template ports and volumes', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Deno.test('appstore resolves repo manifests and docker digest-tracked latest images', async () => {
|
Deno.test('appstore resolves repo manifests and docker digest-tracked latest images', async () => {
|
||||||
const catalogBaseUrl = 'https://catalog.example.test';
|
const appStoreBaseUrl = 'https://appstore.example.test';
|
||||||
const manifestUrl = 'https://code.example.test/cloudly/servezone.catalog.json';
|
const manifestUrl = 'https://code.example.test/cloudly/servezone.appstore.json';
|
||||||
const digest = 'sha256:1234567890abcdef';
|
const digest = 'sha256:1234567890abcdef';
|
||||||
|
|
||||||
const fakeFetch: typeof fetch = async (input, init) => {
|
const fakeFetch: typeof fetch = async (input, init) => {
|
||||||
const url = input instanceof Request ? input.url : input.toString();
|
const url = input instanceof Request ? input.url : input.toString();
|
||||||
const method = init?.method || 'GET';
|
const method = init?.method || 'GET';
|
||||||
|
|
||||||
if (url === `${catalogBaseUrl}/catalog.resolved.json`) {
|
if (url === `${appStoreBaseUrl}/appstore.resolved.json`) {
|
||||||
return new Response('not found', { status: 404 });
|
return new Response('not found', { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url === `${catalogBaseUrl}/catalog.json`) {
|
if (url === `${appStoreBaseUrl}/appstore.json`) {
|
||||||
return Response.json({
|
return Response.json({
|
||||||
schemaVersion: 1,
|
schemaVersion: 1,
|
||||||
updatedAt: '2026-05-24T00:00:00Z',
|
updatedAt: '2026-05-24T00:00:00Z',
|
||||||
@@ -152,14 +154,14 @@ Deno.test('appstore resolves repo manifests and docker digest-tracked latest ima
|
|||||||
};
|
};
|
||||||
|
|
||||||
const appStore = new AppStoreManager({} as any, {
|
const appStore = new AppStoreManager({} as any, {
|
||||||
repoBaseUrl: catalogBaseUrl,
|
baseUrl: appStoreBaseUrl,
|
||||||
fetch: fakeFetch,
|
fetch: fakeFetch,
|
||||||
});
|
});
|
||||||
|
|
||||||
const catalog = await appStore.getCatalog();
|
const appStoreIndex = await appStore.getAppStore();
|
||||||
assertEquals(catalog.apps[0].latestVersion, `latest@${digest}`);
|
assertEquals(appStoreIndex.apps[0].latestVersion, `latest@${digest}`);
|
||||||
assertEquals(catalog.apps[0].resolvedSource?.manifestHash?.length, 64);
|
assertEquals(appStoreIndex.apps[0].resolvedSource?.manifestHash?.length, 64);
|
||||||
assertEquals(catalog.apps[0].upgradeStrategy, 'dockerDigest');
|
assertEquals(appStoreIndex.apps[0].upgradeStrategy, 'dockerDigest');
|
||||||
|
|
||||||
const appMeta = await appStore.getAppMeta('cloudly');
|
const appMeta = await appStore.getAppMeta('cloudly');
|
||||||
assertEquals(appMeta.latestVersion, `latest@${digest}`);
|
assertEquals(appMeta.latestVersion, `latest@${digest}`);
|
||||||
@@ -167,7 +169,7 @@ Deno.test('appstore resolves repo manifests and docker digest-tracked latest ima
|
|||||||
|
|
||||||
const config = await appStore.getAppVersionConfig('cloudly', appMeta.latestVersion);
|
const config = await appStore.getAppVersionConfig('cloudly', appMeta.latestVersion);
|
||||||
assertEquals(config.image, 'registry.example.test/serve.zone/cloudly:latest');
|
assertEquals(config.image, 'registry.example.test/serve.zone/cloudly:latest');
|
||||||
assertEquals(config.catalogVersion, `latest@${digest}`);
|
assertEquals(config.appStoreVersion, `latest@${digest}`);
|
||||||
assertEquals(config.resolvedImageDigest, digest);
|
assertEquals(config.resolvedImageDigest, digest);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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
@@ -9,7 +9,9 @@ import { Onebox } from './classes/onebox.ts';
|
|||||||
import { OneboxDaemon } from './classes/daemon.ts';
|
import { OneboxDaemon } from './classes/daemon.ts';
|
||||||
import { OneboxSystemd } from './classes/systemd.ts';
|
import { OneboxSystemd } from './classes/systemd.ts';
|
||||||
import { OneboxUpdateManager } from './classes/update-manager.ts';
|
import { OneboxUpdateManager } from './classes/update-manager.ts';
|
||||||
import type { IAppVersionConfig } from './classes/appstore-types.ts';
|
import type * as servezoneInterfaces from '@serve.zone/interfaces';
|
||||||
|
|
||||||
|
type IAppStoreVersionConfig = servezoneInterfaces.appstore.IAppStoreVersionConfig;
|
||||||
|
|
||||||
export async function runCli(): Promise<void> {
|
export async function runCli(): Promise<void> {
|
||||||
const args = Deno.args;
|
const args = Deno.args;
|
||||||
@@ -591,7 +593,7 @@ function parseEnvArgs(args: string[]): Record<string, string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getAppStoreEnvVars(
|
function getAppStoreEnvVars(
|
||||||
configArg: IAppVersionConfig,
|
configArg: IAppStoreVersionConfig,
|
||||||
overridesArg: Record<string, string>,
|
overridesArg: Record<string, string>,
|
||||||
): Record<string, string> {
|
): Record<string, string> {
|
||||||
const envVars: Record<string, string> = {};
|
const envVars: Record<string, string> = {};
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ export class AppStoreHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private registerHandlers(): void {
|
private registerHandlers(): void {
|
||||||
// Get app templates (catalog)
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_GetAppTemplates>(
|
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_GetAppStoreTemplates>(
|
||||||
'getAppTemplates',
|
'getAppStoreTemplates',
|
||||||
async (dataArg) => {
|
async (dataArg) => {
|
||||||
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
||||||
const apps = await this.opsServerRef.oneboxRef.appStore.getApps();
|
const apps = await this.opsServerRef.oneboxRef.appStore.getApps();
|
||||||
@@ -25,10 +24,9 @@ export class AppStoreHandler {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get app config for a specific version
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_GetAppConfig>(
|
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_GetAppStoreConfig>(
|
||||||
'getAppConfig',
|
'getAppStoreConfig',
|
||||||
async (dataArg) => {
|
async (dataArg) => {
|
||||||
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
||||||
const config = await this.opsServerRef.oneboxRef.appStore.getAppVersionConfig(
|
const config = await this.opsServerRef.oneboxRef.appStore.getAppVersionConfig(
|
||||||
@@ -42,8 +40,8 @@ export class AppStoreHandler {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_InstallAppTemplate>(
|
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_InstallAppStoreApp>(
|
||||||
'installAppTemplate',
|
'installAppStoreApp',
|
||||||
async (dataArg) => {
|
async (dataArg) => {
|
||||||
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
||||||
const service = await this.opsServerRef.oneboxRef.appStore.installApp(dataArg.install);
|
const service = await this.opsServerRef.oneboxRef.appStore.installApp(dataArg.install);
|
||||||
@@ -52,22 +50,20 @@ export class AppStoreHandler {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get services with available upgrades
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_GetUpgradeableServices>(
|
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_GetUpgradeableAppStoreServices>(
|
||||||
'getUpgradeableServices',
|
'getUpgradeableAppStoreServices',
|
||||||
async (dataArg) => {
|
async (dataArg) => {
|
||||||
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
||||||
const services = await this.opsServerRef.oneboxRef.appStore.getUpgradeableServices();
|
const services = await this.opsServerRef.oneboxRef.appStore.getUpgradeableAppStoreServices();
|
||||||
return { services };
|
return { services };
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Upgrade a service to a new template version
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_UpgradeService>(
|
new plugins.typedrequest.TypedHandler<interfaces.requests.IReq_UpgradeAppStoreService>(
|
||||||
'upgradeService',
|
'upgradeAppStoreService',
|
||||||
async (dataArg) => {
|
async (dataArg) => {
|
||||||
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
|
||||||
|
|
||||||
@@ -84,7 +80,6 @@ export class AppStoreHandler {
|
|||||||
|
|
||||||
logger.info(`Upgrading service '${dataArg.serviceName}' from v${existingService.appTemplateVersion} to v${dataArg.targetVersion}`);
|
logger.info(`Upgrading service '${dataArg.serviceName}' from v${existingService.appTemplateVersion} to v${dataArg.targetVersion}`);
|
||||||
|
|
||||||
// Execute migration
|
|
||||||
const migrationResult = await this.opsServerRef.oneboxRef.appStore.executeMigration(
|
const migrationResult = await this.opsServerRef.oneboxRef.appStore.executeMigration(
|
||||||
existingService,
|
existingService,
|
||||||
existingService.appTemplateVersion,
|
existingService.appTemplateVersion,
|
||||||
@@ -97,7 +92,6 @@ export class AppStoreHandler {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the upgrade
|
|
||||||
const updatedService = await this.opsServerRef.oneboxRef.appStore.applyUpgrade(
|
const updatedService = await this.opsServerRef.oneboxRef.appStore.applyUpgrade(
|
||||||
dataArg.serviceName,
|
dataArg.serviceName,
|
||||||
migrationResult,
|
migrationResult,
|
||||||
|
|||||||
@@ -82,6 +82,11 @@ export { smartguard, smartjwt };
|
|||||||
import { ContainerArchive } from '@serve.zone/containerarchive';
|
import { ContainerArchive } from '@serve.zone/containerarchive';
|
||||||
export { ContainerArchive };
|
export { ContainerArchive };
|
||||||
|
|
||||||
|
// serve.zone App Store contracts and resolver
|
||||||
|
import * as servezoneInterfaces from '@serve.zone/interfaces';
|
||||||
|
import * as servezoneAppstore from '@serve.zone/appstore';
|
||||||
|
export { servezoneInterfaces, servezoneAppstore };
|
||||||
|
|
||||||
// Node.js compat for streaming
|
// Node.js compat for streaming
|
||||||
import * as nodeFs from 'node:fs';
|
import * as nodeFs from 'node:fs';
|
||||||
import * as nodeStream from 'node:stream';
|
import * as nodeStream from 'node:stream';
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,125 +1,77 @@
|
|||||||
|
import type * as servezoneInterfaces from '@serve.zone/interfaces';
|
||||||
import * as plugins from '../plugins.ts';
|
import * as plugins from '../plugins.ts';
|
||||||
import * as data from '../data/index.ts';
|
import * as data from '../data/index.ts';
|
||||||
|
|
||||||
export interface ICatalogApp {
|
export type IAppStoreApp = servezoneInterfaces.appstore.IAppStoreApp;
|
||||||
id: string;
|
export type IAppStoreVersionConfig = servezoneInterfaces.appstore.IAppStoreVersionConfig;
|
||||||
name: string;
|
export type IAppStoreAppMeta = servezoneInterfaces.appstore.IAppStoreAppMeta;
|
||||||
description: string;
|
export type IUpgradeableAppStoreService = servezoneInterfaces.appstore.IUpgradeableAppStoreService;
|
||||||
category: string;
|
|
||||||
iconName?: string;
|
|
||||||
iconUrl?: string;
|
|
||||||
latestVersion: string;
|
|
||||||
tags?: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IAppVersionConfig {
|
export interface IAppStoreInstallOptions extends servezoneInterfaces.appstore.IAppStoreInstallRequest {
|
||||||
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>;
|
|
||||||
autoDNS?: boolean;
|
autoDNS?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IAppMeta {
|
export interface IReq_GetAppStoreTemplates extends plugins.typedrequestInterfaces.implementsTR<
|
||||||
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,
|
plugins.typedrequestInterfaces.ITypedRequest,
|
||||||
IReq_GetAppTemplates
|
IReq_GetAppStoreTemplates
|
||||||
> {
|
> {
|
||||||
method: 'getAppTemplates';
|
method: 'getAppStoreTemplates';
|
||||||
request: {
|
request: {
|
||||||
identity: data.IIdentity;
|
identity: data.IIdentity;
|
||||||
};
|
};
|
||||||
response: {
|
response: {
|
||||||
apps: ICatalogApp[];
|
apps: IAppStoreApp[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReq_GetAppConfig extends plugins.typedrequestInterfaces.implementsTR<
|
export interface IReq_GetAppStoreConfig extends plugins.typedrequestInterfaces.implementsTR<
|
||||||
plugins.typedrequestInterfaces.ITypedRequest,
|
plugins.typedrequestInterfaces.ITypedRequest,
|
||||||
IReq_GetAppConfig
|
IReq_GetAppStoreConfig
|
||||||
> {
|
> {
|
||||||
method: 'getAppConfig';
|
method: 'getAppStoreConfig';
|
||||||
request: {
|
request: {
|
||||||
identity: data.IIdentity;
|
identity: data.IIdentity;
|
||||||
appId: string;
|
appId: string;
|
||||||
version: string;
|
version: string;
|
||||||
};
|
};
|
||||||
response: {
|
response: {
|
||||||
config: IAppVersionConfig;
|
config: IAppStoreVersionConfig;
|
||||||
appMeta: IAppMeta;
|
appMeta: IAppStoreAppMeta;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReq_InstallAppTemplate extends plugins.typedrequestInterfaces.implementsTR<
|
export interface IReq_InstallAppStoreApp extends plugins.typedrequestInterfaces.implementsTR<
|
||||||
plugins.typedrequestInterfaces.ITypedRequest,
|
plugins.typedrequestInterfaces.ITypedRequest,
|
||||||
IReq_InstallAppTemplate
|
IReq_InstallAppStoreApp
|
||||||
> {
|
> {
|
||||||
method: 'installAppTemplate';
|
method: 'installAppStoreApp';
|
||||||
request: {
|
request: {
|
||||||
identity: data.IIdentity;
|
identity: data.IIdentity;
|
||||||
install: IAppInstallOptions;
|
install: IAppStoreInstallOptions;
|
||||||
};
|
};
|
||||||
response: {
|
response: {
|
||||||
service: data.IService;
|
service: data.IService;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReq_GetUpgradeableServices extends plugins.typedrequestInterfaces.implementsTR<
|
export interface IReq_GetUpgradeableAppStoreServices extends plugins.typedrequestInterfaces.implementsTR<
|
||||||
plugins.typedrequestInterfaces.ITypedRequest,
|
plugins.typedrequestInterfaces.ITypedRequest,
|
||||||
IReq_GetUpgradeableServices
|
IReq_GetUpgradeableAppStoreServices
|
||||||
> {
|
> {
|
||||||
method: 'getUpgradeableServices';
|
method: 'getUpgradeableAppStoreServices';
|
||||||
request: {
|
request: {
|
||||||
identity: data.IIdentity;
|
identity: data.IIdentity;
|
||||||
};
|
};
|
||||||
response: {
|
response: {
|
||||||
services: IUpgradeableService[];
|
services: IUpgradeableAppStoreService[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReq_UpgradeService extends plugins.typedrequestInterfaces.implementsTR<
|
export interface IReq_UpgradeAppStoreService extends plugins.typedrequestInterfaces.implementsTR<
|
||||||
plugins.typedrequestInterfaces.ITypedRequest,
|
plugins.typedrequestInterfaces.ITypedRequest,
|
||||||
IReq_UpgradeService
|
IReq_UpgradeAppStoreService
|
||||||
> {
|
> {
|
||||||
method: 'upgradeService';
|
method: 'upgradeAppStoreService';
|
||||||
request: {
|
request: {
|
||||||
identity: data.IIdentity;
|
identity: data.IIdentity;
|
||||||
serviceName: string;
|
serviceName: string;
|
||||||
|
|||||||
+13
-13
@@ -58,8 +58,8 @@ export interface ISettingsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IAppStoreState {
|
export interface IAppStoreState {
|
||||||
apps: interfaces.requests.ICatalogApp[];
|
apps: interfaces.requests.IAppStoreApp[];
|
||||||
upgradeableServices: interfaces.requests.IUpgradeableService[];
|
upgradeableServices: interfaces.requests.IUpgradeableAppStoreService[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IUiState {
|
export interface IUiState {
|
||||||
@@ -1226,13 +1226,13 @@ async function disconnectSocket() {
|
|||||||
// App Store Actions
|
// App Store Actions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
export const fetchAppTemplatesAction = appStoreStatePart.createAction(
|
export const fetchAppStoreTemplatesAction = appStoreStatePart.createAction(
|
||||||
async (statePartArg) => {
|
async (statePartArg) => {
|
||||||
const context = getActionContext();
|
const context = getActionContext();
|
||||||
try {
|
try {
|
||||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||||
interfaces.requests.IReq_GetAppTemplates
|
interfaces.requests.IReq_GetAppStoreTemplates
|
||||||
>('/typedrequest', 'getAppTemplates');
|
>('/typedrequest', 'getAppStoreTemplates');
|
||||||
const response = await typedRequest.fire({ identity: context.identity! });
|
const response = await typedRequest.fire({ identity: context.identity! });
|
||||||
return { ...statePartArg.getState(), apps: response.apps };
|
return { ...statePartArg.getState(), apps: response.apps };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -1242,13 +1242,13 @@ export const fetchAppTemplatesAction = appStoreStatePart.createAction(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const fetchUpgradeableServicesAction = appStoreStatePart.createAction(
|
export const fetchUpgradeableAppStoreServicesAction = appStoreStatePart.createAction(
|
||||||
async (statePartArg) => {
|
async (statePartArg) => {
|
||||||
const context = getActionContext();
|
const context = getActionContext();
|
||||||
try {
|
try {
|
||||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||||
interfaces.requests.IReq_GetUpgradeableServices
|
interfaces.requests.IReq_GetUpgradeableAppStoreServices
|
||||||
>('/typedrequest', 'getUpgradeableServices');
|
>('/typedrequest', 'getUpgradeableAppStoreServices');
|
||||||
const response = await typedRequest.fire({ identity: context.identity! });
|
const response = await typedRequest.fire({ identity: context.identity! });
|
||||||
return { ...statePartArg.getState(), upgradeableServices: response.services };
|
return { ...statePartArg.getState(), upgradeableServices: response.services };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -1258,15 +1258,15 @@ export const fetchUpgradeableServicesAction = appStoreStatePart.createAction(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const upgradeServiceAction = appStoreStatePart.createAction<{
|
export const upgradeAppStoreServiceAction = appStoreStatePart.createAction<{
|
||||||
serviceName: string;
|
serviceName: string;
|
||||||
targetVersion: string;
|
targetVersion: string;
|
||||||
}>(async (statePartArg, dataArg) => {
|
}>(async (statePartArg, dataArg) => {
|
||||||
const context = getActionContext();
|
const context = getActionContext();
|
||||||
try {
|
try {
|
||||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||||
interfaces.requests.IReq_UpgradeService
|
interfaces.requests.IReq_UpgradeAppStoreService
|
||||||
>('/typedrequest', 'upgradeService');
|
>('/typedrequest', 'upgradeAppStoreService');
|
||||||
await typedRequest.fire({
|
await typedRequest.fire({
|
||||||
identity: context.identity!,
|
identity: context.identity!,
|
||||||
serviceName: dataArg.serviceName,
|
serviceName: dataArg.serviceName,
|
||||||
@@ -1274,8 +1274,8 @@ export const upgradeServiceAction = appStoreStatePart.createAction<{
|
|||||||
});
|
});
|
||||||
// Re-fetch upgradeable services and services list
|
// Re-fetch upgradeable services and services list
|
||||||
const upgradeReq = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
const upgradeReq = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||||
interfaces.requests.IReq_GetUpgradeableServices
|
interfaces.requests.IReq_GetUpgradeableAppStoreServices
|
||||||
>('/typedrequest', 'getUpgradeableServices');
|
>('/typedrequest', 'getUpgradeableAppStoreServices');
|
||||||
const upgradeResp = await upgradeReq.fire({ identity: context.identity! });
|
const upgradeResp = await upgradeReq.fire({ identity: context.identity! });
|
||||||
return { ...statePartArg.getState(), upgradeableServices: upgradeResp.services };
|
return { ...statePartArg.getState(), upgradeableServices: upgradeResp.services };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
accessor currentView: 'grid' | 'detail' = 'grid';
|
accessor currentView: 'grid' | 'detail' = 'grid';
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
accessor selectedApp: interfaces.requests.ICatalogApp | null = null;
|
accessor selectedApp: interfaces.requests.IAppStoreApp | null = null;
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
accessor selectedAppMeta: interfaces.requests.IAppMeta | null = null;
|
accessor selectedAppMeta: interfaces.requests.IAppStoreAppMeta | null = null;
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
accessor selectedAppConfig: interfaces.requests.IAppVersionConfig | null = null;
|
accessor selectedAppConfig: interfaces.requests.IAppStoreVersionConfig | null = null;
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
accessor selectedVersion: string = '';
|
accessor selectedVersion: string = '';
|
||||||
@@ -331,7 +331,7 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
|
|
||||||
async connectedCallback() {
|
async connectedCallback() {
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
await appstate.appStoreStatePart.dispatchAction(appstate.fetchAppTemplatesAction, null);
|
await appstate.appStoreStatePart.dispatchAction(appstate.fetchAppStoreTemplatesAction, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
@@ -541,7 +541,7 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderDeploymentFootprint(config: interfaces.requests.IAppVersionConfig): TemplateResult | '' {
|
private renderDeploymentFootprint(config: interfaces.requests.IAppStoreVersionConfig): TemplateResult | '' {
|
||||||
const volumes = this.getConfigVolumes(config);
|
const volumes = this.getConfigVolumes(config);
|
||||||
const publishedPorts = config.publishedPorts || [];
|
const publishedPorts = config.publishedPorts || [];
|
||||||
|
|
||||||
@@ -577,7 +577,7 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderDeployConfirmation(config: interfaces.requests.IAppVersionConfig): TemplateResult | '' {
|
private renderDeployConfirmation(config: interfaces.requests.IAppStoreVersionConfig): TemplateResult | '' {
|
||||||
const volumes = this.getConfigVolumes(config);
|
const volumes = this.getConfigVolumes(config);
|
||||||
const publishedPorts = config.publishedPorts || [];
|
const publishedPorts = config.publishedPorts || [];
|
||||||
if (volumes.length === 0 && publishedPorts.length === 0) return '';
|
if (volumes.length === 0 && publishedPorts.length === 0) return '';
|
||||||
@@ -590,7 +590,7 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getConfigVolumes(config: interfaces.requests.IAppVersionConfig): interfaces.data.IServiceVolume[] {
|
private getConfigVolumes(config: interfaces.requests.IAppStoreVersionConfig): interfaces.data.IServiceVolume[] {
|
||||||
return (config.volumes || []).map((volume) => {
|
return (config.volumes || []).map((volume) => {
|
||||||
if (typeof volume === 'string') {
|
if (typeof volume === 'string') {
|
||||||
return { mountPath: volume };
|
return { mountPath: volume };
|
||||||
@@ -658,8 +658,8 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
if (!identity) return;
|
if (!identity) return;
|
||||||
|
|
||||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||||
interfaces.requests.IReq_GetAppConfig
|
interfaces.requests.IReq_GetAppStoreConfig
|
||||||
>('/typedrequest', 'getAppConfig');
|
>('/typedrequest', 'getAppStoreConfig');
|
||||||
|
|
||||||
const response = await typedRequest.fire({ identity, appId, version });
|
const response = await typedRequest.fire({ identity, appId, version });
|
||||||
|
|
||||||
@@ -728,8 +728,8 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
const identity = appstate.loginStatePart.getState().identity;
|
const identity = appstate.loginStatePart.getState().identity;
|
||||||
if (!identity) return;
|
if (!identity) return;
|
||||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||||
interfaces.requests.IReq_InstallAppTemplate
|
interfaces.requests.IReq_InstallAppStoreApp
|
||||||
>('/typedrequest', 'installAppTemplate');
|
>('/typedrequest', 'installAppStoreApp');
|
||||||
await typedRequest.fire({
|
await typedRequest.fire({
|
||||||
identity,
|
identity,
|
||||||
install: {
|
install: {
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ export class ObViewServices extends DeesElement {
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
appstate.servicesStatePart.dispatchAction(appstate.fetchServicesAction, null),
|
appstate.servicesStatePart.dispatchAction(appstate.fetchServicesAction, null),
|
||||||
appstate.servicesStatePart.dispatchAction(appstate.fetchPlatformServicesAction, null),
|
appstate.servicesStatePart.dispatchAction(appstate.fetchPlatformServicesAction, null),
|
||||||
appstate.appStoreStatePart.dispatchAction(appstate.fetchUpgradeableServicesAction, null),
|
appstate.appStoreStatePart.dispatchAction(appstate.fetchUpgradeableAppStoreServicesAction, null),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// If a platform service was selected from the dashboard, navigate to its detail
|
// If a platform service was selected from the dashboard, navigate to its detail
|
||||||
@@ -497,7 +497,7 @@ export class ObViewServices extends DeesElement {
|
|||||||
class="deploy-button"
|
class="deploy-button"
|
||||||
style="padding: 8px 16px; font-size: 13px;"
|
style="padding: 8px 16px; font-size: 13px;"
|
||||||
@click=${async () => {
|
@click=${async () => {
|
||||||
await appstate.appStoreStatePart.dispatchAction(appstate.upgradeServiceAction, {
|
await appstate.appStoreStatePart.dispatchAction(appstate.upgradeAppStoreServiceAction, {
|
||||||
serviceName: upgradeInfo.serviceName,
|
serviceName: upgradeInfo.serviceName,
|
||||||
targetVersion: upgradeInfo.latestVersion,
|
targetVersion: upgradeInfo.latestVersion,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user