Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: support end-point to query entry context #104

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tsp-typescript-client/src/models/query/query-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ export class QueryHelper {
return new Query({ ...timeObj, ...additionalProperties });
}

public static selectionQuery(items: number[], additionalProperties?: { [key: string]: any }): Query {
const selectionObj = {
[this.REQUESTED_ITEMS_KEY]: items
};

return new Query({ ...selectionObj, ...additionalProperties });
}

/**
* Build a simple time query with selected items
* @param requestedTimes Array of requested times
Expand Down
22 changes: 22 additions & 0 deletions tsp-typescript-client/src/protocol/http-tsp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,28 @@ export class HttpTspClient implements ITspClient {
);
}

/**
* Fetch Time Graph tree, Model extends TimeGraphEntry
* @param expUUID Experiment UUID
* @param outputID Output ID
* @param parameters Query object
* @returns Time graph entry response with entries of type TimeGraphEntry
*/
public async fetchTimeGraphTreeContext(
expUUID: string,
outputID: string,
parameters: Query
): Promise<TspClientResponse<GenericResponse<{ [key: string]: unknown }>>> {
const url =
this.baseUrl +
"/experiments/" +
expUUID +
"/outputs/timeGraph/" +
outputID +
"/tree:context";
return RestClient.post(url, parameters);
}

/**
* Fetch Time Graph states. Model extends TimeGraphModel
* @param expUUID Experiment UUID
Expand Down
13 changes: 13 additions & 0 deletions tsp-typescript-client/src/protocol/tsp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,19 @@ export interface ITspClient {
parameters: Query
): Promise<TspClientResponse<GenericResponse<EntryModel<TimeGraphEntry>>>>;

/**
* Fetch Time Graph tree, Model extends TimeGraphEntry
* @param expUUID Experiment UUID
* @param outputID Output ID
* @param parameters Query object
* @returns Time graph entry response with entries of type TimeGraphEntry
*/
fetchTimeGraphTreeContext(
expUUID: string,
outputID: string,
parameters: Query
): Promise<TspClientResponse<GenericResponse<{ [key: string]: unknown }>>>;

/**
* Fetch Time Graph states. Model extends TimeGraphModel
* @param expUUID Experiment UUID
Expand Down
Loading