@deeptrekker/api-domain 1.0.41 → 1.0.42-depth-calib-x4.0

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.41";
1
+ export declare const API_VERSION = "1.0.42-depth-calib-x4.0";
@@ -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.41";
5
+ exports.API_VERSION = "1.0.42-depth-calib-x4.0";
@@ -80,6 +80,9 @@ export type SensorPod = {
80
80
  */
81
81
  state?: CalibrationStates;
82
82
  };
83
+ pressure?: {
84
+ calibrate: boolean;
85
+ };
83
86
  };
84
87
  /**
85
88
  * Calibratable sensor pod representation.
@@ -0,0 +1,130 @@
1
+ /**
2
+ * The physical mounting position of a thruster on the X4 chassis.
3
+ * @group X4
4
+ * @category Device Allocation
5
+ */
6
+ export declare enum ThrusterPosition {
7
+ FRONT_LEFT = "FRONT_LEFT",
8
+ FRONT_RIGHT = "FRONT_RIGHT",
9
+ VERTICAL_LEFT = "VERTICAL_LEFT",
10
+ VERTICAL_RIGHT = "VERTICAL_RIGHT",
11
+ REAR_LEFT = "REAR_LEFT",
12
+ REAR_RIGHT = "REAR_RIGHT",
13
+ VERTICAL_REAR = "VERTICAL_REAR"
14
+ }
15
+ /**
16
+ * The physical mounting position of a light node on the X4 chassis.
17
+ * @group X4
18
+ * @category Device Allocation
19
+ */
20
+ export declare enum LightPosition {
21
+ LIGHT_0 = "LIGHT_0",
22
+ LIGHT_1 = "LIGHT_1"
23
+ }
24
+ /**
25
+ * Commands the frontend can issue to drive device allocation (thruster/light configuration).
26
+ * @group X4
27
+ * @category Device Allocation
28
+ */
29
+ export declare enum DeviceConfigCmd {
30
+ ENTER_CONFIG_MODE = "ENTER_CONFIG_MODE",
31
+ EXIT_CONFIG_MODE = "EXIT_CONFIG_MODE",
32
+ ACTIVATE_NEXT_UNKNOWN = "ACTIVATE_NEXT_UNKNOWN",
33
+ STOP = "STOP",
34
+ /** Requires `deviceId`. */
35
+ ASSIGN = "ASSIGN",
36
+ SAVE = "SAVE",
37
+ CLEAR_SELECTION = "CLEAR_SELECTION",
38
+ CLEAR_CONFIG = "CLEAR_CONFIG",
39
+ /** Thruster only. Requires `deviceId`. */
40
+ INVERT_DIRECTION = "INVERT_DIRECTION"
41
+ }
42
+ /**
43
+ * Backend-reported progress of the device allocation state machine.
44
+ * @group X4
45
+ * @category Device Allocation
46
+ */
47
+ export declare enum DeviceConfigState {
48
+ IDLE = "IDLE",
49
+ READY = "READY",
50
+ ACTIVATING = "ACTIVATING",
51
+ AWAITING_ASSIGN = "AWAITING_ASSIGN",
52
+ ASSIGNING = "ASSIGNING",
53
+ SAVING = "SAVING",
54
+ FULL_CONFIG_COMPLETE = "FULL_CONFIG_COMPLETE",
55
+ CONFIG_WRITTEN = "CONFIG_WRITTEN"
56
+ }
57
+ /**
58
+ * Error codes the backend can report when rejecting a device allocation command.
59
+ * @group X4
60
+ * @category Device Allocation
61
+ */
62
+ export declare enum DeviceConfigError {
63
+ NONE = "NONE",
64
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
65
+ MISSING_ASSIGN_ID = "MISSING_ASSIGN_ID",
66
+ INVALID_ASSIGN_ID = "INVALID_ASSIGN_ID",
67
+ DUPLICATE_ID = "DUPLICATE_ID",
68
+ NOT_IN_CORRECT_STATE = "NOT_IN_CORRECT_STATE",
69
+ NOT_IN_CONFIG_MODE = "NOT_IN_CONFIG_MODE",
70
+ SAVE_FAILED = "SAVE_FAILED"
71
+ }
72
+ /**
73
+ * Whether a thruster spins in its default or inverted direction.
74
+ * @group X4
75
+ * @category Device Allocation
76
+ */
77
+ export declare enum DeviceDirection {
78
+ DEFAULT = "DEFAULT",
79
+ INVERTED = "INVERTED"
80
+ }
81
+ /**
82
+ * Shared shape for the device allocation payload. The frontend sets `cmd` (and `deviceId`
83
+ * where required); the backend reports progress back through `state`/`errorCode`/`knownDevices`/`unknownCount`.
84
+ * @typeParam TDevicePosition - The position enum for the device type being allocated (e.g. {@link ThrusterPosition}, {@link LightPosition}).
85
+ * @group X4
86
+ * @category Device Allocation
87
+ */
88
+ export type DeviceConfigPayload<TDevicePosition extends string> = {
89
+ /**
90
+ * Frontend-issued command. See {@link DeviceConfigCmd | DeviceConfigCmd}.
91
+ */
92
+ cmd?: DeviceConfigCmd;
93
+ /**
94
+ * The device position targeted by `cmd`. Required for `ASSIGN` and `INVERT_DIRECTION`.
95
+ */
96
+ deviceId?: TDevicePosition;
97
+ /**
98
+ * Backend-reported state of the allocation state machine. See {@link DeviceConfigState | DeviceConfigState}.
99
+ */
100
+ state?: DeviceConfigState;
101
+ /**
102
+ * Backend-reported error from the most recently rejected command. See {@link DeviceConfigError | DeviceConfigError}.
103
+ */
104
+ errorCode?: DeviceConfigError;
105
+ /**
106
+ * The set of device positions that have already been assigned to a physical device.
107
+ */
108
+ knownDevices?: TDevicePosition[];
109
+ /**
110
+ * The number of physical devices detected that have not yet been assigned a position.
111
+ */
112
+ unknownCount?: number;
113
+ };
114
+ /**
115
+ * Device allocation payload for X4 thrusters.
116
+ * @group X4
117
+ * @category Device Allocation
118
+ */
119
+ export type ThrusterConfig = DeviceConfigPayload<ThrusterPosition> & {
120
+ /**
121
+ * The current prop spin direction for each assigned thruster position.
122
+ */
123
+ directions?: Partial<Record<ThrusterPosition, DeviceDirection>>;
124
+ };
125
+ /**
126
+ * Device allocation payload for X4 lights.
127
+ * @group X4
128
+ * @category Device Allocation
129
+ */
130
+ export type LightConfig = DeviceConfigPayload<LightPosition>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceDirection = exports.DeviceConfigError = exports.DeviceConfigState = exports.DeviceConfigCmd = exports.LightPosition = exports.ThrusterPosition = void 0;
4
+ /**
5
+ * The physical mounting position of a thruster on the X4 chassis.
6
+ * @group X4
7
+ * @category Device Allocation
8
+ */
9
+ var ThrusterPosition;
10
+ (function (ThrusterPosition) {
11
+ ThrusterPosition["FRONT_LEFT"] = "FRONT_LEFT";
12
+ ThrusterPosition["FRONT_RIGHT"] = "FRONT_RIGHT";
13
+ ThrusterPosition["VERTICAL_LEFT"] = "VERTICAL_LEFT";
14
+ ThrusterPosition["VERTICAL_RIGHT"] = "VERTICAL_RIGHT";
15
+ ThrusterPosition["REAR_LEFT"] = "REAR_LEFT";
16
+ ThrusterPosition["REAR_RIGHT"] = "REAR_RIGHT";
17
+ ThrusterPosition["VERTICAL_REAR"] = "VERTICAL_REAR";
18
+ })(ThrusterPosition || (exports.ThrusterPosition = ThrusterPosition = {}));
19
+ /**
20
+ * The physical mounting position of a light node on the X4 chassis.
21
+ * @group X4
22
+ * @category Device Allocation
23
+ */
24
+ var LightPosition;
25
+ (function (LightPosition) {
26
+ LightPosition["LIGHT_0"] = "LIGHT_0";
27
+ LightPosition["LIGHT_1"] = "LIGHT_1";
28
+ })(LightPosition || (exports.LightPosition = LightPosition = {}));
29
+ /**
30
+ * Commands the frontend can issue to drive device allocation (thruster/light configuration).
31
+ * @group X4
32
+ * @category Device Allocation
33
+ */
34
+ var DeviceConfigCmd;
35
+ (function (DeviceConfigCmd) {
36
+ DeviceConfigCmd["ENTER_CONFIG_MODE"] = "ENTER_CONFIG_MODE";
37
+ DeviceConfigCmd["EXIT_CONFIG_MODE"] = "EXIT_CONFIG_MODE";
38
+ DeviceConfigCmd["ACTIVATE_NEXT_UNKNOWN"] = "ACTIVATE_NEXT_UNKNOWN";
39
+ DeviceConfigCmd["STOP"] = "STOP";
40
+ /** Requires `deviceId`. */
41
+ DeviceConfigCmd["ASSIGN"] = "ASSIGN";
42
+ DeviceConfigCmd["SAVE"] = "SAVE";
43
+ DeviceConfigCmd["CLEAR_SELECTION"] = "CLEAR_SELECTION";
44
+ DeviceConfigCmd["CLEAR_CONFIG"] = "CLEAR_CONFIG";
45
+ /** Thruster only. Requires `deviceId`. */
46
+ DeviceConfigCmd["INVERT_DIRECTION"] = "INVERT_DIRECTION";
47
+ })(DeviceConfigCmd || (exports.DeviceConfigCmd = DeviceConfigCmd = {}));
48
+ /**
49
+ * Backend-reported progress of the device allocation state machine.
50
+ * @group X4
51
+ * @category Device Allocation
52
+ */
53
+ var DeviceConfigState;
54
+ (function (DeviceConfigState) {
55
+ DeviceConfigState["IDLE"] = "IDLE";
56
+ DeviceConfigState["READY"] = "READY";
57
+ DeviceConfigState["ACTIVATING"] = "ACTIVATING";
58
+ DeviceConfigState["AWAITING_ASSIGN"] = "AWAITING_ASSIGN";
59
+ DeviceConfigState["ASSIGNING"] = "ASSIGNING";
60
+ DeviceConfigState["SAVING"] = "SAVING";
61
+ DeviceConfigState["FULL_CONFIG_COMPLETE"] = "FULL_CONFIG_COMPLETE";
62
+ DeviceConfigState["CONFIG_WRITTEN"] = "CONFIG_WRITTEN";
63
+ })(DeviceConfigState || (exports.DeviceConfigState = DeviceConfigState = {}));
64
+ /**
65
+ * Error codes the backend can report when rejecting a device allocation command.
66
+ * @group X4
67
+ * @category Device Allocation
68
+ */
69
+ var DeviceConfigError;
70
+ (function (DeviceConfigError) {
71
+ DeviceConfigError["NONE"] = "NONE";
72
+ DeviceConfigError["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
73
+ DeviceConfigError["MISSING_ASSIGN_ID"] = "MISSING_ASSIGN_ID";
74
+ DeviceConfigError["INVALID_ASSIGN_ID"] = "INVALID_ASSIGN_ID";
75
+ DeviceConfigError["DUPLICATE_ID"] = "DUPLICATE_ID";
76
+ DeviceConfigError["NOT_IN_CORRECT_STATE"] = "NOT_IN_CORRECT_STATE";
77
+ DeviceConfigError["NOT_IN_CONFIG_MODE"] = "NOT_IN_CONFIG_MODE";
78
+ DeviceConfigError["SAVE_FAILED"] = "SAVE_FAILED";
79
+ })(DeviceConfigError || (exports.DeviceConfigError = DeviceConfigError = {}));
80
+ /**
81
+ * Whether a thruster spins in its default or inverted direction.
82
+ * @group X4
83
+ * @category Device Allocation
84
+ */
85
+ var DeviceDirection;
86
+ (function (DeviceDirection) {
87
+ DeviceDirection["DEFAULT"] = "DEFAULT";
88
+ DeviceDirection["INVERTED"] = "INVERTED";
89
+ })(DeviceDirection || (exports.DeviceDirection = DeviceDirection = {}));
@@ -1,6 +1,8 @@
1
1
  import { Movement } from "../../../core";
2
2
  import { DeviceModel, MotorDiagnostics, Sonar, StereoCamera, X4CameraHead } from "../../cameraHeads";
3
3
  import { ImpaqDriver, SensorPod, X4Light } from "../../peripherals";
4
+ import { LightConfig, ThrusterConfig } from "./deviceAllocation";
5
+ export * from "./deviceAllocation";
4
6
  import { CygnusType } from "../..";
5
7
  /**
6
8
  * The coordinate system used for navigation and positioning.
@@ -729,6 +731,16 @@ export type X4 = {
729
731
  * @readonly
730
732
  */
731
733
  thrusters?: Record<string, X4Thruster>;
734
+ /**
735
+ * The current state of in-app thruster device allocation (mapping physical thrusters to
736
+ * their logical vehicle position). See {@link ThrusterConfig | ThrusterConfig}.
737
+ */
738
+ thrusterConfig?: ThrusterConfig;
739
+ /**
740
+ * The current state of in-app light device allocation (mapping physical light nodes to
741
+ * their logical vehicle position). See {@link LightConfig | LightConfig}.
742
+ */
743
+ lightConfig?: LightConfig;
732
744
  /**
733
745
  * A record of camera heads associated with the X4 vehicle.
734
746
  * Each camera head is identified by its unique MAC address and contains properties such as tilt, motor diagnostics, and temperatures.
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.ControlMode = exports.CoordinateType = void 0;
18
+ __exportStar(require("./deviceAllocation"), exports);
4
19
  /**
5
20
  * The coordinate system used for navigation and positioning.
6
21
  * @internal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeptrekker/api-domain",
3
- "version": "1.0.41",
3
+ "version": "1.0.42-depth-calib-x4.0",
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": {
@@ -37,16 +37,16 @@
37
37
  "@knodes/typedoc-plugin-code-blocks": "^0.22.7",
38
38
  "@types/lodash": "^4.14.182",
39
39
  "@types/node": "^22.0.0",
40
- "@typescript-eslint/eslint-plugin": "^6.1.0",
41
- "@typescript-eslint/parser": "^6.1.0",
42
40
  "@zamiell/typedoc-plugin-not-exported": "^0.2.0",
43
- "eslint": "^8.45.0",
44
- "eslint-config-prettier": "^8.8.0",
45
- "eslint-plugin-unused-imports": "^3.0.0",
46
41
  "prettier": "3.0.3",
47
42
  "rimraf": "^3.0.2",
48
43
  "semver-compare-cli": "^2.0.0",
49
44
  "ts-json-schema-generator": "2.4.0",
45
+ "eslint": "^8.45.0",
46
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
47
+ "@typescript-eslint/parser": "^6.1.0",
48
+ "eslint-plugin-unused-imports": "^3.0.0",
49
+ "eslint-config-prettier": "^8.8.0",
50
50
  "ts-node": "^10.8.1",
51
51
  "tslib": "^2.4.0",
52
52
  "typedoc": "^0.28.9",
@@ -62,7 +62,6 @@
62
62
  "mkdirp": "^1.0.4",
63
63
  "ts-pattern": "^4.3.0",
64
64
  "ts-toolbelt": "^9.6.0",
65
- "type-zoo": "^3.4.1",
66
- "yarn": "^1.22.22"
65
+ "type-zoo": "^3.4.1"
67
66
  }
68
67
  }