@dronedeploy/rocos-js-sdk 4.1.1 → 4.3.0-rc.1
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/IRocosSDK.d.ts +2 -1
- package/cjs/RocosSDK.d.ts +5 -1
- package/cjs/RocosSDK.js +9 -0
- package/cjs/constants/api.d.ts +8 -2
- package/cjs/constants/api.js +13 -5
- package/cjs/models/RocosError.d.ts +1 -0
- package/cjs/models/RocosError.js +1 -0
- package/cjs/models/ServiceEnum.d.ts +1 -0
- package/cjs/models/ServiceEnum.js +1 -0
- package/cjs/models/index.d.ts +1 -0
- package/cjs/models/index.js +1 -0
- package/cjs/models/maps/MapPath.d.ts +143 -0
- package/cjs/models/maps/MapPath.js +2 -0
- package/cjs/models/robot-status/RobotStatusEnums.d.ts +1 -1
- package/cjs/models/robot-status/RobotStatusEnums.js +1 -1
- package/cjs/services/MapService.d.ts +101 -0
- package/cjs/services/MapService.js +140 -0
- package/cjs/services/RobotStatusService.d.ts +37 -0
- package/cjs/services/RobotStatusService.js +94 -0
- package/cjs/services/index.d.ts +1 -0
- package/cjs/services/index.js +1 -0
- package/cjs/services/robot-status/connectivity.d.ts +76 -0
- package/cjs/services/robot-status/connectivity.js +140 -0
- package/cjs/services/robot-status/reportedStatus.d.ts +38 -0
- package/cjs/services/robot-status/reportedStatus.js +109 -0
- package/esm/IRocosSDK.d.ts +2 -1
- package/esm/RocosSDK.d.ts +5 -1
- package/esm/RocosSDK.js +10 -1
- package/esm/constants/api.d.ts +8 -2
- package/esm/constants/api.js +10 -2
- package/esm/models/RocosError.d.ts +1 -0
- package/esm/models/RocosError.js +1 -0
- package/esm/models/ServiceEnum.d.ts +1 -0
- package/esm/models/ServiceEnum.js +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/maps/MapPath.d.ts +143 -0
- package/esm/models/maps/MapPath.js +1 -0
- package/esm/models/robot-status/RobotStatusEnums.d.ts +1 -1
- package/esm/models/robot-status/RobotStatusEnums.js +1 -1
- package/esm/services/MapService.d.ts +101 -0
- package/esm/services/MapService.js +141 -1
- package/esm/services/RobotStatusService.d.ts +37 -0
- package/esm/services/RobotStatusService.js +90 -0
- package/esm/services/index.d.ts +1 -0
- package/esm/services/index.js +1 -0
- package/esm/services/robot-status/connectivity.d.ts +76 -0
- package/esm/services/robot-status/connectivity.js +131 -0
- package/esm/services/robot-status/reportedStatus.d.ts +38 -0
- package/esm/services/robot-status/reportedStatus.js +102 -0
- package/package.json +1 -1
package/cjs/IRocosSDK.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TagService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, RobotStatusService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TagService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
|
2
2
|
import { IBaseService, IDebugLevel, ServiceEnum } from './models';
|
|
3
3
|
export declare abstract class IRocosSDK {
|
|
4
4
|
abstract getService<T extends IBaseService>(_name: ServiceEnum): T;
|
|
5
5
|
abstract getAuthService(): AuthService;
|
|
6
6
|
abstract getRobotService(): RobotService;
|
|
7
|
+
abstract getRobotStatusService(): RobotStatusService;
|
|
7
8
|
abstract getEventService(): EventService;
|
|
8
9
|
abstract getEnvironmentService(): EnvironmentService;
|
|
9
10
|
abstract getProjectService(): ProjectService;
|
package/cjs/RocosSDK.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TagService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, RobotStatusService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TagService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
|
2
2
|
import { AuthorisedConfig, IBaseService, IDebugLevel, IRocosSDKConfig, ServiceEnum } from './models';
|
|
3
3
|
import { IRocosSDK } from './IRocosSDK';
|
|
4
4
|
import { Logger } from 'loglevel';
|
|
@@ -26,6 +26,10 @@ export declare class RocosSDK implements IRocosSDK {
|
|
|
26
26
|
* Gets the robot service.
|
|
27
27
|
*/
|
|
28
28
|
getRobotService(): RobotService;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the robot status service.
|
|
31
|
+
*/
|
|
32
|
+
getRobotStatusService(): RobotStatusService;
|
|
29
33
|
/**
|
|
30
34
|
* Gets the event service.
|
|
31
35
|
*/
|
package/cjs/RocosSDK.js
CHANGED
|
@@ -38,6 +38,9 @@ class RocosSDK {
|
|
|
38
38
|
case models_1.ServiceEnum.ROBOT:
|
|
39
39
|
this.services[name] = new services_1.RobotService(config);
|
|
40
40
|
break;
|
|
41
|
+
case models_1.ServiceEnum.ROBOT_STATUS:
|
|
42
|
+
this.services[name] = new services_1.RobotStatusService(config);
|
|
43
|
+
break;
|
|
41
44
|
case models_1.ServiceEnum.ENVIRONMENT:
|
|
42
45
|
this.services[name] = new services_1.EnvironmentService(config);
|
|
43
46
|
break;
|
|
@@ -133,6 +136,12 @@ class RocosSDK {
|
|
|
133
136
|
getRobotService() {
|
|
134
137
|
return this.getService(models_1.ServiceEnum.ROBOT);
|
|
135
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Gets the robot status service.
|
|
141
|
+
*/
|
|
142
|
+
getRobotStatusService() {
|
|
143
|
+
return this.getService(models_1.ServiceEnum.ROBOT_STATUS);
|
|
144
|
+
}
|
|
136
145
|
/**
|
|
137
146
|
* Gets the event service.
|
|
138
147
|
*/
|
package/cjs/constants/api.d.ts
CHANGED
|
@@ -56,8 +56,10 @@ export declare const API_PROJECT_ROBOT_COMMAND2_URL = "https://{url}/projects/{p
|
|
|
56
56
|
export declare const API_PROJECT_ROBOT_BUTTON_URL = "https://{url}/projects/{projectId}/robots/{callsign}/buttons";
|
|
57
57
|
export declare const API_PROJECT_ROBOT_TRIGGER_URL = "https://{url}/projects/{projectId}/robots/{callsign}/triggers";
|
|
58
58
|
export declare const API_PROJECT_ROBOT_GAMEPAD_URL = "https://{url}/projects/{projectId}/robots/{callsign}/gamepads";
|
|
59
|
-
export declare const
|
|
60
|
-
export declare const
|
|
59
|
+
export declare const API_SERVICE_CONNECTIONS_URL = "https://{url}/{service}/connections/projects/{projectId}";
|
|
60
|
+
export declare const API_SERVICE_CONNECTION_URL = "https://{url}/{service}/connections/projects/{projectId}/callsigns/{callsign}";
|
|
61
|
+
export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL: string;
|
|
62
|
+
export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL: string;
|
|
61
63
|
export declare const API_PROJECT_OPERATION_URL = "https://{url}/projects/{projectId}/operations";
|
|
62
64
|
export declare const API_PROJECT_OPERATION_ID_URL = "https://{url}/projects/{projectId}/operations/{operationId}";
|
|
63
65
|
export declare const API_PROJECT_DASHBOARD_URL = "https://{url}/projects/{projectId}/dashboards";
|
|
@@ -134,6 +136,10 @@ export declare const API_GRAPHS_MAP_NODE_URL = "https://{url}/graphs/projects/{p
|
|
|
134
136
|
export declare const API_GRAPHS_MAP_EDGES_ADD_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/edges/add";
|
|
135
137
|
export declare const API_GRAPHS_MAP_EDGES_ADD_TRANSFORM_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/edges/add/transform";
|
|
136
138
|
export declare const API_GRAPHS_MAP_EDGE_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/edges/{edgeId}";
|
|
139
|
+
export declare const API_GRAPHS_MAP_PATHS_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths";
|
|
140
|
+
export declare const API_GRAPHS_MAP_PATH_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}";
|
|
141
|
+
export declare const API_GRAPHS_MAP_PATH_APPEND_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}/append";
|
|
142
|
+
export declare const API_GRAPHS_MAP_PATH_APPEND_TRANSFORMABLE_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}/append/transformable";
|
|
137
143
|
export declare const API_GRAPHS_MAPS_COPY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy";
|
|
138
144
|
export declare const API_GRAPHS_MAPS_DEPLOY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy";
|
|
139
145
|
export declare const API_GRAPHS_MAPS_GEOJSON_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson";
|
package/cjs/constants/api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.API_PROJECT_ROBOT_EVENT_URL = exports.API_PROJECT_ROBOT_REGISTER_URL = exports.API_PROJECT_ROBOT_DEFINITION_URL = exports.API_PROJECT_ROBOT_ATTRIBUTES_URL = exports.API_PROJECT_ROBOT_ID_URL = exports.API_ACCOUNT_ROBOT_URL = exports.API_PROJECT_ROBOT_URL = exports.API_PROJECT_MAPPED_ASSET_PATH_URL = exports.API_PROJECT_MAPPED_ASSETS_PATH_URL = exports.API_PROJECT_MISSION_ASSET_PATH_URL = exports.API_PROJECT_MISSION_ASSETS_PATH_URL = exports.API_PROJECT_FLOW_ASSET_PATH_URL = exports.API_PROJECT_ROBOT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATIONS_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PROVIDERS_PATH_URL = exports.API_PROJECT_ASSET_PROFILES_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_URL = exports.API_PROJECT_USERS_URL = exports.API_PROJECT_ID_URL = exports.API_PROJECT_URL = exports.API_ACCOUNT_EXTERNAL_PROJECTS_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_ID_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_URL = exports.API_ACCOUNT_PROJECT_USER_ID_URL = exports.API_ACCOUNT_PROJECT_USER_URL = exports.API_ACCOUNT_PROJECT_ID_URL = exports.API_ACCOUNT_PROJECT_URL = exports.API_SERVER_TIME_URL = exports.API_ACCOUNT_SETTINGS_URL = exports.API_AUTH_USER_ACCOUNT_USER_ID_URL = exports.API_AUTH_USER_ACCOUNT_USER_URL = exports.API_ACCOUNT_ACTIVATE_URL = exports.API_ACCOUNT_ID_URL = exports.API_ACCOUNT_URL = exports.API_USER_PAT_TOKEN_URL = exports.API_USER_PAT_URL = exports.API_USER_VERIFY_EMAIL_URL = exports.API_USER_INVITATION_CHECK_URL = exports.API_USER_INVITATION_ACCEPT_URL = exports.API_USER_INVITATION_URL = exports.API_USER_PASSWORD_FORGOT_URL = exports.API_OTP_AUTH_URL = exports.API_OTP_URL = exports.API_USER_TOKEN_URL = exports.API_USER_URL = exports.API_ADMIN_USER_INVITATION_URL = exports.API_APPLICATION_AUTH_URL = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.API_PROJECT_ROBOT_TAG_URL = exports.API_PROJECT_PROFILE_TAG_URL = exports.API_PROJECT_PROFILE_TAGS_URL = exports.API_PROJECT_TAG_ROBOTS_URL = exports.API_PROJECT_ROBOT_TAGS_URL = exports.API_DEVICE_CREDENTIALS_AUTH_URL = exports.API_DEVICE_CREDENTIALS_URL = exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_WORKFLOW_IMPORT_URL = exports.API_PROJECT_WORKFLOW_EXPORT_URL = exports.API_PROJECT_WORKFLOW_AFFECTED_URL = exports.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = exports.API_PROJECT_PROFILE_DEPLOYMENTS_URL = exports.API_PROJECT_ROBOT_DEPLOYMENTS_URL = exports.API_PROJECT_WORKFLOW_ASSET_ID_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = void 0;
|
|
4
|
+
exports.API_PROJECT_STREAM_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = exports.API_PROJECT_GROUP_TYPE_VERSION_URL = exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = exports.API_PROJECT_GROUP_TYPE_ID_URL = exports.API_PROJECT_GROUP_TYPE_URL = exports.API_PROJECT_ENVIRONMENT_URL = exports.API_PROJECT_DEFINITION_LIBRARY = exports.API_PROJECT_DEFINITION_IMPORT_LIBRARY = exports.API_PROJECT_DEFINITION_IMPORT = exports.API_PROJECT_DEFINITION_EXPORT = exports.API_PROJECT_DEFINITION_GAMEPAD_URL = exports.API_PROJECT_DEFINITION_TRIGGER_URL = exports.API_PROJECT_DEFINITION_BUTTON_URL = exports.API_PROJECT_DEFINITION_ACTION_URL = exports.API_PROJECT_DEFINITION_EVENT_URL = exports.API_PROJECT_DEFINITION_COMMAND2_URL = exports.API_PROJECT_DEFINITION_COMMAND_URL = exports.API_PROJECT_DEFINITION_AGENT_URL = exports.API_PROJECT_DEFINITION_SETTING_URL = exports.API_PROJECT_DEFINITION_BLOB_URL = exports.API_PROJECT_DEFINITION_DASHBOARD_URL = exports.API_PROJECT_DEFINITION_COPY_URL = exports.API_PROJECT_DEFINITION_STREAM_URL = exports.API_PROJECT_DEFINITION_ID_URL = exports.API_PROJECT_DEFINITION_URL = exports.API_PROJECT_VROBOT_DEPLOY_URL = exports.API_PROJECT_VROBOT_DETAILS_URL = exports.API_PROJECT_COLLECTION_DOCS_URL = exports.API_PROJECT_COLLECTION_ID_URL = exports.API_PROJECT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_DASHBOARD_WIDGET_URL = exports.API_PROJECT_DASHBOARD_ID_URL = exports.API_PROJECT_DASHBOARD_URL = exports.API_PROJECT_OPERATION_ID_URL = exports.API_PROJECT_OPERATION_URL = exports.API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = exports.API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = exports.API_SERVICE_CONNECTION_URL = exports.API_SERVICE_CONNECTIONS_URL = exports.API_PROJECT_ROBOT_GAMEPAD_URL = exports.API_PROJECT_ROBOT_TRIGGER_URL = exports.API_PROJECT_ROBOT_BUTTON_URL = exports.API_PROJECT_ROBOT_COMMAND2_URL = exports.API_PROJECT_ROBOT_COMMAND_URL = exports.API_PROJECT_ROBOT_AGENT_URL = exports.API_PROJECT_ROBOT_SETTING_URL = exports.API_PROJECT_ROBOT_EVENT_HISTORY_URL = void 0;
|
|
5
|
+
exports.API_GRAPHS_OBSERVATION_KEYS_URL = exports.API_GRAPHS_OBSERVATIONS_URL = exports.API_GRAPHS_PANORAMA_OBSERVATIONS_URL = exports.API_GRAPHS_PANORAMA = exports.API_GRAPHS_PANORAMAS_URL = exports.API_GRAPHS_MAPS_GEOJSON_URL = exports.API_GRAPHS_MAPS_DEPLOY_URL = exports.API_GRAPHS_MAPS_COPY_URL = exports.API_GRAPHS_MAP_PATH_APPEND_TRANSFORMABLE_URL = exports.API_GRAPHS_MAP_PATH_APPEND_URL = exports.API_GRAPHS_MAP_PATH_URL = exports.API_GRAPHS_MAP_PATHS_URL = exports.API_GRAPHS_MAP_EDGE_URL = exports.API_GRAPHS_MAP_EDGES_ADD_TRANSFORM_URL = exports.API_GRAPHS_MAP_EDGES_ADD_URL = exports.API_GRAPHS_MAP_NODE_URL = exports.API_GRAPHS_MAP_NODES_ADD_TRANSFORMABLE_URL = exports.API_GRAPHS_MAP_NODES_ADD_URL = exports.API_GRAPHS_MAP_METADATA_URL = exports.API_GRAPHS_MAP_CONTENT_URL = exports.API_GRAPHS_MAP_ID_URL = exports.API_GRAPHS_MAPS_MERGE_URL = exports.API_GRAPHS_MAPS_DEPLOYED_URL = exports.API_GRAPHS_MAPS_NEW_URL = exports.API_GRAPHS_MAPS_URL = exports.API_DD_INTEGRATION_LEVELS_URL = exports.API_DD_INTEGRATION_LOCATIONS_URL = exports.API_DD_INTEGRATION_ISSUES_URL = exports.API_DD_INTEGRATION_OVERLAYS_URL = exports.API_DD_INTEGRATION_PLAN_BY_ID_URL = exports.API_DD_INTEGRATION_PLANS_URL = exports.API_SPOTTY_URL = exports.API_PROJECT_SCHEDULES_URL = exports.API_SOURCE_ID_URL = exports.API_SOURCE_URL = exports.API_SOURCE_SCHEMA_URL = exports.API_TEMPLATE_EXPORTER_URL = exports.API_TEMPLATE_PROVISION_ID_URL = exports.API_TEMPLATE_PROVISION_URL = exports.API_TEMPLATE_DEPLOY_URL = exports.API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_PROFILE_DASHBOARD_ID_URL = exports.API_PROJECT_PROFILE_DASHBOARD_URL = exports.API_PROJECT_CALLSIGN_STREAM_URL = exports.API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_ROBOT_DASHBOARD_ID_URL = exports.API_PROJECT_ROBOT_DASHBOARD_URL = exports.API_PROJECT_STREAM_CALLSIGN_URL = exports.API_PROJECT_STREAM_DATA_URL = exports.API_PROJECT_STREAM_ID_URL = void 0;
|
|
6
|
+
exports.API_PROJECT_ROBOT_TAG_URL = exports.API_PROJECT_PROFILE_TAG_URL = exports.API_PROJECT_PROFILE_TAGS_URL = exports.API_PROJECT_TAG_ROBOTS_URL = exports.API_PROJECT_ROBOT_TAGS_URL = exports.API_DEVICE_CREDENTIALS_AUTH_URL = exports.API_DEVICE_CREDENTIALS_URL = exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_WORKFLOW_IMPORT_URL = exports.API_PROJECT_WORKFLOW_EXPORT_URL = exports.API_PROJECT_WORKFLOW_AFFECTED_URL = exports.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = exports.API_PROJECT_PROFILE_DEPLOYMENTS_URL = exports.API_PROJECT_ROBOT_DEPLOYMENTS_URL = exports.API_PROJECT_WORKFLOW_ASSET_ID_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_GRAPHS_ASSETS_URL = exports.API_GRAPHS_ASSETS_UPLOAD_URL = exports.API_GRAPHS_TARGETS_URL = exports.API_GRAPHS_TARGET_UPLOAD_URL = void 0;
|
|
7
7
|
exports.API_APPLICATION_AUTH_URL = 'https://{url}/applications/auth';
|
|
8
8
|
exports.API_ADMIN_USER_INVITATION_URL = 'https://{url}/admin/users/invitations';
|
|
9
9
|
exports.API_USER_URL = 'https://{url}/users';
|
|
@@ -62,8 +62,12 @@ exports.API_PROJECT_ROBOT_COMMAND2_URL = 'https://{url}/projects/{projectId}/rob
|
|
|
62
62
|
exports.API_PROJECT_ROBOT_BUTTON_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/buttons';
|
|
63
63
|
exports.API_PROJECT_ROBOT_TRIGGER_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/triggers';
|
|
64
64
|
exports.API_PROJECT_ROBOT_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/gamepads';
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// Generic connections endpoint templates. `{service}` is the service's public path prefix
|
|
66
|
+
// (e.g. robot-configs, robot-services); the per-service specialisations below derive from these.
|
|
67
|
+
exports.API_SERVICE_CONNECTIONS_URL = 'https://{url}/{service}/connections/projects/{projectId}';
|
|
68
|
+
exports.API_SERVICE_CONNECTION_URL = 'https://{url}/{service}/connections/projects/{projectId}/callsigns/{callsign}';
|
|
69
|
+
exports.API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = exports.API_SERVICE_CONNECTIONS_URL.replace('{service}', 'robot-configs');
|
|
70
|
+
exports.API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = exports.API_SERVICE_CONNECTION_URL.replace('{service}', 'robot-configs');
|
|
67
71
|
exports.API_PROJECT_OPERATION_URL = 'https://{url}/projects/{projectId}/operations';
|
|
68
72
|
exports.API_PROJECT_OPERATION_ID_URL = 'https://{url}/projects/{projectId}/operations/{operationId}';
|
|
69
73
|
exports.API_PROJECT_DASHBOARD_URL = 'https://{url}/projects/{projectId}/dashboards';
|
|
@@ -140,6 +144,10 @@ exports.API_GRAPHS_MAP_NODE_URL = 'https://{url}/graphs/projects/{projectId}/map
|
|
|
140
144
|
exports.API_GRAPHS_MAP_EDGES_ADD_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/edges/add';
|
|
141
145
|
exports.API_GRAPHS_MAP_EDGES_ADD_TRANSFORM_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/edges/add/transform';
|
|
142
146
|
exports.API_GRAPHS_MAP_EDGE_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/edges/{edgeId}';
|
|
147
|
+
exports.API_GRAPHS_MAP_PATHS_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths';
|
|
148
|
+
exports.API_GRAPHS_MAP_PATH_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}';
|
|
149
|
+
exports.API_GRAPHS_MAP_PATH_APPEND_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}/append';
|
|
150
|
+
exports.API_GRAPHS_MAP_PATH_APPEND_TRANSFORMABLE_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}/append/transformable';
|
|
143
151
|
exports.API_GRAPHS_MAPS_COPY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy';
|
|
144
152
|
exports.API_GRAPHS_MAPS_DEPLOY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy';
|
|
145
153
|
exports.API_GRAPHS_MAPS_GEOJSON_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson';
|
package/cjs/models/RocosError.js
CHANGED
|
@@ -31,6 +31,7 @@ exports.errorCodes = {
|
|
|
31
31
|
TARGET_SERVICE_ERROR: 'TARGET_SERVICE_ERROR',
|
|
32
32
|
ENVIRONMENT_SERVICE_ERROR: 'ENVIRONMENT_SERVICE_ERROR',
|
|
33
33
|
TAG_SERVICE_ERROR: 'TAG_SERVICE_ERROR',
|
|
34
|
+
ROBOT_STATUS_SERVICE_ERROR: 'ROBOT_STATUS_SERVICE_ERROR',
|
|
34
35
|
};
|
|
35
36
|
class RocosError extends Error {
|
|
36
37
|
constructor(err, code, statusCode) {
|
|
@@ -21,6 +21,7 @@ var ServiceEnum;
|
|
|
21
21
|
ServiceEnum["PROJECT"] = "project";
|
|
22
22
|
ServiceEnum["PROFILE"] = "profile";
|
|
23
23
|
ServiceEnum["ROBOT"] = "robot";
|
|
24
|
+
ServiceEnum["ROBOT_STATUS"] = "robot_status";
|
|
24
25
|
ServiceEnum["RTP_WEBRTC"] = "rtp_webrtc";
|
|
25
26
|
ServiceEnum["SCHEDULE"] = "schedule";
|
|
26
27
|
ServiceEnum["SEARCH"] = "search";
|
package/cjs/models/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export * from './maps/Map';
|
|
|
51
51
|
export * from './maps/MapContent';
|
|
52
52
|
export * from './maps/MapEdge';
|
|
53
53
|
export * from './maps/MapNode';
|
|
54
|
+
export * from './maps/MapPath';
|
|
54
55
|
export * from './maps/Panorama';
|
|
55
56
|
export * from './message';
|
|
56
57
|
export * from './params/ICallerParams';
|
package/cjs/models/index.js
CHANGED
|
@@ -67,6 +67,7 @@ __exportStar(require("./maps/Map"), exports);
|
|
|
67
67
|
__exportStar(require("./maps/MapContent"), exports);
|
|
68
68
|
__exportStar(require("./maps/MapEdge"), exports);
|
|
69
69
|
__exportStar(require("./maps/MapNode"), exports);
|
|
70
|
+
__exportStar(require("./maps/MapPath"), exports);
|
|
70
71
|
__exportStar(require("./maps/Panorama"), exports);
|
|
71
72
|
__exportStar(require("./message"), exports);
|
|
72
73
|
__exportStar(require("./params/ICallerParams"), exports);
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Quaternion, Vector3 } from '../graph';
|
|
2
|
+
import { MapContentNode } from './MapContent';
|
|
3
|
+
/**
|
|
4
|
+
* A path (polyline or polygon) in a robot map, as returned by
|
|
5
|
+
* `GET /graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}` — the same shape the
|
|
6
|
+
* rocos-agent map component's `paths/get` service reports.
|
|
7
|
+
*
|
|
8
|
+
* A path is stored as a sub-graph following the `go-common/graph/paths` convention: a parent
|
|
9
|
+
* node (type `path.parent.v1`, or any existing node acting as anchor) plus one member node
|
|
10
|
+
* per vertex, wired by `path.start.v1` / `path.belongs.v1` / `path.edge.v1` edges. The path
|
|
11
|
+
* id IS the parent node id.
|
|
12
|
+
*/
|
|
13
|
+
export interface MapPath {
|
|
14
|
+
/** The path id (= parent node id). */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Whether the path is a closed polygon (true) or an open polyline (false). */
|
|
17
|
+
closed: boolean;
|
|
18
|
+
/** The full parent node. */
|
|
19
|
+
parent: MapContentNode;
|
|
20
|
+
/** Ordered member (vertex) node ids, walked start → end. */
|
|
21
|
+
members: string[];
|
|
22
|
+
}
|
|
23
|
+
/** Filters for `MapService.listPaths`. */
|
|
24
|
+
export interface ListPathsFilter {
|
|
25
|
+
/** Only include paths with this closed flag (omit for both). */
|
|
26
|
+
closed?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Only include paths whose parent node type is in this list (omit for all).
|
|
29
|
+
*
|
|
30
|
+
* Wire-format caveat: the server takes this as a single comma-separated query parameter
|
|
31
|
+
* (`?types=a,b`), so a node type that itself contains a comma cannot be expressed — it
|
|
32
|
+
* would be split into two wrong filter terms and silently match nothing. Node types are
|
|
33
|
+
* free-form text server-side, so this is conceivable if unlikely; avoid commas in type
|
|
34
|
+
* names, or filter client-side over `listPaths` + `getPath` results if you must.
|
|
35
|
+
*/
|
|
36
|
+
types?: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Body of `POST /graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}/append`. Appends
|
|
40
|
+
* already-existing member nodes to a path, creating the path (and its `path.parent.v1`
|
|
41
|
+
* parent node) when absent — an existing node of any client-writable type is reused as the
|
|
42
|
+
* anchor instead.
|
|
43
|
+
*
|
|
44
|
+
* Members must already exist in the map (400 otherwise). `closed` is only applied while the
|
|
45
|
+
* path is empty; supplying a value that conflicts with a non-empty path's stored flag is
|
|
46
|
+
* rejected with 409 (use {@link MapService.replacePath} to change closed-ness). `data` keys
|
|
47
|
+
* are merged onto the parent node.
|
|
48
|
+
*/
|
|
49
|
+
export interface AppendToPathRequest {
|
|
50
|
+
closed?: boolean;
|
|
51
|
+
data?: Record<string, unknown>;
|
|
52
|
+
members: string[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A rigid-body transform positioning one path vertex relative to the frame named in the
|
|
56
|
+
* enclosing request. `rot` is optional and defaults to identity — path vertices are
|
|
57
|
+
* typically plain positions. Field naming matches {@link AffineTransform} (`pos`/`rot`);
|
|
58
|
+
* the service marshals onto the server's `translation`/`rotation` wire shape.
|
|
59
|
+
*/
|
|
60
|
+
export interface PathPointTransform {
|
|
61
|
+
rot?: Quaternion;
|
|
62
|
+
pos: Vector3;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* One vertex in a path payload. `id` is optional; when blank the server mints a UUID.
|
|
66
|
+
*
|
|
67
|
+
* `transform` is required by the append endpoint (which only creates vertices). In a path
|
|
68
|
+
* replace its presence carries the intent: supplied means the position is declarative (the
|
|
69
|
+
* vertex is created or — when the path exclusively owns the node — recreated at that
|
|
70
|
+
* position, which is how vertices are moved), while omitted means "reuse the existing node
|
|
71
|
+
* in place, position untouched".
|
|
72
|
+
*/
|
|
73
|
+
export interface PathPoint {
|
|
74
|
+
id?: string;
|
|
75
|
+
data?: Record<string, unknown>;
|
|
76
|
+
transform?: PathPointTransform;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A {@link PathPoint} whose transform is mandatory, for the append/transformable body —
|
|
80
|
+
* that endpoint only creates vertices, so every point needs a position. Requiring it at the
|
|
81
|
+
* type level moves the server's 400 for a transform-less point to compile time.
|
|
82
|
+
*/
|
|
83
|
+
export interface TransformablePathPoint extends PathPoint {
|
|
84
|
+
transform: PathPointTransform;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Body of `POST /graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}/append/transformable`.
|
|
88
|
+
* For each point it creates a node (`nodeType`, default `FRAME`) positioned by a `TRANSFORM`
|
|
89
|
+
* edge from the existing `frame` node, and appends them all to the path in one transaction —
|
|
90
|
+
* the cloud analog of the rocos-agent's `paths/append/currentPosition`, with the caller
|
|
91
|
+
* supplying positions instead of the robot's live pose.
|
|
92
|
+
*
|
|
93
|
+
* Every point must carry a `transform` (enforced by {@link TransformablePathPoint}; the
|
|
94
|
+
* server also rejects a transform-less point with 400 — append only creates vertices; use
|
|
95
|
+
* {@link MapService.appendToPath} to append existing nodes). Node creation is create-only: a
|
|
96
|
+
* point id that already exists in the map is rejected with 409 and the whole append rolls
|
|
97
|
+
* back. `closed` and `data` behave as in {@link AppendToPathRequest}.
|
|
98
|
+
*/
|
|
99
|
+
export interface AppendTransformablePointsRequest {
|
|
100
|
+
closed?: boolean;
|
|
101
|
+
data?: Record<string, unknown>;
|
|
102
|
+
frame: string;
|
|
103
|
+
nodeType?: string;
|
|
104
|
+
points: TransformablePathPoint[];
|
|
105
|
+
}
|
|
106
|
+
/** Response of the append/transformable endpoint: the created vertex ids, in path order. */
|
|
107
|
+
export interface AppendPathPointsResponse {
|
|
108
|
+
ids: string[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Body of `PUT /graphs/projects/{projectId}/maps/{mapId}/paths/{pathId}` — the editor
|
|
112
|
+
* primitive. Declares the path's entire desired state; vertex move/insert/delete/reorder
|
|
113
|
+
* and closed-flag changes all reach the server as one idempotent call.
|
|
114
|
+
*
|
|
115
|
+
* The existing structure is torn down (old vertices exclusively owned by the path are
|
|
116
|
+
* deleted; shared members are detached, never moved or deleted; the parent node always
|
|
117
|
+
* survives) and rebuilt from `points`. Each point's `transform` carries its intent:
|
|
118
|
+
*
|
|
119
|
+
* - **With a transform** the position is declarative: the vertex is created (as `nodeType`,
|
|
120
|
+
* default `FRAME`, positioned by a `TRANSFORM` edge from `frame`), and for the path's own
|
|
121
|
+
* vertices same id + new transform = a move. A transform on a node the path doesn't
|
|
122
|
+
* exclusively own is rejected with 409.
|
|
123
|
+
* - **Without a transform** the point reuses an existing node in place, position untouched
|
|
124
|
+
* (400 if it doesn't exist) — how shared waypoints stay in the path.
|
|
125
|
+
*
|
|
126
|
+
* `parentType` applies when the parent node is created (default `path.parent.v1`); against
|
|
127
|
+
* an existing parent it must match (409) or be omitted (reused as-is, the anchored-path
|
|
128
|
+
* model). Replacing can also repair a structurally malformed path (which `getPath` reports
|
|
129
|
+
* as 422). Repeated identical PUTs are hash-stable: the server skips the map-timestamp bump
|
|
130
|
+
* and SUMMARY rewrite when the result matches what is stored.
|
|
131
|
+
*
|
|
132
|
+
* Access rules match {@link MapService.deletePath} (replace deletes vertices): the
|
|
133
|
+
* environment map is off-limits, the dronedeploy map is admin-only, normal maps are open to
|
|
134
|
+
* any caller with project access.
|
|
135
|
+
*/
|
|
136
|
+
export interface ReplacePathRequest {
|
|
137
|
+
closed: boolean;
|
|
138
|
+
parentType?: string;
|
|
139
|
+
nodeType?: string;
|
|
140
|
+
data?: Record<string, unknown>;
|
|
141
|
+
frame?: string;
|
|
142
|
+
points: PathPoint[];
|
|
143
|
+
}
|
|
@@ -45,7 +45,7 @@ export declare enum ServiceConnection {
|
|
|
45
45
|
* expected services.
|
|
46
46
|
*/
|
|
47
47
|
export declare enum RobotConnectivity {
|
|
48
|
-
/**
|
|
48
|
+
/** At least one expected service is connected and none is disconnected. */
|
|
49
49
|
ONLINE = "online",
|
|
50
50
|
/** Some, but not all, expected services report connected. */
|
|
51
51
|
DEGRADED = "degraded",
|
|
@@ -52,7 +52,7 @@ var ServiceConnection;
|
|
|
52
52
|
*/
|
|
53
53
|
var RobotConnectivity;
|
|
54
54
|
(function (RobotConnectivity) {
|
|
55
|
-
/**
|
|
55
|
+
/** At least one expected service is connected and none is disconnected. */
|
|
56
56
|
RobotConnectivity["ONLINE"] = "online";
|
|
57
57
|
/** Some, but not all, expected services report connected. */
|
|
58
58
|
RobotConnectivity["DEGRADED"] = "degraded";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AddEdgeRequest, AddEdgeResponse, AddTransformEdgeRequest } from '../models/maps/MapEdge';
|
|
2
2
|
import { AddNodeRequest, AddNodeResponse, AddTransformableNodeRequest } from '../models/maps/MapNode';
|
|
3
3
|
import { AddPanoramaRequest, AddPanoramaResponse, CreateObservation, Observation } from '../models/maps/Panorama';
|
|
4
|
+
import { AppendPathPointsResponse, AppendToPathRequest, AppendTransformablePointsRequest, ListPathsFilter, MapPath, ReplacePathRequest } from '../models/maps/MapPath';
|
|
4
5
|
import { Asset, IBaseService, IRocosSDKConfig, Map, MapContent, RocosError } from '../models';
|
|
5
6
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
6
7
|
/**
|
|
@@ -334,4 +335,104 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
|
|
|
334
335
|
* @param edgeId The ID of the edge to delete.
|
|
335
336
|
*/
|
|
336
337
|
deleteEdge(projectId: string, mapId: string, edgeId: string): Promise<void>;
|
|
338
|
+
/**
|
|
339
|
+
* List the paths (polylines/polygons) in a map. A path is a sub-graph following the
|
|
340
|
+
* `go-common/graph/paths` convention shared with the rocos-agent's map component; this
|
|
341
|
+
* mirrors the agent's `paths/list` service, returning the parent node ids of every path
|
|
342
|
+
* that survives the filters.
|
|
343
|
+
*
|
|
344
|
+
* @param projectId The ID of the project the map belongs to.
|
|
345
|
+
* @param mapId The ID of the map to list paths from.
|
|
346
|
+
* @param filter Optional closed-flag and parent-node-type filters. The type filter goes
|
|
347
|
+
* over the wire as one comma-separated query parameter, so types containing a comma
|
|
348
|
+
* cannot be expressed (see {@link ListPathsFilter.types}).
|
|
349
|
+
* @returns The path ids (= parent node ids), sorted.
|
|
350
|
+
*/
|
|
351
|
+
listPaths(projectId: string, mapId: string, filter?: ListPathsFilter): Promise<string[]>;
|
|
352
|
+
/**
|
|
353
|
+
* Get one path: its closed flag, full parent node, and ordered member node ids — the same
|
|
354
|
+
* shape as the agent's `paths/get` response. An existing node with no path structure is
|
|
355
|
+
* reported as an empty open path; a missing node is 404; stored structure violating the
|
|
356
|
+
* path convention (e.g. multiple start edges) is 422 (repair it with {@link replacePath}).
|
|
357
|
+
*
|
|
358
|
+
* @param projectId The ID of the project the map belongs to.
|
|
359
|
+
* @param mapId The ID of the map the path lives in.
|
|
360
|
+
* @param pathId The path id (= parent node id).
|
|
361
|
+
*/
|
|
362
|
+
getPath(projectId: string, mapId: string, pathId: string): Promise<MapPath>;
|
|
363
|
+
/**
|
|
364
|
+
* Append already-existing member nodes to a path, creating the path when absent —
|
|
365
|
+
* mirroring the agent's `paths/append`. Members must already exist (400 otherwise);
|
|
366
|
+
* `path.index` numbering continues from the existing member count. A `closed` value
|
|
367
|
+
* conflicting with a non-empty path's stored flag is rejected with 409 (unlike the agent,
|
|
368
|
+
* which silently ignores it) — change closed-ness with {@link replacePath}.
|
|
369
|
+
*
|
|
370
|
+
* @param projectId The ID of the project the map belongs to.
|
|
371
|
+
* @param mapId The ID of the map the path lives in.
|
|
372
|
+
* @param pathId The path id (= parent node id).
|
|
373
|
+
* @param body The members to append, plus optional closed flag and parent data.
|
|
374
|
+
*/
|
|
375
|
+
appendToPath(projectId: string, mapId: string, pathId: string, body: AppendToPathRequest): Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* Create one positioned vertex node per point and append them all to a path in one
|
|
378
|
+
* transaction — the cloud analog of the agent's `paths/append/currentPosition`, with the
|
|
379
|
+
* caller supplying positions instead of the robot's live pose. Every point must carry a
|
|
380
|
+
* transform (append only creates; use {@link appendToPath} for existing nodes); a point id
|
|
381
|
+
* that already exists is a 409 and the whole append rolls back.
|
|
382
|
+
*
|
|
383
|
+
* Wire-shape note: the server receives each point's transform as
|
|
384
|
+
* `{ rotation, translation }`. This method marshals the caller-facing `rot`/`pos`
|
|
385
|
+
* (matching the node/panorama transform naming) onto that shape before POSTing.
|
|
386
|
+
*
|
|
387
|
+
* @param projectId The ID of the project the map belongs to.
|
|
388
|
+
* @param mapId The ID of the map the path lives in.
|
|
389
|
+
* @param pathId The path id (= parent node id).
|
|
390
|
+
* @param body The frame, points, and optional node type / closed flag / parent data.
|
|
391
|
+
* @returns The created vertex node ids, in path order (server-minted UUIDs for blank ids).
|
|
392
|
+
*/
|
|
393
|
+
appendTransformablePointsToPath(projectId: string, mapId: string, pathId: string, body: AppendTransformablePointsRequest): Promise<AppendPathPointsResponse>;
|
|
394
|
+
/**
|
|
395
|
+
* Replace a path's entire structure in one idempotent call — the editor primitive for
|
|
396
|
+
* vertex move/insert/delete/reorder and closed-flag changes. See {@link ReplacePathRequest}
|
|
397
|
+
* for the full semantics; the essentials:
|
|
398
|
+
*
|
|
399
|
+
* - A point WITH a transform declares its position; for the path's own vertices, same id +
|
|
400
|
+
* new transform = a move. A transform on a node the path doesn't exclusively own is 409.
|
|
401
|
+
* - A point WITHOUT a transform reuses an existing node in place (400 if missing).
|
|
402
|
+
* - Old vertices exclusively owned by the path and not re-referenced are deleted; shared
|
|
403
|
+
* members are detached, never moved or deleted.
|
|
404
|
+
* - `parentType` must match an existing parent (409) or be omitted; it applies on create.
|
|
405
|
+
*
|
|
406
|
+
* @param projectId The ID of the project the map belongs to.
|
|
407
|
+
* @param mapId The ID of the map the path lives in.
|
|
408
|
+
* @param pathId The path id (= parent node id).
|
|
409
|
+
* @param body The path's desired state.
|
|
410
|
+
*/
|
|
411
|
+
replacePath(projectId: string, mapId: string, pathId: string, body: ReplacePathRequest): Promise<void>;
|
|
412
|
+
/**
|
|
413
|
+
* Delete a path's structure, mirroring the agent's `paths/delete`: idempotent (a missing
|
|
414
|
+
* path still returns success), member nodes preserved by default, and the parent node
|
|
415
|
+
* itself deleted only when it is a pure `path.parent.v1` (an anchored path keeps its
|
|
416
|
+
* anchor node, minus the path edges).
|
|
417
|
+
*
|
|
418
|
+
* With `deleteMembers`, member nodes exclusively owned by the path (no remaining edges
|
|
419
|
+
* beyond their positioning `TRANSFORM`) are also removed; anything referenced elsewhere
|
|
420
|
+
* survives. Access rules match {@link deleteNode}: environment off-limits, dronedeploy
|
|
421
|
+
* admin-only, normal maps open to any caller with project access.
|
|
422
|
+
*
|
|
423
|
+
* @param projectId The ID of the project the map belongs to.
|
|
424
|
+
* @param mapId The ID of the map the path lives in.
|
|
425
|
+
* @param pathId The path id (= parent node id).
|
|
426
|
+
* @param opts Set `deleteMembers` to also remove exclusively-owned vertex nodes.
|
|
427
|
+
*/
|
|
428
|
+
deletePath(projectId: string, mapId: string, pathId: string, opts?: {
|
|
429
|
+
deleteMembers?: boolean;
|
|
430
|
+
}): Promise<void>;
|
|
431
|
+
/**
|
|
432
|
+
* Marshal a caller-facing {@link PathPoint} onto the server's wire shape: `rot`/`pos`
|
|
433
|
+
* become `rotation`/`translation`, and an absent transform stays absent (its presence
|
|
434
|
+
* carries intent in a replace). A missing `rot` is left for the server to default to
|
|
435
|
+
* identity.
|
|
436
|
+
*/
|
|
437
|
+
private pathPointToWire;
|
|
337
438
|
}
|
|
@@ -454,5 +454,145 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
454
454
|
deleteEdge(projectId, mapId, edgeId) {
|
|
455
455
|
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_EDGE_URL, { url: this.config.url, projectId, mapId, edgeId }, this.config.insecure), 'Failed to delete edge.');
|
|
456
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* List the paths (polylines/polygons) in a map. A path is a sub-graph following the
|
|
459
|
+
* `go-common/graph/paths` convention shared with the rocos-agent's map component; this
|
|
460
|
+
* mirrors the agent's `paths/list` service, returning the parent node ids of every path
|
|
461
|
+
* that survives the filters.
|
|
462
|
+
*
|
|
463
|
+
* @param projectId The ID of the project the map belongs to.
|
|
464
|
+
* @param mapId The ID of the map to list paths from.
|
|
465
|
+
* @param filter Optional closed-flag and parent-node-type filters. The type filter goes
|
|
466
|
+
* over the wire as one comma-separated query parameter, so types containing a comma
|
|
467
|
+
* cannot be expressed (see {@link ListPathsFilter.types}).
|
|
468
|
+
* @returns The path ids (= parent node ids), sorted.
|
|
469
|
+
*/
|
|
470
|
+
async listPaths(projectId, mapId, filter) {
|
|
471
|
+
const queryParams = {};
|
|
472
|
+
if (filter?.closed !== undefined)
|
|
473
|
+
queryParams.closed = filter.closed.toString();
|
|
474
|
+
if (filter?.types?.length)
|
|
475
|
+
queryParams.types = filter.types.join(',');
|
|
476
|
+
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_PATHS_URL, { url: this.config.url, projectId, mapId }, this.config.insecure), 'Failed to list paths.', queryParams);
|
|
477
|
+
return resp.paths;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Get one path: its closed flag, full parent node, and ordered member node ids — the same
|
|
481
|
+
* shape as the agent's `paths/get` response. An existing node with no path structure is
|
|
482
|
+
* reported as an empty open path; a missing node is 404; stored structure violating the
|
|
483
|
+
* path convention (e.g. multiple start edges) is 422 (repair it with {@link replacePath}).
|
|
484
|
+
*
|
|
485
|
+
* @param projectId The ID of the project the map belongs to.
|
|
486
|
+
* @param mapId The ID of the map the path lives in.
|
|
487
|
+
* @param pathId The path id (= parent node id).
|
|
488
|
+
*/
|
|
489
|
+
getPath(projectId, mapId, pathId) {
|
|
490
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_PATH_URL, { url: this.config.url, projectId, mapId, pathId }, this.config.insecure), 'Failed to get path.');
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Append already-existing member nodes to a path, creating the path when absent —
|
|
494
|
+
* mirroring the agent's `paths/append`. Members must already exist (400 otherwise);
|
|
495
|
+
* `path.index` numbering continues from the existing member count. A `closed` value
|
|
496
|
+
* conflicting with a non-empty path's stored flag is rejected with 409 (unlike the agent,
|
|
497
|
+
* which silently ignores it) — change closed-ness with {@link replacePath}.
|
|
498
|
+
*
|
|
499
|
+
* @param projectId The ID of the project the map belongs to.
|
|
500
|
+
* @param mapId The ID of the map the path lives in.
|
|
501
|
+
* @param pathId The path id (= parent node id).
|
|
502
|
+
* @param body The members to append, plus optional closed flag and parent data.
|
|
503
|
+
*/
|
|
504
|
+
async appendToPath(projectId, mapId, pathId, body) {
|
|
505
|
+
await this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_PATH_APPEND_URL, { url: this.config.url, projectId, mapId, pathId }, this.config.insecure), body, 'Failed to append to path.');
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Create one positioned vertex node per point and append them all to a path in one
|
|
509
|
+
* transaction — the cloud analog of the agent's `paths/append/currentPosition`, with the
|
|
510
|
+
* caller supplying positions instead of the robot's live pose. Every point must carry a
|
|
511
|
+
* transform (append only creates; use {@link appendToPath} for existing nodes); a point id
|
|
512
|
+
* that already exists is a 409 and the whole append rolls back.
|
|
513
|
+
*
|
|
514
|
+
* Wire-shape note: the server receives each point's transform as
|
|
515
|
+
* `{ rotation, translation }`. This method marshals the caller-facing `rot`/`pos`
|
|
516
|
+
* (matching the node/panorama transform naming) onto that shape before POSTing.
|
|
517
|
+
*
|
|
518
|
+
* @param projectId The ID of the project the map belongs to.
|
|
519
|
+
* @param mapId The ID of the map the path lives in.
|
|
520
|
+
* @param pathId The path id (= parent node id).
|
|
521
|
+
* @param body The frame, points, and optional node type / closed flag / parent data.
|
|
522
|
+
* @returns The created vertex node ids, in path order (server-minted UUIDs for blank ids).
|
|
523
|
+
*/
|
|
524
|
+
appendTransformablePointsToPath(projectId, mapId, pathId, body) {
|
|
525
|
+
const wireBody = {
|
|
526
|
+
closed: body.closed,
|
|
527
|
+
data: body.data,
|
|
528
|
+
frame: body.frame,
|
|
529
|
+
nodeType: body.nodeType,
|
|
530
|
+
points: body.points.map((p) => this.pathPointToWire(p)),
|
|
531
|
+
};
|
|
532
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_PATH_APPEND_TRANSFORMABLE_URL, { url: this.config.url, projectId, mapId, pathId }, this.config.insecure), wireBody, 'Failed to append points to path.');
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Replace a path's entire structure in one idempotent call — the editor primitive for
|
|
536
|
+
* vertex move/insert/delete/reorder and closed-flag changes. See {@link ReplacePathRequest}
|
|
537
|
+
* for the full semantics; the essentials:
|
|
538
|
+
*
|
|
539
|
+
* - A point WITH a transform declares its position; for the path's own vertices, same id +
|
|
540
|
+
* new transform = a move. A transform on a node the path doesn't exclusively own is 409.
|
|
541
|
+
* - A point WITHOUT a transform reuses an existing node in place (400 if missing).
|
|
542
|
+
* - Old vertices exclusively owned by the path and not re-referenced are deleted; shared
|
|
543
|
+
* members are detached, never moved or deleted.
|
|
544
|
+
* - `parentType` must match an existing parent (409) or be omitted; it applies on create.
|
|
545
|
+
*
|
|
546
|
+
* @param projectId The ID of the project the map belongs to.
|
|
547
|
+
* @param mapId The ID of the map the path lives in.
|
|
548
|
+
* @param pathId The path id (= parent node id).
|
|
549
|
+
* @param body The path's desired state.
|
|
550
|
+
*/
|
|
551
|
+
async replacePath(projectId, mapId, pathId, body) {
|
|
552
|
+
const wireBody = {
|
|
553
|
+
closed: body.closed,
|
|
554
|
+
parentType: body.parentType,
|
|
555
|
+
nodeType: body.nodeType,
|
|
556
|
+
data: body.data,
|
|
557
|
+
frame: body.frame,
|
|
558
|
+
points: body.points.map((p) => this.pathPointToWire(p)),
|
|
559
|
+
};
|
|
560
|
+
await this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_PATH_URL, { url: this.config.url, projectId, mapId, pathId }, this.config.insecure), wireBody, 'Failed to replace path.');
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Delete a path's structure, mirroring the agent's `paths/delete`: idempotent (a missing
|
|
564
|
+
* path still returns success), member nodes preserved by default, and the parent node
|
|
565
|
+
* itself deleted only when it is a pure `path.parent.v1` (an anchored path keeps its
|
|
566
|
+
* anchor node, minus the path edges).
|
|
567
|
+
*
|
|
568
|
+
* With `deleteMembers`, member nodes exclusively owned by the path (no remaining edges
|
|
569
|
+
* beyond their positioning `TRANSFORM`) are also removed; anything referenced elsewhere
|
|
570
|
+
* survives. Access rules match {@link deleteNode}: environment off-limits, dronedeploy
|
|
571
|
+
* admin-only, normal maps open to any caller with project access.
|
|
572
|
+
*
|
|
573
|
+
* @param projectId The ID of the project the map belongs to.
|
|
574
|
+
* @param mapId The ID of the map the path lives in.
|
|
575
|
+
* @param pathId The path id (= parent node id).
|
|
576
|
+
* @param opts Set `deleteMembers` to also remove exclusively-owned vertex nodes.
|
|
577
|
+
*/
|
|
578
|
+
deletePath(projectId, mapId, pathId, opts) {
|
|
579
|
+
let url = (0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_PATH_URL, { url: this.config.url, projectId, mapId, pathId }, this.config.insecure);
|
|
580
|
+
if (opts?.deleteMembers)
|
|
581
|
+
url += '?deleteMembers=true';
|
|
582
|
+
return this.callDelete(url, 'Failed to delete path.');
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Marshal a caller-facing {@link PathPoint} onto the server's wire shape: `rot`/`pos`
|
|
586
|
+
* become `rotation`/`translation`, and an absent transform stays absent (its presence
|
|
587
|
+
* carries intent in a replace). A missing `rot` is left for the server to default to
|
|
588
|
+
* identity.
|
|
589
|
+
*/
|
|
590
|
+
pathPointToWire(p) {
|
|
591
|
+
return {
|
|
592
|
+
id: p.id,
|
|
593
|
+
data: p.data,
|
|
594
|
+
transform: p.transform ? { rotation: p.transform.rot, translation: p.transform.pos } : undefined,
|
|
595
|
+
};
|
|
596
|
+
}
|
|
457
597
|
}
|
|
458
598
|
exports.MapService = MapService;
|