@kong-ui-public/analytics-utilities 4.8.1 → 4.8.2

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.
@@ -125,6 +125,7 @@ const Vn = [
125
125
  "status_code_grouped",
126
126
  "time",
127
127
  "upstream_uri",
128
+ "upstream_status_code_grouped",
128
129
  "websocket"
129
130
  ], nr = I(Xe), Ve = [
130
131
  "request_uri",
@@ -476,7 +477,7 @@ const mt = {
476
477
  evening: "in the evening",
477
478
  night: "at night"
478
479
  }
479
- }, Dt = (e, t) => {
480
+ }, _t = (e, t) => {
480
481
  const n = Number(e), r = n % 100;
481
482
  if (r > 20 || r < 10)
482
483
  switch (r % 10) {
@@ -488,8 +489,8 @@ const mt = {
488
489
  return n + "rd";
489
490
  }
490
491
  return n + "th";
491
- }, _t = {
492
- ordinalNumber: Dt,
492
+ }, Dt = {
493
+ ordinalNumber: _t,
493
494
  era: P({
494
495
  values: mt,
495
496
  defaultWidth: "wide"
@@ -663,7 +664,7 @@ const Ot = /^(\d+)(th|st|nd|rd)?/i, xt = /\d+/i, St = {
663
664
  formatDistance: it,
664
665
  formatLong: lt,
665
666
  formatRelative: ft,
666
- localize: _t,
667
+ localize: Dt,
667
668
  match: Ft,
668
669
  options: {
669
670
  weekStartsOn: 0,
@@ -1331,26 +1332,26 @@ function ve(e, t, n) {
1331
1332
  const r = U(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? Ht, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (c = n == null ? void 0 : n.locale) == null ? void 0 : c.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((T = (M = r.locale) == null ? void 0 : M.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((v = (b = n == null ? void 0 : n.locale) == null ? void 0 : b.options) == null ? void 0 : v.weekStartsOn) ?? r.weekStartsOn ?? ((ne = (te = r.locale) == null ? void 0 : te.options) == null ? void 0 : ne.weekStartsOn) ?? 0, o = h(e);
1332
1333
  if (!rt(o))
1333
1334
  throw new RangeError("Invalid time value");
1334
- let u = t.match(Jt).map((D) => {
1335
- const w = D[0];
1335
+ let u = t.match(Jt).map((_) => {
1336
+ const w = _[0];
1336
1337
  if (w === "p" || w === "P") {
1337
1338
  const G = Gt[w];
1338
- return G(D, a.formatLong);
1339
+ return G(_, a.formatLong);
1339
1340
  }
1340
- return D;
1341
- }).join("").match(Bt).map((D) => {
1342
- if (D === "''")
1341
+ return _;
1342
+ }).join("").match(Bt).map((_) => {
1343
+ if (_ === "''")
1343
1344
  return { isToken: !1, value: "'" };
1344
- const w = D[0];
1345
+ const w = _[0];
1345
1346
  if (w === "'")
1346
- return { isToken: !1, value: nn(D) };
1347
+ return { isToken: !1, value: nn(_) };
1347
1348
  if (ae[w])
1348
- return { isToken: !0, value: D };
1349
+ return { isToken: !0, value: _ };
1349
1350
  if (w.match(tn))
1350
1351
  throw new RangeError(
1351
1352
  "Format string contains an unescaped latin alphabet character `" + w + "`"
1352
1353
  );
1353
- return { isToken: !1, value: D };
1354
+ return { isToken: !1, value: _ };
1354
1355
  });
1355
1356
  a.localize.preprocessor && (u = a.localize.preprocessor(o, u));
1356
1357
  const l = {
@@ -1358,9 +1359,9 @@ function ve(e, t, n) {
1358
1359
  weekStartsOn: i,
1359
1360
  locale: a
1360
1361
  };
1361
- return u.map((D) => {
1362
- if (!D.isToken) return D.value;
1363
- const w = D.value;
1362
+ return u.map((_) => {
1363
+ if (!_.isToken) return _.value;
1364
+ const w = _.value;
1364
1365
  (!(n != null && n.useAdditionalWeekYearTokens) && jt(w) || !(n != null && n.useAdditionalDayOfYearTokens) && $t(w)) && Zt(w, t, String(e));
1365
1366
  const G = ae[w[0]];
1366
1367
  return G(o, w, a.localize, l);
@@ -1521,10 +1522,10 @@ function W(e, t, n) {
1521
1522
  const i = parseInt(r[3], 10);
1522
1523
  return fe(a, i) ? (s = Math.abs(a) * de + i * wn, r[1] === "+" ? -s : s) : NaN;
1523
1524
  }
1524
- if (_n(e)) {
1525
+ if (Dn(e)) {
1525
1526
  t = new Date(t || Date.now());
1526
1527
  const i = n ? t : Tn(t), o = B(i, e);
1527
- return -(n ? o : Dn(t, o, e));
1528
+ return -(n ? o : _n(t, o, e));
1528
1529
  }
1529
1530
  return NaN;
1530
1531
  }
@@ -1537,7 +1538,7 @@ function B(e, t) {
1537
1538
  const s = a % 1e3;
1538
1539
  return a -= s >= 0 ? s : 1e3 + s, r - a;
1539
1540
  }
1540
- function Dn(e, t, n) {
1541
+ function _n(e, t, n) {
1541
1542
  let a = e.getTime() - t;
1542
1543
  const s = B(new Date(a), n);
1543
1544
  if (t === s)
@@ -1550,7 +1551,7 @@ function fe(e, t) {
1550
1551
  return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
1551
1552
  }
1552
1553
  const me = {};
1553
- function _n(e) {
1554
+ function Dn(e) {
1554
1555
  if (me[e])
1555
1556
  return !0;
1556
1557
  try {
@@ -1764,11 +1765,11 @@ function vn(e, t) {
1764
1765
  return Te(t, r, i) ? (n.setUTCFullYear(t, r, i), n) : /* @__PURE__ */ new Date(NaN);
1765
1766
  }
1766
1767
  if (s = y.Www.exec(e), s)
1767
- return a = parseInt(s[1], 10) - 1, De(a) ? we(t, a) : /* @__PURE__ */ new Date(NaN);
1768
+ return a = parseInt(s[1], 10) - 1, _e(a) ? we(t, a) : /* @__PURE__ */ new Date(NaN);
1768
1769
  if (s = y.WwwD.exec(e), s) {
1769
1770
  a = parseInt(s[1], 10) - 1;
1770
1771
  const i = parseInt(s[2], 10) - 1;
1771
- return De(a, i) ? we(t, a, i) : /* @__PURE__ */ new Date(NaN);
1772
+ return _e(a, i) ? we(t, a, i) : /* @__PURE__ */ new Date(NaN);
1772
1773
  }
1773
1774
  return null;
1774
1775
  }
@@ -1814,7 +1815,7 @@ function Yn(e, t) {
1814
1815
  const n = Ne(e);
1815
1816
  return !(n && t > 366 || !n && t > 365);
1816
1817
  }
1817
- function De(e, t) {
1818
+ function _e(e, t) {
1818
1819
  return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
1819
1820
  }
1820
1821
  function Z(e, t, n) {
@@ -1860,7 +1861,7 @@ function Ye(e, t) {
1860
1861
  function ur(e) {
1861
1862
  return ve(e, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
1862
1863
  }
1863
- function _e(e, t = {}) {
1864
+ function De(e, t = {}) {
1864
1865
  if (!e)
1865
1866
  return e;
1866
1867
  const n = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -1874,7 +1875,7 @@ function _e(e, t = {}) {
1874
1875
  }
1875
1876
  }
1876
1877
  function cr(e, t) {
1877
- return `${_e(e.getTime())} - ${_e(t.getTime(), { includeTZ: !0 })}`;
1878
+ return `${De(e.getTime())} - ${De(t.getTime(), { includeTZ: !0 })}`;
1878
1879
  }
1879
1880
  const q = {
1880
1881
  secondly: 1e3,
@@ -1994,7 +1995,7 @@ class mr extends Hn {
1994
1995
  }
1995
1996
  }
1996
1997
  const Y = (e, t) => new Date(e.getTime() - Ye(t, e));
1997
- class _ {
1998
+ class D {
1998
1999
  constructor(t) {
1999
2000
  g(this, "timeframeText");
2000
2001
  g(this, "key");
@@ -2062,7 +2063,7 @@ class _ {
2062
2063
  return ke(n, t);
2063
2064
  }
2064
2065
  }
2065
- class Cn extends _ {
2066
+ class Cn extends D {
2066
2067
  rawStart(t) {
2067
2068
  let n = O(this.tzAdjustedDate(t), { weekStartsOn: 1 });
2068
2069
  return t && (n = Y(n, t)), n;
@@ -2071,7 +2072,7 @@ class Cn extends _ {
2071
2072
  return 60 * 60 * 24 * 7;
2072
2073
  }
2073
2074
  }
2074
- class Ln extends _ {
2075
+ class Ln extends D {
2075
2076
  rawStart(t) {
2076
2077
  let n = k(this.tzAdjustedDate(t));
2077
2078
  return t && (n = Y(n, t)), n;
@@ -2080,7 +2081,7 @@ class Ln extends _ {
2080
2081
  return 60 * 60 * 24 * 31;
2081
2082
  }
2082
2083
  }
2083
- class qn extends _ {
2084
+ class qn extends D {
2084
2085
  rawEnd(t) {
2085
2086
  let n = O(this.tzAdjustedDate(t), { weekStartsOn: 1 });
2086
2087
  return t && (n = Y(n, t)), n;
@@ -2093,7 +2094,7 @@ class qn extends _ {
2093
2094
  return t && (r = Y(r, t)), r;
2094
2095
  }
2095
2096
  }
2096
- class Un extends _ {
2097
+ class Un extends D {
2097
2098
  rawEnd(t) {
2098
2099
  let n = k(this.tzAdjustedDate(t));
2099
2100
  return t && (n = Y(n, t)), n;
@@ -2106,7 +2107,7 @@ class Un extends _ {
2106
2107
  const zn = /* @__PURE__ */ new Map([
2107
2108
  [
2108
2109
  m.FIFTEEN_MIN,
2109
- new _({
2110
+ new D({
2110
2111
  key: m.FIFTEEN_MIN,
2111
2112
  display: "Last 15 minutes",
2112
2113
  timeframeText: "15 minutes",
@@ -2119,7 +2120,7 @@ const zn = /* @__PURE__ */ new Map([
2119
2120
  ],
2120
2121
  [
2121
2122
  m.ONE_HOUR,
2122
- new _({
2123
+ new D({
2123
2124
  key: m.ONE_HOUR,
2124
2125
  display: "Last hour",
2125
2126
  timeframeText: "One hour",
@@ -2132,7 +2133,7 @@ const zn = /* @__PURE__ */ new Map([
2132
2133
  ],
2133
2134
  [
2134
2135
  m.SIX_HOUR,
2135
- new _({
2136
+ new D({
2136
2137
  key: m.SIX_HOUR,
2137
2138
  display: "Last 6 hours",
2138
2139
  timeframeText: "6 hours",
@@ -2145,7 +2146,7 @@ const zn = /* @__PURE__ */ new Map([
2145
2146
  ],
2146
2147
  [
2147
2148
  m.TWELVE_HOUR,
2148
- new _({
2149
+ new D({
2149
2150
  key: m.TWELVE_HOUR,
2150
2151
  display: "Last 12 hours",
2151
2152
  timeframeText: "12 hours",
@@ -2158,7 +2159,7 @@ const zn = /* @__PURE__ */ new Map([
2158
2159
  ],
2159
2160
  [
2160
2161
  m.ONE_DAY,
2161
- new _({
2162
+ new D({
2162
2163
  key: m.ONE_DAY,
2163
2164
  display: "Last 24 hours",
2164
2165
  timeframeText: "24 hours",
@@ -2171,7 +2172,7 @@ const zn = /* @__PURE__ */ new Map([
2171
2172
  ],
2172
2173
  [
2173
2174
  m.SEVEN_DAY,
2174
- new _({
2175
+ new D({
2175
2176
  key: m.SEVEN_DAY,
2176
2177
  display: "Last 7 days",
2177
2178
  timeframeText: "7 days",
@@ -2184,7 +2185,7 @@ const zn = /* @__PURE__ */ new Map([
2184
2185
  ],
2185
2186
  [
2186
2187
  m.THIRTY_DAY,
2187
- new _({
2188
+ new D({
2188
2189
  key: m.THIRTY_DAY,
2189
2190
  display: "Last 30 days",
2190
2191
  timeframeText: "30 days",
@@ -2260,7 +2261,7 @@ const zn = /* @__PURE__ */ new Map([
2260
2261
  ]);
2261
2262
  function hr(e) {
2262
2263
  const t = new Date(e.start), n = new Date(e.end), r = (n.getTime() - t.getTime()) / 1e3;
2263
- return e.timePeriodsKey && zn.get(e.timePeriodsKey) || new _({
2264
+ return e.timePeriodsKey && zn.get(e.timePeriodsKey) || new D({
2264
2265
  key: "custom",
2265
2266
  timeframeText: "custom",
2266
2267
  display: "custom",
@@ -2389,7 +2390,7 @@ const wr = (e, t) => {
2389
2390
  data: s,
2390
2391
  meta: o
2391
2392
  };
2392
- }, Dr = (e, t) => {
2393
+ }, _r = (e, t) => {
2393
2394
  const n = Math.floor(Math.random() * 9991) + 10, r = new ee(n), a = Date.now() - 6 * 60 * 60 * 1e3, s = Date.now(), i = new Date((a + s) / 2).toISOString(), o = [];
2394
2395
  if (t) {
2395
2396
  const c = Object.keys(t), d = Object.values(t), M = (T, b) => {
@@ -2453,7 +2454,7 @@ export {
2453
2454
  Xn as REFRESH_INTERVAL_MS,
2454
2455
  ee as SeededRandom,
2455
2456
  zn as TimePeriods,
2456
- _ as Timeframe,
2457
+ D as Timeframe,
2457
2458
  m as TimeframeKeys,
2458
2459
  fr as TimeseriesQueryTime,
2459
2460
  Hn as UnaryQueryTime,
@@ -2473,9 +2474,9 @@ export {
2473
2474
  rr as filterableRequestWildcardDimensions,
2474
2475
  pe as floorToNearestTimeGrain,
2475
2476
  ur as formatISOTimeWithTZ,
2476
- _e as formatTime,
2477
+ De as formatTime,
2477
2478
  cr as formatTimeRange,
2478
- Dr as generateCrossSectionalData,
2479
+ _r as generateCrossSectionalData,
2479
2480
  Tr as generateMultipleMetricTimeSeriesData,
2480
2481
  wr as generateSingleMetricTimeSeriesData,
2481
2482
  lr as granularitiesToOptions,