@mablhq/mabl-cli 2.51.18 → 2.51.28

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.
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataTablesRbacPreflight = void 0;
4
+ async function dataTablesRbacPreflight(apiClient, dataTableIds = []) {
5
+ if (!dataTableIds.length) {
6
+ return [];
7
+ }
8
+ const dataTablePromises = [];
9
+ for (const dataTableId of dataTableIds !== null && dataTableIds !== void 0 ? dataTableIds : []) {
10
+ const promise = apiClient.getDataTable(dataTableId);
11
+ dataTablePromises.push(promise);
12
+ }
13
+ return Promise.all(dataTablePromises);
14
+ }
15
+ exports.dataTablesRbacPreflight = dataTablesRbacPreflight;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExpectedDeploymentType = void 0;
4
+ const mablApi_1 = require("../mablApi");
5
+ function getExpectedDeploymentType(testType) {
6
+ switch (testType) {
7
+ case mablApi_1.TestTypeEnum.Api:
8
+ return mablApi_1.Deployment.DeploymentTypeEnum.Api;
9
+ case mablApi_1.TestTypeEnum.Mobile:
10
+ return mablApi_1.Deployment.DeploymentTypeEnum.MobileApplication;
11
+ default:
12
+ return mablApi_1.Deployment.DeploymentTypeEnum.WebApplication;
13
+ }
14
+ }
15
+ exports.getExpectedDeploymentType = getExpectedDeploymentType;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getForbiddenApiError = exports.assertThrowsForbiddenError = void 0;
4
+ const ApiError_1 = require("../api/ApiError");
5
+ async function assertThrowsForbiddenError(func, missingPermissionMessage) {
6
+ let thrownError;
7
+ try {
8
+ await func;
9
+ }
10
+ catch (error) {
11
+ thrownError = error;
12
+ }
13
+ assertForbiddenError(thrownError, missingPermissionMessage);
14
+ }
15
+ exports.assertThrowsForbiddenError = assertThrowsForbiddenError;
16
+ function assertForbiddenError(error, expectedMessage) {
17
+ expect(error instanceof ApiError_1.ApiError).toBeTruthy();
18
+ expect(error.statusCode).toBe(403);
19
+ expect(error === null || error === void 0 ? void 0 : error.message).toBe(expectedMessage);
20
+ }
21
+ function getForbiddenApiError(message) {
22
+ return new ApiError_1.ApiError(message, 403);
23
+ }
24
+ exports.getForbiddenApiError = getForbiddenApiError;