@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,253 @@
|
|
|
1
|
+
import { ConnectionOptions, Consumer, ConsumerConfig, JetStreamOptions, NatsError, PublishOptions, Subscription, SubscriptionOptions } from 'nats.ws';
|
|
2
|
+
import { DownloadTapSettingsRequest } from './requestDTOs';
|
|
3
|
+
import { ComponentSettingsBase, ComponentSettingsIdentifier, ComponentSettingsListItem, DataGridControl, ErrorResponse, FileParameter, ListItemType, ProfileGroup, RepositoryPackageReference, RepositorySettingsPackageDefinition } from './DTOs';
|
|
4
|
+
interface BaseClientRequestOptions {
|
|
5
|
+
publishOptions?: PublishOptions;
|
|
6
|
+
rawResponse?: boolean;
|
|
7
|
+
fullSubject?: boolean;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class BaseClient {
|
|
11
|
+
readonly baseSubject: string;
|
|
12
|
+
private connection;
|
|
13
|
+
private connectionOptions;
|
|
14
|
+
private domainAccess;
|
|
15
|
+
private eventEmitter;
|
|
16
|
+
private _accessToken;
|
|
17
|
+
private _headers;
|
|
18
|
+
private _timeout;
|
|
19
|
+
/** Get request access token */
|
|
20
|
+
get accessToken(): string;
|
|
21
|
+
/** Set request access token */
|
|
22
|
+
set accessToken(value: string);
|
|
23
|
+
/** Get request headers */
|
|
24
|
+
get headers(): {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
/** Set request headers */
|
|
28
|
+
set headers(value: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
});
|
|
31
|
+
/** Get timeout */
|
|
32
|
+
get timeout(): number;
|
|
33
|
+
/** Set timeout in milliseconds. Default is 40000 milliseconds */
|
|
34
|
+
set timeout(value: number);
|
|
35
|
+
constructor(baseSubject: string, options: ConnectionOptions);
|
|
36
|
+
private withTimeout;
|
|
37
|
+
/**
|
|
38
|
+
* Send a request to the nats server.
|
|
39
|
+
* @param subject The subject to request
|
|
40
|
+
* @param payload (optional)
|
|
41
|
+
* @param options (optional)
|
|
42
|
+
* @returns Promise of an object
|
|
43
|
+
*/
|
|
44
|
+
protected request<T>(subject: string, payload?: any, options?: BaseClientRequestOptions): Promise<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Handle the error
|
|
47
|
+
* @param error
|
|
48
|
+
* @param subject
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
protected natsErrorHandler(error: NatsError, subject: string): ErrorResponse;
|
|
52
|
+
/**
|
|
53
|
+
* Build the headers' object.
|
|
54
|
+
* @returns {MsgHdrs} Header object
|
|
55
|
+
*/
|
|
56
|
+
private buildHeaders;
|
|
57
|
+
/**
|
|
58
|
+
* Subscribes to given subject.
|
|
59
|
+
* @param subject The subject to subscribe
|
|
60
|
+
* @param options Subscription options
|
|
61
|
+
* @returns Subscription object
|
|
62
|
+
*/
|
|
63
|
+
protected subscribe(subject: string, options: SubscriptionOptions): Subscription;
|
|
64
|
+
/**
|
|
65
|
+
* Subscribes to given subject.
|
|
66
|
+
* @param subject The subject to subscribe
|
|
67
|
+
* @param jetStreamOptions Subscription options
|
|
68
|
+
* @returns Subscription object
|
|
69
|
+
*/
|
|
70
|
+
protected createJetStreamConsumer(stream: string, subject: string, jetStreamOptions?: Partial<JetStreamOptions>, consumerOptions?: Partial<ConsumerConfig>): Promise<Consumer>;
|
|
71
|
+
protected encode(payload: any): Uint8Array;
|
|
72
|
+
/**
|
|
73
|
+
* Create a connection to the nats server.
|
|
74
|
+
* @param {ConnectionOptions} options
|
|
75
|
+
*/
|
|
76
|
+
connect(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Close the connection.
|
|
79
|
+
*/
|
|
80
|
+
close(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Add a domain specific access token to the dictionary.
|
|
83
|
+
* @param {string} domain
|
|
84
|
+
* @param {string} accessToken
|
|
85
|
+
*/
|
|
86
|
+
addDomainAccessToken(domain: string, accessToken: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Generic error callback function.
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
protected error(): ((reason: any) => PromiseLike<never>) | null | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Generic success callback function.
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
protected success<T>(): ((value: T) => T | PromiseLike<T>) | null | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Add an error-event listener.
|
|
99
|
+
* @param listener
|
|
100
|
+
* @returns {EventEmitter}
|
|
101
|
+
*/
|
|
102
|
+
addErrorEventListener(listener: (...args: any[]) => void): void;
|
|
103
|
+
/**
|
|
104
|
+
* Remove an error-event listener.
|
|
105
|
+
* @param listener
|
|
106
|
+
*/
|
|
107
|
+
removeErrorEventListener(listener: (...args: any[]) => void): void;
|
|
108
|
+
/**
|
|
109
|
+
* Retrieve component settings overview
|
|
110
|
+
* @returns {{Promise<ComponentSettingsIdentifier[]>}}
|
|
111
|
+
*/
|
|
112
|
+
getComponentSettingsOverview(): Promise<ComponentSettingsIdentifier[]>;
|
|
113
|
+
/**
|
|
114
|
+
* Change componentsettings
|
|
115
|
+
* @param groupName
|
|
116
|
+
* @param name
|
|
117
|
+
* @param returnedSettings
|
|
118
|
+
* @returns {{Promise<ComponentSettingsBase>}}
|
|
119
|
+
*/
|
|
120
|
+
setComponentSettings(groupName: string, name: string, returnedSettings: ComponentSettingsBase): Promise<ComponentSettingsBase>;
|
|
121
|
+
/**
|
|
122
|
+
* Retrieve componentsettings
|
|
123
|
+
* @param groupName
|
|
124
|
+
* @param name
|
|
125
|
+
* @returns {{Promise<ComponentSettingsBase>}}
|
|
126
|
+
*/
|
|
127
|
+
getComponentSettings(groupName: string, name: string): Promise<ComponentSettingsBase>;
|
|
128
|
+
/**
|
|
129
|
+
* Retrieve componentsettings list item
|
|
130
|
+
* @param groupName
|
|
131
|
+
* @param name
|
|
132
|
+
* @param index
|
|
133
|
+
* @returns {{Promise<ComponentSettingsListItem>}}
|
|
134
|
+
*/
|
|
135
|
+
getComponentSettingsListItem(groupName: string, name: string, index: number): Promise<ComponentSettingsListItem>;
|
|
136
|
+
/**
|
|
137
|
+
* Set componentsettings list item settings
|
|
138
|
+
* @param {string} groupName
|
|
139
|
+
* @param {string} name
|
|
140
|
+
* @param {number} index
|
|
141
|
+
* @param {ComponentSettingsListItem} item
|
|
142
|
+
* @returns {Promise<ComponentSettingsListItem>}
|
|
143
|
+
*/
|
|
144
|
+
setComponentSettingsListItem(groupName: string, name: string, index: number, item: ComponentSettingsListItem): Promise<ComponentSettingsListItem>;
|
|
145
|
+
/**
|
|
146
|
+
* Get component setting data grid
|
|
147
|
+
* @param {string} groupName
|
|
148
|
+
* @param {string} name
|
|
149
|
+
* @param {number} index
|
|
150
|
+
* @param {string} propertyName
|
|
151
|
+
* @returns {Promise<DataGridControl>}
|
|
152
|
+
*/
|
|
153
|
+
getComponentSettingDataGrid(groupName: string, name: string, index: number, propertyName: string): Promise<DataGridControl>;
|
|
154
|
+
/**
|
|
155
|
+
* Set component setting data grid
|
|
156
|
+
* @param {string} groupName
|
|
157
|
+
* @param {string} name
|
|
158
|
+
* @param {number} index
|
|
159
|
+
* @param {string} propertyName
|
|
160
|
+
* @param {DataGridControl} dataGridControl
|
|
161
|
+
* @returns {{Promise<DataGridControl>}}
|
|
162
|
+
*/
|
|
163
|
+
setComponentSettingDataGrid(groupName: string, name: string, index: number, propertyName: string, dataGridControl: DataGridControl): Promise<DataGridControl>;
|
|
164
|
+
/**
|
|
165
|
+
* Add component setting item type to data grid
|
|
166
|
+
* @param {string} groupName
|
|
167
|
+
* @param {string} name
|
|
168
|
+
* @param {number} index
|
|
169
|
+
* @param {string} propertyName
|
|
170
|
+
* @param {string} typeName
|
|
171
|
+
* @returns {Promise<DataGridControl>}
|
|
172
|
+
*/
|
|
173
|
+
addComponentSettingDataGridItemType(groupName: string, name: string, index: number, propertyName: string, typeName: string): Promise<DataGridControl>;
|
|
174
|
+
/**
|
|
175
|
+
* Add component setting item to data grid
|
|
176
|
+
* @param {string} groupName
|
|
177
|
+
* @param {string} name
|
|
178
|
+
* @param {number} index
|
|
179
|
+
* @param {string} propertyName
|
|
180
|
+
* @returns {Promise<DataGridControl>}
|
|
181
|
+
*/
|
|
182
|
+
addComponentSettingDataGridItem(groupName: string, name: string, index: number, propertyName: string): Promise<DataGridControl>;
|
|
183
|
+
/**
|
|
184
|
+
* Get item types available in the component setting data grid
|
|
185
|
+
* @param groupName
|
|
186
|
+
* @param name
|
|
187
|
+
* @param index
|
|
188
|
+
* @param propertyName
|
|
189
|
+
* @returns {Promise<ListItemType[]>}
|
|
190
|
+
*/
|
|
191
|
+
getComponentSettingDataGridTypes(groupName: string, name: string, index: number, propertyName: string): Promise<ListItemType[]>;
|
|
192
|
+
/**
|
|
193
|
+
* Change componentsettings profiles
|
|
194
|
+
* @param {ProfileGroup[]} returnedSettings
|
|
195
|
+
* @returns {Promise<ProfileGroup[]>}
|
|
196
|
+
*/
|
|
197
|
+
setComponentSettingsProfiles(returnedSettings: ProfileGroup[]): Promise<ProfileGroup[]>;
|
|
198
|
+
/**
|
|
199
|
+
* Get componentsettings profiles
|
|
200
|
+
* @returns {Promise<ProfileGroup[]>}
|
|
201
|
+
*/
|
|
202
|
+
getComponentSettingsProfiles(): Promise<ProfileGroup[]>;
|
|
203
|
+
/**
|
|
204
|
+
* Upload exported OpenTAP Settings files
|
|
205
|
+
* @param {FileParameter} file
|
|
206
|
+
* @returns {Promise<void>}
|
|
207
|
+
*/
|
|
208
|
+
uploadComponentSettings(file: FileParameter): Promise<string[]>;
|
|
209
|
+
/**
|
|
210
|
+
* Downloads a .TapSettings file containing the settings for a given component settings group
|
|
211
|
+
* @param {DownloadTapSettingsRequest} tapSettingsRequest The download request specifying the component settings group to download
|
|
212
|
+
* @returns {Promise<Uint8Array>} A byte array containing the downloaded .TapSettings file
|
|
213
|
+
*/
|
|
214
|
+
downloadComponentSettings(tapSettingsRequest: DownloadTapSettingsRequest): Promise<Uint8Array>;
|
|
215
|
+
/**
|
|
216
|
+
* Load a component settings TapPackage by referencing a package in a package repository
|
|
217
|
+
* @param {RepositoryPackageReference} packageReference
|
|
218
|
+
* @returns {Promise<ErrorResponse[]>}
|
|
219
|
+
*/
|
|
220
|
+
loadComponentSettingsFromRepository(packageReference: RepositoryPackageReference): Promise<ErrorResponse[]>;
|
|
221
|
+
/**
|
|
222
|
+
* Save a TapPackage containing component settings in a package repository
|
|
223
|
+
* @param {RepositorySettingsPackageDefinition} repositoryPackageDefinition
|
|
224
|
+
* @returns {Promise<void>}
|
|
225
|
+
*/
|
|
226
|
+
saveComponentSettingsToRepository(repositoryPackageDefinition: RepositorySettingsPackageDefinition): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Retrieve types available to be added to specified component settings list
|
|
229
|
+
* @param {string} groupName
|
|
230
|
+
* @param {string} name
|
|
231
|
+
* @returns {Promise<ListItemType[]>}
|
|
232
|
+
*/
|
|
233
|
+
getComponentSettingsListAvailableTypes(groupName: string, name: string): Promise<ListItemType[]>;
|
|
234
|
+
/**
|
|
235
|
+
* Adds a new item to a component settings list
|
|
236
|
+
* @param {string} groupName
|
|
237
|
+
* @param {string} name
|
|
238
|
+
* @param {string} typeName
|
|
239
|
+
* @returns {Promise<ListItemType[]>}
|
|
240
|
+
*/
|
|
241
|
+
addComponentSettingsListItem(groupName: string, name: string, typeName: string): Promise<ComponentSettingsBase>;
|
|
242
|
+
/**
|
|
243
|
+
* Get settings package files
|
|
244
|
+
* @returns {Promise<string[]>}
|
|
245
|
+
*/
|
|
246
|
+
getSettingsPackageFiles(): Promise<string[]>;
|
|
247
|
+
/**
|
|
248
|
+
* Get settings package types
|
|
249
|
+
* @returns {Promise<string[]>}
|
|
250
|
+
*/
|
|
251
|
+
settingsPackageTypes(): Promise<string[]>;
|
|
252
|
+
}
|
|
253
|
+
export {};
|