diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 88b1478..5dda9b1 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/interfaces', - version: '1.0.18', + version: '1.0.19', description: 'interfaces for working with containers' } diff --git a/ts/data/cluster.ts b/ts/data/cluster.ts index 36b609d..ba57c2b 100644 --- a/ts/data/cluster.ts +++ b/ts/data/cluster.ts @@ -6,13 +6,19 @@ export interface IClusterIdentifier { secretKey: string; } -export interface IClusterConfig { +export interface ICluster { id: string; data: { name: string; secretKey: string; jumpCode: string; + + /** + * when was the jump code used + * avoid replay attacks + */ jumpCodeUsedAt: number; + /** * how can the cluster reach cloudly */ @@ -29,12 +35,16 @@ export interface IClusterConfig { containers: IClusterConfigContainer[]; /** - * + * ACME info. This is used to get SSL certificates. */ acmeInfo: { serverAddress: string; serverSecret: string; }; + + /** + * Where to get the images from + */ registryInfo: IDockerRegistryInfo; }; } diff --git a/ts/requests/cluster.ts b/ts/requests/cluster.ts index 3ab5d8d..f375dec 100644 --- a/ts/requests/cluster.ts +++ b/ts/requests/cluster.ts @@ -1,6 +1,19 @@ -import type { IClusterConfig } from '../data/cluster.js'; +import type { ICluster } from '../data/cluster.js'; import * as plugins from '../plugins.js'; +export interface IRequest_GetAllClusters extends plugins.typedrequestInterfaces.implementsTR< + plugins.typedrequestInterfaces.ITypedRequest, + IRequest_GetAllClusters +> { + method: 'getAllClusters'; + request: { + jwt: string; + }; + response: { + clusters: ICluster[]; + }; +} + export interface IRequest_CreateCluster extends plugins.typedrequestInterfaces.implementsTR< plugins.typedrequestInterfaces.ITypedRequest, IRequest_CreateCluster @@ -11,7 +24,7 @@ export interface IRequest_CreateCluster extends plugins.typedrequestInterfaces.i clusterName: string; }; response: { - clusterConfig: IClusterConfig; + clusterConfig: ICluster; }; } @@ -22,9 +35,9 @@ export interface IRequest_UpdateCluster extends plugins.typedrequestInterfaces.i method: 'updateCluster'; request: { jwt: string; - clusterConfig: IClusterConfig; + clusterConfig: ICluster; }; response: { - clusterConfig: IClusterConfig; + clusterConfig: ICluster; }; } \ No newline at end of file diff --git a/ts/requests/config.ts b/ts/requests/config.ts index e8e58ae..54a54c8 100644 --- a/ts/requests/config.ts +++ b/ts/requests/config.ts @@ -26,7 +26,7 @@ extends plugins.typedrequestInterfaces.implementsTR< clusterIdentifier: clusterInterfaces.IClusterIdentifier; }; response: { - configData: clusterInterfaces.IClusterConfig; + configData: clusterInterfaces.ICluster; }; } @@ -37,7 +37,7 @@ extends plugins.typedrequestInterfaces.implementsTR< > { method: 'pushClusterConfig'; request: { - configData: clusterInterfaces.IClusterConfig; + configData: clusterInterfaces.ICluster; }; response: {}; } @@ -49,7 +49,7 @@ extends plugins.typedrequestInterfaces.implementsTR< > { method: 'pushContainerUpdate' request: { - configData: clusterInterfaces.IClusterConfig; + configData: clusterInterfaces.ICluster; specificContainerConfigToUpdate: clusterInterfaces.IClusterConfigContainer; }; response: {}