File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import { ExpeditionSpec } from "./expedition-spec" ;
2+ import { BrowserSessionId } from "../types" ;
3+
4+ /**
5+ * Specification that bases on an already finished expedition and its artifacts.
6+ */
7+ export class OfflineExpeditionSpec implements ExpeditionSpec {
8+ constructor ( public readonly expeditionId : BrowserSessionId ) { }
9+
10+ asJson ( ) : any {
11+ return {
12+ 'type' : 'OfflineExpeditionSpec' ,
13+ 'expeditionId' : this . expeditionId
14+ } ;
15+ }
16+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ export class DeviceClient {
2626 */
2727 constructor ( private session : WebmateAPISession ) { }
2828
29+ /**
30+ * Get Device info for Device Id.
31+ *
32+ * @param deviceId Id of Device for which info should be fetched.
33+ * @return device info.
34+ */
35+ public getDeviceInfo ( deviceId : DeviceId ) : Observable < DeviceDTO > {
36+ return this . apiClient . getDeviceInfo ( deviceId ) ;
37+ }
38+
2939 /**
3040 * Get all Device ids for a project.
3141 *
@@ -175,6 +185,7 @@ export class DeviceClient {
175185
176186export class DeviceApiClient extends WebmateAPIClient {
177187
188+ private getDeviceInfoRoute = new UriTemplate ( "/device/devices/${deviceId}" ) ;
178189 private getDeviceIdsForProjectRoute = new UriTemplate ( "/projects/${projectId}/device/devices" ) ;
179190 private requestDeviceByRequirementsForProjectRoute = new UriTemplate ( "/projects/${projectId}/device/devices" ) ;
180191 private synchronizeDeviceRoute = new UriTemplate ( "/device/devices/${deviceId}/sync" ) ;
@@ -191,6 +202,10 @@ export class DeviceApiClient extends WebmateAPIClient {
191202 super ( authInfo , environment ) ;
192203 }
193204
205+ public getDeviceInfo ( deviceId : DeviceId ) : Observable < DeviceDTO > {
206+ return this . sendGET ( this . getDeviceInfoRoute , Map ( { "deviceId" : deviceId } ) ) ;
207+ }
208+
194209 public getDeviceIdsForProject ( projectId : ProjectId ) : Observable < Array < DeviceId > > {
195210 return this . sendGET ( this . getDeviceIdsForProjectRoute , Map ( { "projectId" : projectId } ) ) ;
196211 }
You can’t perform that action at this time.
0 commit comments