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

Follow recent tsp-typescript-client API additions for configurations #1140

Merged
merged 1 commit into from
Nov 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -735,7 +735,7 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
{...outputProps}
></TraceOverviewComponent>
);
case 'TIME_GRAPH':
case ProviderType.TIME_GRAPH:
if (this.chartPersistedState && this.chartPersistedState.output.id === output.id) {
outputProps.persistChartState = this.chartPersistedState.payload;
this.chartPersistedState = undefined;
Expand All @@ -749,7 +749,7 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
className={this.state.pinnedView?.id === output.id ? 'pinned-view-shadow' : ''}
/>
);
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;
Expand All @@ -761,15 +761,15 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
className={this.state.pinnedView?.id === output.id ? 'pinned-view-shadow' : ''}
/>
);
case 'TABLE':
case ProviderType.TABLE:
return (
<TableOutputComponent
key={output.id}
{...outputProps}
className={this.state.pinnedView?.id === output.id ? 'pinned-view-shadow' : ''}
/>
);
case 'DATA_TREE':
case ProviderType.DATA_TREE:
return (
<DataTreeOutputComponent
key={output.id}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { OutputAddedSignalPayload } from 'traceviewer-base/lib/signals/output-added-signal-payload';
import { signalManager, Signals } from 'traceviewer-base/lib/signals/signal-manager';
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 { ITspClientProvider } from 'traceviewer-base/lib/tsp-client-provider';
import { ExperimentManager } from 'traceviewer-base/lib/experiment-manager';
Expand Down Expand Up @@ -91,7 +91,7 @@ export class ReactAvailableViewsWidget extends React.Component<ReactAvailableVie
const selectedOutput: OutputDescriptor = this._nodeIdToOutput[id];
this.setState({ selectedOutput: id });
if (selectedOutput && this._selectedExperiment) {
if (selectedOutput.type !== 'NONE') {
if (selectedOutput.type !== ProviderType.NONE) {
signalManager().fireOutputAddedSignal(
new OutputAddedSignalPayload(selectedOutput, this._selectedExperiment)
);
Expand Down
106 changes: 88 additions & 18 deletions theia-extensions/viewer-prototype/src/browser/theia-rpc-tsp-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { inject, injectable, interfaces } from '@theia/core/shared/inversify';
import { ITspClient } from 'tsp-typescript-client/lib/protocol/tsp-client';
import { TspClientResponse } from 'tsp-typescript-client/lib/protocol/tsp-client-response';
import { Trace } from 'tsp-typescript-client/lib/models/trace';
import { Query } from 'tsp-typescript-client/lib/models/query/query';
import { AnnotationCategoriesModel, AnnotationModel } from 'tsp-typescript-client/lib/models/annotation';
import { Configuration } from 'tsp-typescript-client/lib/models/configuration';
import { ConfigurationSourceType } from 'tsp-typescript-client/lib/models/configuration-source';
import { DataTreeEntry } from 'tsp-typescript-client/lib/models/data-tree';
import { EntryModel } from 'tsp-typescript-client/lib/models/entry';
import { Experiment } from 'tsp-typescript-client/lib/models/experiment';
import { GenericResponse } from 'tsp-typescript-client/lib/models/response/responses';
import { HealthStatus } from 'tsp-typescript-client/lib/models/health';
import { Identifier } from 'tsp-typescript-client/lib/models/identifier';
import { XyEntry, XYModel } from 'tsp-typescript-client/lib/models/xy';
import { TimeGraphEntry, TimeGraphArrow, TimeGraphModel } from 'tsp-typescript-client/lib/models/timegraph';
import { AnnotationCategoriesModel, AnnotationModel } from 'tsp-typescript-client/lib/models/annotation';
import { TableModel, ColumnHeaderEntry } from 'tsp-typescript-client/lib/models/table';
import { MarkerSet } from 'tsp-typescript-client/lib/models/markerset';
import { OutputDescriptor } from 'tsp-typescript-client/lib/models/output-descriptor';
import { EntryModel } from 'tsp-typescript-client/lib/models/entry';
import { ConfigurationQuery, OutputConfigurationQuery, Query } from 'tsp-typescript-client/lib/models/query/query';
import { GenericResponse } from 'tsp-typescript-client/lib/models/response/responses';
import { OutputStyleModel } from 'tsp-typescript-client/lib/models/styles';
import { MarkerSet } from 'tsp-typescript-client/lib/models/markerset';
import { DataTreeEntry } from 'tsp-typescript-client/lib/models/data-tree';
import { ConfigurationSourceType } from 'tsp-typescript-client/lib/models/configuration-source';
import { Configuration } from 'tsp-typescript-client/lib/models/configuration';
import { ColumnHeaderEntry, TableModel } from 'tsp-typescript-client/lib/models/table';
import { TimeGraphArrow, TimeGraphEntry, TimeGraphModel } from 'tsp-typescript-client/lib/models/timegraph';
import { Trace } from 'tsp-typescript-client/lib/models/trace';
import { XyEntry, XYModel } from 'tsp-typescript-client/lib/models/xy';
import { ITspClient } from 'tsp-typescript-client/lib/protocol/tsp-client';
import { TspClientResponse } from 'tsp-typescript-client/lib/protocol/tsp-client-response';

export const TspClientProxy = Symbol('TspClientProxy') as symbol & interfaces.Abstract<TspClientProxy>;
export type TspClientProxy = ITspClient;
Expand Down Expand Up @@ -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<TspClientResponse<ConfigurationSourceType[]>> {
return this.toTspClientResponse<ConfigurationSourceType[]>(
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<TspClientResponse<ConfigurationSourceType>> {
return this.toTspClientResponse<ConfigurationSourceType>(
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<TspClientResponse<OutputDescriptor>> {
return this.toTspClientResponse<OutputDescriptor>(
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<TspClientResponse<OutputDescriptor>> {
return this.toTspClientResponse<OutputDescriptor>(
await this.tspClient.deleteDerivedOutput(expUUID, outputID, derivedOutputID)
);
}

/**
* Check the health status of the server
* @returns The Health Status
Expand Down Expand Up @@ -423,24 +490,27 @@ 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<TspClientResponse<Configuration>> {
public async createConfiguration(
typeId: string,
parameters: ConfigurationQuery
): Promise<TspClientResponse<Configuration>> {
return this.toTspClientResponse<Configuration>(await this.tspClient.createConfiguration(typeId, parameters));
}

/**
* 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<TspClientResponse<Configuration>> {
return this.toTspClientResponse<Configuration>(
await this.tspClient.updateConfiguration(typeId, configId, parameters)
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading