@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.
@@ -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.JourneyRunResult.StatusEnum.Queued:
94
+ case mablApi_1.TestRunResult.StatusEnum.Queued:
95
95
  return chalk.gray;
96
- case mablApi_1.JourneyRunResult.StatusEnum.Running:
96
+ case mablApi_1.TestRunResult.StatusEnum.Running:
97
97
  return chalk.white;
98
- case mablApi_1.JourneyRunResult.StatusEnum.Completed:
98
+ case mablApi_1.TestRunResult.StatusEnum.Completed:
99
99
  return chalk.green;
100
- case mablApi_1.JourneyRunResult.StatusEnum.Failed:
100
+ case mablApi_1.TestRunResult.StatusEnum.Failed:
101
101
  return chalk.red;
102
- case mablApi_1.JourneyRunResult.StatusEnum.Terminated:
103
- case mablApi_1.JourneyRunResult.StatusEnum.Skipped:
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 : '';