@kong-ui-public/analytics-utilities 12.1.5-pr.2700.d98d1061d.0 → 12.2.1-pr.2701.86bca6224.0

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.
@@ -1,9 +1,9 @@
1
1
  var Jr = Object.defineProperty;
2
2
  var ea = (e, t, n) => t in e ? Jr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var T = (e, t, n) => ea(e, typeof t != "symbol" ? t + "" : t, n);
4
- const Ro = 3e4, Co = 1e3, Yo = "analytics-query-provider";
4
+ const Co = 3e4, Yo = 1e3, Go = "analytics-query-provider";
5
5
  var p = /* @__PURE__ */ ((e) => (e.FIFTEEN_MIN = "15m", e.ONE_HOUR = "1h", e.SIX_HOUR = "6h", e.TWELVE_HOUR = "12h", e.ONE_DAY = "24h", e.SEVEN_DAY = "7d", e.THIRTY_DAY = "30d", e.NINETY_DAY = "90d", e.ONE_HUNDRED_EIGHTY_DAY = "180d", e.ONE_YEAR = "365d", e.CURRENT_WEEK = "current_week", e.CURRENT_MONTH = "current_month", e.CURRENT_QUARTER = "current_quarter", e.CURRENT_YEAR = "current_year", e.PREVIOUS_WEEK = "previous_week", e.PREVIOUS_MONTH = "previous_month", e.PREVIOUS_QUARTER = "previous_quarter", e.PREVIOUS_YEAR = "previous_year", e))(p || {});
6
- const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
6
+ const ko = ["90d", "180d", "365d", "current_year", "previous_year"], Ao = [
7
7
  "horizontal_bar",
8
8
  "vertical_bar",
9
9
  "timeseries_line",
@@ -11,7 +11,7 @@ const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
11
11
  "timeseries_bar",
12
12
  "donut",
13
13
  "single_value"
14
- ], ta = ["in", "not_in", "selector"], Ao = ["=", "!="], Fo = ["=", "!=", "<", ">", "<=", ">="], na = ["empty", "not_empty"], Ho = ["starts_with", "ends_with"], Lo = ["absolute", "relative"], on = [
14
+ ], ta = ["in", "not_in", "selector"], Fo = ["=", "!="], Ho = ["=", "!=", "<", ">", "<=", ">="], na = ["empty", "not_empty"], Lo = ["starts_with", "ends_with"], Uo = ["absolute", "relative"], on = [
15
15
  "15m",
16
16
  "1h",
17
17
  "6h",
@@ -166,7 +166,7 @@ const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
166
166
  "service_protocol",
167
167
  "trace_id",
168
168
  "upstream_uri"
169
- ], Uo = sa, ua = [
169
+ ], Wo = sa, ua = [
170
170
  "ai_count",
171
171
  "latencies_response_ms",
172
172
  "latencies_upstream_ms",
@@ -176,18 +176,18 @@ const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
176
176
  "response_header_content_length",
177
177
  "status_code",
178
178
  "upstream_status_code"
179
- ], ca = oe(ua), Wo = [
179
+ ], ca = oe(ua), qo = [
180
180
  "15M",
181
181
  "1H",
182
182
  "6H",
183
183
  "12H",
184
184
  "24H",
185
185
  "7D"
186
- ], qo = ["basic", "api_usage", "llm_usage"], la = {
186
+ ], jo = ["basic", "api_usage", "llm_usage"], la = {
187
187
  basic: new Set(Me),
188
188
  api_usage: new Set(Se),
189
189
  llm_usage: new Set(Oe)
190
- }, jo = (e, t) => t.filter((n) => la[e].has(n.field)), dn = [
190
+ }, zo = (e, t) => t.filter((n) => la[e].has(n.field)), dn = [
191
191
  { code: "AF", name: "Afghanistan" },
192
192
  { code: "AX", name: "Aland Islands" },
193
193
  { code: "AL", name: "Albania" },
@@ -434,7 +434,7 @@ const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
434
434
  { code: "YE", name: "Yemen" },
435
435
  { code: "ZM", name: "Zambia" },
436
436
  { code: "ZW", name: "Zimbabwe" }
437
- ], zo = [
437
+ ], Vo = [
438
438
  "horizontal_bar",
439
439
  "vertical_bar",
440
440
  "gauge",
@@ -922,7 +922,7 @@ const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
922
922
  },
923
923
  required: ["type", "definition", "layout"],
924
924
  additionalProperties: !1
925
- }, Vo = {
925
+ }, $o = {
926
926
  type: "object",
927
927
  properties: {
928
928
  tiles: {
@@ -941,7 +941,7 @@ const Go = ["90d", "180d", "365d", "current_year", "previous_year"], ko = [
941
941
  },
942
942
  required: ["tiles"],
943
943
  additionalProperties: !1
944
- }, $o = (e) => {
944
+ }, Bo = (e) => {
945
945
  const t = [];
946
946
  return Me.includes(e) && t.push("basic"), Se.includes(e) && t.push("api_usage"), Oe.includes(e) && t.push("llm_usage"), (oa.includes(e) || ca.includes(e)) && t.push("requests"), t;
947
947
  }, xa = {
@@ -2635,7 +2635,7 @@ function go(e, t, n) {
2635
2635
  function Mn(e, t) {
2636
2636
  return -ce(e, t);
2637
2637
  }
2638
- function Bo(e, t = {}) {
2638
+ function Zo(e, t = {}) {
2639
2639
  const n = (t == null ? void 0 : t.tz) || Intl.DateTimeFormat().resolvedOptions().timeZone;
2640
2640
  let r = "MMM dd, yyy hh:mm a";
2641
2641
  switch (t.format) {
@@ -2664,7 +2664,7 @@ function nn(e, t = {}) {
2664
2664
  return console.error("Invalid value passed to formatTime", e), "(invalid date)";
2665
2665
  }
2666
2666
  }
2667
- function Zo(e, t) {
2667
+ function Xo(e, t) {
2668
2668
  return `${nn(e.getTime())} - ${nn(t.getTime(), { includeTZ: !0 })}`;
2669
2669
  }
2670
2670
  const Te = {
@@ -2682,7 +2682,7 @@ const Te = {
2682
2682
  weekly: 60 * 60 * 24 * 7 * 1e3,
2683
2683
  trend: 0
2684
2684
  };
2685
- function Xo(e, t) {
2685
+ function Qo(e, t) {
2686
2686
  return e.map((n) => ({
2687
2687
  value: n,
2688
2688
  label: t.t(`configuration.vitals.reports.granularity.${n}`)
@@ -2695,7 +2695,7 @@ function po(e, t) {
2695
2695
  origin: t
2696
2696
  };
2697
2697
  }
2698
- function Qo(e) {
2698
+ function Ko(e) {
2699
2699
  return e && sn.find((n) => e <= Te[n]) || null;
2700
2700
  }
2701
2701
  function Sn(e, t, n, r) {
@@ -2749,7 +2749,7 @@ class ve {
2749
2749
  return Wt(this.endDate());
2750
2750
  }
2751
2751
  }
2752
- class Ko extends ve {
2752
+ class Jo extends ve {
2753
2753
  constructor(n, r, i, o, c) {
2754
2754
  super(n, i, o);
2755
2755
  T(this, "granularity");
@@ -2776,7 +2776,7 @@ class wo extends ve {
2776
2776
  return this.endDate().getTime() - this.startDate().getTime();
2777
2777
  }
2778
2778
  }
2779
- class Jo extends wo {
2779
+ class es extends wo {
2780
2780
  startDate() {
2781
2781
  return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
2782
2782
  }
@@ -3623,7 +3623,7 @@ const No = /* @__PURE__ */ new Map([
3623
3623
  })
3624
3624
  ]
3625
3625
  ]);
3626
- function es(e) {
3626
+ function ts(e) {
3627
3627
  const t = new Date(e.start), n = new Date(e.end), r = (n.getTime() - t.getTime()) / 1e3;
3628
3628
  return e.timePeriodsKey && To(No.get(e.timePeriodsKey)) || new S({
3629
3629
  key: "custom",
@@ -3638,14 +3638,14 @@ function es(e) {
3638
3638
  allowedTiers: ["free", "plus", "enterprise"]
3639
3639
  });
3640
3640
  }
3641
- function ts(e) {
3641
+ function ns(e) {
3642
3642
  return {
3643
3643
  ...e.key !== "custom" && { timePeriodsKey: e.key },
3644
3644
  start: e.rawStart(),
3645
3645
  end: e.rawEnd()
3646
3646
  };
3647
3647
  }
3648
- function ns(e) {
3648
+ function rs(e) {
3649
3649
  return {
3650
3650
  key: e.key,
3651
3651
  display: e.display,
@@ -3659,7 +3659,7 @@ function ns(e) {
3659
3659
  function rn(e, t) {
3660
3660
  return Wi(e.getTimezoneOffset() - t.getTimezoneOffset());
3661
3661
  }
3662
- const rs = {
3662
+ const as = {
3663
3663
  "15M": p.FIFTEEN_MIN,
3664
3664
  "1H": p.ONE_HOUR,
3665
3665
  "6H": p.SIX_HOUR,
@@ -3693,7 +3693,7 @@ class et {
3693
3693
  return Math.floor(i * (n - t + 1)) + t;
3694
3694
  }
3695
3695
  }
3696
- const as = (e, t, n) => {
3696
+ const is = (e, t, n) => {
3697
3697
  const r = vn(10, 1e4), i = new et(r), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), m = [];
3698
3698
  let g = 0;
3699
3699
  for (let d = o; d <= c; d += 60 * 60 * 1e3)
@@ -3750,7 +3750,7 @@ const as = (e, t, n) => {
3750
3750
  data: m,
3751
3751
  meta: f
3752
3752
  };
3753
- }, is = (e, t) => {
3753
+ }, os = (e, t) => {
3754
3754
  const n = vn(10, 1e4), r = new et(n), i = Date.now() - 6 * 60 * 60 * 1e3, o = Date.now(), c = [], m = {};
3755
3755
  e.forEach((l) => {
3756
3756
  m[l.name] = 0;
@@ -3784,7 +3784,7 @@ const as = (e, t, n) => {
3784
3784
  data: c,
3785
3785
  meta: g
3786
3786
  };
3787
- }, os = (e, t, n) => {
3787
+ }, ss = (e, t, n) => {
3788
3788
  const r = Math.floor(Math.random() * 9991) + 10, i = new et(r), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), m = new Date((o + c) / 2).toISOString(), g = [];
3789
3789
  if (t) {
3790
3790
  const d = Object.keys(t), h = Object.values(t), b = (E, N) => {
@@ -3844,7 +3844,7 @@ const as = (e, t, n) => {
3844
3844
  function vn(e, t) {
3845
3845
  return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
3846
3846
  }
3847
- const Io = new Map(dn.map((e) => [e.code, { code: e.code, name: e.name }])), ss = (e) => {
3847
+ const Io = new Map(dn.map((e) => [e.code, { code: e.code, name: e.name }])), us = (e) => {
3848
3848
  var t;
3849
3849
  return ((t = Io.get(e)) == null ? void 0 : t.name) || e;
3850
3850
  };
@@ -3878,8 +3878,8 @@ var Nn = { exports: {} };
3878
3878
  var xo = Nn.exports;
3879
3879
  const Ve = /* @__PURE__ */ En(xo);
3880
3880
  var an;
3881
- const $e = new Intl.NumberFormat(((an = document == null ? void 0 : document.documentElement) == null ? void 0 : an.lang) || "en-US");
3882
- function us({
3881
+ const Po = typeof document < "u" && ((an = document.documentElement) == null ? void 0 : an.lang) || "en-US", $e = new Intl.NumberFormat(Po);
3882
+ function cs({
3883
3883
  i18n: e
3884
3884
  }) {
3885
3885
  const t = (o, c) => {
@@ -3954,17 +3954,17 @@ function us({
3954
3954
  }
3955
3955
  export {
3956
3956
  dn as COUNTRIES,
3957
- Jo as DeltaQueryTime,
3958
- Co as EXPORT_RECORD_LIMIT,
3957
+ es as DeltaQueryTime,
3958
+ Yo as EXPORT_RECORD_LIMIT,
3959
3959
  Te as Granularities,
3960
- Yo as INJECT_QUERY_PROVIDER,
3961
- Ro as REFRESH_INTERVAL_MS,
3960
+ Go as INJECT_QUERY_PROVIDER,
3961
+ Co as REFRESH_INTERVAL_MS,
3962
3962
  et as SeededRandom,
3963
- rs as TIMEFRAME_LOOKUP,
3963
+ as as TIMEFRAME_LOOKUP,
3964
3964
  No as TimePeriods,
3965
3965
  S as Timeframe,
3966
3966
  p as TimeframeKeys,
3967
- Ko as TimeseriesQueryTime,
3967
+ Jo as TimeseriesQueryTime,
3968
3968
  wo as UnaryQueryTime,
3969
3969
  aa as aiExploreAggregations,
3970
3970
  Ma as apiUsageQuerySchema,
@@ -3974,39 +3974,39 @@ export {
3974
3974
  On as ceilToNearestTimeGrain,
3975
3975
  ba as choroplethMapSchema,
3976
3976
  Io as countries,
3977
- Vo as dashboardConfigSchema,
3978
- zo as dashboardTileTypes,
3977
+ $o as dashboardConfigSchema,
3978
+ Vo as dashboardTileTypes,
3979
3979
  la as datasourceToFilterableDimensions,
3980
- es as datePickerSelectionToTimeframe,
3980
+ ts as datePickerSelectionToTimeframe,
3981
3981
  ga as donutChartSchema,
3982
3982
  rn as dstOffsetHours,
3983
3983
  ra as exploreAggregations,
3984
3984
  ta as exploreFilterTypesV2,
3985
- Go as extendedRelativeTimeRangeValues,
3985
+ ko as extendedRelativeTimeRangeValues,
3986
3986
  Oe as filterableAiExploreDimensions,
3987
3987
  Me as filterableBasicExploreDimensions,
3988
3988
  Se as filterableExploreDimensions,
3989
3989
  oa as filterableRequestDimensions,
3990
3990
  ca as filterableRequestMetrics,
3991
- Uo as filterableRequestWildcardDimensions,
3991
+ Wo as filterableRequestWildcardDimensions,
3992
3992
  _o as floorToNearestTimeGrain,
3993
3993
  nn as formatTime,
3994
- Zo as formatTimeRange,
3995
- Bo as formatTimestamp,
3994
+ Xo as formatTimeRange,
3995
+ Zo as formatTimestamp,
3996
3996
  ya as gaugeChartSchema,
3997
- os as generateCrossSectionalData,
3998
- is as generateMultipleMetricTimeSeriesData,
3999
- as as generateSingleMetricTimeSeriesData,
4000
- ss as getCountryName,
4001
- $o as getFieldDataSources,
4002
- Xo as granularitiesToOptions,
3997
+ ss as generateCrossSectionalData,
3998
+ os as generateMultipleMetricTimeSeriesData,
3999
+ is as generateSingleMetricTimeSeriesData,
4000
+ us as getCountryName,
4001
+ Bo as getFieldDataSources,
4002
+ Qo as granularitiesToOptions,
4003
4003
  po as granularityMsToQuery,
4004
4004
  sn as granularityValues,
4005
4005
  Oa as llmUsageSchema,
4006
4006
  _a as metricCardSchema,
4007
- Qo as msToGranularity,
4007
+ Ko as msToGranularity,
4008
4008
  $e as numberFormatter,
4009
- qo as queryDatasources,
4009
+ jo as queryDatasources,
4010
4010
  ln as queryableAiExploreDimensions,
4011
4011
  Ze as queryableBasicExploreDimensions,
4012
4012
  cn as queryableExploreDimensions,
@@ -4014,26 +4014,26 @@ export {
4014
4014
  ua as queryableRequestMetrics,
4015
4015
  sa as queryableRequestWildcardDimensions,
4016
4016
  vn as rand,
4017
- Wo as relativeTimeRangeValuesRequestV2,
4017
+ qo as relativeTimeRangeValuesRequestV2,
4018
4018
  on as relativeTimeRangeValuesV4,
4019
- ko as reportChartTypes,
4019
+ Ao as reportChartTypes,
4020
4020
  na as requestFilterTypeEmptyV2,
4021
- Ao as requestFilterTypeEqualsV2,
4022
- Fo as requestFilterTypeMetricV2,
4023
- Ho as requestFilterTypeWildcardV2,
4021
+ Fo as requestFilterTypeEqualsV2,
4022
+ Ho as requestFilterTypeMetricV2,
4023
+ Lo as requestFilterTypeWildcardV2,
4024
4024
  wa as singleValueSchema,
4025
4025
  da as slottableSchema,
4026
- jo as stripUnknownFilters,
4026
+ zo as stripUnknownFilters,
4027
4027
  fa as thresholdSchema,
4028
4028
  Ia as tileConfigSchema,
4029
4029
  va as tileDefinitionSchema,
4030
4030
  Na as tileLayoutSchema,
4031
- Lo as timeRangeTypeV2,
4032
- ts as timeframeToDatepickerSelection,
4033
- ns as timeframeToDatepickerTimeperiod,
4031
+ Uo as timeRangeTypeV2,
4032
+ ns as timeframeToDatepickerSelection,
4033
+ rs as timeframeToDatepickerTimeperiod,
4034
4034
  ha as timeseriesChartSchema,
4035
4035
  pa as topNTableSchema,
4036
- us as unitFormatter,
4036
+ cs as unitFormatter,
4037
4037
  Ea as validDashboardQuery
4038
4038
  };
4039
4039
  //# sourceMappingURL=vitals-utilities.es.js.map