@dronedeploy/rocos-js-sdk 3.0.28 → 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.
@@ -122,9 +122,12 @@ 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}";
129
+ export declare const API_GRAPHS_MAP_CONTENT_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/content";
130
+ export declare const API_GRAPHS_MAP_METADATA_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata";
128
131
  export declare const API_GRAPHS_MAPS_COPY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy";
129
132
  export declare const API_GRAPHS_MAPS_DEPLOY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy";
130
133
  export declare const API_GRAPHS_MAPS_GEOJSON_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson";
@@ -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.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 = 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_ID_URL = exports.API_GRAPHS_MAPS_MERGE_URL = exports.API_GRAPHS_MAPS_DEPLOYED_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 = 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,9 +128,12 @@ 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}';
135
+ exports.API_GRAPHS_MAP_CONTENT_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/content';
136
+ exports.API_GRAPHS_MAP_METADATA_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata';
134
137
  exports.API_GRAPHS_MAPS_COPY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy';
135
138
  exports.API_GRAPHS_MAPS_DEPLOY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy';
136
139
  exports.API_GRAPHS_MAPS_GEOJSON_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson';
@@ -48,6 +48,7 @@ export * from './IToken';
48
48
  export * from './IWidget';
49
49
  export * from './IWidgetLineGroup';
50
50
  export * from './maps/Map';
51
+ export * from './maps/MapContent';
51
52
  export * from './maps/Panorama';
52
53
  export * from './message';
53
54
  export * from './params/ICallerParams';
@@ -64,6 +64,7 @@ __exportStar(require("./IToken"), exports);
64
64
  __exportStar(require("./IWidget"), exports);
65
65
  __exportStar(require("./IWidgetLineGroup"), exports);
66
66
  __exportStar(require("./maps/Map"), exports);
67
+ __exportStar(require("./maps/MapContent"), exports);
67
68
  __exportStar(require("./maps/Panorama"), exports);
68
69
  __exportStar(require("./message"), exports);
69
70
  __exportStar(require("./params/ICallerParams"), exports);
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Canonical JSON representation of a robot map's graph content.
3
+ *
4
+ * This is the body shape returned by `GET /graphs/projects/{projectId}/maps/{mapId}`
5
+ * and accepted by `PUT /graphs/projects/{projectId}/maps/{mapId}/content`. Distinct
6
+ * from {@link Map} (the listing/metadata model returned by `list()`).
7
+ */
8
+ export interface MapContent {
9
+ nodes: Record<string, MapContentNode>;
10
+ edges: Record<string, MapContentEdge>;
11
+ }
12
+ export interface MapContentNode {
13
+ id: string;
14
+ type: string;
15
+ edges: Record<string, unknown>;
16
+ data: Record<string, unknown>;
17
+ externalData?: Record<string, unknown>;
18
+ }
19
+ export interface MapContentEdge {
20
+ id: string;
21
+ from: string;
22
+ to: string;
23
+ type: string;
24
+ data: Record<string, unknown>;
25
+ externalData?: Record<string, unknown>;
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { Asset, IBaseService, IRocosSDKConfig, Map, RocosError } from '../models';
1
+ import { Asset, IBaseService, IRocosSDKConfig, Map, MapContent, RocosError } from '../models';
2
2
  import { CreateObservation, Observation } from '../models/maps/Panorama';
3
3
  import { BaseServiceAbstract } from './BaseServiceAbstract';
4
4
  /**
@@ -50,7 +50,14 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
50
50
  */
51
51
  get(projectId: string, mapId: string): Promise<Map>;
52
52
  /**
53
- * Updates a maps metadata
53
+ * Updates a map's metadata.
54
+ *
55
+ * @deprecated Hits the legacy `PUT /maps/{mapId}` endpoint that only accepts
56
+ * metadata; the giraffe API is migrating that endpoint toward "PUT the full
57
+ * resource" semantics (both metadata and content together). Prefer
58
+ * {@link updateMetadata} for metadata-only changes and {@link updateContent}
59
+ * for graph-content replacement.
60
+ *
54
61
  * @param projectId Project ID
55
62
  * @param mapId Map ID
56
63
  * @param options New metadata
@@ -59,6 +66,30 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
59
66
  description?: string;
60
67
  callsign?: string;
61
68
  }): Promise<void>;
69
+ /**
70
+ * Updates a map's metadata via the granular `/metadata` endpoint.
71
+ *
72
+ * @param projectId Project ID
73
+ * @param mapId Map ID
74
+ * @param options New metadata fields. `description` is required by the
75
+ * backend; sending an empty value returns a 400.
76
+ */
77
+ updateMetadata(projectId: string, mapId: string, options: {
78
+ description: string;
79
+ }): Promise<void>;
80
+ /**
81
+ * Replaces the graph content of an existing cloud map with the supplied
82
+ * canonical `{ nodes, edges }` payload.
83
+ *
84
+ * Server-managed parts (SUMMARY, MAP_INFO identity fields, MAP_INFO
85
+ * timestamp, content hash) are preserved or recomputed by the backend; a
86
+ * byte-identical content payload is a no-op on the server (idempotent).
87
+ *
88
+ * @param projectId Project ID
89
+ * @param mapId Map ID
90
+ * @param content Canonical map content to write
91
+ */
92
+ updateContent(projectId: string, mapId: string, content: MapContent): Promise<void>;
62
93
  /**
63
94
  * Begins uploading a map from the agent
64
95
  *
@@ -86,15 +117,36 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
86
117
  */
87
118
  delete(projectId: string, mapId: string, callsign: string, hash: string): Promise<void>;
88
119
  /**
89
- * Makes a copy of an uploaded map
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.
90
125
  *
91
126
  * @param projectId Project ID
92
- * @param mapId Map ID
93
- * @param options Options to create the new map
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
94
143
  */
95
144
  copy(projectId: string, mapId: string, options: {
145
+ name?: string;
96
146
  description?: string;
97
- }): Promise<void>;
147
+ }): Promise<{
148
+ mapId: string;
149
+ }>;
98
150
  /** Deploy a map from the cloud to a robot
99
151
  *
100
152
  * @param projectId Project ID
@@ -89,7 +89,14 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
89
89
  }, this.config.insecure), 'Failed to get map.');
90
90
  }
91
91
  /**
92
- * Updates a maps metadata
92
+ * Updates a map's metadata.
93
+ *
94
+ * @deprecated Hits the legacy `PUT /maps/{mapId}` endpoint that only accepts
95
+ * metadata; the giraffe API is migrating that endpoint toward "PUT the full
96
+ * resource" semantics (both metadata and content together). Prefer
97
+ * {@link updateMetadata} for metadata-only changes and {@link updateContent}
98
+ * for graph-content replacement.
99
+ *
93
100
  * @param projectId Project ID
94
101
  * @param mapId Map ID
95
102
  * @param options New metadata
@@ -101,6 +108,40 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
101
108
  mapId,
102
109
  }, this.config.insecure), options, 'Failed to update map.');
103
110
  }
111
+ /**
112
+ * Updates a map's metadata via the granular `/metadata` endpoint.
113
+ *
114
+ * @param projectId Project ID
115
+ * @param mapId Map ID
116
+ * @param options New metadata fields. `description` is required by the
117
+ * backend; sending an empty value returns a 400.
118
+ */
119
+ async updateMetadata(projectId, mapId, options) {
120
+ return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_METADATA_URL, {
121
+ url: this.config.url,
122
+ projectId,
123
+ mapId,
124
+ }, this.config.insecure), options, 'Failed to update map metadata.');
125
+ }
126
+ /**
127
+ * Replaces the graph content of an existing cloud map with the supplied
128
+ * canonical `{ nodes, edges }` payload.
129
+ *
130
+ * Server-managed parts (SUMMARY, MAP_INFO identity fields, MAP_INFO
131
+ * timestamp, content hash) are preserved or recomputed by the backend; a
132
+ * byte-identical content payload is a no-op on the server (idempotent).
133
+ *
134
+ * @param projectId Project ID
135
+ * @param mapId Map ID
136
+ * @param content Canonical map content to write
137
+ */
138
+ async updateContent(projectId, mapId, content) {
139
+ return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_CONTENT_URL, {
140
+ url: this.config.url,
141
+ projectId,
142
+ mapId,
143
+ }, this.config.insecure), content, 'Failed to update map content.');
144
+ }
104
145
  /**
105
146
  * Begins uploading a map from the agent
106
147
  *
@@ -124,11 +165,34 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
124
165
  }, this.config.insecure), 'Failed to delete map.', callsign ? { callsign, hash } : {});
125
166
  }
126
167
  /**
127
- * Makes a copy of an uploaded map
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.
128
173
  *
129
174
  * @param projectId Project ID
130
- * @param mapId Map ID
131
- * @param options Options to create the new map
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
132
196
  */
133
197
  async copy(projectId, mapId, options) {
134
198
  return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_COPY_URL, {
@@ -122,9 +122,12 @@ 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}";
129
+ export declare const API_GRAPHS_MAP_CONTENT_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/content";
130
+ export declare const API_GRAPHS_MAP_METADATA_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata";
128
131
  export declare const API_GRAPHS_MAPS_COPY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy";
129
132
  export declare const API_GRAPHS_MAPS_DEPLOY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy";
130
133
  export declare const API_GRAPHS_MAPS_GEOJSON_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson";
@@ -122,9 +122,12 @@ 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}';
129
+ export const API_GRAPHS_MAP_CONTENT_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/content';
130
+ export const API_GRAPHS_MAP_METADATA_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata';
128
131
  export const API_GRAPHS_MAPS_COPY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy';
129
132
  export const API_GRAPHS_MAPS_DEPLOY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy';
130
133
  export const API_GRAPHS_MAPS_GEOJSON_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson';
@@ -48,6 +48,7 @@ export * from './IToken';
48
48
  export * from './IWidget';
49
49
  export * from './IWidgetLineGroup';
50
50
  export * from './maps/Map';
51
+ export * from './maps/MapContent';
51
52
  export * from './maps/Panorama';
52
53
  export * from './message';
53
54
  export * from './params/ICallerParams';
@@ -48,6 +48,7 @@ export * from './IToken';
48
48
  export * from './IWidget';
49
49
  export * from './IWidgetLineGroup';
50
50
  export * from './maps/Map';
51
+ export * from './maps/MapContent';
51
52
  export * from './maps/Panorama';
52
53
  export * from './message';
53
54
  export * from './params/ICallerParams';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Canonical JSON representation of a robot map's graph content.
3
+ *
4
+ * This is the body shape returned by `GET /graphs/projects/{projectId}/maps/{mapId}`
5
+ * and accepted by `PUT /graphs/projects/{projectId}/maps/{mapId}/content`. Distinct
6
+ * from {@link Map} (the listing/metadata model returned by `list()`).
7
+ */
8
+ export interface MapContent {
9
+ nodes: Record<string, MapContentNode>;
10
+ edges: Record<string, MapContentEdge>;
11
+ }
12
+ export interface MapContentNode {
13
+ id: string;
14
+ type: string;
15
+ edges: Record<string, unknown>;
16
+ data: Record<string, unknown>;
17
+ externalData?: Record<string, unknown>;
18
+ }
19
+ export interface MapContentEdge {
20
+ id: string;
21
+ from: string;
22
+ to: string;
23
+ type: string;
24
+ data: Record<string, unknown>;
25
+ externalData?: Record<string, unknown>;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { Asset, IBaseService, IRocosSDKConfig, Map, RocosError } from '../models';
1
+ import { Asset, IBaseService, IRocosSDKConfig, Map, MapContent, RocosError } from '../models';
2
2
  import { CreateObservation, Observation } from '../models/maps/Panorama';
3
3
  import { BaseServiceAbstract } from './BaseServiceAbstract';
4
4
  /**
@@ -50,7 +50,14 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
50
50
  */
51
51
  get(projectId: string, mapId: string): Promise<Map>;
52
52
  /**
53
- * Updates a maps metadata
53
+ * Updates a map's metadata.
54
+ *
55
+ * @deprecated Hits the legacy `PUT /maps/{mapId}` endpoint that only accepts
56
+ * metadata; the giraffe API is migrating that endpoint toward "PUT the full
57
+ * resource" semantics (both metadata and content together). Prefer
58
+ * {@link updateMetadata} for metadata-only changes and {@link updateContent}
59
+ * for graph-content replacement.
60
+ *
54
61
  * @param projectId Project ID
55
62
  * @param mapId Map ID
56
63
  * @param options New metadata
@@ -59,6 +66,30 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
59
66
  description?: string;
60
67
  callsign?: string;
61
68
  }): Promise<void>;
69
+ /**
70
+ * Updates a map's metadata via the granular `/metadata` endpoint.
71
+ *
72
+ * @param projectId Project ID
73
+ * @param mapId Map ID
74
+ * @param options New metadata fields. `description` is required by the
75
+ * backend; sending an empty value returns a 400.
76
+ */
77
+ updateMetadata(projectId: string, mapId: string, options: {
78
+ description: string;
79
+ }): Promise<void>;
80
+ /**
81
+ * Replaces the graph content of an existing cloud map with the supplied
82
+ * canonical `{ nodes, edges }` payload.
83
+ *
84
+ * Server-managed parts (SUMMARY, MAP_INFO identity fields, MAP_INFO
85
+ * timestamp, content hash) are preserved or recomputed by the backend; a
86
+ * byte-identical content payload is a no-op on the server (idempotent).
87
+ *
88
+ * @param projectId Project ID
89
+ * @param mapId Map ID
90
+ * @param content Canonical map content to write
91
+ */
92
+ updateContent(projectId: string, mapId: string, content: MapContent): Promise<void>;
62
93
  /**
63
94
  * Begins uploading a map from the agent
64
95
  *
@@ -86,15 +117,36 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
86
117
  */
87
118
  delete(projectId: string, mapId: string, callsign: string, hash: string): Promise<void>;
88
119
  /**
89
- * Makes a copy of an uploaded map
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.
90
125
  *
91
126
  * @param projectId Project ID
92
- * @param mapId Map ID
93
- * @param options Options to create the new map
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
94
143
  */
95
144
  copy(projectId: string, mapId: string, options: {
145
+ name?: string;
96
146
  description?: string;
97
- }): Promise<void>;
147
+ }): Promise<{
148
+ mapId: string;
149
+ }>;
98
150
  /** Deploy a map from the cloud to a robot
99
151
  *
100
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_ID_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';
@@ -86,7 +86,14 @@ export class MapService extends BaseServiceAbstract {
86
86
  }, this.config.insecure), 'Failed to get map.');
87
87
  }
88
88
  /**
89
- * Updates a maps metadata
89
+ * Updates a map's metadata.
90
+ *
91
+ * @deprecated Hits the legacy `PUT /maps/{mapId}` endpoint that only accepts
92
+ * metadata; the giraffe API is migrating that endpoint toward "PUT the full
93
+ * resource" semantics (both metadata and content together). Prefer
94
+ * {@link updateMetadata} for metadata-only changes and {@link updateContent}
95
+ * for graph-content replacement.
96
+ *
90
97
  * @param projectId Project ID
91
98
  * @param mapId Map ID
92
99
  * @param options New metadata
@@ -98,6 +105,40 @@ export class MapService extends BaseServiceAbstract {
98
105
  mapId,
99
106
  }, this.config.insecure), options, 'Failed to update map.');
100
107
  }
108
+ /**
109
+ * Updates a map's metadata via the granular `/metadata` endpoint.
110
+ *
111
+ * @param projectId Project ID
112
+ * @param mapId Map ID
113
+ * @param options New metadata fields. `description` is required by the
114
+ * backend; sending an empty value returns a 400.
115
+ */
116
+ async updateMetadata(projectId, mapId, options) {
117
+ return this.callPut(formatServiceUrl(API_GRAPHS_MAP_METADATA_URL, {
118
+ url: this.config.url,
119
+ projectId,
120
+ mapId,
121
+ }, this.config.insecure), options, 'Failed to update map metadata.');
122
+ }
123
+ /**
124
+ * Replaces the graph content of an existing cloud map with the supplied
125
+ * canonical `{ nodes, edges }` payload.
126
+ *
127
+ * Server-managed parts (SUMMARY, MAP_INFO identity fields, MAP_INFO
128
+ * timestamp, content hash) are preserved or recomputed by the backend; a
129
+ * byte-identical content payload is a no-op on the server (idempotent).
130
+ *
131
+ * @param projectId Project ID
132
+ * @param mapId Map ID
133
+ * @param content Canonical map content to write
134
+ */
135
+ async updateContent(projectId, mapId, content) {
136
+ return this.callPut(formatServiceUrl(API_GRAPHS_MAP_CONTENT_URL, {
137
+ url: this.config.url,
138
+ projectId,
139
+ mapId,
140
+ }, this.config.insecure), content, 'Failed to update map content.');
141
+ }
101
142
  /**
102
143
  * Begins uploading a map from the agent
103
144
  *
@@ -121,11 +162,34 @@ export class MapService extends BaseServiceAbstract {
121
162
  }, this.config.insecure), 'Failed to delete map.', callsign ? { callsign, hash } : {});
122
163
  }
123
164
  /**
124
- * Makes a copy of an uploaded map
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.
125
170
  *
126
171
  * @param projectId Project ID
127
- * @param mapId Map ID
128
- * @param options Options to create the new map
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
129
193
  */
130
194
  async copy(projectId, mapId, options) {
131
195
  return this.callPost(formatServiceUrl(API_GRAPHS_MAPS_COPY_URL, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.28",
3
+ "version": "3.0.30",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",