@opentap/runner-client 2.29.0 → 2.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +253 -0
- package/dist/cjs/DTOs.d.ts +1505 -0
- package/dist/cjs/RunnerClient.d.ts +93 -0
- package/dist/cjs/SessionClient.d.ts +359 -0
- package/dist/cjs/SystemClient.d.ts +62 -0
- package/dist/cjs/encoders.d.ts +7 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/requestDTOs.d.ts +78 -0
- package/dist/cjs/utils.d.ts +11 -0
- package/dist/mjs/package.json +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ConnectionOptions, Consumer, NatsError, Subscription, SubscriptionOptions } from 'nats.ws';
|
|
2
|
+
import { RunnerUpdateRequest } from './requestDTOs';
|
|
3
|
+
import { ISession, ISessionMetricInfo, Image, MetadataUpdatedEvent, RepositoryPackageReference, Session } from './DTOs';
|
|
4
|
+
import { BaseClient } from './BaseClient';
|
|
5
|
+
export declare class RunnerClient extends BaseClient {
|
|
6
|
+
private runnerId;
|
|
7
|
+
default: {
|
|
8
|
+
startSession: (testPlanRepositoryReference?: RepositoryPackageReference, timeout?: number) => Promise<Session>;
|
|
9
|
+
startSessionWithOverriddenImage: (testPlanReference?: RepositoryPackageReference, imageOverride?: Image, timeout?: number) => Promise<Session>;
|
|
10
|
+
getImage: () => Promise<Image>;
|
|
11
|
+
setImage: (image: Image) => Promise<Image>;
|
|
12
|
+
getSettings: () => Promise<RepositoryPackageReference | undefined>;
|
|
13
|
+
setSettings: (repositoryPackageReference: RepositoryPackageReference) => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
constructor(baseSubject: string, options: ConnectionOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Get the created image with the specified ID.
|
|
18
|
+
* @param imageId
|
|
19
|
+
* @returns {{Promise<Image>}}
|
|
20
|
+
*/
|
|
21
|
+
getImage(imageId: string): Promise<Image>;
|
|
22
|
+
/**
|
|
23
|
+
* Get all created images
|
|
24
|
+
* @returns {{Promise<Image[]>}}
|
|
25
|
+
*/
|
|
26
|
+
getImages(): Promise<Image[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Get all sessions
|
|
29
|
+
* @returns {{Promise<Session[]>}}
|
|
30
|
+
*/
|
|
31
|
+
getSessions(): Promise<Session[]>;
|
|
32
|
+
setSession(session: ISession): Promise<Session>;
|
|
33
|
+
/**
|
|
34
|
+
* Create a OpenTAP package configuration image from a list image inputs consisting of user specified packages and repositories.
|
|
35
|
+
* @param {Image[]} images List of images
|
|
36
|
+
* @param {number} timeout Optional timeout in milliseconds
|
|
37
|
+
* @returns {{Promise<Image>}}
|
|
38
|
+
*/
|
|
39
|
+
resolveImage(images: Image[], timeout?: number): Promise<Image>;
|
|
40
|
+
/**
|
|
41
|
+
* Dry runs to resolve an image from a list of images. Dry run means that no packages will be downloaded.
|
|
42
|
+
* @param {Image[]} images List of images
|
|
43
|
+
* @param {number} timeout Optional timeout in milliseconds
|
|
44
|
+
* @returns {{Promise<Image>}}
|
|
45
|
+
*/
|
|
46
|
+
resolveImageDryRun(images: Image[], timeout?: number): Promise<Image>;
|
|
47
|
+
/**
|
|
48
|
+
* Shut down a session
|
|
49
|
+
* @param sessionId the ID of the session to shut down
|
|
50
|
+
* @returns {{Promise<void>}}
|
|
51
|
+
*/
|
|
52
|
+
shutdownSession(sessionId: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Start a session
|
|
55
|
+
* @returns {{Promise<Session>}}
|
|
56
|
+
*/
|
|
57
|
+
startSession(): Promise<Session>;
|
|
58
|
+
/**
|
|
59
|
+
* Get the session manager image.
|
|
60
|
+
* @returns {{Promise<Image>}}
|
|
61
|
+
*/
|
|
62
|
+
getSessionManagerImage(): Promise<Image>;
|
|
63
|
+
/**
|
|
64
|
+
* Start a session based on an image.
|
|
65
|
+
* @param imageId
|
|
66
|
+
* @returns {{Promise<Session>}}
|
|
67
|
+
*/
|
|
68
|
+
startImageSession(image: Image): Promise<Session>;
|
|
69
|
+
/**
|
|
70
|
+
* Update the `Runner` plugin to the given version
|
|
71
|
+
* @param runnerUpdateRequest
|
|
72
|
+
* @returns {{Promise<void>}}
|
|
73
|
+
*/
|
|
74
|
+
updateRunner(runnerUpdateRequest: RunnerUpdateRequest): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Subscribe to the MetadataUpdated event
|
|
77
|
+
* @param {(event:MetadataUpdatedEvent|undefined,err:NatsError|Error|null)=>void} handler
|
|
78
|
+
* @param {SubscriptionOptions} options?
|
|
79
|
+
* @returns Subscription
|
|
80
|
+
*/
|
|
81
|
+
connectMetadataUpdatedEvents(handler: (event: MetadataUpdatedEvent | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
82
|
+
/**
|
|
83
|
+
* Connect to metrics published for the given SessionMetricInfo from the idle session
|
|
84
|
+
* @param {ISessionMetricInfo} metricInfo
|
|
85
|
+
* @param {(result:MetricValue|undefined,err:NatsError|Error|null)=>void} handler
|
|
86
|
+
* @param {SubscriptionOptions} options?
|
|
87
|
+
* @returns Subscription
|
|
88
|
+
*/
|
|
89
|
+
connectMetric(metricInfo: ISessionMetricInfo, inactiveThresholdMilliseconds: number, maxBatchSize: number, handler: (metricData: {
|
|
90
|
+
encodedMetrics: Uint8Array[];
|
|
91
|
+
timestamps: number[];
|
|
92
|
+
}) => void): Promise<Consumer>;
|
|
93
|
+
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, IMetricsConfiguration, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Resource, Result, RunStatus, SessionEvent, Setting, TestPlan, TestRun, TestStepType, TestStepValidationError, WatchDog } from './DTOs';
|
|
2
|
+
import { ConnectionOptions, NatsError, Subscription, SubscriptionOptions } from 'nats.ws';
|
|
3
|
+
import { BaseClient } from './BaseClient';
|
|
4
|
+
export declare class SessionClient extends BaseClient {
|
|
5
|
+
private subscriptions;
|
|
6
|
+
constructor(baseSubject: string, options: ConnectionOptions);
|
|
7
|
+
/**
|
|
8
|
+
* @param sessionLogsHandler Function to be called when log list or error is received
|
|
9
|
+
* @param options (optional) Subscription options
|
|
10
|
+
* @returns Subscription object
|
|
11
|
+
*/
|
|
12
|
+
connectSessionLogs(sessionLogsHandler: (logList: LogList | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
13
|
+
/**
|
|
14
|
+
* @param eventHandler Function to be called when session event or error is received
|
|
15
|
+
* @param options (optional) Subscription options
|
|
16
|
+
* @returns Subscription object
|
|
17
|
+
*/
|
|
18
|
+
connectSessionEvents(eventHandler: (sessionEvent: SessionEvent | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): void;
|
|
19
|
+
/**
|
|
20
|
+
* @param resultHandler Function to be called when result or error is received
|
|
21
|
+
* @param testRunHandler Function to be called when test run or error is received
|
|
22
|
+
* @param options (optional) Subscription options
|
|
23
|
+
* @returns Subscription array: Result and Test Run subscriptions
|
|
24
|
+
*/
|
|
25
|
+
connectSessionResults(resultHandler: (result: Result | undefined, err: NatsError | Error | null) => void, testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): [Subscription, Subscription];
|
|
26
|
+
/**
|
|
27
|
+
* @param testRunHandler Function to be called when test run or error is received
|
|
28
|
+
* @param options (optional) Subscription options
|
|
29
|
+
* @returns Subscription array: Result and Test Run subscriptions
|
|
30
|
+
*/
|
|
31
|
+
connectTestRunEvents(testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
32
|
+
/**
|
|
33
|
+
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
34
|
+
* @param {string} testPlanRunId
|
|
35
|
+
* @param {(event:OnTestPlanRun|undefined,err:NatsError|Error|null)=>void} handler
|
|
36
|
+
* @param {SubscriptionOptions} options?
|
|
37
|
+
* @returns Subscription
|
|
38
|
+
*/
|
|
39
|
+
connectTestPlanRunEvents(testPlanRunId: string, handler: (event: OnTestPlanRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
40
|
+
/**
|
|
41
|
+
* Connect to listen to the test plan run logs for the given test plan run ID
|
|
42
|
+
* @param {string} testPlanRunId
|
|
43
|
+
* @param {(logList:LogList|undefined,err:NatsError|Error|null)=>void} handler
|
|
44
|
+
* @param {SubscriptionOptions} options?
|
|
45
|
+
* @returns Subscription
|
|
46
|
+
*/
|
|
47
|
+
connectTestPlanRunLogs(testPlanRunId: string, handler: (logList: LogList | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
48
|
+
/**
|
|
49
|
+
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
50
|
+
* @param {string} testPlanRunId
|
|
51
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
52
|
+
* @param {SubscriptionOptions} options?
|
|
53
|
+
* @returns Subscription
|
|
54
|
+
*/
|
|
55
|
+
connectTestPlanRunParameterEvents(testPlanRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
56
|
+
/**
|
|
57
|
+
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
58
|
+
* @param {string} testPlanRunId
|
|
59
|
+
* @param {string} testStepRunId
|
|
60
|
+
* @param {(testRun:OnTestStepRun|undefined,err:NatsError|Error|null)=>void} handler
|
|
61
|
+
* @param {SubscriptionOptions} options?
|
|
62
|
+
* @returns Subscription
|
|
63
|
+
*/
|
|
64
|
+
connectTestStepRunEvents(testPlanRunId: string, testStepRunId: string, handler: (testStepRunId: string | undefined, testRun: OnTestStepRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
65
|
+
/**
|
|
66
|
+
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
67
|
+
* @param {string} testPlanRunId
|
|
68
|
+
* @param {string} testStepRunId
|
|
69
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
70
|
+
* @param {SubscriptionOptions} options?
|
|
71
|
+
* @returns Subscription
|
|
72
|
+
*/
|
|
73
|
+
connectTestStepRunParameterEvents(testPlanRunId: string, testStepRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
74
|
+
/**
|
|
75
|
+
* Connect to listen to the test step run results for the given test step and test plan run ID
|
|
76
|
+
* @param {string} testPlanRunId
|
|
77
|
+
* @param {string} testStepRunId
|
|
78
|
+
* @param {string} resultName
|
|
79
|
+
* @param {(result:Result|undefined,err:NatsError|Error|null)=>void} handler
|
|
80
|
+
* @param {SubscriptionOptions} options?
|
|
81
|
+
* @returns Subscription
|
|
82
|
+
*/
|
|
83
|
+
connectTestStepRunResults(testPlanRunId: string, testStepRunId: string, resultName: string, handler: (result: Result | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
84
|
+
/**
|
|
85
|
+
* Unsubscibe from session events
|
|
86
|
+
*/
|
|
87
|
+
unsubscribeSessionEvents(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve session logs
|
|
90
|
+
* @param id (optional)
|
|
91
|
+
* @param level (optional)
|
|
92
|
+
* @param excludedSource (optional)
|
|
93
|
+
* @param filterText (optional)
|
|
94
|
+
* @param offset (optional)
|
|
95
|
+
* @param limit (optional)
|
|
96
|
+
* @return Successfully retrieved OpenTAP log messages.
|
|
97
|
+
*/
|
|
98
|
+
getSessionLogs(id?: string, levels?: number[], excludedSources?: string[], filterText?: string, offset?: number, limit?: number): Promise<LogList>;
|
|
99
|
+
/**
|
|
100
|
+
* Retrieve session log indexes
|
|
101
|
+
* @param id (optional)
|
|
102
|
+
* @param level (optional)
|
|
103
|
+
* @param excludedSource (optional)
|
|
104
|
+
* @param filterText (optional)
|
|
105
|
+
* @param searchText (optional)
|
|
106
|
+
* @return Logs indexes retrieved
|
|
107
|
+
*/
|
|
108
|
+
sessionLogSearch(id: string | undefined, levels: number[] | null | undefined, excludedSources: string[] | null | undefined, filterText: string | null | undefined, searchText: string | null | undefined): Promise<number[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Retrieve log sources
|
|
111
|
+
* @param id (optional)
|
|
112
|
+
* @return Logs indexes retrieved
|
|
113
|
+
*/
|
|
114
|
+
sessionLogSources(id: string | undefined): Promise<string[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Retrieve session log counts
|
|
117
|
+
* @param id (optional)
|
|
118
|
+
* @return Logs indexes retrieved
|
|
119
|
+
*/
|
|
120
|
+
sessionLogCounts(id: string | undefined): Promise<{
|
|
121
|
+
[key: string]: number;
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* Retrieve log severities
|
|
125
|
+
* @return Log levels retrieved
|
|
126
|
+
*/
|
|
127
|
+
logLevels(): Promise<{
|
|
128
|
+
[key: string]: string;
|
|
129
|
+
}>;
|
|
130
|
+
/**
|
|
131
|
+
* Get status, with an optional testplan execution completion timeout
|
|
132
|
+
* @param {number | null | undefined} timeout (optional)
|
|
133
|
+
* @return RunStatus retrieved
|
|
134
|
+
*/
|
|
135
|
+
getStatus(timeout: number | null | undefined): Promise<RunStatus>;
|
|
136
|
+
/**
|
|
137
|
+
* Upload test plan XML
|
|
138
|
+
* @param xml Test Plan XML
|
|
139
|
+
* @return Test plan loaded. List of load errors is returned.
|
|
140
|
+
*/
|
|
141
|
+
setTestPlanXML(xml: string): Promise<string[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Retrieve loaded test plan XML
|
|
144
|
+
* @return Test plan retrieved
|
|
145
|
+
*/
|
|
146
|
+
getTestPlanXML(): Promise<string>;
|
|
147
|
+
/**
|
|
148
|
+
* Downloads the resource from the runner and returns it as raw bytes
|
|
149
|
+
* @return Raw bytes representing the resource
|
|
150
|
+
*/
|
|
151
|
+
downloadResource(resource: Resource): Promise<Uint8Array>;
|
|
152
|
+
/**
|
|
153
|
+
* Load test plan using a test plan TapPackage from a repository
|
|
154
|
+
* @param {RepositoryPackageDefinition} packageReference
|
|
155
|
+
* @return Test plan loaded. List of load errors is returned.
|
|
156
|
+
*/
|
|
157
|
+
loadTestPlanFromRepository(packageReference: RepositoryPackageReference): Promise<string[]>;
|
|
158
|
+
/**
|
|
159
|
+
* Save currently loaded test plan to a repository
|
|
160
|
+
* @param {RepositoryPackageDefinition} packageReference
|
|
161
|
+
* @return Test plan uploaded.
|
|
162
|
+
*/
|
|
163
|
+
saveTestPlanToRepository(packageReference: RepositoryPackageDefinition): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Test plan resources opened
|
|
166
|
+
* @return Test plan resources opened.
|
|
167
|
+
*/
|
|
168
|
+
resourcesOpen(): Promise<TestPlan>;
|
|
169
|
+
/**
|
|
170
|
+
* Test plan resources closed
|
|
171
|
+
* @return Test plan resources closed.
|
|
172
|
+
*/
|
|
173
|
+
resourcesClose(): Promise<TestPlan>;
|
|
174
|
+
/**
|
|
175
|
+
* Retrieve test plan or test step settings
|
|
176
|
+
* @param {string} contextId
|
|
177
|
+
* @return List of settings retrieved
|
|
178
|
+
*/
|
|
179
|
+
getSettings(contextId: string): Promise<Setting[]>;
|
|
180
|
+
/**
|
|
181
|
+
* Change test plan or test step settings
|
|
182
|
+
* @param {string} contextId
|
|
183
|
+
* @param {Setting[]} settings
|
|
184
|
+
* @return Settings changed
|
|
185
|
+
*/
|
|
186
|
+
setSettings(contextId: string, settings: Setting[]): Promise<Setting[]>;
|
|
187
|
+
/**
|
|
188
|
+
* Retrieve test plan structure
|
|
189
|
+
* @param {string[] | null | undefined} properties
|
|
190
|
+
* @return Test plan retrieved
|
|
191
|
+
*/
|
|
192
|
+
getTestPlan(properties: string[] | null | undefined): Promise<TestPlan>;
|
|
193
|
+
/**
|
|
194
|
+
* Change test plan structure
|
|
195
|
+
* @param {TestPlan} plan
|
|
196
|
+
* @return Test plan changed
|
|
197
|
+
*/
|
|
198
|
+
setTestPlan(plan: TestPlan): Promise<TestPlan>;
|
|
199
|
+
/**
|
|
200
|
+
* Set the name of the test plan
|
|
201
|
+
* @param {string} testPlanName
|
|
202
|
+
* @return {Promise<void>}
|
|
203
|
+
*/
|
|
204
|
+
setTestPlanName(testPlanName: string): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Retrieve all validation errors present in the test plan
|
|
207
|
+
* @return Retrieved validation errors for loaded TestPlan
|
|
208
|
+
*/
|
|
209
|
+
getValidationErrors(): Promise<TestStepValidationError[]>;
|
|
210
|
+
/**
|
|
211
|
+
* Retrieve or change common test step settings
|
|
212
|
+
* @param {CommonSettings} commonSettings
|
|
213
|
+
* @return Common test step settings retrieved or changed
|
|
214
|
+
*/
|
|
215
|
+
commonStepSettings(commonSettings: CommonSettings): Promise<CommonSettings>;
|
|
216
|
+
/**
|
|
217
|
+
* Retrieve or invoke common test step settings context menu items
|
|
218
|
+
* @param {string} propertyName
|
|
219
|
+
* @param {TestPlan} commonContext
|
|
220
|
+
* @return Get context menu (right-click menu) for a property in the testplan or teststep
|
|
221
|
+
*/
|
|
222
|
+
commonStepSettingsContextMenu(propertyName: string | null, commonContext: CommonContext): Promise<CommonContext>;
|
|
223
|
+
/**
|
|
224
|
+
* Retrieve all pending user input IDs
|
|
225
|
+
* @return Retrieved pending user inputs
|
|
226
|
+
*/
|
|
227
|
+
getUserInputs(): Promise<string[]>;
|
|
228
|
+
/**
|
|
229
|
+
* Retrieve pending user input based on ID
|
|
230
|
+
* @param {string} id
|
|
231
|
+
* @return Retrieved pending user input
|
|
232
|
+
*/
|
|
233
|
+
getUserInput(id: string): Promise<Interaction>;
|
|
234
|
+
/**
|
|
235
|
+
* Modify or answer pending user input based on ID
|
|
236
|
+
* @param interaction
|
|
237
|
+
* @returns {Promise<Interaction>}
|
|
238
|
+
*/
|
|
239
|
+
setUserInput(interaction: Interaction): Promise<Interaction>;
|
|
240
|
+
/**
|
|
241
|
+
* Property context menu
|
|
242
|
+
* @param {string} contextId
|
|
243
|
+
* @param {string | null} propertyName
|
|
244
|
+
* @return Get context menu (right-click menu) for a property in the testplan or teststep
|
|
245
|
+
*/
|
|
246
|
+
getContextMenu(contextId: string, propertyName: string | null): Promise<Setting[]>;
|
|
247
|
+
/**
|
|
248
|
+
* Property context menu
|
|
249
|
+
* @param {string} contextId
|
|
250
|
+
* @param {string | null} propertyName
|
|
251
|
+
* @param {Setting[]} contextMenu
|
|
252
|
+
* @return Set context menu (right-click menu) for a property in the testplan or teststep
|
|
253
|
+
*/
|
|
254
|
+
setContextMenu(contextId: string, propertyName: string | null, contextMenu: Setting[]): Promise<Setting[]>;
|
|
255
|
+
/**
|
|
256
|
+
* Get data grid
|
|
257
|
+
* @param {string} contextId
|
|
258
|
+
* @param {string | null} propertyName
|
|
259
|
+
* @return DataGridControl retrieved
|
|
260
|
+
*/
|
|
261
|
+
getDataGrid(contextId: string, propertyName: string | null): Promise<DataGridControl>;
|
|
262
|
+
/**
|
|
263
|
+
* Set data grid
|
|
264
|
+
* @return Set data grid
|
|
265
|
+
*/
|
|
266
|
+
setDataGrid(contextId: string, propertyName: string, dataGridControl: DataGridControl): Promise<DataGridControl>;
|
|
267
|
+
/**
|
|
268
|
+
* Add item type to data grid
|
|
269
|
+
* @param {string} contextId
|
|
270
|
+
* @param {string | null} propertyName
|
|
271
|
+
* @param {string | null} typeName
|
|
272
|
+
* @return DataGridControl retrieved
|
|
273
|
+
*/
|
|
274
|
+
addDataGridItemType(contextId: string, propertyName: string | null, typeName: string | null): Promise<DataGridControl>;
|
|
275
|
+
/**
|
|
276
|
+
* Add item to data grid
|
|
277
|
+
* @param {string} contextId
|
|
278
|
+
* @param {string | null} propertyName
|
|
279
|
+
* @return DataGridControl retrieved
|
|
280
|
+
*/
|
|
281
|
+
addDataGridItem(contextId: string, propertyName: string | null): Promise<DataGridControl>;
|
|
282
|
+
/**
|
|
283
|
+
* Get item types available in the data grid
|
|
284
|
+
* @param {string} contextId
|
|
285
|
+
* @param {string | null} propertyName
|
|
286
|
+
* @return List of ListItemType retrieved
|
|
287
|
+
*/
|
|
288
|
+
getDataGridTypes(contextId: string, propertyName: string | null): Promise<ListItemType[]>;
|
|
289
|
+
/**
|
|
290
|
+
* Retrieve static available step type information.
|
|
291
|
+
* @return StepTypes retrieved
|
|
292
|
+
*/
|
|
293
|
+
getStepTypes(): Promise<TestStepType[]>;
|
|
294
|
+
/**
|
|
295
|
+
* Pause test plan execution at next possible test step
|
|
296
|
+
*/
|
|
297
|
+
setPauseNext(): Promise<void>;
|
|
298
|
+
/**
|
|
299
|
+
* Retrieve breakpoints set in test plan
|
|
300
|
+
*/
|
|
301
|
+
getBreakpoints(): Promise<BreakPoints>;
|
|
302
|
+
/**
|
|
303
|
+
* Set breakpoints in test plan
|
|
304
|
+
* @param {BreakPoints} breakPointsDto
|
|
305
|
+
* @return BreakPoints retrieved
|
|
306
|
+
*/
|
|
307
|
+
setBreakpoints(breakPointsDto: BreakPoints): Promise<BreakPoints>;
|
|
308
|
+
/**
|
|
309
|
+
* Jump test plan execution to step. Execution state must be 'breaking'.
|
|
310
|
+
* @param {string} stepId
|
|
311
|
+
*/
|
|
312
|
+
setJumpToStep(stepId: string): Promise<void>;
|
|
313
|
+
/**
|
|
314
|
+
* Execute test plan with attaching metadata
|
|
315
|
+
* @param {Parameter[]} parameters
|
|
316
|
+
* @return RunStatus retrieved
|
|
317
|
+
*/
|
|
318
|
+
runTestPlan(parameters: Parameter[]): Promise<RunStatus>;
|
|
319
|
+
/**
|
|
320
|
+
* Abort test plan execution
|
|
321
|
+
*/
|
|
322
|
+
abortTestPlan(): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Shuts down session
|
|
325
|
+
*/
|
|
326
|
+
shutdown(): Promise<void>;
|
|
327
|
+
/**
|
|
328
|
+
* Retrieves installed packages in this session
|
|
329
|
+
*/
|
|
330
|
+
getImage(): Promise<Image>;
|
|
331
|
+
/**
|
|
332
|
+
* Retrieves session readiness
|
|
333
|
+
*/
|
|
334
|
+
getReadiness(): Promise<void>;
|
|
335
|
+
/**
|
|
336
|
+
* Retrieves watchdog
|
|
337
|
+
*/
|
|
338
|
+
getWatchDog(): Promise<WatchDog>;
|
|
339
|
+
/**
|
|
340
|
+
* Sets a new watchdog
|
|
341
|
+
* @param {WatchDog} watchDog
|
|
342
|
+
*/
|
|
343
|
+
setWatchDog(watchDog: WatchDog): Promise<WatchDog>;
|
|
344
|
+
/**
|
|
345
|
+
* Retrieve settings types used in creating a Settings TapPackage
|
|
346
|
+
*/
|
|
347
|
+
getSettingsTypes(): Promise<string[]>;
|
|
348
|
+
/**
|
|
349
|
+
* Get the metric information
|
|
350
|
+
* @returns Promise
|
|
351
|
+
*/
|
|
352
|
+
getMetricsConfiguration(): Promise<MetricsConfiguration>;
|
|
353
|
+
/**
|
|
354
|
+
* Set the metric information. Used for setting up which metrics should be published for polling.
|
|
355
|
+
* @param {IMetricsConfiguration} metricsRequest
|
|
356
|
+
* @returns Promise
|
|
357
|
+
*/
|
|
358
|
+
setMetricsConfiguration(metricsRequest: IMetricsConfiguration): Promise<void>;
|
|
359
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ConnectionOptions, Subscription, SubscriptionOptions } from 'nats.ws';
|
|
2
|
+
import { ErrorResponse, RunnerEvent, TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs } from './DTOs';
|
|
3
|
+
import { BaseClient } from './BaseClient';
|
|
4
|
+
export interface RunnerLifetimeEvent {
|
|
5
|
+
RunnerId: string;
|
|
6
|
+
Subject: string;
|
|
7
|
+
Discriminator: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class SystemClient extends BaseClient {
|
|
10
|
+
constructor(baseSubject: string, options: ConnectionOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Subscribe to the lifetime event.
|
|
13
|
+
* @param listener
|
|
14
|
+
* @param {SubscriptionOptions} options
|
|
15
|
+
* @returns {Subscription}
|
|
16
|
+
*/
|
|
17
|
+
subscribeLifetimeEventListener(listener: (error: ErrorResponse | null, message: RunnerLifetimeEvent | null) => void, options?: SubscriptionOptions): Subscription;
|
|
18
|
+
/**
|
|
19
|
+
* Subscribe to the runner updated events for the given Runner ID.
|
|
20
|
+
* Wildcard can be used to receive all runner updated events.
|
|
21
|
+
* @param {string} runnerId
|
|
22
|
+
* @param {(error:ErrorResponse|null,message:RunnerEvent|null)=>void} listener
|
|
23
|
+
* @param {SubscriptionOptions} options?
|
|
24
|
+
*/
|
|
25
|
+
subscribeRunnerUpdatedEvents(runnerId: string, listener: (error: ErrorResponse | null, message: RunnerEvent | null) => void, options?: SubscriptionOptions): Subscription;
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to the test step run start events for the given Runner and Run ID.
|
|
28
|
+
* Wildcard can be used for the Runner or Run ID to receive all test step run start events.
|
|
29
|
+
* @param {string} runnerId
|
|
30
|
+
* @param {string} runId
|
|
31
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
32
|
+
* @param {SubscriptionOptions} options?
|
|
33
|
+
*/
|
|
34
|
+
subscribeTestStepRunStartEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestStepRunStartEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
35
|
+
/**
|
|
36
|
+
* Subscribe to the test step run completed events for the given Runner and Run ID.
|
|
37
|
+
* Wildcard can be used for the Runner or Run ID to receive all test step run completed events.
|
|
38
|
+
* @param {string} runnerId
|
|
39
|
+
* @param {string} runId
|
|
40
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
41
|
+
* @param {SubscriptionOptions} options?
|
|
42
|
+
*/
|
|
43
|
+
subscribeTestStepRunCompletedEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestStepRunCompletedEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
44
|
+
/**
|
|
45
|
+
* Subscribe to the test plan run start events for the given Runner and Run ID.
|
|
46
|
+
* Wildcard can be used for the Runner or Run ID to receive all test plan run start events.
|
|
47
|
+
* @param {string} runnerId
|
|
48
|
+
* @param {string} runId
|
|
49
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
50
|
+
* @param {SubscriptionOptions} options?
|
|
51
|
+
*/
|
|
52
|
+
subscribeTestPlanRunStartEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestPlanRunStartEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
53
|
+
/**
|
|
54
|
+
* Subscribe to the test plan run completed events for the given Runner and Run ID.
|
|
55
|
+
* Wildcard can be used for the Runner or Run ID to receive all test plan run completed events.
|
|
56
|
+
* @param {string} runnerId
|
|
57
|
+
* @param {string} runId
|
|
58
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
59
|
+
* @param {SubscriptionOptions} options?
|
|
60
|
+
*/
|
|
61
|
+
subscribeTestPlanRunCompletedEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestPlanRunCompletedEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
62
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Codec } from 'nats.ws';
|
|
2
|
+
export declare const numberCodec: Codec<number>;
|
|
3
|
+
export declare const booleanCodec: Codec<boolean>;
|
|
4
|
+
export declare const stringCodec: Codec<string>;
|
|
5
|
+
export declare const jsonCodec: Codec<unknown>;
|
|
6
|
+
export declare function NumberCodec(): Codec<number>;
|
|
7
|
+
export declare function BooleanCodec(): Codec<boolean>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { booleanCodec, jsonCodec, numberCodec, stringCodec } from './encoders';
|
|
2
|
+
export { RunnerClient } from './RunnerClient';
|
|
3
|
+
export { SessionClient } from './SessionClient';
|
|
4
|
+
export { SystemClient, RunnerLifetimeEvent } from './SystemClient';
|
|
5
|
+
export * from './DTOs';
|
|
6
|
+
export * from 'nats.ws';
|
package/dist/cjs/package.json
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CommonContext, ComponentSettingsBase, ComponentSettingsListItem, DataGridControl, Image, RepositoryPackageReference, Setting } from './DTOs';
|
|
2
|
+
export interface DefaultSessionRequest {
|
|
3
|
+
imageOverride: Image | null;
|
|
4
|
+
testPlanReference: RepositoryPackageReference | null;
|
|
5
|
+
}
|
|
6
|
+
export interface SetSettingsRequest {
|
|
7
|
+
contextId: string;
|
|
8
|
+
settings: Setting[];
|
|
9
|
+
}
|
|
10
|
+
export interface PropertyReferenceRequest {
|
|
11
|
+
contextId: string;
|
|
12
|
+
propertyName: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface SetContextMenuRequest {
|
|
15
|
+
contextId: string;
|
|
16
|
+
propertyName: string | null;
|
|
17
|
+
contextMenu: Setting[];
|
|
18
|
+
}
|
|
19
|
+
export interface SetDataGridRequest {
|
|
20
|
+
contextId: string;
|
|
21
|
+
propertyName: string;
|
|
22
|
+
dataGridControl: DataGridControl;
|
|
23
|
+
}
|
|
24
|
+
export interface AddDataGridItemTypeRequest {
|
|
25
|
+
contextId: string;
|
|
26
|
+
propertyName: string | null;
|
|
27
|
+
typeName: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface CommonStepSettingsContextRequest {
|
|
30
|
+
commonContext: CommonContext;
|
|
31
|
+
propertyName: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface GetSessionLogsRequest {
|
|
34
|
+
id: string | undefined;
|
|
35
|
+
levels: number[] | undefined;
|
|
36
|
+
excludedSources: string[] | undefined;
|
|
37
|
+
filterText: string | undefined;
|
|
38
|
+
offset: number | undefined;
|
|
39
|
+
limit: number | undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface GetSessionSearchRequest {
|
|
42
|
+
id: string | undefined;
|
|
43
|
+
levels: number[] | null | undefined;
|
|
44
|
+
excludedSources: string[] | null | undefined;
|
|
45
|
+
filterText: string | null | undefined;
|
|
46
|
+
searchText: string | null | undefined;
|
|
47
|
+
}
|
|
48
|
+
export interface GetComponentSettingsRequest {
|
|
49
|
+
groupName: string | undefined;
|
|
50
|
+
name: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
export interface SetComponentSettingsRequest extends GetComponentSettingsRequest {
|
|
53
|
+
returnedSettings: ComponentSettingsBase | undefined;
|
|
54
|
+
}
|
|
55
|
+
export interface GetComponentSettingsListItemRequest extends GetComponentSettingsRequest {
|
|
56
|
+
index: number | undefined;
|
|
57
|
+
}
|
|
58
|
+
export interface SetComponentSettingsListItemRequest extends GetComponentSettingsListItemRequest {
|
|
59
|
+
item: ComponentSettingsListItem | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface GetComponentSettingDataGridRequest extends GetComponentSettingsListItemRequest {
|
|
62
|
+
propertyName: string | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface SetComponentSettingDataGridRequest extends GetComponentSettingDataGridRequest {
|
|
65
|
+
dataGridControl: DataGridControl | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface AddComponentSettingDataGridItemTypeRequest extends GetComponentSettingDataGridRequest {
|
|
68
|
+
typeName: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
export interface AddComponentSettingsListItemRequest extends GetComponentSettingsRequest {
|
|
71
|
+
typeName: string | undefined;
|
|
72
|
+
}
|
|
73
|
+
export interface DownloadTapSettingsRequest {
|
|
74
|
+
groupName: string | undefined;
|
|
75
|
+
}
|
|
76
|
+
export interface RunnerUpdateRequest {
|
|
77
|
+
updateTo: string;
|
|
78
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface SubjectParts {
|
|
2
|
+
runnerId: string | undefined;
|
|
3
|
+
sessionId: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Get the runner ID and session ID from the subject as SubjectParts.
|
|
7
|
+
* @param {string} subject
|
|
8
|
+
* @returns SubjectParts
|
|
9
|
+
*/
|
|
10
|
+
export declare const getSubjectParts: (subject: string) => SubjectParts;
|
|
11
|
+
export {};
|
package/dist/mjs/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentap/runner-client",
|
|
3
|
-
"version": "2.29.
|
|
3
|
+
"version": "2.29.1",
|
|
4
4
|
"description": "This is the web client for the OpenTAP Runner.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/mjs/index.js",
|
|
7
7
|
"types": "./dist/mjs/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
"import": "./dist/mjs/index.js",
|
|
10
|
-
"require": "./dist/cjs/index.js"
|
|
10
|
+
"require": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/cjs/index.d.ts"
|
|
11
12
|
},
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "rimraf ./dist && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && bash ./post-build.sh",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"typescript": "^4.8.2"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"nats.ws": "
|
|
49
|
+
"nats.ws": "~1.29.0",
|
|
49
50
|
"uuid": "^9.0.0",
|
|
50
51
|
"events": "^3.3.0"
|
|
51
52
|
},
|