@dronedeploy/rocos-js-sdk 4.4.1 → 4.4.2

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.
@@ -0,0 +1,20 @@
1
+ /** One stored item in a config group, scoped by whatever the group's `type` represents (e.g. one gamepad, one command). */
2
+ export interface ConfigGroupItem<T> {
3
+ id: string;
4
+ value: T;
5
+ /** Robot-scoped response only: whether this robot's config overrides its robot definition's. */
6
+ _isOverridden?: boolean;
7
+ /** Robot-scoped response only: the robot definition's item this one overrides, when it does. */
8
+ _globalItem?: ConfigGroupItem<T>;
9
+ }
10
+ /** Response shape shared by RobotService/ProfileService config-group endpoints (gamepads, commands-v2, ...). */
11
+ export interface ConfigGroupResponse<T> {
12
+ version?: string;
13
+ type: string;
14
+ items: Array<ConfigGroupItem<T>>;
15
+ /** Robot-scoped response only. */
16
+ robotDefinitionId?: string;
17
+ username?: string;
18
+ createdAt?: string;
19
+ updatedAt?: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ import { ConfigGroupItem, ConfigGroupResponse } from '../ConfigGroupResponse';
2
+ /** Declares one named parameter a command accepts. `default` is always a string, whatever `type` names. */
3
+ export interface CommandV2ParameterDeclaration {
4
+ type: string;
5
+ default: string;
6
+ }
7
+ export interface CommandV2Settings {
8
+ target: string;
9
+ /** Stored as a number on newer configs, a numeric string on older ones. Absent on some legacy configs. */
10
+ timeoutMs?: number | string;
11
+ requiresClockSync: boolean;
12
+ payloadTemplate: string;
13
+ /** Should be an object, but a known editor round-trip bug can persist it as a raw JSON string. */
14
+ payloadMeta?: Record<string, unknown> | string | null;
15
+ }
16
+ export interface CommandV2 {
17
+ schemaVersion: number;
18
+ id: string;
19
+ name: string;
20
+ type: string;
21
+ /** Absent for commands declaring no parameters, not an empty object. */
22
+ parameters?: Record<string, CommandV2ParameterDeclaration>;
23
+ settings: CommandV2Settings;
24
+ }
25
+ /** One stored command, scoped to a specific command id (CommandV2.id). */
26
+ export type CommandV2Item = ConfigGroupItem<CommandV2>;
27
+ /** Response shape of RobotService/ProfileService getCommandsV2 — one item per declared command. */
28
+ export type CommandV2Response = ConfigGroupResponse<CommandV2>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,5 @@
1
1
  export * from '../ResponseLevelEnum';
2
+ export * from './CommandV2';
2
3
  export * from './IRocosCommandMessageHeartbeat';
3
4
  export * from './IRocosCommandMessageResponse';
4
5
  export * from './RocosCommandResultStatus';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("../ResponseLevelEnum"), exports);
18
+ __exportStar(require("./CommandV2"), exports);
18
19
  __exportStar(require("./IRocosCommandMessageHeartbeat"), exports);
19
20
  __exportStar(require("./IRocosCommandMessageResponse"), exports);
20
21
  __exportStar(require("./RocosCommandResultStatus"), exports);
@@ -1,3 +1,4 @@
1
+ import { ConfigGroupItem, ConfigGroupResponse } from '../ConfigGroupResponse';
1
2
  export declare enum GamepadButtonType {
2
3
  UNKNOWN = 0,
3
4
  UP = 1,
@@ -81,20 +82,6 @@ export interface GamepadConfig {
81
82
  axisExpos?: GamepadAxisValueMap;
82
83
  }
83
84
  /** One stored gamepad config, scoped to a specific physical controller model (GamepadConfig.gamepad). */
84
- export interface GamepadConfigItem {
85
- id: string;
86
- value: GamepadConfig;
87
- /** Robot-scoped response only: whether this robot's config overrides its robot definition's. */
88
- _isOverridden?: boolean;
89
- }
85
+ export type GamepadConfigItem = ConfigGroupItem<GamepadConfig>;
90
86
  /** Response shape of RobotService/ProfileService getGamepads — one item per registered controller model. */
91
- export interface GamepadConfigResponse {
92
- version?: string;
93
- type: string;
94
- items: GamepadConfigItem[];
95
- /** Robot-scoped response only. */
96
- robotDefinitionId?: string;
97
- username?: string;
98
- createdAt?: string;
99
- updatedAt?: string;
100
- }
87
+ export type GamepadConfigResponse = ConfigGroupResponse<GamepadConfig>;
@@ -6,6 +6,7 @@ export * from './callsigns/CallsignsLookup';
6
6
  export * from './callsigns/CallsignsQuery';
7
7
  export * from './callsigns/CallsignsQueryPredicate';
8
8
  export * from './command';
9
+ export * from './ConfigGroupResponse';
9
10
  export * from './device-credentials/DeviceCredentials';
10
11
  export * from './Dashboard';
11
12
  export * from './ExportDataQuery';
@@ -22,6 +22,7 @@ __exportStar(require("./callsigns/CallsignsLookup"), exports);
22
22
  __exportStar(require("./callsigns/CallsignsQuery"), exports);
23
23
  __exportStar(require("./callsigns/CallsignsQueryPredicate"), exports);
24
24
  __exportStar(require("./command"), exports);
25
+ __exportStar(require("./ConfigGroupResponse"), exports);
25
26
  __exportStar(require("./device-credentials/DeviceCredentials"), exports);
26
27
  __exportStar(require("./Dashboard"), exports);
27
28
  __exportStar(require("./ExportDataQuery"), exports);
@@ -1,4 +1,5 @@
1
1
  import { AgentSettingsRequestItem, AgentSettingsResponse } from '../models/IRobotSettings';
2
+ import { CommandV2Item, CommandV2Response } from '../models/command/CommandV2';
2
3
  import { CreateRobotDefinitionRequest, RobotProfile } from '../models/RobotProfile';
3
4
  import { GamepadConfigItem, GamepadConfigResponse } from '../models/gamepad/GamepadConfig';
4
5
  import { RocosError } from '../models/RocosError';
@@ -168,7 +169,7 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
168
169
  * @param definitionId - Robot definition Id
169
170
  * @description - Renamed from robotDefGetCommandsV2
170
171
  */
171
- getCommandsV2(projectId: string, definitionId: string): Promise<any>;
172
+ getCommandsV2(projectId: string, definitionId: string): Promise<CommandV2Response>;
172
173
  /**
173
174
  * Update command V2 for a robot definition
174
175
  *
@@ -177,7 +178,7 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
177
178
  * @param model - Payload
178
179
  * @description - Renamed from robotDefUpdateCommandsV2
179
180
  */
180
- updateCommandsV2(projectId: string, definitionId: string, model: any): Promise<any>;
181
+ updateCommandsV2(projectId: string, definitionId: string, model: CommandV2Item[]): Promise<void>;
181
182
  /**
182
183
  * Get command actions for a robot definition
183
184
  *
@@ -238,7 +238,6 @@ class ProfileService extends BaseServiceAbstract_1.BaseServiceAbstract {
238
238
  * @param definitionId - Robot definition Id
239
239
  * @description - Renamed from robotDefGetCommandsV2
240
240
  */
241
- // TODO: map the response object
242
241
  async getCommandsV2(projectId, definitionId) {
243
242
  return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEFINITION_COMMAND2_URL, { url: this.config.url, projectId, definitionId }, this.config.insecure), `Failed to get command list for ${projectId}, definitionId ${definitionId}.`);
244
243
  }
@@ -250,9 +249,6 @@ class ProfileService extends BaseServiceAbstract_1.BaseServiceAbstract {
250
249
  * @param model - Payload
251
250
  * @description - Renamed from robotDefUpdateCommandsV2
252
251
  */
253
- // TODO: map the request model
254
- // TODO: map the response object
255
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
256
252
  async updateCommandsV2(projectId, definitionId, model) {
257
253
  return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEFINITION_COMMAND2_URL, { url: this.config.url, projectId, definitionId }, this.config.insecure), model, `Failed to update command list for ${projectId}, definitionId ${definitionId}.`);
258
254
  }
@@ -1,4 +1,4 @@
1
- import { AgentSettingsResponse, GamepadConfigItem, GamepadConfigResponse, IBaseService, IConnectedCallsign, IRobot, IRobotListItem, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
1
+ import { AgentSettingsResponse, CommandV2Item, CommandV2Response, GamepadConfigItem, GamepadConfigResponse, IBaseService, IConnectedCallsign, IRobot, IRobotListItem, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
2
2
  import { BaseServiceAbstract } from './BaseServiceAbstract';
3
3
  export declare class RobotService extends BaseServiceAbstract implements IBaseService {
4
4
  constructor(config: IRocosSDKConfig);
@@ -227,7 +227,7 @@ export declare class RobotService extends BaseServiceAbstract implements IBaseSe
227
227
  * @param projectId - Project Id
228
228
  * @param callsign - Robot callsign
229
229
  */
230
- getCommandsV2(projectId: string, callsign: string): Promise<any>;
230
+ getCommandsV2(projectId: string, callsign: string): Promise<CommandV2Response>;
231
231
  /**
232
232
  * Update command V2 for a robot
233
233
  *
@@ -235,7 +235,7 @@ export declare class RobotService extends BaseServiceAbstract implements IBaseSe
235
235
  * @param callsign - Robot callsign
236
236
  * @param model - Payload
237
237
  */
238
- updateCommandsV2(projectId: string, callsign: string, model: any): Promise<any>;
238
+ updateCommandsV2(projectId: string, callsign: string, model: CommandV2Item[]): Promise<void>;
239
239
  /**
240
240
  * Get buttons for a robot
241
241
  *
@@ -380,7 +380,6 @@ class RobotService extends BaseServiceAbstract_1.BaseServiceAbstract {
380
380
  * @param projectId - Project Id
381
381
  * @param callsign - Robot callsign
382
382
  */
383
- // TODO: map the response object
384
383
  async getCommandsV2(projectId, callsign) {
385
384
  return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_COMMAND2_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to get command list for ${projectId}, callsign ${callsign}.`);
386
385
  }
@@ -391,9 +390,6 @@ class RobotService extends BaseServiceAbstract_1.BaseServiceAbstract {
391
390
  * @param callsign - Robot callsign
392
391
  * @param model - Payload
393
392
  */
394
- // TODO: map the request model
395
- // TODO: map the response object
396
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
397
393
  async updateCommandsV2(projectId, callsign, model) {
398
394
  return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_COMMAND2_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), model, `Failed to update commands for ${projectId}, callsign ${callsign}.`);
399
395
  }
@@ -0,0 +1,20 @@
1
+ /** One stored item in a config group, scoped by whatever the group's `type` represents (e.g. one gamepad, one command). */
2
+ export interface ConfigGroupItem<T> {
3
+ id: string;
4
+ value: T;
5
+ /** Robot-scoped response only: whether this robot's config overrides its robot definition's. */
6
+ _isOverridden?: boolean;
7
+ /** Robot-scoped response only: the robot definition's item this one overrides, when it does. */
8
+ _globalItem?: ConfigGroupItem<T>;
9
+ }
10
+ /** Response shape shared by RobotService/ProfileService config-group endpoints (gamepads, commands-v2, ...). */
11
+ export interface ConfigGroupResponse<T> {
12
+ version?: string;
13
+ type: string;
14
+ items: Array<ConfigGroupItem<T>>;
15
+ /** Robot-scoped response only. */
16
+ robotDefinitionId?: string;
17
+ username?: string;
18
+ createdAt?: string;
19
+ updatedAt?: string;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ import { ConfigGroupItem, ConfigGroupResponse } from '../ConfigGroupResponse';
2
+ /** Declares one named parameter a command accepts. `default` is always a string, whatever `type` names. */
3
+ export interface CommandV2ParameterDeclaration {
4
+ type: string;
5
+ default: string;
6
+ }
7
+ export interface CommandV2Settings {
8
+ target: string;
9
+ /** Stored as a number on newer configs, a numeric string on older ones. Absent on some legacy configs. */
10
+ timeoutMs?: number | string;
11
+ requiresClockSync: boolean;
12
+ payloadTemplate: string;
13
+ /** Should be an object, but a known editor round-trip bug can persist it as a raw JSON string. */
14
+ payloadMeta?: Record<string, unknown> | string | null;
15
+ }
16
+ export interface CommandV2 {
17
+ schemaVersion: number;
18
+ id: string;
19
+ name: string;
20
+ type: string;
21
+ /** Absent for commands declaring no parameters, not an empty object. */
22
+ parameters?: Record<string, CommandV2ParameterDeclaration>;
23
+ settings: CommandV2Settings;
24
+ }
25
+ /** One stored command, scoped to a specific command id (CommandV2.id). */
26
+ export type CommandV2Item = ConfigGroupItem<CommandV2>;
27
+ /** Response shape of RobotService/ProfileService getCommandsV2 — one item per declared command. */
28
+ export type CommandV2Response = ConfigGroupResponse<CommandV2>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  export * from '../ResponseLevelEnum';
2
+ export * from './CommandV2';
2
3
  export * from './IRocosCommandMessageHeartbeat';
3
4
  export * from './IRocosCommandMessageResponse';
4
5
  export * from './RocosCommandResultStatus';
@@ -1,4 +1,5 @@
1
1
  export * from '../ResponseLevelEnum';
2
+ export * from './CommandV2';
2
3
  export * from './IRocosCommandMessageHeartbeat';
3
4
  export * from './IRocosCommandMessageResponse';
4
5
  export * from './RocosCommandResultStatus';
@@ -1,3 +1,4 @@
1
+ import { ConfigGroupItem, ConfigGroupResponse } from '../ConfigGroupResponse';
1
2
  export declare enum GamepadButtonType {
2
3
  UNKNOWN = 0,
3
4
  UP = 1,
@@ -81,20 +82,6 @@ export interface GamepadConfig {
81
82
  axisExpos?: GamepadAxisValueMap;
82
83
  }
83
84
  /** One stored gamepad config, scoped to a specific physical controller model (GamepadConfig.gamepad). */
84
- export interface GamepadConfigItem {
85
- id: string;
86
- value: GamepadConfig;
87
- /** Robot-scoped response only: whether this robot's config overrides its robot definition's. */
88
- _isOverridden?: boolean;
89
- }
85
+ export type GamepadConfigItem = ConfigGroupItem<GamepadConfig>;
90
86
  /** Response shape of RobotService/ProfileService getGamepads — one item per registered controller model. */
91
- export interface GamepadConfigResponse {
92
- version?: string;
93
- type: string;
94
- items: GamepadConfigItem[];
95
- /** Robot-scoped response only. */
96
- robotDefinitionId?: string;
97
- username?: string;
98
- createdAt?: string;
99
- updatedAt?: string;
100
- }
87
+ export type GamepadConfigResponse = ConfigGroupResponse<GamepadConfig>;
@@ -6,6 +6,7 @@ export * from './callsigns/CallsignsLookup';
6
6
  export * from './callsigns/CallsignsQuery';
7
7
  export * from './callsigns/CallsignsQueryPredicate';
8
8
  export * from './command';
9
+ export * from './ConfigGroupResponse';
9
10
  export * from './device-credentials/DeviceCredentials';
10
11
  export * from './Dashboard';
11
12
  export * from './ExportDataQuery';
@@ -6,6 +6,7 @@ export * from './callsigns/CallsignsLookup';
6
6
  export * from './callsigns/CallsignsQuery';
7
7
  export * from './callsigns/CallsignsQueryPredicate';
8
8
  export * from './command';
9
+ export * from './ConfigGroupResponse';
9
10
  export * from './device-credentials/DeviceCredentials';
10
11
  export * from './Dashboard';
11
12
  export * from './ExportDataQuery';
@@ -1,4 +1,5 @@
1
1
  import { AgentSettingsRequestItem, AgentSettingsResponse } from '../models/IRobotSettings';
2
+ import { CommandV2Item, CommandV2Response } from '../models/command/CommandV2';
2
3
  import { CreateRobotDefinitionRequest, RobotProfile } from '../models/RobotProfile';
3
4
  import { GamepadConfigItem, GamepadConfigResponse } from '../models/gamepad/GamepadConfig';
4
5
  import { RocosError } from '../models/RocosError';
@@ -168,7 +169,7 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
168
169
  * @param definitionId - Robot definition Id
169
170
  * @description - Renamed from robotDefGetCommandsV2
170
171
  */
171
- getCommandsV2(projectId: string, definitionId: string): Promise<any>;
172
+ getCommandsV2(projectId: string, definitionId: string): Promise<CommandV2Response>;
172
173
  /**
173
174
  * Update command V2 for a robot definition
174
175
  *
@@ -177,7 +178,7 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
177
178
  * @param model - Payload
178
179
  * @description - Renamed from robotDefUpdateCommandsV2
179
180
  */
180
- updateCommandsV2(projectId: string, definitionId: string, model: any): Promise<any>;
181
+ updateCommandsV2(projectId: string, definitionId: string, model: CommandV2Item[]): Promise<void>;
181
182
  /**
182
183
  * Get command actions for a robot definition
183
184
  *
@@ -235,7 +235,6 @@ export class ProfileService extends BaseServiceAbstract {
235
235
  * @param definitionId - Robot definition Id
236
236
  * @description - Renamed from robotDefGetCommandsV2
237
237
  */
238
- // TODO: map the response object
239
238
  async getCommandsV2(projectId, definitionId) {
240
239
  return this.callGet(formatServiceUrl(API_PROJECT_DEFINITION_COMMAND2_URL, { url: this.config.url, projectId, definitionId }, this.config.insecure), `Failed to get command list for ${projectId}, definitionId ${definitionId}.`);
241
240
  }
@@ -247,9 +246,6 @@ export class ProfileService extends BaseServiceAbstract {
247
246
  * @param model - Payload
248
247
  * @description - Renamed from robotDefUpdateCommandsV2
249
248
  */
250
- // TODO: map the request model
251
- // TODO: map the response object
252
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
253
249
  async updateCommandsV2(projectId, definitionId, model) {
254
250
  return this.callPost(formatServiceUrl(API_PROJECT_DEFINITION_COMMAND2_URL, { url: this.config.url, projectId, definitionId }, this.config.insecure), model, `Failed to update command list for ${projectId}, definitionId ${definitionId}.`);
255
251
  }
@@ -1,4 +1,4 @@
1
- import { AgentSettingsResponse, GamepadConfigItem, GamepadConfigResponse, IBaseService, IConnectedCallsign, IRobot, IRobotListItem, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
1
+ import { AgentSettingsResponse, CommandV2Item, CommandV2Response, GamepadConfigItem, GamepadConfigResponse, IBaseService, IConnectedCallsign, IRobot, IRobotListItem, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
2
2
  import { BaseServiceAbstract } from './BaseServiceAbstract';
3
3
  export declare class RobotService extends BaseServiceAbstract implements IBaseService {
4
4
  constructor(config: IRocosSDKConfig);
@@ -227,7 +227,7 @@ export declare class RobotService extends BaseServiceAbstract implements IBaseSe
227
227
  * @param projectId - Project Id
228
228
  * @param callsign - Robot callsign
229
229
  */
230
- getCommandsV2(projectId: string, callsign: string): Promise<any>;
230
+ getCommandsV2(projectId: string, callsign: string): Promise<CommandV2Response>;
231
231
  /**
232
232
  * Update command V2 for a robot
233
233
  *
@@ -235,7 +235,7 @@ export declare class RobotService extends BaseServiceAbstract implements IBaseSe
235
235
  * @param callsign - Robot callsign
236
236
  * @param model - Payload
237
237
  */
238
- updateCommandsV2(projectId: string, callsign: string, model: any): Promise<any>;
238
+ updateCommandsV2(projectId: string, callsign: string, model: CommandV2Item[]): Promise<void>;
239
239
  /**
240
240
  * Get buttons for a robot
241
241
  *
@@ -377,7 +377,6 @@ export class RobotService extends BaseServiceAbstract {
377
377
  * @param projectId - Project Id
378
378
  * @param callsign - Robot callsign
379
379
  */
380
- // TODO: map the response object
381
380
  async getCommandsV2(projectId, callsign) {
382
381
  return this.callGet(formatServiceUrl(API_PROJECT_ROBOT_COMMAND2_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to get command list for ${projectId}, callsign ${callsign}.`);
383
382
  }
@@ -388,9 +387,6 @@ export class RobotService extends BaseServiceAbstract {
388
387
  * @param callsign - Robot callsign
389
388
  * @param model - Payload
390
389
  */
391
- // TODO: map the request model
392
- // TODO: map the response object
393
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
394
390
  async updateCommandsV2(projectId, callsign, model) {
395
391
  return this.callPost(formatServiceUrl(API_PROJECT_ROBOT_COMMAND2_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), model, `Failed to update commands for ${projectId}, callsign ${callsign}.`);
396
392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "4.4.1",
3
+ "version": "4.4.2",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",