diff --git a/packages/base/package.json b/packages/base/package.json index fab9d436..09af4ffe 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -16,7 +16,7 @@ "src" ], "dependencies": { - "tsp-typescript-client": "^0.4.3" + "tsp-typescript-client": "^0.5.0" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^3.4.0", diff --git a/packages/react-components/package.json b/packages/react-components/package.json index 5f966dee..a171d634 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -39,7 +39,7 @@ "semantic-ui-react": "^0.86.0", "timeline-chart": "^0.4.1", "traceviewer-base": "0.3.0", - "tsp-typescript-client": "^0.4.3" + "tsp-typescript-client": "^0.5.0" }, "devDependencies": { "@testing-library/react": "^15.0.6", diff --git a/packages/react-components/src/components/trace-context-component.tsx b/packages/react-components/src/components/trace-context-component.tsx index 718bd657..a4eff110 100644 --- a/packages/react-components/src/components/trace-context-component.tsx +++ b/packages/react-components/src/components/trace-context-component.tsx @@ -7,7 +7,7 @@ import '../../style/status-bar.css'; import { Layout, Responsive, WidthProvider } from 'react-grid-layout'; import { TimelineChart } from 'timeline-chart/lib/time-graph-model'; import { TimeGraphUnitController } from 'timeline-chart/lib/time-graph-unit-controller'; -import { OutputDescriptor } from 'tsp-typescript-client/lib/models/output-descriptor'; +import { OutputDescriptor, ProviderType } from 'tsp-typescript-client/lib/models/output-descriptor'; import { Experiment } from 'tsp-typescript-client/lib/models/experiment'; import { ITspClient } from 'tsp-typescript-client/lib/protocol/tsp-client'; import { TimeRange, TimeRangeString } from 'traceviewer-base/lib/utils/time-range'; @@ -735,7 +735,7 @@ export class TraceContextComponent extends React.Component ); - case 'TIME_GRAPH': + case ProviderType.TIME_GRAPH: if (this.chartPersistedState && this.chartPersistedState.output.id === output.id) { outputProps.persistChartState = this.chartPersistedState.payload; this.chartPersistedState = undefined; @@ -749,7 +749,7 @@ export class TraceContextComponent extends React.Component ); - case 'TREE_TIME_XY': + case ProviderType.TREE_TIME_XY: if (this.chartPersistedState && this.chartPersistedState.output.id === output.id) { outputProps.persistChartState = this.chartPersistedState.payload; this.chartPersistedState = undefined; @@ -761,7 +761,7 @@ export class TraceContextComponent extends React.Component ); - case 'TABLE': + case ProviderType.TABLE: return ( ); - case 'DATA_TREE': + case ProviderType.DATA_TREE: return ( ; export type TspClientProxy = ITspClient; @@ -364,6 +364,73 @@ export class TheiaRpcTspProxy implements ITspClient { ); } + /** + * Fetch all configuration source types for a given experiment and output + * @param expUUID Experiment UUID + * @param outputID Output ID + * @returns Generic response with the model + */ + public async fetchOutputConfigurationTypes( + expUUID: string, + outputID: string + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.fetchOutputConfigurationTypes(expUUID, outputID) + ); + } + + /** + * Fetch configuration source type for a given type ID, experiment and output + * @param expUUID Experiment UUID + * @param outputID Output ID + * @param typeID the ID of the configuration source type + * @returns Generic response with the model + */ + public async fetchOutputConfigurationType( + expUUID: string, + outputID: string, + typeID: string + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.fetchOutputConfigurationType(expUUID, outputID, typeID) + ); + } + + /** + * Create a derived output for a given experiment, output and parameters + * @param expUUID Experiment UUID + * @param outputID Output ID + * @param parameters OutputConfigurationQuery object + * @returns the output descriptor of the derived output + */ + public async createDerivedOutput( + expUUID: string, + outputID: string, + parameters: OutputConfigurationQuery + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.createDerivedOutput(expUUID, outputID, parameters) + ); + } + + /** + * Delete a derived output (and it's configuration) for a given experiment, + * output and derived output + * @param expUUID Experiment UUID + * @param outputID Output ID + * @param derivedOutputID the ID of the derived output + * @returns the output descriptor of the deleted derived output + */ + public async deleteDerivedOutput( + expUUID: string, + outputID: string, + derivedOutputID: string + ): Promise> { + return this.toTspClientResponse( + await this.tspClient.deleteDerivedOutput(expUUID, outputID, derivedOutputID) + ); + } + /** * Check the health status of the server * @returns The Health Status @@ -423,10 +490,13 @@ export class TheiaRpcTspProxy implements ITspClient { /** * Create a configuration for a given type ID and parameters * @param typeId the ID of the configuration source type - * @param parameters Query object + * @param parameters ConfigurationQuery object * @returns Generic response with the model */ - public async createConfiguration(typeId: string, parameters: Query): Promise> { + public async createConfiguration( + typeId: string, + parameters: ConfigurationQuery + ): Promise> { return this.toTspClientResponse(await this.tspClient.createConfiguration(typeId, parameters)); } @@ -434,13 +504,13 @@ export class TheiaRpcTspProxy implements ITspClient { * Update a configuration for a given type ID, config ID and parameters * @param typeId the ID of the configuration source type * @param configId the ID of the configuration - * @param parameters Query object + * @param parameters ConfigurationQuery object * @returns Generic response with the model */ public async updateConfiguration( typeId: string, configId: string, - parameters: Query + parameters: ConfigurationQuery ): Promise> { return this.toTspClientResponse( await this.tspClient.updateConfiguration(typeId, configId, parameters) diff --git a/yarn.lock b/yarn.lock index 74e8ae85..de21f128 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13796,10 +13796,10 @@ tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.6.2: resolved "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== -tsp-typescript-client@^0.4.3: - version "0.4.3" - resolved "https://registry.npmjs.org/tsp-typescript-client/-/tsp-typescript-client-0.4.3.tgz#c2a679c8bed359ff09f4532d0365e0ee42dae461" - integrity sha512-6wmi9Y6ftWJHWdNmzt7b5ST2EPP3srDnPfviA/8hSt/VYsFnagDKLCWWuCHVSPee2XmEWG2vfIIy3Q6LzJdHiQ== +tsp-typescript-client@^0.5.0: + version "0.5.0" + resolved "https://registry.npmjs.org/tsp-typescript-client/-/tsp-typescript-client-0.5.0.tgz#02572aeced3e1cba3b82bf07c4d30d6029a980eb" + integrity sha512-bV2fsvce4B9sAsZzO/pP0NrCxJmqugmkO5HHoKQ6MPx34BUH/bQ1ODkhk+Zqv/1Hjw8KLn94EXkTpgcvZmSXuA== dependencies: json-bigint sidorares/json-bigint#2c0a5f896d7888e68e5f4ae3c7ea5cd42fd54473 node-fetch "^2.5.0"