feat(k1): wire dormant control lease
This commit is contained in:
@@ -82,6 +82,28 @@ export interface XgridsModelingControlSafety {
|
||||
publisher_installed: false;
|
||||
}
|
||||
|
||||
export interface XgridsApplicationControlExecution {
|
||||
mode: "dormant-write-disabled";
|
||||
state: "disarmed" | "armed-shadow-only" | "expired" | "closed";
|
||||
lease?: {
|
||||
state: "armed" | "expired" | "closed";
|
||||
remaining_seconds: number;
|
||||
authority_cached: boolean;
|
||||
exportable: false;
|
||||
} | null;
|
||||
orchestrator?: Record<string, unknown> | null;
|
||||
publisher: {
|
||||
mode: "write-disabled";
|
||||
denied_attempts: number;
|
||||
transport_calls: 0;
|
||||
vendor_writes_enabled: false;
|
||||
publisher_armed: false;
|
||||
automatic_retry: false;
|
||||
};
|
||||
live_transport_installed: false;
|
||||
can_emit_requests: false;
|
||||
}
|
||||
|
||||
export interface XgridsAcquisition {
|
||||
schema_version?: string;
|
||||
acquisition_id: string;
|
||||
@@ -205,6 +227,7 @@ export interface XgridsK1State {
|
||||
metrics?: XgridsK1Metrics;
|
||||
compatibility?: XgridsCompatibilityState | null;
|
||||
modeling_control_safety?: XgridsModelingControlSafety | null;
|
||||
application_control_execution?: XgridsApplicationControlExecution | null;
|
||||
device_ref?: XgridsDeviceRef | null;
|
||||
device_session?: XgridsDeviceSession | null;
|
||||
acquisition?: XgridsAcquisition | null;
|
||||
@@ -306,6 +329,12 @@ export interface StopCameraPreviewRequest {
|
||||
generation: number;
|
||||
}
|
||||
|
||||
export interface ShadowApplicationControlArmRequest {
|
||||
operator_confirmed: true;
|
||||
lease_seconds?: number;
|
||||
timezone_name: string;
|
||||
}
|
||||
|
||||
export class ApiError extends Error {
|
||||
readonly status: number;
|
||||
|
||||
@@ -453,6 +482,20 @@ export const xgridsK1Api = {
|
||||
updateViewerSettings(body: ViewerSettings): Promise<XgridsK1State> {
|
||||
return invokeState(xgridsK1Actions.viewerSettingsUpdate, body);
|
||||
},
|
||||
|
||||
getShadowApplicationControlState(): Promise<XgridsK1State> {
|
||||
return invokeState(xgridsK1Actions.applicationControlShadowState);
|
||||
},
|
||||
|
||||
armShadowApplicationControl(
|
||||
body: ShadowApplicationControlArmRequest,
|
||||
): Promise<XgridsK1State> {
|
||||
return invokeState(xgridsK1Actions.applicationControlShadowArm, body);
|
||||
},
|
||||
|
||||
disarmShadowApplicationControl(): Promise<XgridsK1State> {
|
||||
return invokeState(xgridsK1Actions.applicationControlShadowDisarm);
|
||||
},
|
||||
};
|
||||
|
||||
export type EventSocketStatus = "connecting" | "open" | "closed" | "error";
|
||||
|
||||
@@ -30,4 +30,16 @@ export const xgridsK1Actions = Object.freeze({
|
||||
cameraPreviewSelect: requirePluginAction(xgridsK1Manifest, "camera.preview.select"),
|
||||
cameraPreviewStop: requirePluginAction(xgridsK1Manifest, "camera.preview.stop"),
|
||||
viewerSettingsUpdate: requirePluginAction(xgridsK1Manifest, "viewer.settings.update"),
|
||||
applicationControlShadowState: requirePluginAction(
|
||||
xgridsK1Manifest,
|
||||
"application-control.shadow-state",
|
||||
),
|
||||
applicationControlShadowArm: requirePluginAction(
|
||||
xgridsK1Manifest,
|
||||
"application-control.shadow-arm",
|
||||
),
|
||||
applicationControlShadowDisarm: requirePluginAction(
|
||||
xgridsK1Manifest,
|
||||
"application-control.shadow-disarm",
|
||||
),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user