@mablhq/mabl-cli 1.40.11 → 1.41.4
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/api/mablApiClient.js +25 -0
- package/cli.js +0 -0
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +6 -6
- package/commands/plans/plans_cmds/describe.js +0 -1
- package/execution/index.js +1 -1
- package/mablApi/index.js +1 -1
- package/mablscript/MablAction.js +19 -1
- package/mablscript/MablStep.js +0 -17
- package/mablscript/actions/ConditionAction.js +7 -2
- package/mablscript/steps/AssertStep.js +24 -15
- package/mablscript/steps/IfConditionStep.js +8 -1
- package/mablscript/steps/ReleaseStep.js +2 -1
- package/mablscript/steps/SelectStep.js +1 -1
- package/mablscript/steps/SetFilesStep.js +2 -1
- package/mablscript/steps/SyntheticStep.js +1 -1
- package/package.json +1 -1
- package/util/markdownUtil.js +5 -5
package/api/mablApiClient.js
CHANGED
|
@@ -767,6 +767,21 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
767
767
|
throw toApiError(`Failed to get users`, error);
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
+
async recordTimeSeriesMetricMeasurement(type, value, options) {
|
|
771
|
+
try {
|
|
772
|
+
return this.makePostRequest(`${this.baseApiUrl}/metrics/timeSeries`, createTimeSeriesMetricMeasurement(type, value, options));
|
|
773
|
+
}
|
|
774
|
+
catch (error) {
|
|
775
|
+
throw toApiError('Failed to record time series metric measurement', error);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
async recordWorkspaceTimeSeriesMetricMeasurement(type, value, workspaceId, options) {
|
|
779
|
+
const labels = { ...options === null || options === void 0 ? void 0 : options.labels, workspaceId };
|
|
780
|
+
return this.recordTimeSeriesMetricMeasurement(type, value, {
|
|
781
|
+
...options,
|
|
782
|
+
labels,
|
|
783
|
+
});
|
|
784
|
+
}
|
|
770
785
|
}
|
|
771
786
|
exports.MablApiClient = MablApiClient;
|
|
772
787
|
function sortTemporallyAscending(entities) {
|
|
@@ -781,3 +796,13 @@ function toApiError(summary, cause) {
|
|
|
781
796
|
: cause.toString()}`;
|
|
782
797
|
return new ApiError_1.ApiError(message, code, cause);
|
|
783
798
|
}
|
|
799
|
+
function createTimeSeriesMetricMeasurement(type, numberValue, options) {
|
|
800
|
+
return {
|
|
801
|
+
labels: options === null || options === void 0 ? void 0 : options.labels,
|
|
802
|
+
event_time: options === null || options === void 0 ? void 0 : options.event_time,
|
|
803
|
+
type,
|
|
804
|
+
value: Number.isInteger(numberValue)
|
|
805
|
+
? { int64_value: numberValue }
|
|
806
|
+
: { double_value: numberValue },
|
|
807
|
+
};
|
|
808
|
+
}
|
package/cli.js
CHANGED
|
File without changes
|
|
@@ -91,16 +91,16 @@ class ExecutionResultPresenter {
|
|
|
91
91
|
}
|
|
92
92
|
mapJourneyRunStatusToColor(status) {
|
|
93
93
|
switch (status) {
|
|
94
|
-
case mablApi_1.
|
|
94
|
+
case mablApi_1.TestRunResult.StatusEnum.Queued:
|
|
95
95
|
return chalk.gray;
|
|
96
|
-
case mablApi_1.
|
|
96
|
+
case mablApi_1.TestRunResult.StatusEnum.Running:
|
|
97
97
|
return chalk.white;
|
|
98
|
-
case mablApi_1.
|
|
98
|
+
case mablApi_1.TestRunResult.StatusEnum.Completed:
|
|
99
99
|
return chalk.green;
|
|
100
|
-
case mablApi_1.
|
|
100
|
+
case mablApi_1.TestRunResult.StatusEnum.Failed:
|
|
101
101
|
return chalk.red;
|
|
102
|
-
case mablApi_1.
|
|
103
|
-
case mablApi_1.
|
|
102
|
+
case mablApi_1.TestRunResult.StatusEnum.Terminated:
|
|
103
|
+
case mablApi_1.TestRunResult.StatusEnum.Skipped:
|
|
104
104
|
return chalk.yellow;
|
|
105
105
|
default:
|
|
106
106
|
return chalk.reset;
|
|
@@ -13,7 +13,6 @@ async function getPlan(parsed) {
|
|
|
13
13
|
const planId = parsed.id;
|
|
14
14
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
15
15
|
const plan = await apiClient.getPlan(planId);
|
|
16
|
-
delete plan.execution_graph;
|
|
17
16
|
delete plan.journeys_ddt_migration_backup;
|
|
18
17
|
(0, describe_1.outputEntity)(plan, parsed.output);
|
|
19
18
|
return (_a = plan.id) !== null && _a !== void 0 ? _a : '';
|