Skip to content

Commit 406fe13

Browse files
committedNov 6, 2024
Support parentId and creation configuration in output descriptors
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
1 parent 9f06ee5 commit 406fe13

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed
 

‎tsp-typescript-client/fixtures/tsp-client/experiment-outputs-0.json

+16
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,21 @@
2222
"name": "Output name",
2323
"description": "Output description",
2424
"type": "TIME_GRAPH"
25+
},
26+
{
27+
"id": "timegraph.output.id2",
28+
"name": "Output name (Config)",
29+
"description": "Output description (Config)",
30+
"type": "TIME_GRAPH",
31+
"parentId": "timegraph.output.id",
32+
"configuration" : {
33+
"id": "my-config-1-id",
34+
"name": "My configuration 1",
35+
"description": "My configuration 1 description",
36+
"sourceTypeId": "my-source-type-1-id",
37+
"parameters": {
38+
"path": "/home/user/tmp"
39+
}
40+
}
2541
}
2642
]

‎tsp-typescript-client/src/models/configuration.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import { createNormalizer } from "../protocol/serialization";
2+
3+
export const Configuration = createNormalizer<Configuration>({
4+
parameters: undefined
5+
});
16

27
/**
38
* Model of a configuration instance

‎tsp-typescript-client/src/models/output-descriptor.ts

+12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import { createNormalizer } from '../protocol/serialization';
2+
import { Configuration } from './configuration';
23

34
export const OutputDescriptor = createNormalizer<OutputDescriptor>({
45
end: BigInt,
56
queryParameters: undefined,
67
start: BigInt,
8+
configuration: Configuration
79
});
810

911
/**
1012
* Descriptor of a specific output provider
1113
*/
1214
export interface OutputDescriptor {
15+
/**
16+
* Output provider's parent ID
17+
*/
18+
parentId?: string;
19+
1320
/**
1421
* Output provider's ID
1522
*/
@@ -56,4 +63,9 @@ export interface OutputDescriptor {
5663
* List of compatible outputs that can be used in the same view (ex. as overlay)
5764
*/
5865
compatibleProviders?: string[];
66+
67+
/**
68+
* Configuration used to create this data provider.
69+
*/
70+
configuration?: Configuration;
5971
}

‎tsp-typescript-client/src/protocol/tsp-client.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('HttpTspClient Deserialization', () => {
124124
const response = await client.experimentOutputs('not-relevant');
125125
const outputs = response.getModel()!;
126126

127-
expect(outputs).toHaveLength(4);
127+
expect(outputs).toHaveLength(5);
128128
});
129129

130130
it('fetchAnnotationsCategories', async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.