@deeptrekker/api-domain 1.0.54-x4-updates.8 → 1.0.54-x4-updates.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- export declare const API_VERSION = "1.0.54-x4-updates.8";
1
+ export declare const API_VERSION = "1.0.54-x4-updates.9";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.API_VERSION = void 0;
4
4
  /* AUTO GENERATED FILE */
5
- exports.API_VERSION = "1.0.54-x4-updates.8";
5
+ exports.API_VERSION = "1.0.54-x4-updates.9";
@@ -2,7 +2,7 @@ import { Movement } from "../../../core";
2
2
  import { DeviceModel, MotorDiagnostics, SerialDevice, Sonar, Sonar3D, StereoCamera, X4CameraHead } from "../../cameraHeads";
3
3
  import { ImpaqDriver, SensorPod, X4Light } from "../../peripherals";
4
4
  import { LightConfig, ThrusterConfig } from "./deviceAllocation";
5
- import { X4RollbackStatus, X4SoftwareVersion, X4SoftwareUpdateRequest, X4SoftwareUpdateStatus } from "./softwareUpdates";
5
+ import { X4SoftwareVersion, X4SoftwareUpdateRequest, X4SoftwareUpdateStatus } from "./softwareUpdates";
6
6
  export * from "./deviceAllocation";
7
7
  export * from "./softwareUpdates";
8
8
  import { CygnusType } from "../..";
@@ -925,20 +925,10 @@ export type X4 = {
925
925
  */
926
926
  lowPowerMode?: boolean;
927
927
  /**
928
- * The app sends an {@link X4SoftwareUpdateRequest | X4SoftwareUpdateRequest} to start
929
- * a Spectra update, and the vehicle reports an {@link X4SoftwareUpdateStatus | X4SoftwareUpdateStatus}.
928
+ * The app sends an {@link X4SoftwareUpdateRequest | X4SoftwareUpdateRequest} to start an update
929
+ * or a rollback, and the vehicle reports an {@link X4SoftwareUpdateStatus | X4SoftwareUpdateStatus}.
930
930
  */
931
931
  softwareUpdate?: X4SoftwareUpdateRequest | X4SoftwareUpdateStatus;
932
- /**
933
- * The app sends `true` to roll back to the previous application slot, and the vehicle
934
- * reports an {@link X4RollbackStatus | X4RollbackStatus}.
935
- */
936
- softwareRollback?: boolean | X4RollbackStatus;
937
- /**
938
- * The app sends `true` to roll the OS back to the other rootfs slot, which reboots the
939
- * vehicle, and the vehicle reports an {@link X4RollbackStatus | X4RollbackStatus}.
940
- */
941
- softwareRollbackOs?: boolean | X4RollbackStatus;
942
932
  /**
943
933
  * The OS and application versions installed on the vehicle. Read only.
944
934
  */
@@ -16,14 +16,20 @@ export type X4UpdateTransferSizes = {
16
16
  tools?: number;
17
17
  };
18
18
  /**
19
- * The request the app sends as `softwareUpdate` to start an update. The app then transfers the
20
- * files over the `UPDATE_TRANSFER` data channel.
19
+ * The request the app sends as `softwareUpdate`. `update` starts an update, and the app then
20
+ * transfers the files over the `UPDATE_TRANSFER` data channel. `rollbackApp` returns to the
21
+ * previous application slot, and `rollbackOs` to the other OS, which reboots the vehicle.
21
22
  * @group X4
22
23
  * @category Software Updates
23
24
  */
24
25
  export type X4SoftwareUpdateRequest = {
26
+ action: "update";
25
27
  type: X4UpdateKind;
26
28
  transfer: X4UpdateTransferSizes;
29
+ } | {
30
+ action: "rollbackApp";
31
+ } | {
32
+ action: "rollbackOs";
27
33
  };
28
34
  /**
29
35
  * The state of an update or a rollback as the vehicle reports it. `running` covers every step
@@ -52,21 +58,20 @@ export type X4FirmwareStatus = {
52
58
  failedMacs?: string[];
53
59
  };
54
60
  /**
55
- * The status the vehicle reports as `softwareUpdate`. `detail` is a code such as
56
- * `awaiting-transfer`, `transfer-stalled` or `interrupted-by-restart`, or a sentence for logs.
61
+ * The last update as the vehicle reports it in `softwareUpdate.update`. `detail` is a code such
62
+ * as `awaiting-transfer`, `transfer-stalled` or `interrupted-by-restart`, or a sentence for logs.
57
63
  * @group X4
58
64
  * @category Software Updates
59
65
  */
60
- export type X4SoftwareUpdateStatus = {
66
+ export type X4UpdateStatus = {
61
67
  state?: X4UpdateState;
62
68
  detail?: string;
63
69
  run?: string;
64
70
  type?: string;
65
- firmware?: X4FirmwareStatus;
66
71
  };
67
72
  /**
68
- * The status the vehicle reports as `softwareRollback` and `softwareRollbackOs`. An OS rollback reports
69
- * `succeeded` just before the vehicle reboots onto the other OS.
73
+ * The last rollback as the vehicle reports it in `softwareUpdate.rollback`. `target` is `app`
74
+ * or `os`. An OS rollback reports `succeeded` just before the vehicle reboots onto the other OS.
70
75
  * @group X4
71
76
  * @category Software Updates
72
77
  */
@@ -74,6 +79,18 @@ export type X4RollbackStatus = {
74
79
  state?: X4UpdateState;
75
80
  detail?: string;
76
81
  run?: string;
82
+ target?: "app" | "os";
83
+ };
84
+ /**
85
+ * What the vehicle reports as `softwareUpdate`: the last update, the last rollback and the
86
+ * peripheral firmware.
87
+ * @group X4
88
+ * @category Software Updates
89
+ */
90
+ export type X4SoftwareUpdateStatus = {
91
+ update?: X4UpdateStatus;
92
+ rollback?: X4RollbackStatus;
93
+ firmware?: X4FirmwareStatus;
77
94
  };
78
95
  /**
79
96
  * The OS and application versions the vehicle reports as `softwareVersion`,
@@ -100,10 +117,9 @@ export type X4SoftwareVersion = {
100
117
  * @group X4
101
118
  * @category Software Updates
102
119
  */
103
- export type X4UpdateErrorSource = "softwareUpdate" | "softwareRollback" | "softwareRollbackOs";
120
+ export type X4UpdateErrorSource = "softwareUpdate";
104
121
  /**
105
- * The error the vehicle sends when it refuses a `softwareUpdate`, `softwareRollback` or
106
- * `softwareRollbackOs` request. `message` is for logs only. Errors from other settings carry no `source`.
122
+ * The error the vehicle sends when it refuses a `softwareUpdate` request. `message` is for logs only. Errors from other settings carry no `source`.
107
123
  * @group X4
108
124
  * @category Software Updates
109
125
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeptrekker/api-domain",
3
- "version": "1.0.54-x4-updates.8",
3
+ "version": "1.0.54-x4-updates.9",
4
4
  "description": "A business domain of types and schemas that the Deep Trekker topside communicates with via an API.",
5
5
  "main": "dist/index.js",
6
6
  "engines": {