@dronedeploy/rocos-js-sdk 3.0.28 → 3.0.29

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.
@@ -125,6 +125,8 @@ export declare const API_GRAPHS_MAPS_URL = "https://{url}/graphs/projects/{proje
125
125
  export declare const API_GRAPHS_MAPS_DEPLOYED_URL = "https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}";
126
126
  export declare const API_GRAPHS_MAPS_MERGE_URL = "https://{url}/graphs/projects/{projectId}/maps/merge";
127
127
  export declare const API_GRAPHS_MAP_ID_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}";
128
+ export declare const API_GRAPHS_MAP_CONTENT_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/content";
129
+ export declare const API_GRAPHS_MAP_METADATA_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata";
128
130
  export declare const API_GRAPHS_MAPS_COPY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy";
129
131
  export declare const API_GRAPHS_MAPS_DEPLOY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy";
130
132
  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_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_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_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 = 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';
@@ -131,6 +131,8 @@ exports.API_GRAPHS_MAPS_URL = 'https://{url}/graphs/projects/{projectId}/maps';
131
131
  exports.API_GRAPHS_MAPS_DEPLOYED_URL = 'https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}';
132
132
  exports.API_GRAPHS_MAPS_MERGE_URL = 'https://{url}/graphs/projects/{projectId}/maps/merge';
133
133
  exports.API_GRAPHS_MAP_ID_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}';
134
+ exports.API_GRAPHS_MAP_CONTENT_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/content';
135
+ exports.API_GRAPHS_MAP_METADATA_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata';
134
136
  exports.API_GRAPHS_MAPS_COPY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy';
135
137
  exports.API_GRAPHS_MAPS_DEPLOY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy';
136
138
  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
  *
@@ -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
  *
@@ -125,6 +125,8 @@ export declare const API_GRAPHS_MAPS_URL = "https://{url}/graphs/projects/{proje
125
125
  export declare const API_GRAPHS_MAPS_DEPLOYED_URL = "https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}";
126
126
  export declare const API_GRAPHS_MAPS_MERGE_URL = "https://{url}/graphs/projects/{projectId}/maps/merge";
127
127
  export declare const API_GRAPHS_MAP_ID_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}";
128
+ export declare const API_GRAPHS_MAP_CONTENT_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/content";
129
+ export declare const API_GRAPHS_MAP_METADATA_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata";
128
130
  export declare const API_GRAPHS_MAPS_COPY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy";
129
131
  export declare const API_GRAPHS_MAPS_DEPLOY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy";
130
132
  export declare const API_GRAPHS_MAPS_GEOJSON_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson";
@@ -125,6 +125,8 @@ export const API_GRAPHS_MAPS_URL = 'https://{url}/graphs/projects/{projectId}/ma
125
125
  export const API_GRAPHS_MAPS_DEPLOYED_URL = 'https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}';
126
126
  export const API_GRAPHS_MAPS_MERGE_URL = 'https://{url}/graphs/projects/{projectId}/maps/merge';
127
127
  export const API_GRAPHS_MAP_ID_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}';
128
+ export const API_GRAPHS_MAP_CONTENT_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/content';
129
+ export const API_GRAPHS_MAP_METADATA_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/metadata';
128
130
  export const API_GRAPHS_MAPS_COPY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy';
129
131
  export const API_GRAPHS_MAPS_DEPLOY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy';
130
132
  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
  *
@@ -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_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
  *
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.29",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",