autoql-fe-utils 1.11.25 → 1.11.27

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/dist/index.js CHANGED
@@ -2693,7 +2693,7 @@ var getUniqueYearsForColumn = (data, columns, index) => {
2693
2693
  var supportsNetworkGraph = (data, columns) => {
2694
2694
  var _a2, _b2;
2695
2695
  const logUnsupportedReason = (message) => {
2696
- console.warn(`[supportsNetworkGraph] ${message}`);
2696
+ console.debug(`[supportsNetworkGraph] ${message}`);
2697
2697
  };
2698
2698
  if (!data || data.length < 2) {
2699
2699
  logUnsupportedReason(`Insufficient rows (${(_a2 = data == null ? void 0 : data.length) != null ? _a2 : 0}). Need at least 2 rows.`);
@@ -2823,7 +2823,7 @@ var supportsSankey = (rows, columns) => {
2823
2823
  var _a2, _b2;
2824
2824
  try {
2825
2825
  const logUnsupportedReason = (message) => {
2826
- console.warn(`[supportsSankey] ${message}`);
2826
+ console.debug(`[supportsSankey] ${message}`);
2827
2827
  };
2828
2828
  if (!(rows == null ? void 0 : rows.length) || !(columns == null ? void 0 : columns.length)) {
2829
2829
  logUnsupportedReason(
@@ -10716,7 +10716,8 @@ var runQueryOnly = ({
10716
10716
  cancelToken,
10717
10717
  scope = "null",
10718
10718
  newColumns,
10719
- displayOverrides
10719
+ displayOverrides,
10720
+ projectId
10720
10721
  }) => {
10721
10722
  const url = `${domain}/autoql/api/v1/query?key=${apiKey}`;
10722
10723
  const finalUserSelection = userSelectionFinal || transformUserSelection(userSelection);
@@ -10738,7 +10739,8 @@ var runQueryOnly = ({
10738
10739
  scope: finalScope,
10739
10740
  additional_selects: newColumns,
10740
10741
  display_overrides: displayOverrides,
10741
- time_zone: getCurrentTimezone()
10742
+ time_zone: getCurrentTimezone(),
10743
+ project_id: projectId
10742
10744
  };
10743
10745
  if (!query || !query.trim()) {
10744
10746
  console.error("No query supplied in request");
@@ -10818,7 +10820,8 @@ var runQuery = async ({
10818
10820
  skipQueryValidation,
10819
10821
  scope = "null",
10820
10822
  newColumns,
10821
- displayOverrides
10823
+ displayOverrides,
10824
+ projectId
10822
10825
  } = {}) => {
10823
10826
  if (enableQueryValidation && !(userSelection == null ? void 0 : userSelection.length) && !skipQueryValidation) {
10824
10827
  try {
@@ -10860,7 +10863,8 @@ var runQuery = async ({
10860
10863
  cancelToken,
10861
10864
  scope,
10862
10865
  newColumns,
10863
- displayOverrides
10866
+ displayOverrides,
10867
+ projectId
10864
10868
  });
10865
10869
  };
10866
10870
  var runCachedDashboardQuery = async ({
@@ -10878,7 +10882,8 @@ var runCachedDashboardQuery = async ({
10878
10882
  queryIndex,
10879
10883
  tileKey,
10880
10884
  dashboardId,
10881
- force
10885
+ force,
10886
+ projectId
10882
10887
  } = {}) => {
10883
10888
  if (!dashboardId) {
10884
10889
  console.error("No dashboard ID supplied in request");
@@ -10903,6 +10908,9 @@ var runCachedDashboardQuery = async ({
10903
10908
  if (force) {
10904
10909
  queryParams.set("force", "true");
10905
10910
  }
10911
+ if (projectId != null) {
10912
+ queryParams.set("project_id", String(projectId));
10913
+ }
10906
10914
  const url = `${domain}/autoql/api/v1/dashboards/${dashboardId}/tiles/${tileKey}/query?${queryParams.toString()}`;
10907
10915
  const config = {
10908
10916
  headers: {
@@ -10943,7 +10951,8 @@ var runCachedDashboardQueryPost = async ({
10943
10951
  queryIndex,
10944
10952
  tileKey,
10945
10953
  dashboardId,
10946
- force
10954
+ force,
10955
+ projectId
10947
10956
  } = {}) => {
10948
10957
  if (!dashboardId) {
10949
10958
  console.error("No dashboard ID supplied in request");
@@ -10967,7 +10976,8 @@ var runCachedDashboardQueryPost = async ({
10967
10976
  const data = {
10968
10977
  query_index: (queryIndex || 0).toString(),
10969
10978
  force,
10970
- session_filter_locks: filters
10979
+ session_filter_locks: filters,
10980
+ project_id: projectId
10971
10981
  };
10972
10982
  const url = `${domain}/autoql/api/v1/dashboards/${dashboardId}/tiles/${tileKey}/query?${queryParams.toString()}`;
10973
10983
  const config = {
@@ -12751,8 +12761,8 @@ function formatDecimal_default(x) {
12751
12761
  return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
12752
12762
  }
12753
12763
  function formatDecimalParts(x, p) {
12754
- if (!isFinite(x) || x === 0) return null;
12755
- var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e"), coefficient = x.slice(0, i);
12764
+ if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null;
12765
+ var i, coefficient = x.slice(0, i);
12756
12766
  return [
12757
12767
  coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
12758
12768
  +x.slice(i + 1)
@@ -12846,7 +12856,7 @@ function formatTrim_default(s) {
12846
12856
  var prefixExponent;
12847
12857
  function formatPrefixAuto_default(x, p) {
12848
12858
  var d = formatDecimalParts(x, p);
12849
- if (!d) return prefixExponent = void 0, x.toPrecision(p);
12859
+ if (!d) return x + "";
12850
12860
  var coefficient = d[0], exponent = d[1], i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n = coefficient.length;
12851
12861
  return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0];
12852
12862
  }
@@ -12886,13 +12896,13 @@ var map = Array.prototype.map;
12886
12896
  var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
12887
12897
  function locale_default(locale2) {
12888
12898
  var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity_default : formatGroup_default(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity_default : formatNumerals_default(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "\u2212" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
12889
- function newFormat(specifier, options) {
12899
+ function newFormat(specifier) {
12890
12900
  specifier = formatSpecifier(specifier);
12891
12901
  var fill = specifier.fill, align = specifier.align, sign = specifier.sign, symbol2 = specifier.symbol, zero = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
12892
12902
  if (type === "n") comma = true, type = "g";
12893
12903
  else if (!formatTypes_default[type]) precision === void 0 && (precision = 12), trim = true, type = "g";
12894
12904
  if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "=";
12895
- var prefix = (options && options.prefix !== void 0 ? options.prefix : "") + (symbol2 === "$" ? currencyPrefix : symbol2 === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : ""), suffix = (symbol2 === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "") + (options && options.suffix !== void 0 ? options.suffix : "");
12905
+ var prefix = symbol2 === "$" ? currencyPrefix : symbol2 === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol2 === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
12896
12906
  var formatType = formatTypes_default[type], maybeSuffix = /[defgprs%]/.test(type);
12897
12907
  precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
12898
12908
  function format2(value) {
@@ -12907,7 +12917,7 @@ function locale_default(locale2) {
12907
12917
  if (trim) value = formatTrim_default(value);
12908
12918
  if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
12909
12919
  valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
12910
- valueSuffix = (type === "s" && !isNaN(value) && prefixExponent !== void 0 ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
12920
+ valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
12911
12921
  if (maybeSuffix) {
12912
12922
  i = -1, n = value.length;
12913
12923
  while (++i < n) {
@@ -12944,9 +12954,9 @@ function locale_default(locale2) {
12944
12954
  return format2;
12945
12955
  }
12946
12956
  function formatPrefix2(specifier, value) {
12947
- var e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k = Math.pow(10, -e), f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), { suffix: prefixes[8 + e / 3] });
12957
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
12948
12958
  return function(value2) {
12949
- return f(k * value2);
12959
+ return f(k * value2) + prefix;
12950
12960
  };
12951
12961
  }
12952
12962
  return {