-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrpc-interface.ts
More file actions
209 lines (204 loc) · 5.64 KB
/
Copy pathrpc-interface.ts
File metadata and controls
209 lines (204 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
* Copyright (c) 2025 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* json-rpc-codegen generated file: DO NOT EDIT!
*/
export interface Common {
id: string,
description?: string,
doc?: string,
}
export interface Pack extends Common {
overview?: string,
used?: boolean,
references?: string[],
}
export interface PacksInfo {
packs: Pack[],
}
export interface Component extends Common {
pack: string,
implements?: string,
maxInstances?: number,
}
export interface Options {
version?: string,
fixedVendor?: boolean,
enforced?: boolean,
}
export interface CtItem {
name: string,
result?: string,
}
export interface ComponentInstance {
id: string,
selectedCount: number,
resolvedComponent?: Component,
layer?: string,
options?: Options,
}
export interface CtVariant extends CtItem {
components: Component[],
}
export interface CtAggregate extends CtItem {
id: string,
activeVariant?: string,
activeVersion?: string,
selectedCount?: number,
variants: CtVariant[],
layer?: string,
options?: Options,
}
export interface CtTreeItem extends CtItem {
cgroups?: CtGroup[],
aggregates?: CtAggregate[],
}
export type Api = Common;
export type Taxonomy = Common;
export interface CtGroup extends CtTreeItem {
api?: Api,
taxonomy?: Taxonomy,
}
export type Bundle = Common;
export interface CtBundle extends CtTreeItem {
bundle?: Bundle,
}
export interface CtClass extends CtItem {
taxonomy?: Taxonomy,
activeBundle?: string,
bundles: CtBundle[],
}
export interface CtRoot {
classes: CtClass[],
}
export interface Condition {
expression: string,
aggregates?: string[],
}
export interface Result {
result: string,
id: string,
aggregates?: string[],
conditions?: Condition[],
}
export interface Results {
validation?: Result[],
}
export interface UsedItems {
components: ComponentInstance[],
packs: Pack[],
}
export interface LogMessages {
info?: string[],
errors?: string[],
warnings?: string[],
}
export interface ApplyParams {
context: string,
}
export interface ResolveParams {
context: string,
}
export interface LoadSolutionParams {
solution: string,
}
export interface GetPacksInfoParams {
context: string,
}
export interface GetUsedItemsParams {
context: string,
}
export interface GetComponentsTreeParams {
context: string,
all: boolean,
}
export interface SelectComponentParams {
context: string,
id: string,
count: number,
}
export interface SelectVariantParams {
context: string,
id: string,
variant: string,
}
export interface SelectVersionParams {
context: string,
id: string,
version: string,
}
export interface SelectBundleParams {
context: string,
cclass: string,
bundle: string,
}
export interface ValidateComponentsParams {
context: string,
}
export interface RpcInterface {
getVersion(): Promise<string>;
shutdown(): Promise<boolean>;
apply(args: ApplyParams): Promise<boolean>;
resolve(args: ResolveParams): Promise<boolean>;
loadPacks(): Promise<boolean>;
loadSolution(args: LoadSolutionParams): Promise<boolean>;
getPacksInfo(args: GetPacksInfoParams): Promise<PacksInfo>;
getUsedItems(args: GetUsedItemsParams): Promise<UsedItems>;
getComponentsTree(args: GetComponentsTreeParams): Promise<CtRoot>;
selectComponent(args: SelectComponentParams): Promise<boolean>;
selectVariant(args: SelectVariantParams): Promise<boolean>;
selectVersion(args: SelectVersionParams): Promise<boolean>;
selectBundle(args: SelectBundleParams): Promise<boolean>;
validateComponents(args: ValidateComponentsParams): Promise<Results>;
getLogMessages(): Promise<LogMessages>;
}
export abstract class RpcMethods implements RpcInterface {
abstract get<TArgs, TResponse>(remoteMethod: string, args?: TArgs): Promise<TResponse>;
public async getVersion(): Promise<string> {
return this.get('GetVersion');
}
public async shutdown(): Promise<boolean> {
return this.get('Shutdown');
}
public async apply(args: ApplyParams): Promise<boolean> {
return this.get('Apply', args);
}
public async resolve(args: ResolveParams): Promise<boolean> {
return this.get('Resolve', args);
}
public async loadPacks(): Promise<boolean> {
return this.get('LoadPacks');
}
public async loadSolution(args: LoadSolutionParams): Promise<boolean> {
return this.get('LoadSolution', args);
}
public async getPacksInfo(args: GetPacksInfoParams): Promise<PacksInfo> {
return this.get('GetPacksInfo', args);
}
public async getUsedItems(args: GetUsedItemsParams): Promise<UsedItems> {
return this.get('GetUsedItems', args);
}
public async getComponentsTree(args: GetComponentsTreeParams): Promise<CtRoot> {
return this.get('GetComponentsTree', args);
}
public async selectComponent(args: SelectComponentParams): Promise<boolean> {
return this.get('SelectComponent', args);
}
public async selectVariant(args: SelectVariantParams): Promise<boolean> {
return this.get('SelectVariant', args);
}
public async selectVersion(args: SelectVersionParams): Promise<boolean> {
return this.get('SelectVersion', args);
}
public async selectBundle(args: SelectBundleParams): Promise<boolean> {
return this.get('SelectBundle', args);
}
public async validateComponents(args: ValidateComponentsParams): Promise<Results> {
return this.get('ValidateComponents', args);
}
public async getLogMessages(): Promise<LogMessages> {
return this.get('GetLogMessages');
}
}