openvibe-sdk/runtime

Generated at from openvibe-contracts v0.107.0 and openvibe-sdk v0.35.0.

From types/runtime.d.ts (server only). Declarations are shown verbatim.

type RuntimeOfferLimits

platform.runtime-offer@1 and platform.runtime-class@1: execution capacity and environment kinds. Validated by openvibe-contracts (required lazily by the validate* functions).

export type RuntimeOfferLimits = { cpu_cores: number; memory_mb: number; duration_seconds?: number; concurrency?: number };

type RuntimeOfferPrice

export type RuntimeOfferPrice = { amount_usd: number; unit: 'second' | 'hour' | 'invocation' };

type RuntimeOffer

export type RuntimeOffer = { id: string; kind: 'container' | 'process' | 'wasm' | 'vm' | 'function'; region: string;
    node: string; limits: RuntimeOfferLimits; price: RuntimeOfferPrice; availability: 'available' | 'limited' | 'unavailable';
    constraints: string[] };

type RuntimeClass

export type RuntimeClass = 'function' | 'code' | 'browser' | 'linux' | 'desktop' | 'gpu';

type ValidationError

export type ValidationError = { path: string; message: string };

function runtimeOffer

Null/undefined fields are stripped.

export declare function runtimeOffer(fields: Partial<RuntimeOffer>): RuntimeOffer;

function runtimeClass

Returns the class when it is a known runtime class, or throws.

export declare function runtimeClass(value: string): RuntimeClass;

const RUNTIME_CLASSES

export declare const RUNTIME_CLASSES: RuntimeClass[];

function validateRuntimeOffer

export declare function validateRuntimeOffer(record: unknown): { ok: boolean; errors: ValidationError[] };

function validateRuntimeClass

export declare function validateRuntimeClass(value: unknown): { ok: boolean; errors: ValidationError[] };