@dronedeploy/rocos-js-sdk 3.0.29 → 3.0.30
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/constants/api.d.ts +1 -0
- package/cjs/constants/api.js +3 -2
- package/cjs/services/MapService.d.ts +25 -4
- package/cjs/services/MapService.js +26 -3
- package/esm/constants/api.d.ts +1 -0
- package/esm/constants/api.js +1 -0
- package/esm/services/MapService.d.ts +25 -4
- package/esm/services/MapService.js +27 -4
- package/package.json +1 -1
package/cjs/constants/api.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export declare const API_DD_INTEGRATION_ISSUES_URL = "https://{url}/projects/{pr
|
|
|
122
122
|
export declare const API_DD_INTEGRATION_LOCATIONS_URL = "https://{url}/projects/{projectId}/dd/locations";
|
|
123
123
|
export declare const API_DD_INTEGRATION_LEVELS_URL = "https://{url}/projects/{projectId}/dd/levels";
|
|
124
124
|
export declare const API_GRAPHS_MAPS_URL = "https://{url}/graphs/projects/{projectId}/maps";
|
|
125
|
+
export declare const API_GRAPHS_MAPS_NEW_URL = "https://{url}/graphs/projects/{projectId}/maps/new";
|
|
125
126
|
export declare const API_GRAPHS_MAPS_DEPLOYED_URL = "https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}";
|
|
126
127
|
export declare const API_GRAPHS_MAPS_MERGE_URL = "https://{url}/graphs/projects/{projectId}/maps/merge";
|
|
127
128
|
export declare const API_GRAPHS_MAP_ID_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}";
|
package/cjs/constants/api.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
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
4
|
exports.API_PROJECT_STREAM_DATA_URL = exports.API_PROJECT_STREAM_ID_URL = 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_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.
|
|
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 = void 0;
|
|
5
|
+
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 = exports.API_GRAPHS_OBSERVATION_KEYS_URL = exports.API_GRAPHS_OBSERVATIONS_URL = exports.API_GRAPHS_PANORAMA_OBSERVATIONS_URL = exports.API_GRAPHS_PANORAMA = exports.API_GRAPHS_MAPS_GEOJSON_URL = exports.API_GRAPHS_MAPS_DEPLOY_URL = exports.API_GRAPHS_MAPS_COPY_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 = 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 = 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';
|
|
@@ -128,6 +128,7 @@ exports.API_DD_INTEGRATION_ISSUES_URL = 'https://{url}/projects/{projectId}/dd/i
|
|
|
128
128
|
exports.API_DD_INTEGRATION_LOCATIONS_URL = 'https://{url}/projects/{projectId}/dd/locations';
|
|
129
129
|
exports.API_DD_INTEGRATION_LEVELS_URL = 'https://{url}/projects/{projectId}/dd/levels';
|
|
130
130
|
exports.API_GRAPHS_MAPS_URL = 'https://{url}/graphs/projects/{projectId}/maps';
|
|
131
|
+
exports.API_GRAPHS_MAPS_NEW_URL = 'https://{url}/graphs/projects/{projectId}/maps/new';
|
|
131
132
|
exports.API_GRAPHS_MAPS_DEPLOYED_URL = 'https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}';
|
|
132
133
|
exports.API_GRAPHS_MAPS_MERGE_URL = 'https://{url}/graphs/projects/{projectId}/maps/merge';
|
|
133
134
|
exports.API_GRAPHS_MAP_ID_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}';
|
|
@@ -117,15 +117,36 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
|
|
|
117
117
|
*/
|
|
118
118
|
delete(projectId: string, mapId: string, callsign: string, hash: string): Promise<void>;
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* Creates a new map with the supplied canonical content.
|
|
121
|
+
*
|
|
122
|
+
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
123
|
+
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
124
|
+
* hash, timestamp) is created automatically.
|
|
121
125
|
*
|
|
122
126
|
* @param projectId Project ID
|
|
123
|
-
* @param mapId
|
|
124
|
-
* @param
|
|
127
|
+
* @param mapId The mapId to create. Must be unique within the project.
|
|
128
|
+
* @param content Canonical map content (`{nodes, edges}`).
|
|
129
|
+
*/
|
|
130
|
+
create(projectId: string, mapId: string, content: MapContent): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Makes a copy of an existing cloud map under a new mapId.
|
|
133
|
+
*
|
|
134
|
+
* If `options.name` is omitted, the server picks an available
|
|
135
|
+
* `<sourceMapId>-copy[-N]` slot. The resolved mapId is returned so the
|
|
136
|
+
* caller knows where to look for the copy. The write is asynchronous on the
|
|
137
|
+
* server side - the copy may not be immediately readable via `get()`.
|
|
138
|
+
*
|
|
139
|
+
* @param projectId Project ID
|
|
140
|
+
* @param mapId Source map ID
|
|
141
|
+
* @param options Optional `name` (new mapId) and `description` for the copy
|
|
142
|
+
* @returns The mapId assigned to the new copy
|
|
125
143
|
*/
|
|
126
144
|
copy(projectId: string, mapId: string, options: {
|
|
145
|
+
name?: string;
|
|
127
146
|
description?: string;
|
|
128
|
-
}): Promise<
|
|
147
|
+
}): Promise<{
|
|
148
|
+
mapId: string;
|
|
149
|
+
}>;
|
|
129
150
|
/** Deploy a map from the cloud to a robot
|
|
130
151
|
*
|
|
131
152
|
* @param projectId Project ID
|
|
@@ -165,11 +165,34 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
165
165
|
}, this.config.insecure), 'Failed to delete map.', callsign ? { callsign, hash } : {});
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* Creates a new map with the supplied canonical content.
|
|
169
|
+
*
|
|
170
|
+
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
171
|
+
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
172
|
+
* hash, timestamp) is created automatically.
|
|
169
173
|
*
|
|
170
174
|
* @param projectId Project ID
|
|
171
|
-
* @param mapId
|
|
172
|
-
* @param
|
|
175
|
+
* @param mapId The mapId to create. Must be unique within the project.
|
|
176
|
+
* @param content Canonical map content (`{nodes, edges}`).
|
|
177
|
+
*/
|
|
178
|
+
async create(projectId, mapId, content) {
|
|
179
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_NEW_URL, {
|
|
180
|
+
url: this.config.url,
|
|
181
|
+
projectId,
|
|
182
|
+
}, this.config.insecure), { mapId, map: content }, 'Failed to create map.');
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Makes a copy of an existing cloud map under a new mapId.
|
|
186
|
+
*
|
|
187
|
+
* If `options.name` is omitted, the server picks an available
|
|
188
|
+
* `<sourceMapId>-copy[-N]` slot. The resolved mapId is returned so the
|
|
189
|
+
* caller knows where to look for the copy. The write is asynchronous on the
|
|
190
|
+
* server side - the copy may not be immediately readable via `get()`.
|
|
191
|
+
*
|
|
192
|
+
* @param projectId Project ID
|
|
193
|
+
* @param mapId Source map ID
|
|
194
|
+
* @param options Optional `name` (new mapId) and `description` for the copy
|
|
195
|
+
* @returns The mapId assigned to the new copy
|
|
173
196
|
*/
|
|
174
197
|
async copy(projectId, mapId, options) {
|
|
175
198
|
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_COPY_URL, {
|
package/esm/constants/api.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export declare const API_DD_INTEGRATION_ISSUES_URL = "https://{url}/projects/{pr
|
|
|
122
122
|
export declare const API_DD_INTEGRATION_LOCATIONS_URL = "https://{url}/projects/{projectId}/dd/locations";
|
|
123
123
|
export declare const API_DD_INTEGRATION_LEVELS_URL = "https://{url}/projects/{projectId}/dd/levels";
|
|
124
124
|
export declare const API_GRAPHS_MAPS_URL = "https://{url}/graphs/projects/{projectId}/maps";
|
|
125
|
+
export declare const API_GRAPHS_MAPS_NEW_URL = "https://{url}/graphs/projects/{projectId}/maps/new";
|
|
125
126
|
export declare const API_GRAPHS_MAPS_DEPLOYED_URL = "https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}";
|
|
126
127
|
export declare const API_GRAPHS_MAPS_MERGE_URL = "https://{url}/graphs/projects/{projectId}/maps/merge";
|
|
127
128
|
export declare const API_GRAPHS_MAP_ID_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}";
|
package/esm/constants/api.js
CHANGED
|
@@ -122,6 +122,7 @@ export const API_DD_INTEGRATION_ISSUES_URL = 'https://{url}/projects/{projectId}
|
|
|
122
122
|
export const API_DD_INTEGRATION_LOCATIONS_URL = 'https://{url}/projects/{projectId}/dd/locations';
|
|
123
123
|
export const API_DD_INTEGRATION_LEVELS_URL = 'https://{url}/projects/{projectId}/dd/levels';
|
|
124
124
|
export const API_GRAPHS_MAPS_URL = 'https://{url}/graphs/projects/{projectId}/maps';
|
|
125
|
+
export const API_GRAPHS_MAPS_NEW_URL = 'https://{url}/graphs/projects/{projectId}/maps/new';
|
|
125
126
|
export const API_GRAPHS_MAPS_DEPLOYED_URL = 'https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}';
|
|
126
127
|
export const API_GRAPHS_MAPS_MERGE_URL = 'https://{url}/graphs/projects/{projectId}/maps/merge';
|
|
127
128
|
export const API_GRAPHS_MAP_ID_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}';
|
|
@@ -117,15 +117,36 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
|
|
|
117
117
|
*/
|
|
118
118
|
delete(projectId: string, mapId: string, callsign: string, hash: string): Promise<void>;
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* Creates a new map with the supplied canonical content.
|
|
121
|
+
*
|
|
122
|
+
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
123
|
+
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
124
|
+
* hash, timestamp) is created automatically.
|
|
121
125
|
*
|
|
122
126
|
* @param projectId Project ID
|
|
123
|
-
* @param mapId
|
|
124
|
-
* @param
|
|
127
|
+
* @param mapId The mapId to create. Must be unique within the project.
|
|
128
|
+
* @param content Canonical map content (`{nodes, edges}`).
|
|
129
|
+
*/
|
|
130
|
+
create(projectId: string, mapId: string, content: MapContent): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Makes a copy of an existing cloud map under a new mapId.
|
|
133
|
+
*
|
|
134
|
+
* If `options.name` is omitted, the server picks an available
|
|
135
|
+
* `<sourceMapId>-copy[-N]` slot. The resolved mapId is returned so the
|
|
136
|
+
* caller knows where to look for the copy. The write is asynchronous on the
|
|
137
|
+
* server side - the copy may not be immediately readable via `get()`.
|
|
138
|
+
*
|
|
139
|
+
* @param projectId Project ID
|
|
140
|
+
* @param mapId Source map ID
|
|
141
|
+
* @param options Optional `name` (new mapId) and `description` for the copy
|
|
142
|
+
* @returns The mapId assigned to the new copy
|
|
125
143
|
*/
|
|
126
144
|
copy(projectId: string, mapId: string, options: {
|
|
145
|
+
name?: string;
|
|
127
146
|
description?: string;
|
|
128
|
-
}): Promise<
|
|
147
|
+
}): Promise<{
|
|
148
|
+
mapId: string;
|
|
149
|
+
}>;
|
|
129
150
|
/** Deploy a map from the cloud to a robot
|
|
130
151
|
*
|
|
131
152
|
* @param projectId Project ID
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_GRAPHS_MAPS_COPY_URL, API_GRAPHS_MAPS_DEPLOYED_URL, API_GRAPHS_MAPS_DEPLOY_URL, API_GRAPHS_MAPS_GEOJSON_URL, API_GRAPHS_MAPS_MERGE_URL, API_GRAPHS_MAPS_URL, API_GRAPHS_MAP_CONTENT_URL, API_GRAPHS_MAP_ID_URL, API_GRAPHS_MAP_METADATA_URL, API_GRAPHS_OBSERVATIONS_URL, API_GRAPHS_OBSERVATION_KEYS_URL, API_GRAPHS_PANORAMA, API_GRAPHS_PANORAMA_OBSERVATIONS_URL, } from '../constants/api';
|
|
1
|
+
import { API_GRAPHS_MAPS_COPY_URL, API_GRAPHS_MAPS_DEPLOYED_URL, API_GRAPHS_MAPS_DEPLOY_URL, API_GRAPHS_MAPS_GEOJSON_URL, API_GRAPHS_MAPS_MERGE_URL, API_GRAPHS_MAPS_NEW_URL, API_GRAPHS_MAPS_URL, API_GRAPHS_MAP_CONTENT_URL, API_GRAPHS_MAP_ID_URL, API_GRAPHS_MAP_METADATA_URL, API_GRAPHS_OBSERVATIONS_URL, API_GRAPHS_OBSERVATION_KEYS_URL, API_GRAPHS_PANORAMA, API_GRAPHS_PANORAMA_OBSERVATIONS_URL, } from '../constants/api';
|
|
2
2
|
import { RocosError, errorCodes } from '../models';
|
|
3
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
4
|
import { RocosLogger } from '../logger/RocosLogger';
|
|
@@ -162,11 +162,34 @@ export class MapService extends BaseServiceAbstract {
|
|
|
162
162
|
}, this.config.insecure), 'Failed to delete map.', callsign ? { callsign, hash } : {});
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Creates a new map with the supplied canonical content.
|
|
166
|
+
*
|
|
167
|
+
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
168
|
+
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
169
|
+
* hash, timestamp) is created automatically.
|
|
166
170
|
*
|
|
167
171
|
* @param projectId Project ID
|
|
168
|
-
* @param mapId
|
|
169
|
-
* @param
|
|
172
|
+
* @param mapId The mapId to create. Must be unique within the project.
|
|
173
|
+
* @param content Canonical map content (`{nodes, edges}`).
|
|
174
|
+
*/
|
|
175
|
+
async create(projectId, mapId, content) {
|
|
176
|
+
return this.callPost(formatServiceUrl(API_GRAPHS_MAPS_NEW_URL, {
|
|
177
|
+
url: this.config.url,
|
|
178
|
+
projectId,
|
|
179
|
+
}, this.config.insecure), { mapId, map: content }, 'Failed to create map.');
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Makes a copy of an existing cloud map under a new mapId.
|
|
183
|
+
*
|
|
184
|
+
* If `options.name` is omitted, the server picks an available
|
|
185
|
+
* `<sourceMapId>-copy[-N]` slot. The resolved mapId is returned so the
|
|
186
|
+
* caller knows where to look for the copy. The write is asynchronous on the
|
|
187
|
+
* server side - the copy may not be immediately readable via `get()`.
|
|
188
|
+
*
|
|
189
|
+
* @param projectId Project ID
|
|
190
|
+
* @param mapId Source map ID
|
|
191
|
+
* @param options Optional `name` (new mapId) and `description` for the copy
|
|
192
|
+
* @returns The mapId assigned to the new copy
|
|
170
193
|
*/
|
|
171
194
|
async copy(projectId, mapId, options) {
|
|
172
195
|
return this.callPost(formatServiceUrl(API_GRAPHS_MAPS_COPY_URL, {
|