import manifestDocument from "../../plugin.manifest.json";

import {
  DEVICE_STATE_READ_ACTION_ID,
  parseDevicePluginManifest,
  requirePluginAction,
} from "@mission-core/plugin-sdk";

export const xgridsK1Manifest = parseDevicePluginManifest(manifestDocument);

export const xgridsK1Actions = Object.freeze({
  stateRead: requirePluginAction(xgridsK1Manifest, DEVICE_STATE_READ_ACTION_ID),
  discoveryScan: requirePluginAction(xgridsK1Manifest, "discovery.scan"),
  deviceInspect: requirePluginAction(xgridsK1Manifest, "device.inspect"),
  sensorCatalogRead: requirePluginAction(xgridsK1Manifest, "sensor.catalog.read"),
  deviceCalibrationSnapshotRead: requirePluginAction(
    xgridsK1Manifest,
    "calibration.device-snapshot.read",
  ),
  networkProvision: requirePluginAction(xgridsK1Manifest, "network.provision"),
  connectionVerify: requirePluginAction(xgridsK1Manifest, "connection.verify"),
  acquisitionPrepare: requirePluginAction(xgridsK1Manifest, "acquisition.prepare"),
  acquisitionStart: requirePluginAction(xgridsK1Manifest, "acquisition.start"),
  acquisitionStop: requirePluginAction(xgridsK1Manifest, "acquisition.stop"),
  acquisitionAbort: requirePluginAction(xgridsK1Manifest, "acquisition.abort"),
  acquisitionStateRead: requirePluginAction(xgridsK1Manifest, "acquisition.state.read"),
  compatibilityStreamStartLive: requirePluginAction(xgridsK1Manifest, "stream.start-live"),
  streamStartReplay: requirePluginAction(xgridsK1Manifest, "stream.start-replay"),
  compatibilityStreamStop: requirePluginAction(xgridsK1Manifest, "stream.stop"),
  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",
  ),
  applicationControlSessionOpen: requirePluginAction(
    xgridsK1Manifest,
    "application-control.session.open",
  ),
  applicationControlWorkspaceEnter: requirePluginAction(
    xgridsK1Manifest,
    "application-control.workspace.enter",
  ),
  applicationControlSessionClose: requirePluginAction(
    xgridsK1Manifest,
    "application-control.session.close",
  ),
});
