feat: add platform desired state contracts

This commit is contained in:
2026-04-28 12:08:44 +00:00
parent d9a3403778
commit eb299afb53
5 changed files with 160 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@serve.zone/interfaces",
"version": "5.4.4",
"version": "5.4.5",
"private": false,
"description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
"exports": {
+3
View File
@@ -8,6 +8,9 @@ tap.test('exports public namespaces', async () => {
if (!interfaces.requests) {
throw new Error('Missing requests namespace');
}
if (!interfaces.requests.platform) {
throw new Error('Missing platform request namespace');
}
if (!interfaces.platform) {
throw new Error('Missing platform namespace');
}
+5
View File
@@ -3,6 +3,7 @@ import * as clusterInterfaces from '../data/cluster.js';
import * as serverInterfaces from '../data/server.js';
import * as userInterfaces from '../data/user.js';
import type { IService } from '../data/service.js';
import type { IPlatformBinding, IPlatformProviderConfig } from '../platform/types.js';
export interface IRequest_Any_Cloudly_GetServerConfig
extends plugins.typedrequestInterfaces.implementsTR<
@@ -31,6 +32,8 @@ extends plugins.typedrequestInterfaces.implementsTR<
response: {
configData: clusterInterfaces.ICluster;
services: IService[];
platformProviderConfigs?: IPlatformProviderConfig[];
platformBindings?: IPlatformBinding[];
};
}
@@ -43,6 +46,8 @@ extends plugins.typedrequestInterfaces.implementsTR<
request: {
configData: clusterInterfaces.ICluster;
services: IService[];
platformProviderConfigs?: IPlatformProviderConfig[];
platformBindings?: IPlatformBinding[];
};
response: {};
}
+3 -1
View File
@@ -15,6 +15,7 @@ import * as informRequests from './inform.js';
import * as logRequests from './log.js';
import * as networkRequests from './network.js';
import * as nodeRequests from './node.js';
import * as platformRequests from './platform.js';
import * as routingRequests from './routing.js';
import * as secretBundleRequests from './secretbundle.js';
import * as secretGroupRequests from './secretgroup.js';
@@ -41,6 +42,7 @@ export {
logRequests as log,
networkRequests as network,
nodeRequests as node,
platformRequests as platform,
routingRequests as routing,
secretBundleRequests as secretbundle,
secretGroupRequests as secretgroup,
@@ -52,4 +54,4 @@ export {
versionRequests as version,
};
export * from './inform.js';
export * from './inform.js';
+148
View File
@@ -0,0 +1,148 @@
import * as plugins from '../plugins.js';
import type { IIdentity } from '../data/user.js';
import type {
IPlatformBinding,
IPlatformCapability,
IPlatformProviderConfig,
TPlatformBindingStatus,
} from '../platform/types.js';
export interface IReq_Any_Cloudly_GetPlatformDesiredState
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_GetPlatformDesiredState
> {
method: 'getPlatformDesiredState';
request: {
identity: IIdentity;
};
response: {
capabilities: IPlatformCapability[];
providerConfigs: IPlatformProviderConfig[];
bindings: IPlatformBinding[];
};
}
export interface IReq_Any_Cloudly_GetPlatformCapabilities
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_GetPlatformCapabilities
> {
method: 'getPlatformCapabilities';
request: {
identity: IIdentity;
};
response: {
capabilities: IPlatformCapability[];
};
}
export interface IReq_Any_Cloudly_GetPlatformProviderConfigs
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_GetPlatformProviderConfigs
> {
method: 'getPlatformProviderConfigs';
request: {
identity: IIdentity;
capability?: IPlatformProviderConfig['capability'];
};
response: {
providerConfigs: IPlatformProviderConfig[];
};
}
export interface IReq_Any_Cloudly_UpsertPlatformProviderConfig
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_UpsertPlatformProviderConfig
> {
method: 'upsertPlatformProviderConfig';
request: {
identity: IIdentity;
providerConfig: IPlatformProviderConfig;
};
response: {
providerConfig: IPlatformProviderConfig;
};
}
export interface IReq_Any_Cloudly_DeletePlatformProviderConfigById
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_DeletePlatformProviderConfigById
> {
method: 'deletePlatformProviderConfigById';
request: {
identity: IIdentity;
providerConfigId: string;
};
response: {
success: boolean;
};
}
export interface IReq_Any_Cloudly_GetPlatformBindings
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_GetPlatformBindings
> {
method: 'getPlatformBindings';
request: {
identity: IIdentity;
serviceId?: string;
capability?: IPlatformBinding['capability'];
};
response: {
bindings: IPlatformBinding[];
};
}
export interface IReq_Any_Cloudly_UpsertPlatformBinding
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_UpsertPlatformBinding
> {
method: 'upsertPlatformBinding';
request: {
identity: IIdentity;
binding: IPlatformBinding;
};
response: {
binding: IPlatformBinding;
};
}
export interface IReq_Any_Cloudly_UpdatePlatformBindingStatus
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_UpdatePlatformBindingStatus
> {
method: 'updatePlatformBindingStatus';
request: {
identity: IIdentity;
bindingId: string;
status: TPlatformBindingStatus;
endpoints?: IPlatformBinding['endpoints'];
credentials?: IPlatformBinding['credentials'];
errorText?: string;
};
response: {
binding: IPlatformBinding;
};
}
export interface IReq_Any_Cloudly_DeletePlatformBindingById
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Any_Cloudly_DeletePlatformBindingById
> {
method: 'deletePlatformBindingById';
request: {
identity: IIdentity;
bindingId: string;
};
response: {
success: boolean;
};
}