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", "name": "@serve.zone/interfaces",
"version": "5.4.4", "version": "5.4.5",
"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": {
+3
View File
@@ -8,6 +8,9 @@ tap.test('exports public namespaces', async () => {
if (!interfaces.requests) { if (!interfaces.requests) {
throw new Error('Missing requests namespace'); throw new Error('Missing requests namespace');
} }
if (!interfaces.requests.platform) {
throw new Error('Missing platform request namespace');
}
if (!interfaces.platform) { if (!interfaces.platform) {
throw new Error('Missing platform namespace'); 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 serverInterfaces from '../data/server.js';
import * as userInterfaces from '../data/user.js'; import * as userInterfaces from '../data/user.js';
import type { IService } from '../data/service.js'; import type { IService } from '../data/service.js';
import type { IPlatformBinding, IPlatformProviderConfig } from '../platform/types.js';
export interface IRequest_Any_Cloudly_GetServerConfig export interface IRequest_Any_Cloudly_GetServerConfig
extends plugins.typedrequestInterfaces.implementsTR< extends plugins.typedrequestInterfaces.implementsTR<
@@ -31,6 +32,8 @@ extends plugins.typedrequestInterfaces.implementsTR<
response: { response: {
configData: clusterInterfaces.ICluster; configData: clusterInterfaces.ICluster;
services: IService[]; services: IService[];
platformProviderConfigs?: IPlatformProviderConfig[];
platformBindings?: IPlatformBinding[];
}; };
} }
@@ -43,6 +46,8 @@ extends plugins.typedrequestInterfaces.implementsTR<
request: { request: {
configData: clusterInterfaces.ICluster; configData: clusterInterfaces.ICluster;
services: IService[]; services: IService[];
platformProviderConfigs?: IPlatformProviderConfig[];
platformBindings?: IPlatformBinding[];
}; };
response: {}; response: {};
} }
+2
View File
@@ -15,6 +15,7 @@ import * as informRequests from './inform.js';
import * as logRequests from './log.js'; import * as logRequests from './log.js';
import * as networkRequests from './network.js'; import * as networkRequests from './network.js';
import * as nodeRequests from './node.js'; import * as nodeRequests from './node.js';
import * as platformRequests from './platform.js';
import * as routingRequests from './routing.js'; import * as routingRequests from './routing.js';
import * as secretBundleRequests from './secretbundle.js'; import * as secretBundleRequests from './secretbundle.js';
import * as secretGroupRequests from './secretgroup.js'; import * as secretGroupRequests from './secretgroup.js';
@@ -41,6 +42,7 @@ export {
logRequests as log, logRequests as log,
networkRequests as network, networkRequests as network,
nodeRequests as node, nodeRequests as node,
platformRequests as platform,
routingRequests as routing, routingRequests as routing,
secretBundleRequests as secretbundle, secretBundleRequests as secretbundle,
secretGroupRequests as secretgroup, secretGroupRequests as secretgroup,
+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;
};
}