@ganakailabs/cloudeval-cli 0.28.1 → 0.29.1

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.
@@ -15,7 +15,7 @@ This notice is not a substitute for legal review before public or enterprise dis
15
15
  | (MIT OR CC0-1.0) | 2 |
16
16
  | 0BSD | 1 |
17
17
  | Apache-2.0 | 50 |
18
- | BSD-3-Clause | 14 |
18
+ | BSD-3-Clause | 3 |
19
19
  | ISC | 12 |
20
20
  | MIT | 172 |
21
21
 
@@ -89,16 +89,6 @@ This notice is not a substitute for legal review before public or enterprise dis
89
89
  | @opentelemetry/semantic-conventions | 1.41.1 | Apache-2.0 | OpenTelemetry Authors | https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions |
90
90
  | @opentelemetry/sql-common | 0.41.2 | Apache-2.0 | OpenTelemetry Authors | https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/sql-common#readme |
91
91
  | @opentelemetry/winston-transport | 0.27.0 | Apache-2.0 | OpenTelemetry Authors | https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/winston-transport#readme |
92
- | @protobufjs/aspromise | 1.1.2 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
93
- | @protobufjs/base64 | 1.1.2 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
94
- | @protobufjs/codegen | 2.0.5 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
95
- | @protobufjs/eventemitter | 1.1.1 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
96
- | @protobufjs/fetch | 1.1.1 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
97
- | @protobufjs/float | 1.0.2 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
98
- | @protobufjs/inquire | 1.1.2 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
99
- | @protobufjs/path | 1.1.2 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
100
- | @protobufjs/pool | 1.1.0 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
101
- | @protobufjs/utf8 | 1.1.1 | BSD-3-Clause | Daniel Wirtz | https://github.com/dcodeIO/protobuf.js#readme |
102
92
  | @sindresorhus/is | 4.6.0 | MIT | Sindre Sorhus | https://github.com/sindresorhus/is#readme |
103
93
  | @types/bunyan | 1.8.11 | MIT | NOASSERTION | https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bunyan |
104
94
  | @types/mysql | 2.15.27 | MIT | NOASSERTION | https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mysql |
@@ -220,8 +210,7 @@ This notice is not a substitute for legal review before public or enterprise dis
220
210
  | postgres-bytea | 1.0.1 | MIT | Ben Drucker | https://github.com/bendrucker/postgres-bytea#readme |
221
211
  | postgres-date | 1.0.7 | MIT | Ben Drucker | https://github.com/bendrucker/postgres-date#readme |
222
212
  | postgres-interval | 1.2.0 | MIT | Ben Drucker | https://github.com/bendrucker/postgres-interval#readme |
223
- | protobufjs | 7.6.1 | BSD-3-Clause | Daniel Wirtz | https://protobufjs.github.io/protobuf.js/ |
224
- | protobufjs | 8.0.2 | BSD-3-Clause | Daniel Wirtz | https://protobufjs.github.io/protobuf.js/ |
213
+ | protobufjs | 8.4.1 | BSD-3-Clause | Daniel Wirtz | https://github.com/protobufjs/protobuf.js#readme |
225
214
  | react-devtools-core | 4.28.5 | MIT | NOASSERTION | https://github.com/facebook/react#readme |
226
215
  | react-reconciler | 0.29.2 | MIT | NOASSERTION | https://reactjs.org/ |
227
216
  | react | 18.3.1 | MIT | NOASSERTION | https://reactjs.org/ |
@@ -263,8 +252,8 @@ This notice is not a substitute for legal review before public or enterprise dis
263
252
  | winston-transport | 4.9.0 | MIT | Charlie Robbins | https://github.com/winstonjs/winston-transport#readme |
264
253
  | wrap-ansi | 7.0.0 | MIT | Sindre Sorhus | https://github.com/chalk/wrap-ansi#readme |
265
254
  | wrap-ansi | 8.1.0 | MIT | Sindre Sorhus | https://github.com/chalk/wrap-ansi#readme |
266
- | ws | 7.5.10 | MIT | Einar Otto Stangvik | https://github.com/websockets/ws |
267
- | ws | 8.18.3 | MIT | Einar Otto Stangvik | https://github.com/websockets/ws |
255
+ | ws | 7.5.11 | MIT | Einar Otto Stangvik | https://github.com/websockets/ws |
256
+ | ws | 8.21.0 | MIT | Einar Otto Stangvik | https://github.com/websockets/ws |
268
257
  | wsl-utils | 0.1.0 | MIT | Sindre Sorhus | https://github.com/sindresorhus/wsl-utils#readme |
269
258
  | xtend | 4.0.2 | MIT | Raynos | https://github.com/Raynos/xtend |
270
259
  | y18n | 5.0.8 | ISC | Ben Coe | https://github.com/yargs/y18n |
@@ -5,10 +5,10 @@ import {
5
5
  listSessions,
6
6
  recordSessionTurn,
7
7
  resolveFrontendBaseUrl
8
- } from "./chunk-QSBGUI25.js";
8
+ } from "./chunk-CS4NE336.js";
9
9
  import {
10
10
  Onboarding
11
- } from "./chunk-LRQBWG3N.js";
11
+ } from "./chunk-4OE4CRKD.js";
12
12
  import {
13
13
  checkUserStatus,
14
14
  completeActiveAssistantMessage,
@@ -35,13 +35,13 @@ import {
35
35
  reduceChunk,
36
36
  runReports,
37
37
  streamChat
38
- } from "./chunk-USSCB2ZU.js";
38
+ } from "./chunk-ERGQHMNT.js";
39
39
  import {
40
40
  Banner
41
- } from "./chunk-L5ICTZHW.js";
41
+ } from "./chunk-VRLH2WYY.js";
42
42
  import {
43
43
  CLI_VERSION
44
- } from "./chunk-XDMPAWK2.js";
44
+ } from "./chunk-AO4LJZTG.js";
45
45
  import {
46
46
  raisedButtonStyle,
47
47
  terminalTheme
@@ -5914,7 +5914,7 @@ var getUserIdentityFromToken = async (token) => {
5914
5914
  return { name: "You" };
5915
5915
  }
5916
5916
  try {
5917
- const { extractEmailFromToken } = await import("./dist-PEYJDO7A.js");
5917
+ const { extractEmailFromToken } = await import("./dist-QYIPN7MD.js");
5918
5918
  const email = extractEmailFromToken(token) ?? void 0;
5919
5919
  return {
5920
5920
  name: getFirstNameForDisplay({ email }),
@@ -7350,7 +7350,7 @@ var App = ({
7350
7350
  setIsLoggingIn(true);
7351
7351
  setLoaderStep(1);
7352
7352
  try {
7353
- const { login } = await import("./dist-PEYJDO7A.js");
7353
+ const { login } = await import("./dist-QYIPN7MD.js");
7354
7354
  const newToken = await login(baseUrl, {
7355
7355
  headless: Boolean(process.env.SSH_TTY || process.env.CI)
7356
7356
  });
@@ -3,8 +3,8 @@ import {
3
3
  bannerMetaColor,
4
4
  bannerSegmentColor,
5
5
  splitBannerLineSegments
6
- } from "./chunk-L5ICTZHW.js";
7
- import "./chunk-XDMPAWK2.js";
6
+ } from "./chunk-VRLH2WYY.js";
7
+ import "./chunk-AO4LJZTG.js";
8
8
  import "./chunk-ZDKRIOMB.js";
9
9
  export {
10
10
  Banner,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Onboarding
3
- } from "./chunk-LRQBWG3N.js";
4
- import "./chunk-USSCB2ZU.js";
3
+ } from "./chunk-4OE4CRKD.js";
4
+ import "./chunk-ERGQHMNT.js";
5
5
  import "./chunk-ZDKRIOMB.js";
6
6
  export {
7
7
  Onboarding
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  completeOnboarding
3
- } from "./chunk-USSCB2ZU.js";
3
+ } from "./chunk-ERGQHMNT.js";
4
4
  import {
5
5
  terminalTheme
6
6
  } from "./chunk-ZDKRIOMB.js";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var CLI_VERSION = "0.28.1";
2
+ var CLI_VERSION = "0.29.1";
3
3
 
4
4
  export {
5
5
  CLI_VERSION
@@ -115,6 +115,15 @@ var buildFrontendUrl = (options) => {
115
115
  setParam(url, "downloadReport", options.downloadReport);
116
116
  setParam(url, "reportVerbosity", options.reportVerbosity);
117
117
  break;
118
+ case "issues":
119
+ case "action-center":
120
+ url = appUrl(options.baseUrl, "/issues");
121
+ setParam(url, "project", options.projectId);
122
+ setParam(url, "type", options.type);
123
+ setParam(url, "severity", options.severity);
124
+ setParam(url, "q", options.q);
125
+ setParam(url, "sort", options.sort);
126
+ break;
118
127
  case "billing":
119
128
  url = appUrl(options.baseUrl, "/subscription");
120
129
  setParam(url, "tab", options.tab);
@@ -65,6 +65,9 @@ var SENSITIVE_KEY_PATTERN = /token|authorization|cookie|secret|password|api[_-]?
65
65
  var SENSITIVE_QUERY_PARAM_PATTERN = /token|authorization|cookie|secret|password|api[_-]?key|access[_-]?key|client[_-]?secret|refresh|device[_-]?code|user[_-]?code|code/i;
66
66
  var CLOUDEVAL_ACCESS_KEY_VALUE_PATTERN = /\bcev_[a-z0-9]+_ak_[A-Za-z0-9]+_[A-Za-z0-9._~+-]+(?:_[A-Za-z0-9._~+-]+)*\b/gi;
67
67
  var AUTHORIZATION_BEARER_PATTERN = /\b(authorization\s*:\s*bearer\s+)([^\s'",}]+)/gi;
68
+ var INLINE_SECRET_ASSIGNMENT_PATTERN = /\b((?:token|authorization|cookie|secret|password|api[_-]?key|access[_-]?key|client[_-]?secret|refresh|device[_-]?code|user[_-]?code)=)([^&\s'",}]+)/gi;
69
+ var JSONISH_SECRET_FIELD_PATTERN = /(["'](?:token|authorization|cookie|secret|password|api[_-]?key|access[_-]?key|client[_-]?secret|refresh|device[_-]?code|user[_-]?code)["']\s*:\s*["'])([^"']+)(["'])/gi;
70
+ var ENCODED_SECRET_REDACTION = encodeURIComponent(SECRET_REDACTION);
68
71
  var isSensitiveSecretKey = (key) => SENSITIVE_KEY_PATTERN.test(key);
69
72
  var redactSensitiveText = (value) => {
70
73
  let text = value;
@@ -89,7 +92,12 @@ var redactSensitiveText = (value) => {
89
92
  }
90
93
  } catch {
91
94
  }
92
- return text.replace(AUTHORIZATION_BEARER_PATTERN, (_match, prefix) => `${prefix}${SECRET_REDACTION}`).replace(CLOUDEVAL_ACCESS_KEY_VALUE_PATTERN, SECRET_REDACTION);
95
+ return text.replace(AUTHORIZATION_BEARER_PATTERN, (_match, prefix) => `${prefix}${SECRET_REDACTION}`).replace(JSONISH_SECRET_FIELD_PATTERN, (_match, prefix, _secret, suffix) => `${prefix}${SECRET_REDACTION}${suffix}`).replace(INLINE_SECRET_ASSIGNMENT_PATTERN, (_match, prefix, secret) => {
96
+ if (secret === SECRET_REDACTION || secret.toLowerCase() === ENCODED_SECRET_REDACTION.toLowerCase()) {
97
+ return `${prefix}${secret}`;
98
+ }
99
+ return `${prefix}${SECRET_REDACTION}`;
100
+ }).replace(CLOUDEVAL_ACCESS_KEY_VALUE_PATTERN, SECRET_REDACTION);
93
101
  };
94
102
  var redactSensitiveSecrets = (value) => {
95
103
  if (Array.isArray(value)) {
@@ -1503,6 +1511,15 @@ var extractEmailFromToken = (token) => {
1503
1511
  }
1504
1512
  };
1505
1513
  var AUTH_LOOKUP_ERROR = "CloudEvalAuthLookupError";
1514
+ var USER_PROFILE_MISSING_PATTERN = /USER_NOT_FOUND|CloudEval user profile not found|onboarding required/i;
1515
+ var isMissingUserProfileDetail = (detail) => USER_PROFILE_MISSING_PATTERN.test(detail ?? "");
1516
+ var authLookupErrorFromDetail = (response, context, detail) => {
1517
+ const status = [response.status, response.statusText].filter(Boolean).join(" ");
1518
+ const suffix = detail ? ` - ${detail.slice(0, 300)}` : "";
1519
+ const error = new Error(`${context} failed: ${status}${suffix}`);
1520
+ error.name = AUTH_LOOKUP_ERROR;
1521
+ return error;
1522
+ };
1506
1523
  var authLookupError = async (response, context) => {
1507
1524
  let detail = "";
1508
1525
  try {
@@ -1545,6 +1562,13 @@ var fetchCurrentUserFromServer = async (apiBase, token) => {
1545
1562
  if (response.status === 401 || response.status === 403) {
1546
1563
  throw await authLookupError(response, "Current user lookup");
1547
1564
  }
1565
+ if (response.status === 404) {
1566
+ const detail = await readResponseDetail(response);
1567
+ if (isMissingUserProfileDetail(detail)) {
1568
+ throw authLookupErrorFromDetail(response, "Current user lookup", detail);
1569
+ }
1570
+ return null;
1571
+ }
1548
1572
  if (!response.ok) {
1549
1573
  return null;
1550
1574
  }
@@ -3033,6 +3057,68 @@ var runReports = async (options) => {
3033
3057
  var getReportJobStatus = async (options) => fetchJson(options, `/jobs/${encodeURIComponent(options.jobId)}`, {
3034
3058
  user_id: requireUserId(options.userId)
3035
3059
  });
3060
+ var appendQuery2 = (url, values) => {
3061
+ for (const [key, value] of Object.entries(values)) {
3062
+ if (value === void 0) {
3063
+ continue;
3064
+ }
3065
+ if (Array.isArray(value)) {
3066
+ for (const entry of value) {
3067
+ if (entry) {
3068
+ url.searchParams.append(key, entry);
3069
+ }
3070
+ }
3071
+ continue;
3072
+ }
3073
+ if (value) {
3074
+ url.searchParams.set(key, value);
3075
+ }
3076
+ }
3077
+ return url;
3078
+ };
3079
+ var compactErrorBody3 = async (response) => {
3080
+ const body = await response.text().catch(() => "");
3081
+ const trimmed = body.trim();
3082
+ if (!trimmed) {
3083
+ return void 0;
3084
+ }
3085
+ return trimmed.length > 1e3 ? `${trimmed.slice(0, 1e3)}...` : trimmed;
3086
+ };
3087
+ var fetchJson2 = async (options, path2, query = {}) => {
3088
+ const url = appendQuery2(new URL(`${normalizeApiBase(options.baseUrl)}${path2}`), {
3089
+ user_id: options.userId,
3090
+ ...query
3091
+ });
3092
+ const response = await fetch(url, {
3093
+ headers: getCLIHeaders(options.authToken)
3094
+ });
3095
+ if (!response.ok) {
3096
+ const detail = await compactErrorBody3(response);
3097
+ throw new Error(
3098
+ detail ? `Issues request failed (${response.status}): ${detail}` : `Issues request failed (${response.status}).`
3099
+ );
3100
+ }
3101
+ return response.json();
3102
+ };
3103
+ var listIssuesItems = async (options) => fetchJson2(options, "/issues/items", {
3104
+ project_ids: options.projectIds,
3105
+ exclude_project_ids: options.excludeProjectIds,
3106
+ type: options.types,
3107
+ severity: options.severities,
3108
+ pillar: options.pillars,
3109
+ category: options.categories,
3110
+ resource_type: options.resourceTypes,
3111
+ q: options.q,
3112
+ min_monthly_savings: options.minMonthlySavings !== void 0 ? String(options.minMonthlySavings) : void 0,
3113
+ sort: options.sort || "priority",
3114
+ limit: String(options.limit ?? 50),
3115
+ offset: String(options.offset ?? 0),
3116
+ allow_full_scan: options.allowFullScan === false ? "false" : "true"
3117
+ });
3118
+ var getIssuesItem = async (options) => fetchJson2(options, `/issues/items/${encodeURIComponent(options.itemId)}`, {
3119
+ project_ids: options.projectIds,
3120
+ allow_full_scan: options.allowFullScan === false ? "false" : "true"
3121
+ });
3036
3122
  var CREDIT_LOW_RATIO = 0.1;
3037
3123
  var CREDIT_WARNING_RATIO = 0.25;
3038
3124
  var DEFAULT_FREE_TRIAL_CREDITS_TOTAL = 1e3;
@@ -3547,7 +3633,7 @@ var getConnection = async (options) => {
3547
3633
  const connections = await listConnections(options);
3548
3634
  return connections.find((connection) => String(connection.id) === options.connectionId) ?? null;
3549
3635
  };
3550
- var compactErrorBody3 = async (response) => {
3636
+ var compactErrorBody4 = async (response) => {
3551
3637
  const body = await response.text().catch(() => "");
3552
3638
  const trimmed = body.trim();
3553
3639
  return trimmed ? redactSensitiveText(trimmed).slice(0, 1e3) : void 0;
@@ -3566,7 +3652,7 @@ var fetchCredentialJson = async (options, path2, request = {}) => {
3566
3652
  ...request.body ? { body: JSON.stringify(request.body) } : {}
3567
3653
  });
3568
3654
  if (!response.ok) {
3569
- const body = await compactErrorBody3(response);
3655
+ const body = await compactErrorBody4(response);
3570
3656
  throw new Error(
3571
3657
  `Credential request failed with status ${response.status} ${response.statusText}${body ? `: ${body}` : ""}`
3572
3658
  );
@@ -3718,6 +3804,8 @@ export {
3718
3804
  getWafReportHistory,
3719
3805
  runReports,
3720
3806
  getReportJobStatus,
3807
+ listIssuesItems,
3808
+ getIssuesItem,
3721
3809
  getBillingConfig,
3722
3810
  getBillingEntitlement,
3723
3811
  getSubscriptionStatus,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CLI_VERSION
3
- } from "./chunk-XDMPAWK2.js";
3
+ } from "./chunk-AO4LJZTG.js";
4
4
  import {
5
5
  shouldUseColor,
6
6
  terminalTheme