@opentap/runner-client 2.20.0-alpha.1.8.7789948835 → 2.20.0
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/{lib → dist/cjs}/DTOs.js +68 -2
- package/{lib → dist/cjs}/SessionClient.js +172 -0
- package/dist/cjs/package.json +3 -0
- package/dist/mjs/BaseClient.js +595 -0
- package/{lib → dist/mjs}/DTOs.d.ts +31 -0
- package/dist/mjs/DTOs.js +3431 -0
- package/dist/mjs/RunnerClient.js +175 -0
- package/{lib → dist/mjs}/SessionClient.d.ts +59 -1
- package/dist/mjs/SessionClient.js +739 -0
- package/dist/mjs/SystemClient.js +159 -0
- package/dist/mjs/index.js +5 -0
- package/dist/mjs/package.json +3 -0
- package/dist/mjs/requestDTOs.js +1 -0
- package/package.json +10 -5
- /package/{lib → dist/cjs}/BaseClient.js +0 -0
- /package/{lib → dist/cjs}/RunnerClient.js +0 -0
- /package/{lib → dist/cjs}/SystemClient.js +0 -0
- /package/{lib → dist/cjs}/index.js +0 -0
- /package/{lib → dist/cjs}/requestDTOs.js +0 -0
- /package/{lib → dist/mjs}/BaseClient.d.ts +0 -0
- /package/{lib → dist/mjs}/RunnerClient.d.ts +0 -0
- /package/{lib → dist/mjs}/SystemClient.d.ts +0 -0
- /package/{lib → dist/mjs}/index.d.ts +0 -0
- /package/{lib → dist/mjs}/requestDTOs.d.ts +0 -0
package/{lib → dist/cjs}/DTOs.js
RENAMED
|
@@ -16,8 +16,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.SessionShutdownInitiated = exports.SessionStartFailed = exports.SessionStarted = exports.SessionStartInitiated = exports.SessionEventArgs = exports.SettingsTapPackage = exports.RepositorySettingsPackageDefinition = exports.RepositoryPackageDefinition = exports.RepositoryPackageReference = exports.ProfileGroup = exports.ListItemType = exports.ComponentSettings = exports.FileDescriptor = exports.Resource = exports.PluginTypeSelectorControl = exports.PictureControl = exports.PasswordControl = exports.MultiSelectControl = exports.DropdownControl = exports.EnabledControl = exports.DirectoryPathControl = exports.FilePathControl = exports.ComboBoxControl = exports.TextBoxControl = exports.DataGridControl = exports.DataGridReferenceControl = exports.CheckBoxControl = exports.AvailableValue = exports.ButtonsControl = exports.ButtonControl = exports.ExternalParameter = exports.MetaData = exports.DisplayAttribute = exports.VisualStatus = exports.Icon = exports.ColumnDisplayName = exports.LayoutMode = exports.Layout = exports.Setting = exports.ComponentSettingsListItem = exports.AnnotatedObject = exports.ComponentSettingsList = exports.ComponentSettingsIdentifier = exports.ComponentSettingsBase = exports.Links = exports.Session = exports.ImageResolveErrorResponse = exports.ErrorResponse = exports.PackageSpecifier = exports.Image = void 0;
|
|
19
|
-
exports.
|
|
20
|
-
exports.RunnerDeletedEvent = exports.RunnerUpdatedEvent = exports.RunnerRegisteredEvent = exports.RunnerEvent = exports.TestPlanRunCompletedEventArgs = exports.TestPlanRunStartEventArgs = exports.TestPlanRunEvent = void 0;
|
|
19
|
+
exports.TestStepRunEvent = exports.OnTestStepRun = exports.OnTestPlanRun = exports.TestPlanSettingsChangedEventArgs = exports.UserInputRequestCompletedEventArgs = exports.UserInputRequestEventArgs = exports.BreakEventArgs = exports.TestStepChangeEventArgs = exports.SettingsChangedEventArgs = exports.TestPlanExecutionStateChangedEventArgs = exports.TestPlanChangeEventArgs = exports.StoppedEventArgs = exports.StoppingEventArgs = exports.StartedEventArgs = exports.StartingEventArgs = exports.SessionTimeoutEventArgs = exports.SessionEventType = exports.SessionEvent = exports.ResultColumn = exports.Result = exports.LogEvent = exports.TestStepRun = exports.TestRun = exports.WatchDog = exports.Parameter = exports.BreakPoints = exports.InstalledFile = exports.Interaction = exports.CommonContext = exports.CommonSettings = exports.ValidationError = exports.TestStepValidationError = exports.TestStepCopy = exports.TestStepType = exports.TestStep = exports.TestPlan = exports.ExecutionState = exports.Verdict = exports.RunStatus = exports.MissingLicenseResponse = exports.LogEntry = exports.LogList = exports.ApiException = exports.ImageCreationFailed = exports.ImageCreated = exports.ImageCreating = exports.ImageEventArgs = exports.SessionInactivityLimitHit = exports.SessionShutdownFailed = exports.SessionShutdown = void 0;
|
|
20
|
+
exports.RunnerDeletedEvent = exports.RunnerUpdatedEvent = exports.RunnerRegisteredEvent = exports.RunnerEvent = exports.TestPlanRunCompletedEventArgs = exports.TestPlanRunStartEventArgs = exports.TestPlanRunEvent = exports.TestStepRunCompletedEventArgs = exports.TestStepRunStartEventArgs = void 0;
|
|
21
21
|
var Image = /** @class */ (function () {
|
|
22
22
|
function Image(data) {
|
|
23
23
|
this.packages = [];
|
|
@@ -3512,6 +3512,72 @@ var TestPlanSettingsChangedEventArgs = /** @class */ (function (_super) {
|
|
|
3512
3512
|
return TestPlanSettingsChangedEventArgs;
|
|
3513
3513
|
}(SessionEvent));
|
|
3514
3514
|
exports.TestPlanSettingsChangedEventArgs = TestPlanSettingsChangedEventArgs;
|
|
3515
|
+
var OnTestPlanRun = /** @class */ (function () {
|
|
3516
|
+
function OnTestPlanRun(data) {
|
|
3517
|
+
if (data) {
|
|
3518
|
+
for (var property in data) {
|
|
3519
|
+
if (Object.prototype.hasOwnProperty.call(data, property))
|
|
3520
|
+
this[property] = data[property];
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
}
|
|
3524
|
+
OnTestPlanRun.prototype.init = function (_data) {
|
|
3525
|
+
if (_data) {
|
|
3526
|
+
this.status = _data['Status'];
|
|
3527
|
+
this.userId = _data['UserId'];
|
|
3528
|
+
}
|
|
3529
|
+
};
|
|
3530
|
+
OnTestPlanRun.fromJS = function (data) {
|
|
3531
|
+
data = typeof data === 'object' ? data : {};
|
|
3532
|
+
var result = new OnTestPlanRun();
|
|
3533
|
+
result.init(data);
|
|
3534
|
+
return result;
|
|
3535
|
+
};
|
|
3536
|
+
OnTestPlanRun.prototype.toJSON = function (data) {
|
|
3537
|
+
data = typeof data === 'object' ? data : {};
|
|
3538
|
+
data['Status'] = this.status;
|
|
3539
|
+
data['UserId'] = this.userId;
|
|
3540
|
+
return data;
|
|
3541
|
+
};
|
|
3542
|
+
return OnTestPlanRun;
|
|
3543
|
+
}());
|
|
3544
|
+
exports.OnTestPlanRun = OnTestPlanRun;
|
|
3545
|
+
var OnTestStepRun = /** @class */ (function () {
|
|
3546
|
+
function OnTestStepRun(data) {
|
|
3547
|
+
if (data) {
|
|
3548
|
+
for (var property in data) {
|
|
3549
|
+
if (Object.prototype.hasOwnProperty.call(data, property))
|
|
3550
|
+
this[property] = data[property];
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
OnTestStepRun.prototype.init = function (_data) {
|
|
3555
|
+
if (_data) {
|
|
3556
|
+
this.status = _data['Status'];
|
|
3557
|
+
this.stepId = _data['StepId'];
|
|
3558
|
+
this.parentRunId = _data['ParentRunId'];
|
|
3559
|
+
this.verdict = _data['Verdict'];
|
|
3560
|
+
this.duration = _data['Duration'];
|
|
3561
|
+
}
|
|
3562
|
+
};
|
|
3563
|
+
OnTestStepRun.fromJS = function (data) {
|
|
3564
|
+
data = typeof data === 'object' ? data : {};
|
|
3565
|
+
var result = new OnTestStepRun();
|
|
3566
|
+
result.init(data);
|
|
3567
|
+
return result;
|
|
3568
|
+
};
|
|
3569
|
+
OnTestStepRun.prototype.toJSON = function (data) {
|
|
3570
|
+
data = typeof data === 'object' ? data : {};
|
|
3571
|
+
data['Status'] = this.status;
|
|
3572
|
+
data['StepId'] = this.stepId;
|
|
3573
|
+
data['ParentRunId'] = this.parentRunId;
|
|
3574
|
+
data['Verdict'] = this.verdict;
|
|
3575
|
+
data['Duration'] = this.duration;
|
|
3576
|
+
return data;
|
|
3577
|
+
};
|
|
3578
|
+
return OnTestStepRun;
|
|
3579
|
+
}());
|
|
3580
|
+
exports.OnTestStepRun = OnTestStepRun;
|
|
3515
3581
|
var TestStepRunEvent = /** @class */ (function () {
|
|
3516
3582
|
function TestStepRunEvent(data) {
|
|
3517
3583
|
if (data) {
|
|
@@ -123,6 +123,178 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
123
123
|
} })),
|
|
124
124
|
];
|
|
125
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* @param testRunHandler Function to be called when test run or error is received
|
|
128
|
+
* @param options (optional) Subscription options
|
|
129
|
+
* @returns Subscription array: Result and Test Run subscriptions
|
|
130
|
+
*/
|
|
131
|
+
SessionClient.prototype.connectTestRunEvents = function (testRunHandler, options) {
|
|
132
|
+
return this.subscribe('OnTestRun', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
133
|
+
if (error) {
|
|
134
|
+
testRunHandler(undefined, error);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
139
|
+
var testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
140
|
+
var testRun = DTOs_1.TestRun.fromJS(testRunJs);
|
|
141
|
+
testRunHandler(testRun, error);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
testRunHandler(undefined, error);
|
|
145
|
+
}
|
|
146
|
+
} }));
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
150
|
+
* @param {string} testPlanRunId
|
|
151
|
+
* @param {(event:OnTestPlanRun|undefined,err:NatsError|Error|null)=>void} handler
|
|
152
|
+
* @param {SubscriptionOptions} options?
|
|
153
|
+
* @returns Subscription
|
|
154
|
+
*/
|
|
155
|
+
SessionClient.prototype.connectTestPlanRunEvents = function (testPlanRunId, handler, options) {
|
|
156
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
157
|
+
if (error) {
|
|
158
|
+
handler(undefined, error);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
163
|
+
var onTestPlanRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
164
|
+
var onTestPlanRun = DTOs_1.OnTestPlanRun.fromJS(onTestPlanRunJs);
|
|
165
|
+
handler(onTestPlanRun, error);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
handler(undefined, error);
|
|
169
|
+
}
|
|
170
|
+
} }));
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Connect to listen to the test plan run logs for the given test plan run ID
|
|
174
|
+
* @param {string} testPlanRunId
|
|
175
|
+
* @param {(logList:LogList|undefined,err:NatsError|Error|null)=>void} handler
|
|
176
|
+
* @param {SubscriptionOptions} options?
|
|
177
|
+
* @returns Subscription
|
|
178
|
+
*/
|
|
179
|
+
SessionClient.prototype.connectTestPlanRunLogs = function (testPlanRunId, handler, options) {
|
|
180
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".Logs"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
181
|
+
if (error) {
|
|
182
|
+
handler(undefined, error);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
187
|
+
var logListJson = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
188
|
+
var logList = DTOs_1.LogList.fromJS(logListJson);
|
|
189
|
+
handler(logList, error);
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
handler(undefined, error);
|
|
193
|
+
}
|
|
194
|
+
} }));
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
198
|
+
* @param {string} testPlanRunId
|
|
199
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
200
|
+
* @param {SubscriptionOptions} options?
|
|
201
|
+
* @returns Subscription
|
|
202
|
+
*/
|
|
203
|
+
SessionClient.prototype.connectTestPlanRunParameterEvents = function (testPlanRunId, handler, options) {
|
|
204
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".Parameters"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
205
|
+
if (error) {
|
|
206
|
+
handler(undefined, error);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
211
|
+
var parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
212
|
+
var parameterList = parameterListJs.map(function (parameterJs) { return DTOs_1.Parameter.fromJS(parameterJs); });
|
|
213
|
+
handler(parameterList, error);
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
handler(undefined, error);
|
|
217
|
+
}
|
|
218
|
+
} }));
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
222
|
+
* @param {string} testPlanRunId
|
|
223
|
+
* @param {string} testStepRunId
|
|
224
|
+
* @param {(testRun:OnTestStepRun|undefined,err:NatsError|Error|null)=>void} handler
|
|
225
|
+
* @param {SubscriptionOptions} options?
|
|
226
|
+
* @returns Subscription
|
|
227
|
+
*/
|
|
228
|
+
SessionClient.prototype.connectTestStepRunEvents = function (testPlanRunId, testStepRunId, handler, options) {
|
|
229
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
230
|
+
var _a;
|
|
231
|
+
if (error) {
|
|
232
|
+
handler(undefined, undefined, error);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
237
|
+
var onTestStepRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
238
|
+
var onTestStepRun = DTOs_1.OnTestStepRun.fromJS(onTestStepRunJs);
|
|
239
|
+
var stepRunId = (_a = encodedMessage.subject.match(/\.StepRun\.(.+)$/)) === null || _a === void 0 ? void 0 : _a[1];
|
|
240
|
+
handler(stepRunId, onTestStepRun, error);
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
handler(undefined, undefined, error);
|
|
244
|
+
}
|
|
245
|
+
} }));
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
249
|
+
* @param {string} testPlanRunId
|
|
250
|
+
* @param {string} testStepRunId
|
|
251
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
252
|
+
* @param {SubscriptionOptions} options?
|
|
253
|
+
* @returns Subscription
|
|
254
|
+
*/
|
|
255
|
+
SessionClient.prototype.connectTestStepRunParameterEvents = function (testPlanRunId, testStepRunId, handler, options) {
|
|
256
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId, ".Parameters"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
257
|
+
if (error) {
|
|
258
|
+
handler(undefined, error);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
263
|
+
var parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
264
|
+
var parameterList = parameterListJs.map(function (parameterJs) { return DTOs_1.Parameter.fromJS(parameterJs); });
|
|
265
|
+
handler(parameterList, error);
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
handler(undefined, error);
|
|
269
|
+
}
|
|
270
|
+
} }));
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Connect to listen to the test step run results for the given test step and test plan run ID
|
|
274
|
+
* @param {string} testPlanRunId
|
|
275
|
+
* @param {string} testStepRunId
|
|
276
|
+
* @param {string} resultName
|
|
277
|
+
* @param {(result:Result|undefined,err:NatsError|Error|null)=>void} handler
|
|
278
|
+
* @param {SubscriptionOptions} options?
|
|
279
|
+
* @returns Subscription
|
|
280
|
+
*/
|
|
281
|
+
SessionClient.prototype.connectTestStepRunResults = function (testPlanRunId, testStepRunId, resultName, handler, options) {
|
|
282
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId, ".Result.").concat(resultName), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
283
|
+
if (error) {
|
|
284
|
+
handler(undefined, error);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
try {
|
|
288
|
+
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
289
|
+
var resultJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
290
|
+
var result = DTOs_1.Result.fromJS(resultJs);
|
|
291
|
+
handler(result, error);
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
handler(undefined, error);
|
|
295
|
+
}
|
|
296
|
+
} }));
|
|
297
|
+
};
|
|
126
298
|
/**
|
|
127
299
|
* Unsubscibe from session events
|
|
128
300
|
*/
|