@dronedeploy/rocos-js-sdk 3.1.4 → 3.1.5-rc1
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.
|
@@ -117,17 +117,25 @@ 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
|
-
* Creates a new map with the supplied canonical content
|
|
120
|
+
* Creates a new map with the supplied canonical content, and optionally seeds its
|
|
121
|
+
* description in the same call.
|
|
121
122
|
*
|
|
122
123
|
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
123
124
|
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
124
125
|
* hash, timestamp) is created automatically.
|
|
125
126
|
*
|
|
127
|
+
* When `options.description` is supplied, the server writes it into the map's
|
|
128
|
+
* SUMMARY in the same goroutine as the create — atomically replacing the
|
|
129
|
+
* historic create-then-{@link updateMetadata} two-step.
|
|
130
|
+
*
|
|
126
131
|
* @param projectId Project ID
|
|
127
132
|
* @param mapId The mapId to create. Must be unique within the project.
|
|
128
133
|
* @param content Canonical map content (`{nodes, edges}`).
|
|
134
|
+
* @param options Optional `description` to seed alongside the new map.
|
|
129
135
|
*/
|
|
130
|
-
create(projectId: string, mapId: string, content: MapContent
|
|
136
|
+
create(projectId: string, mapId: string, content: MapContent, options?: {
|
|
137
|
+
description?: string;
|
|
138
|
+
}): Promise<void>;
|
|
131
139
|
/**
|
|
132
140
|
* Makes a copy of an existing cloud map under a new mapId.
|
|
133
141
|
*
|
|
@@ -165,21 +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
|
-
* Creates a new map with the supplied canonical content
|
|
168
|
+
* Creates a new map with the supplied canonical content, and optionally seeds its
|
|
169
|
+
* description in the same call.
|
|
169
170
|
*
|
|
170
171
|
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
171
172
|
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
172
173
|
* hash, timestamp) is created automatically.
|
|
173
174
|
*
|
|
175
|
+
* When `options.description` is supplied, the server writes it into the map's
|
|
176
|
+
* SUMMARY in the same goroutine as the create — atomically replacing the
|
|
177
|
+
* historic create-then-{@link updateMetadata} two-step.
|
|
178
|
+
*
|
|
174
179
|
* @param projectId Project ID
|
|
175
180
|
* @param mapId The mapId to create. Must be unique within the project.
|
|
176
181
|
* @param content Canonical map content (`{nodes, edges}`).
|
|
182
|
+
* @param options Optional `description` to seed alongside the new map.
|
|
177
183
|
*/
|
|
178
|
-
async create(projectId, mapId, content) {
|
|
184
|
+
async create(projectId, mapId, content, options = {}) {
|
|
185
|
+
const body = {
|
|
186
|
+
mapId,
|
|
187
|
+
content,
|
|
188
|
+
};
|
|
189
|
+
if (options.description) {
|
|
190
|
+
body.metadata = { description: options.description };
|
|
191
|
+
}
|
|
179
192
|
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_NEW_URL, {
|
|
180
193
|
url: this.config.url,
|
|
181
194
|
projectId,
|
|
182
|
-
}, this.config.insecure),
|
|
195
|
+
}, this.config.insecure), body, 'Failed to create map.');
|
|
183
196
|
}
|
|
184
197
|
/**
|
|
185
198
|
* Makes a copy of an existing cloud map under a new mapId.
|
|
@@ -117,17 +117,25 @@ 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
|
-
* Creates a new map with the supplied canonical content
|
|
120
|
+
* Creates a new map with the supplied canonical content, and optionally seeds its
|
|
121
|
+
* description in the same call.
|
|
121
122
|
*
|
|
122
123
|
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
123
124
|
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
124
125
|
* hash, timestamp) is created automatically.
|
|
125
126
|
*
|
|
127
|
+
* When `options.description` is supplied, the server writes it into the map's
|
|
128
|
+
* SUMMARY in the same goroutine as the create — atomically replacing the
|
|
129
|
+
* historic create-then-{@link updateMetadata} two-step.
|
|
130
|
+
*
|
|
126
131
|
* @param projectId Project ID
|
|
127
132
|
* @param mapId The mapId to create. Must be unique within the project.
|
|
128
133
|
* @param content Canonical map content (`{nodes, edges}`).
|
|
134
|
+
* @param options Optional `description` to seed alongside the new map.
|
|
129
135
|
*/
|
|
130
|
-
create(projectId: string, mapId: string, content: MapContent
|
|
136
|
+
create(projectId: string, mapId: string, content: MapContent, options?: {
|
|
137
|
+
description?: string;
|
|
138
|
+
}): Promise<void>;
|
|
131
139
|
/**
|
|
132
140
|
* Makes a copy of an existing cloud map under a new mapId.
|
|
133
141
|
*
|
|
@@ -162,21 +162,34 @@ export class MapService extends BaseServiceAbstract {
|
|
|
162
162
|
}, this.config.insecure), 'Failed to delete map.', callsign ? { callsign, hash } : {});
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
* Creates a new map with the supplied canonical content
|
|
165
|
+
* Creates a new map with the supplied canonical content, and optionally seeds its
|
|
166
|
+
* description in the same call.
|
|
166
167
|
*
|
|
167
168
|
* The server requires at least one node in the content; an empty `{nodes:{},
|
|
168
169
|
* edges:{}}` payload is rejected. Server-managed metadata (SUMMARY, MAP_INFO,
|
|
169
170
|
* hash, timestamp) is created automatically.
|
|
170
171
|
*
|
|
172
|
+
* When `options.description` is supplied, the server writes it into the map's
|
|
173
|
+
* SUMMARY in the same goroutine as the create — atomically replacing the
|
|
174
|
+
* historic create-then-{@link updateMetadata} two-step.
|
|
175
|
+
*
|
|
171
176
|
* @param projectId Project ID
|
|
172
177
|
* @param mapId The mapId to create. Must be unique within the project.
|
|
173
178
|
* @param content Canonical map content (`{nodes, edges}`).
|
|
179
|
+
* @param options Optional `description` to seed alongside the new map.
|
|
174
180
|
*/
|
|
175
|
-
async create(projectId, mapId, content) {
|
|
181
|
+
async create(projectId, mapId, content, options = {}) {
|
|
182
|
+
const body = {
|
|
183
|
+
mapId,
|
|
184
|
+
content,
|
|
185
|
+
};
|
|
186
|
+
if (options.description) {
|
|
187
|
+
body.metadata = { description: options.description };
|
|
188
|
+
}
|
|
176
189
|
return this.callPost(formatServiceUrl(API_GRAPHS_MAPS_NEW_URL, {
|
|
177
190
|
url: this.config.url,
|
|
178
191
|
projectId,
|
|
179
|
-
}, this.config.insecure),
|
|
192
|
+
}, this.config.insecure), body, 'Failed to create map.');
|
|
180
193
|
}
|
|
181
194
|
/**
|
|
182
195
|
* Makes a copy of an existing cloud map under a new mapId.
|