feat: add registry target contracts

This commit is contained in:
2026-04-28 15:40:55 +00:00
parent eb299afb53
commit 7f5cb4e247
6 changed files with 53 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@serve.zone/interfaces", "name": "@serve.zone/interfaces",
"version": "5.4.5", "version": "5.4.6",
"private": false, "private": false,
"description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.", "description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
"exports": { "exports": {
+6
View File
@@ -1,4 +1,5 @@
import * as plugins from '../plugins.js'; import * as plugins from '../plugins.js';
import type { IRegistryPushEvent } from './registry.js';
export interface IImage { export interface IImage {
id: string; id: string;
@@ -12,9 +13,14 @@ export interface IImage {
description: string; description: string;
versions: Array<{ versions: Array<{
versionString: string; versionString: string;
digest?: string;
registryRepository?: string;
registryTag?: string;
source?: 'upload' | 'registry';
storagePath?: string; storagePath?: string;
size: number; size: number;
createdAt: number; createdAt: number;
}>; }>;
lastPushEvent?: IRegistryPushEvent;
}; };
} }
+1
View File
@@ -8,6 +8,7 @@ export * from './domain.js';
export * from './event.js'; export * from './event.js';
export * from './externalregistry.js'; export * from './externalregistry.js';
export * from './image.js'; export * from './image.js';
export * from './registry.js';
export * from './secretbundle.js'; export * from './secretbundle.js';
export * from './secretgroup.js'; export * from './secretgroup.js';
export * from './baremetal.js'; export * from './baremetal.js';
+25
View File
@@ -0,0 +1,25 @@
export type TRegistryProtocol = 'oci';
export interface IRegistryTarget {
protocol: TRegistryProtocol;
registryHost: string;
repository: string;
tag: string;
imageUrl: string;
serviceId?: string;
imageId?: string;
}
export interface IRegistryPushEvent {
protocol: TRegistryProtocol;
registryHost: string;
repository: string;
tag: string;
digest: string;
imageUrl: string;
pushedAt: number;
serviceId?: string;
imageId?: string;
actorUserId?: string;
manifestMediaType?: string;
}
+3
View File
@@ -1,4 +1,5 @@
import type { IServiceRessources } from './docker.js'; import type { IServiceRessources } from './docker.js';
import type { IRegistryTarget } from './registry.js';
export interface IService { export interface IService {
id: string; id: string;
@@ -7,6 +8,8 @@ export interface IService {
description: string; description: string;
imageId: string; imageId: string;
imageVersion: string; imageVersion: string;
registryTarget?: IRegistryTarget;
deployOnPush?: boolean;
environment: { [key: string]: string }; environment: { [key: string]: string };
/** /**
* the main secret bundle id, exclusive to the service * the main secret bundle id, exclusive to the service
+17
View File
@@ -1,5 +1,6 @@
import * as plugins from '../plugins.js'; import * as plugins from '../plugins.js';
import type { IService } from '../data/service.js'; import type { IService } from '../data/service.js';
import type { IRegistryTarget } from '../data/registry.js';
import type { IIdentity } from '../data/user.js'; import type { IIdentity } from '../data/user.js';
import type { IServiceRessources } from '../data/docker.js'; import type { IServiceRessources } from '../data/docker.js';
@@ -32,6 +33,22 @@ extends plugins.typedrequestInterfaces.implementsTR<
}; };
} }
export interface IRequest_Any_Cloudly_GetServiceRegistryTarget
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IRequest_Any_Cloudly_GetServiceRegistryTarget
> {
method: 'getServiceRegistryTarget';
request: {
identity: IIdentity;
serviceId: string;
tag?: string;
};
response: {
registryTarget: IRegistryTarget;
};
}
export interface IRequest_Any_Cloudly_CreateService export interface IRequest_Any_Cloudly_CreateService
extends plugins.typedrequestInterfaces.implementsTR< extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest, plugins.typedrequestInterfaces.ITypedRequest,