|
1 | 1 | import { Query } from '../models/query/query';
|
2 | 2 | import { GenericResponse } from '../models/response/responses';
|
3 | 3 | import { XYModel } from '../models/xy';
|
4 |
| -import { TimeGraphArrow, TimeGraphModel } from '../models/timegraph'; |
5 |
| -import { TableModel } from '../models/table'; |
| 4 | +import { TimeGraphEntry, TimeGraphArrow, TimeGraphModel } from '../models/timegraph'; |
| 5 | +import { TableModel, ColumnHeaderEntry } from '../models/table'; |
6 | 6 | import { Trace } from '../models/trace';
|
7 | 7 | import { RestClient } from './rest-client';
|
8 | 8 | import { Experiment } from '../models/experiment';
|
@@ -137,24 +137,24 @@ export class TspClient {
|
137 | 137 | * @param expUUID Experiment UUID
|
138 | 138 | * @param outputID Output ID
|
139 | 139 | * @param parameters Query object
|
140 |
| - * @returns Generic entry response with entries of type T |
| 140 | + * @returns Generic entry response with entries |
141 | 141 | */
|
142 |
| - public async fetchXYTree<M extends Entry, H extends EntryHeader>(expUUID: string, |
143 |
| - outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<EntryModel<M, H>>>> { |
| 142 | + public async fetchXYTree(expUUID: string, |
| 143 | + outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<EntryModel<Entry>>>> { |
144 | 144 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/XY/' + outputID + '/tree';
|
145 |
| - return await RestClient.post<GenericResponse<EntryModel<M, H>>>(url, parameters); |
| 145 | + return await RestClient.post<GenericResponse<EntryModel<Entry>>>(url, parameters); |
146 | 146 | }
|
147 | 147 |
|
148 | 148 | /**
|
149 | 149 | * Fetch XY. model extends XYModel
|
150 | 150 | * @param expUUID Experiment UUID
|
151 | 151 | * @param outputID Output ID
|
152 | 152 | * @param parameters Query object
|
153 |
| - * @returns XY model response with the model of type T |
| 153 | + * @returns XY model response with the model |
154 | 154 | */
|
155 |
| - public async fetchXY<T extends XYModel>(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<T>>> { |
| 155 | + public async fetchXY(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<XYModel>>> { |
156 | 156 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/XY/' + outputID + '/xy';
|
157 |
| - return await RestClient.post<GenericResponse<T>>(url, parameters); |
| 157 | + return await RestClient.post<GenericResponse<XYModel>>(url, parameters); |
158 | 158 | }
|
159 | 159 |
|
160 | 160 | /**
|
@@ -186,36 +186,36 @@ export class TspClient {
|
186 | 186 | * @param expUUID Experiment UUID
|
187 | 187 | * @param outputID Output ID
|
188 | 188 | * @param parameters Query object
|
189 |
| - * @returns Time graph entry response with entries of type T and headers of type U |
| 189 | + * @returns Time graph entry response with entries of type TimeGraphEntry |
190 | 190 | */
|
191 |
| - public async fetchTimeGraphTree<M extends Entry, H extends EntryHeader>(expUUID: string, |
192 |
| - outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<EntryModel<M, H>>>> { |
| 191 | + public async fetchTimeGraphTree(expUUID: string, |
| 192 | + outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<EntryModel<TimeGraphEntry>>>> { |
193 | 193 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/timeGraph/' + outputID + '/tree';
|
194 |
| - return await RestClient.post<GenericResponse<EntryModel<M, H>>>(url, parameters); |
| 194 | + return await RestClient.post<GenericResponse<EntryModel<TimeGraphEntry>>>(url, parameters); |
195 | 195 | }
|
196 | 196 |
|
197 | 197 | /**
|
198 | 198 | * Fetch Time Graph states. Model extends TimeGraphModel
|
199 | 199 | * @param expUUID Experiment UUID
|
200 | 200 | * @param outputID Output ID
|
201 | 201 | * @param parameters Query object
|
202 |
| - * @returns Generic response with the model of type T |
| 202 | + * @returns Generic response with the model |
203 | 203 | */
|
204 |
| - public async fetchTimeGraphStates<T extends TimeGraphModel>(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<T>>> { |
| 204 | + public async fetchTimeGraphStates(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<TimeGraphModel>>> { |
205 | 205 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/timeGraph/' + outputID + '/states';
|
206 |
| - return await RestClient.post<GenericResponse<T>>(url, parameters); |
| 206 | + return await RestClient.post<GenericResponse<TimeGraphModel>>(url, parameters); |
207 | 207 | }
|
208 | 208 |
|
209 | 209 | /**
|
210 | 210 | * Fetch Time Graph arrows. Model extends TimeGraphArrow
|
211 | 211 | * @param expUUID Experiment UUID
|
212 | 212 | * @param outputID Output ID
|
213 | 213 | * @param parameters Query object
|
214 |
| - * @returns Generic response with the model of type T |
| 214 | + * @returns Generic response with the model |
215 | 215 | */
|
216 |
| - public async fetchTimeGraphArrows<T extends TimeGraphArrow>(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<T>>> { |
| 216 | + public async fetchTimeGraphArrows(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<TimeGraphArrow>>> { |
217 | 217 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/timeGraph/' + outputID + '/arrows';
|
218 |
| - return await RestClient.post<GenericResponse<T>>(url, parameters); |
| 218 | + return await RestClient.post<GenericResponse<TimeGraphArrow>>(url, parameters); |
219 | 219 | }
|
220 | 220 |
|
221 | 221 | /**
|
@@ -246,35 +246,35 @@ export class TspClient {
|
246 | 246 | * @param expUUID Experiment UUID
|
247 | 247 | * @param outputID Output ID
|
248 | 248 | * @param parameters Query object
|
249 |
| - * @returns Generic entry response with entries of type T |
| 249 | + * @returns Generic entry response with columns headers as model |
250 | 250 | */
|
251 |
| - public async fetchTableColumns<M extends Entry, H extends EntryHeader>(expUUID: string, |
252 |
| - outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<EntryModel<M, H>>>> { |
| 251 | + public async fetchTableColumns(expUUID: string, |
| 252 | + outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<ColumnHeaderEntry[]>>> { |
253 | 253 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/table/' + outputID + '/columns';
|
254 |
| - return await RestClient.post<GenericResponse<EntryModel<M, H>>>(url, parameters); |
| 254 | + return await RestClient.post<GenericResponse<ColumnHeaderEntry[]>>(url, parameters); |
255 | 255 | }
|
256 | 256 |
|
257 | 257 | /**
|
258 | 258 | * Fetch Table lines
|
259 | 259 | * @param expUUID Experiment UUID
|
260 | 260 | * @param outputID Output ID
|
261 | 261 | * @param parameters Query object
|
262 |
| - * @returns Generic response with the model of type T |
| 262 | + * @returns Generic response with the model |
263 | 263 | */
|
264 |
| - public async fetchTableLines<T extends TableModel>(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<T>>> { |
| 264 | + public async fetchTableLines(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<TableModel>>> { |
265 | 265 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/table/' + outputID + '/lines';
|
266 |
| - return await RestClient.post<GenericResponse<T>>(url, parameters); |
| 266 | + return await RestClient.post<GenericResponse<TableModel>>(url, parameters); |
267 | 267 | }
|
268 | 268 |
|
269 | 269 | /**
|
270 | 270 | * Fetch output styles
|
271 | 271 | * @param expUUID Experiment UUID
|
272 | 272 | * @param outputID Output ID
|
273 | 273 | * @param parameters Query object
|
274 |
| - * @returns Generic response with the model of type T |
| 274 | + * @returns Generic response with the model |
275 | 275 | */
|
276 |
| - public async fetchStyles<T extends OutputStyleModel>(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<T>>> { |
| 276 | + public async fetchStyles(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<OutputStyleModel>>> { |
277 | 277 | const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/' + outputID + '/style';
|
278 |
| - return await RestClient.post<GenericResponse<T>>(url, parameters); |
| 278 | + return await RestClient.post<GenericResponse<OutputStyleModel>>(url, parameters); |
279 | 279 | }
|
280 | 280 | }
|
0 commit comments