@dronedeploy/rocos-js-sdk 4.4.9 → 4.4.11
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.
- package/cjs/models/gamepad/GamepadConfig.d.ts +21 -4
- package/cjs/models/gamepad/GamepadConfig.js +10 -1
- package/cjs/services/robot-status/connectivity.d.ts +3 -5
- package/cjs/services/robot-status/connectivity.js +10 -6
- package/esm/models/gamepad/GamepadConfig.d.ts +21 -4
- package/esm/models/gamepad/GamepadConfig.js +7 -0
- package/esm/services/robot-status/connectivity.d.ts +3 -5
- package/esm/services/robot-status/connectivity.js +10 -6
- package/package.json +1 -1
|
@@ -57,12 +57,9 @@ export interface GamepadButtonRef {
|
|
|
57
57
|
type: GamepadButtonType;
|
|
58
58
|
text: string;
|
|
59
59
|
}
|
|
60
|
-
export interface
|
|
60
|
+
export interface GamepadActionBase {
|
|
61
61
|
name: string;
|
|
62
62
|
source: GamepadButtonRef;
|
|
63
|
-
commandId: string;
|
|
64
|
-
/** Absent on configs saved before Commands V2 existed. */
|
|
65
|
-
commandVersion?: GamepadCommandVersion;
|
|
66
63
|
triggerType: GamepadTriggerType;
|
|
67
64
|
/** Milliseconds between repeats. Only meaningful for `continuously`. */
|
|
68
65
|
frequency: number;
|
|
@@ -76,6 +73,26 @@ export interface GamepadAction {
|
|
|
76
73
|
*/
|
|
77
74
|
modifiers?: GamepadButtonRef[];
|
|
78
75
|
}
|
|
76
|
+
export type GamepadActionType = 'robot' | 'dashboard';
|
|
77
|
+
/** A robot-side action. `actionType` is absent on configurations saved before destinations existed. */
|
|
78
|
+
export interface GamepadRobotAction extends GamepadActionBase {
|
|
79
|
+
actionType?: 'robot';
|
|
80
|
+
commandId: string;
|
|
81
|
+
/** Absent on configs saved before Commands V2 existed. */
|
|
82
|
+
commandVersion?: GamepadCommandVersion;
|
|
83
|
+
}
|
|
84
|
+
/** A semantic action broadcast to widgets mounted on the current dashboard page. */
|
|
85
|
+
export interface GamepadDashboardAction extends GamepadActionBase {
|
|
86
|
+
actionType: 'dashboard';
|
|
87
|
+
actionName: string;
|
|
88
|
+
/** Custom-widget bundles that predate destinations skip any action without a `commandId`, so it must stay absent. */
|
|
89
|
+
commandId?: never;
|
|
90
|
+
commandVersion?: never;
|
|
91
|
+
}
|
|
92
|
+
export type GamepadAction = GamepadRobotAction | GamepadDashboardAction;
|
|
93
|
+
/** Prefer this over checking `actionType === 'robot'`, which misses configurations saved before destinations existed. */
|
|
94
|
+
export declare const isGamepadRobotAction: (action: GamepadAction) => action is GamepadRobotAction;
|
|
95
|
+
export declare const isGamepadDashboardAction: (action: GamepadAction) => action is GamepadDashboardAction;
|
|
79
96
|
export interface GamepadVariable {
|
|
80
97
|
name: string;
|
|
81
98
|
source: GamepadButtonRef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GamepadCommandVersion = exports.GamepadTriggerType = exports.MODIFIER_RELEASE_FRACTION = exports.DEFAULT_MODIFIER_THRESHOLD = exports.GamepadButtonType = void 0;
|
|
3
|
+
exports.isGamepadDashboardAction = exports.isGamepadRobotAction = exports.GamepadCommandVersion = exports.GamepadTriggerType = exports.MODIFIER_RELEASE_FRACTION = exports.DEFAULT_MODIFIER_THRESHOLD = exports.GamepadButtonType = void 0;
|
|
4
4
|
// Ref: https://github.com/alaingilbert/GamepadJs
|
|
5
5
|
var GamepadButtonType;
|
|
6
6
|
(function (GamepadButtonType) {
|
|
@@ -55,3 +55,12 @@ var GamepadCommandVersion;
|
|
|
55
55
|
GamepadCommandVersion["COMMANDS_V2"] = "commands-v2";
|
|
56
56
|
GamepadCommandVersion["RUN_JS"] = "run-js";
|
|
57
57
|
})(GamepadCommandVersion || (exports.GamepadCommandVersion = GamepadCommandVersion = {}));
|
|
58
|
+
/** Prefer this over checking `actionType === 'robot'`, which misses configurations saved before destinations existed. */
|
|
59
|
+
const isGamepadRobotAction = (action) => {
|
|
60
|
+
return action.actionType !== 'dashboard';
|
|
61
|
+
};
|
|
62
|
+
exports.isGamepadRobotAction = isGamepadRobotAction;
|
|
63
|
+
const isGamepadDashboardAction = (action) => {
|
|
64
|
+
return action.actionType === 'dashboard';
|
|
65
|
+
};
|
|
66
|
+
exports.isGamepadDashboardAction = isGamepadDashboardAction;
|
|
@@ -3,7 +3,8 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
/**
|
|
4
4
|
* Service id → public path prefix, for services that expose the standard
|
|
5
5
|
* `connections` endpoint. New services adopting the convention are added here.
|
|
6
|
-
*
|
|
6
|
+
* `robot-telemetry` is Teletubby's broker-side view (is the robot's telemetry
|
|
7
|
+
* stream connected), distinct from `telemetry-liveness` (is telemetry arriving).
|
|
7
8
|
*/
|
|
8
9
|
export declare const CONNECTION_SERVICE_PREFIXES: Record<string, string>;
|
|
9
10
|
/**
|
|
@@ -12,10 +13,7 @@ export declare const CONNECTION_SERVICE_PREFIXES: Record<string, string>;
|
|
|
12
13
|
* the caller). See `getTelemetryLiveness`.
|
|
13
14
|
*/
|
|
14
15
|
export declare const TELEMETRY_LIVENESS_SERVICE = "telemetry-liveness";
|
|
15
|
-
/**
|
|
16
|
-
* The services evaluated by default. The `telemetry` connections endpoint joins
|
|
17
|
-
* this list once Teletubby exposes it (follow-up).
|
|
18
|
-
*/
|
|
16
|
+
/** The services evaluated by default. */
|
|
19
17
|
export declare const DEFAULT_EXPECTED_SERVICES: string[];
|
|
20
18
|
/**
|
|
21
19
|
* Floor for the connections-endpoint poll interval. Guards against a caller
|
|
@@ -8,11 +8,13 @@ const formatServiceUrl_1 = require("../../helpers/formatServiceUrl");
|
|
|
8
8
|
/**
|
|
9
9
|
* Service id → public path prefix, for services that expose the standard
|
|
10
10
|
* `connections` endpoint. New services adopting the convention are added here.
|
|
11
|
-
*
|
|
11
|
+
* `robot-telemetry` is Teletubby's broker-side view (is the robot's telemetry
|
|
12
|
+
* stream connected), distinct from `telemetry-liveness` (is telemetry arriving).
|
|
12
13
|
*/
|
|
13
14
|
exports.CONNECTION_SERVICE_PREFIXES = {
|
|
14
15
|
'robot-configs': 'robot-configs',
|
|
15
16
|
'robot-services': 'robot-services',
|
|
17
|
+
'robot-telemetry': 'telemetry',
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* The telemetry-liveness signal is derived from heartbeat freshness rather than
|
|
@@ -20,11 +22,13 @@ exports.CONNECTION_SERVICE_PREFIXES = {
|
|
|
20
22
|
* the caller). See `getTelemetryLiveness`.
|
|
21
23
|
*/
|
|
22
24
|
exports.TELEMETRY_LIVENESS_SERVICE = 'telemetry-liveness';
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
/** The services evaluated by default. */
|
|
26
|
+
exports.DEFAULT_EXPECTED_SERVICES = [
|
|
27
|
+
exports.TELEMETRY_LIVENESS_SERVICE,
|
|
28
|
+
'robot-configs',
|
|
29
|
+
'robot-services',
|
|
30
|
+
'robot-telemetry',
|
|
31
|
+
];
|
|
28
32
|
const DEFAULT_CONNECTIVITY_POLL_MS = 5000;
|
|
29
33
|
/**
|
|
30
34
|
* Floor for the connections-endpoint poll interval. Guards against a caller
|
|
@@ -57,12 +57,9 @@ export interface GamepadButtonRef {
|
|
|
57
57
|
type: GamepadButtonType;
|
|
58
58
|
text: string;
|
|
59
59
|
}
|
|
60
|
-
export interface
|
|
60
|
+
export interface GamepadActionBase {
|
|
61
61
|
name: string;
|
|
62
62
|
source: GamepadButtonRef;
|
|
63
|
-
commandId: string;
|
|
64
|
-
/** Absent on configs saved before Commands V2 existed. */
|
|
65
|
-
commandVersion?: GamepadCommandVersion;
|
|
66
63
|
triggerType: GamepadTriggerType;
|
|
67
64
|
/** Milliseconds between repeats. Only meaningful for `continuously`. */
|
|
68
65
|
frequency: number;
|
|
@@ -76,6 +73,26 @@ export interface GamepadAction {
|
|
|
76
73
|
*/
|
|
77
74
|
modifiers?: GamepadButtonRef[];
|
|
78
75
|
}
|
|
76
|
+
export type GamepadActionType = 'robot' | 'dashboard';
|
|
77
|
+
/** A robot-side action. `actionType` is absent on configurations saved before destinations existed. */
|
|
78
|
+
export interface GamepadRobotAction extends GamepadActionBase {
|
|
79
|
+
actionType?: 'robot';
|
|
80
|
+
commandId: string;
|
|
81
|
+
/** Absent on configs saved before Commands V2 existed. */
|
|
82
|
+
commandVersion?: GamepadCommandVersion;
|
|
83
|
+
}
|
|
84
|
+
/** A semantic action broadcast to widgets mounted on the current dashboard page. */
|
|
85
|
+
export interface GamepadDashboardAction extends GamepadActionBase {
|
|
86
|
+
actionType: 'dashboard';
|
|
87
|
+
actionName: string;
|
|
88
|
+
/** Custom-widget bundles that predate destinations skip any action without a `commandId`, so it must stay absent. */
|
|
89
|
+
commandId?: never;
|
|
90
|
+
commandVersion?: never;
|
|
91
|
+
}
|
|
92
|
+
export type GamepadAction = GamepadRobotAction | GamepadDashboardAction;
|
|
93
|
+
/** Prefer this over checking `actionType === 'robot'`, which misses configurations saved before destinations existed. */
|
|
94
|
+
export declare const isGamepadRobotAction: (action: GamepadAction) => action is GamepadRobotAction;
|
|
95
|
+
export declare const isGamepadDashboardAction: (action: GamepadAction) => action is GamepadDashboardAction;
|
|
79
96
|
export interface GamepadVariable {
|
|
80
97
|
name: string;
|
|
81
98
|
source: GamepadButtonRef;
|
|
@@ -52,3 +52,10 @@ export var GamepadCommandVersion;
|
|
|
52
52
|
GamepadCommandVersion["COMMANDS_V2"] = "commands-v2";
|
|
53
53
|
GamepadCommandVersion["RUN_JS"] = "run-js";
|
|
54
54
|
})(GamepadCommandVersion || (GamepadCommandVersion = {}));
|
|
55
|
+
/** Prefer this over checking `actionType === 'robot'`, which misses configurations saved before destinations existed. */
|
|
56
|
+
export const isGamepadRobotAction = (action) => {
|
|
57
|
+
return action.actionType !== 'dashboard';
|
|
58
|
+
};
|
|
59
|
+
export const isGamepadDashboardAction = (action) => {
|
|
60
|
+
return action.actionType === 'dashboard';
|
|
61
|
+
};
|
|
@@ -3,7 +3,8 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
/**
|
|
4
4
|
* Service id → public path prefix, for services that expose the standard
|
|
5
5
|
* `connections` endpoint. New services adopting the convention are added here.
|
|
6
|
-
*
|
|
6
|
+
* `robot-telemetry` is Teletubby's broker-side view (is the robot's telemetry
|
|
7
|
+
* stream connected), distinct from `telemetry-liveness` (is telemetry arriving).
|
|
7
8
|
*/
|
|
8
9
|
export declare const CONNECTION_SERVICE_PREFIXES: Record<string, string>;
|
|
9
10
|
/**
|
|
@@ -12,10 +13,7 @@ export declare const CONNECTION_SERVICE_PREFIXES: Record<string, string>;
|
|
|
12
13
|
* the caller). See `getTelemetryLiveness`.
|
|
13
14
|
*/
|
|
14
15
|
export declare const TELEMETRY_LIVENESS_SERVICE = "telemetry-liveness";
|
|
15
|
-
/**
|
|
16
|
-
* The services evaluated by default. The `telemetry` connections endpoint joins
|
|
17
|
-
* this list once Teletubby exposes it (follow-up).
|
|
18
|
-
*/
|
|
16
|
+
/** The services evaluated by default. */
|
|
19
17
|
export declare const DEFAULT_EXPECTED_SERVICES: string[];
|
|
20
18
|
/**
|
|
21
19
|
* Floor for the connections-endpoint poll interval. Guards against a caller
|
|
@@ -5,11 +5,13 @@ import { formatServiceUrl } from '../../helpers/formatServiceUrl';
|
|
|
5
5
|
/**
|
|
6
6
|
* Service id → public path prefix, for services that expose the standard
|
|
7
7
|
* `connections` endpoint. New services adopting the convention are added here.
|
|
8
|
-
*
|
|
8
|
+
* `robot-telemetry` is Teletubby's broker-side view (is the robot's telemetry
|
|
9
|
+
* stream connected), distinct from `telemetry-liveness` (is telemetry arriving).
|
|
9
10
|
*/
|
|
10
11
|
export const CONNECTION_SERVICE_PREFIXES = {
|
|
11
12
|
'robot-configs': 'robot-configs',
|
|
12
13
|
'robot-services': 'robot-services',
|
|
14
|
+
'robot-telemetry': 'telemetry',
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* The telemetry-liveness signal is derived from heartbeat freshness rather than
|
|
@@ -17,11 +19,13 @@ export const CONNECTION_SERVICE_PREFIXES = {
|
|
|
17
19
|
* the caller). See `getTelemetryLiveness`.
|
|
18
20
|
*/
|
|
19
21
|
export const TELEMETRY_LIVENESS_SERVICE = 'telemetry-liveness';
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/** The services evaluated by default. */
|
|
23
|
+
export const DEFAULT_EXPECTED_SERVICES = [
|
|
24
|
+
TELEMETRY_LIVENESS_SERVICE,
|
|
25
|
+
'robot-configs',
|
|
26
|
+
'robot-services',
|
|
27
|
+
'robot-telemetry',
|
|
28
|
+
];
|
|
25
29
|
const DEFAULT_CONNECTIVITY_POLL_MS = 5000;
|
|
26
30
|
/**
|
|
27
31
|
* Floor for the connections-endpoint poll interval. Guards against a caller
|