@mablhq/mabl-cli 1.40.4 → 1.40.12

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
+ }
@@ -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 : '';
@@ -126,7 +126,6 @@ exports.builder = (yargs) => {
126
126
  })
127
127
  .option(constants_1.CommandArgNoPrompt, {
128
128
  describe: 'Do not prompt to confirm execution selections',
129
- type: 'boolean',
130
129
  alias: constants_1.CommandArgAliases.NoPrompt,
131
130
  })
132
131
  .check((argv) => (0, testsUtil_1.validateRunCommandWithLabels)(argv[constants_1.CommandArgId], argv[constants_1.CommandArgLabelsInclude], argv[constants_1.CommandArgLabelsExclude]));
@@ -136,7 +135,7 @@ async function runInCloud(parsed) {
136
135
  var _a;
137
136
  const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClientFromOptionalApiKey(parsed['api-key']);
138
137
  const workspaceId = await (0, util_1.getWorkspaceId)(parsed);
139
- const prompt = parsed.prompt;
138
+ const prompt = parsed.prompt && !parsed[constants_1.CommandArgNoPrompt];
140
139
  const branchName = parsed['mabl-branch'] || constants_1.DefaultBranchName;
141
140
  const branchChangesOnly = parsed['branch-changes-only'];
142
141
  const maybeTestId = parsed.id;