@kong-ui-public/analytics-config-store 0.8.41 → 0.9.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,2 +1,5 @@
1
1
  export declare const THIRTY_DAYS_MS = 2592000000;
2
+ export declare const DEFAULT_MAX_PARALLEL_REQUESTS = 2;
3
+ export declare const DEFAULT_REQUEST_INTERVAL = 2000;
4
+ export declare const DEFAULT_REQUEST_INTERVAL_CAP = 10;
2
5
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,aAAa,CAAA;AAExC,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAC9C,eAAO,MAAM,wBAAwB,OAAO,CAAA;AAC5C,eAAO,MAAM,4BAA4B,KAAK,CAAA"}
@@ -9,6 +9,11 @@ export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"a
9
9
  requests: {
10
10
  retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
11
11
  } | null;
12
+ ui?: {
13
+ maxParallelRequests?: number | undefined;
14
+ requestInterval?: number | undefined;
15
+ requestIntervalCap?: number | undefined;
16
+ } | undefined;
12
17
  } | null, ConfigStoreState | {
13
18
  analytics: {
14
19
  percentiles: boolean;
@@ -17,12 +22,20 @@ export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"a
17
22
  requests: {
18
23
  retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
19
24
  } | null;
25
+ ui?: {
26
+ maxParallelRequests?: number | undefined;
27
+ requestInterval?: number | undefined;
28
+ requestIntervalCap?: number | undefined;
29
+ } | undefined;
20
30
  }>;
21
31
  longRetention: import("vue").ComputedRef<boolean>;
22
32
  defaultQueryTimeForOrg: import("vue").ComputedRef<"7d">;
23
33
  loading: import("vue").ComputedRef<boolean>;
24
34
  analytics: import("vue").ComputedRef<boolean>;
25
35
  percentiles: import("vue").ComputedRef<boolean>;
36
+ maxParallelRequests: import("vue").ComputedRef<number>;
37
+ requestInterval: import("vue").ComputedRef<number>;
38
+ requestIntervalCap: import("vue").ComputedRef<number>;
26
39
  }, "analyticsConfig">>, Pick<{
27
40
  analyticsConfig: import("vue").Ref<{
28
41
  analytics: {
@@ -32,6 +45,11 @@ export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"a
32
45
  requests: {
33
46
  retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
34
47
  } | null;
48
+ ui?: {
49
+ maxParallelRequests?: number | undefined;
50
+ requestInterval?: number | undefined;
51
+ requestIntervalCap?: number | undefined;
52
+ } | undefined;
35
53
  } | null, ConfigStoreState | {
36
54
  analytics: {
37
55
  percentiles: boolean;
@@ -40,13 +58,21 @@ export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"a
40
58
  requests: {
41
59
  retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
42
60
  } | null;
61
+ ui?: {
62
+ maxParallelRequests?: number | undefined;
63
+ requestInterval?: number | undefined;
64
+ requestIntervalCap?: number | undefined;
65
+ } | undefined;
43
66
  }>;
44
67
  longRetention: import("vue").ComputedRef<boolean>;
45
68
  defaultQueryTimeForOrg: import("vue").ComputedRef<"7d">;
46
69
  loading: import("vue").ComputedRef<boolean>;
47
70
  analytics: import("vue").ComputedRef<boolean>;
48
71
  percentiles: import("vue").ComputedRef<boolean>;
49
- }, "analytics" | "percentiles" | "longRetention" | "defaultQueryTimeForOrg" | "loading">, Pick<{
72
+ maxParallelRequests: import("vue").ComputedRef<number>;
73
+ requestInterval: import("vue").ComputedRef<number>;
74
+ requestIntervalCap: import("vue").ComputedRef<number>;
75
+ }, "analytics" | "percentiles" | "maxParallelRequests" | "requestInterval" | "requestIntervalCap" | "longRetention" | "defaultQueryTimeForOrg" | "loading">, Pick<{
50
76
  analyticsConfig: import("vue").Ref<{
51
77
  analytics: {
52
78
  percentiles: boolean;
@@ -55,6 +81,11 @@ export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"a
55
81
  requests: {
56
82
  retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
57
83
  } | null;
84
+ ui?: {
85
+ maxParallelRequests?: number | undefined;
86
+ requestInterval?: number | undefined;
87
+ requestIntervalCap?: number | undefined;
88
+ } | undefined;
58
89
  } | null, ConfigStoreState | {
59
90
  analytics: {
60
91
  percentiles: boolean;
@@ -63,11 +94,19 @@ export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"a
63
94
  requests: {
64
95
  retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
65
96
  } | null;
97
+ ui?: {
98
+ maxParallelRequests?: number | undefined;
99
+ requestInterval?: number | undefined;
100
+ requestIntervalCap?: number | undefined;
101
+ } | undefined;
66
102
  }>;
67
103
  longRetention: import("vue").ComputedRef<boolean>;
68
104
  defaultQueryTimeForOrg: import("vue").ComputedRef<"7d">;
69
105
  loading: import("vue").ComputedRef<boolean>;
70
106
  analytics: import("vue").ComputedRef<boolean>;
71
107
  percentiles: import("vue").ComputedRef<boolean>;
108
+ maxParallelRequests: import("vue").ComputedRef<number>;
109
+ requestInterval: import("vue").ComputedRef<number>;
110
+ requestIntervalCap: import("vue").ComputedRef<number>;
72
111
  }, never>>;
73
112
  //# sourceMappingURL=analytics-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analytics-config.d.ts","sourceRoot":"","sources":["../../../src/stores/analytics-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAK7F,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,iBAAiB,CAAA;AAEvD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8ClC,CAAA"}
1
+ {"version":3,"file":"analytics-config.d.ts","sourceRoot":"","sources":["../../../src/stores/analytics-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAU7F,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,iBAAiB,CAAA;AAEvD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6DlC,CAAA"}
@@ -1,56 +1,74 @@
1
- import { ref as d, inject as f, computed as s, defineComponent as g, unref as r, renderSlot as p, createCommentVNode as m } from "vue";
2
- import { defineStore as h, storeToRefs as v } from "pinia";
3
- const q = 2592e6, A = "analytics-query-provider", C = h("analytics-config", () => {
4
- const n = d(null), o = f(A);
5
- o ? o.configFn().then((e) => {
6
- n.value = e;
1
+ import { ref as g, inject as m, computed as s, defineComponent as A, unref as a, renderSlot as f, createCommentVNode as q } from "vue";
2
+ import { defineStore as E, storeToRefs as h } from "pinia";
3
+ const _ = 2592e6, R = 2, T = 2e3, C = 10, P = "analytics-query-provider", S = E("analytics-config", () => {
4
+ const t = g(null), r = m(P);
5
+ r ? r.configFn().then((e) => {
6
+ t.value = e;
7
7
  }).catch((e) => {
8
8
  console.warn("Error fetching analytics config"), console.warn(e);
9
- }) : (console.warn("Analytics components require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"), n.value = {
9
+ }) : (console.warn("Analytics components require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"), t.value = {
10
10
  analytics: null,
11
11
  requests: null
12
12
  });
13
- const l = s(() => {
14
- var t, y;
15
- const e = (y = (t = n.value) == null ? void 0 : t.analytics) == null ? void 0 : y.retention_ms;
16
- return !!e && e >= q;
17
- }), a = s(() => "7d"), i = s(() => !n.value), c = s(() => {
13
+ const u = s(() => {
14
+ var n, d;
15
+ const e = (d = (n = t.value) == null ? void 0 : n.analytics) == null ? void 0 : d.retention_ms;
16
+ return !!e && e >= _;
17
+ }), o = s(() => "7d"), l = s(() => !t.value), c = s(() => {
18
18
  var e;
19
- return !!((e = n.value) != null && e.analytics);
20
- }), u = s(() => {
21
- var e, t;
22
- return !!((t = (e = n.value) == null ? void 0 : e.analytics) != null && t.percentiles);
23
- });
19
+ return !!((e = t.value) != null && e.analytics);
20
+ }), y = s(() => {
21
+ var e, n;
22
+ return !!((n = (e = t.value) == null ? void 0 : e.analytics) != null && n.percentiles);
23
+ }), i = s(
24
+ () => {
25
+ var e, n;
26
+ return ((n = (e = t.value) == null ? void 0 : e.ui) == null ? void 0 : n.maxParallelRequests) ?? R;
27
+ }
28
+ ), p = s(
29
+ () => {
30
+ var e, n;
31
+ return ((n = (e = t.value) == null ? void 0 : e.ui) == null ? void 0 : n.requestInterval) ?? T;
32
+ }
33
+ ), v = s(
34
+ () => {
35
+ var e, n;
36
+ return ((n = (e = t.value) == null ? void 0 : e.ui) == null ? void 0 : n.requestIntervalCap) ?? C;
37
+ }
38
+ );
24
39
  return {
25
- analyticsConfig: n,
26
- longRetention: l,
27
- defaultQueryTimeForOrg: a,
28
- loading: i,
40
+ analyticsConfig: t,
41
+ longRetention: u,
42
+ defaultQueryTimeForOrg: o,
43
+ loading: l,
29
44
  analytics: c,
30
- percentiles: u
45
+ percentiles: y,
46
+ maxParallelRequests: i,
47
+ requestInterval: p,
48
+ requestIntervalCap: v
31
49
  };
32
- }), k = /* @__PURE__ */ g({
50
+ }), L = /* @__PURE__ */ A({
33
51
  __name: "AnalyticsConfigCheck",
34
52
  props: {
35
53
  requireAnalytics: { type: Boolean },
36
54
  requirePercentiles: { type: Boolean }
37
55
  },
38
- setup(n) {
39
- const o = n, l = C(), { analytics: a, percentiles: i, loading: c } = v(l), u = s(
40
- () => (o.requireAnalytics ? a.value : !0) && (o.requirePercentiles ? i.value : !0)
56
+ setup(t) {
57
+ const r = t, u = S(), { analytics: o, percentiles: l, loading: c } = h(u), y = s(
58
+ () => (r.requireAnalytics ? o.value : !0) && (r.requirePercentiles ? l.value : !0)
41
59
  );
42
- return (e, t) => !r(c) && u.value ? p(e.$slots, "default", {
60
+ return (i, p) => !a(c) && y.value ? f(i.$slots, "default", {
43
61
  key: 0,
44
- hasAnalytics: r(a),
45
- hasPercentiles: r(i)
46
- }) : r(c) ? m("", !0) : p(e.$slots, "fallback", {
62
+ hasAnalytics: a(o),
63
+ hasPercentiles: a(l)
64
+ }) : a(c) ? q("", !0) : f(i.$slots, "fallback", {
47
65
  key: 1,
48
- hasAnalytics: r(a),
49
- hasPercentiles: r(i)
66
+ hasAnalytics: a(o),
67
+ hasPercentiles: a(l)
50
68
  });
51
69
  }
52
70
  });
53
71
  export {
54
- k as AnalyticsConfigCheck,
55
- C as useAnalyticsConfigStore
72
+ L as AnalyticsConfigCheck,
73
+ S as useAnalyticsConfigStore
56
74
  };
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["kong-ui-public-vitals-config-store"]={},t.Vue,t.pinia))})(this,function(t,e,d){"use strict";const y="analytics-query-provider",p=d.defineStore("analytics-config",()=>{const i=e.ref(null),r=e.inject(y);r?r.configFn().then(n=>{i.value=n}).catch(n=>{console.warn("Error fetching analytics config"),console.warn(n)}):(console.warn("Analytics components require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"),i.value={analytics:null,requests:null});const l=e.computed(()=>{var o,f;const n=(f=(o=i.value)==null?void 0:o.analytics)==null?void 0:f.retention_ms;return!!n&&n>=2592e6}),s=e.computed(()=>"7d"),c=e.computed(()=>!i.value),a=e.computed(()=>{var n;return!!((n=i.value)!=null&&n.analytics)}),u=e.computed(()=>{var n,o;return!!((o=(n=i.value)==null?void 0:n.analytics)!=null&&o.percentiles)});return{analyticsConfig:i,longRetention:l,defaultQueryTimeForOrg:s,loading:c,analytics:a,percentiles:u}}),g=e.defineComponent({__name:"AnalyticsConfigCheck",props:{requireAnalytics:{type:Boolean},requirePercentiles:{type:Boolean}},setup(i){const r=i,l=p(),{analytics:s,percentiles:c,loading:a}=d.storeToRefs(l),u=e.computed(()=>(r.requireAnalytics?s.value:!0)&&(r.requirePercentiles?c.value:!0));return(n,o)=>!e.unref(a)&&u.value?e.renderSlot(n.$slots,"default",{key:0,hasAnalytics:e.unref(s),hasPercentiles:e.unref(c)}):e.unref(a)?e.createCommentVNode("",!0):e.renderSlot(n.$slots,"fallback",{key:1,hasAnalytics:e.unref(s),hasPercentiles:e.unref(c)})}});t.AnalyticsConfigCheck=g,t.useAnalyticsConfigStore=p,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o["kong-ui-public-vitals-config-store"]={},o.Vue,o.pinia))})(this,function(o,e,p){"use strict";const E="analytics-query-provider",f=p.defineStore("analytics-config",()=>{const s=e.ref(null),r=e.inject(E);r?r.configFn().then(n=>{s.value=n}).catch(n=>{console.warn("Error fetching analytics config"),console.warn(n)}):(console.warn("Analytics components require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"),s.value={analytics:null,requests:null});const u=e.computed(()=>{var t,A;const n=(A=(t=s.value)==null?void 0:t.analytics)==null?void 0:A.retention_ms;return!!n&&n>=2592e6}),i=e.computed(()=>"7d"),a=e.computed(()=>!s.value),c=e.computed(()=>{var n;return!!((n=s.value)!=null&&n.analytics)}),d=e.computed(()=>{var n,t;return!!((t=(n=s.value)==null?void 0:n.analytics)!=null&&t.percentiles)}),l=e.computed(()=>{var n,t;return((t=(n=s.value)==null?void 0:n.ui)==null?void 0:t.maxParallelRequests)??2}),y=e.computed(()=>{var n,t;return((t=(n=s.value)==null?void 0:n.ui)==null?void 0:t.requestInterval)??2e3}),T=e.computed(()=>{var n,t;return((t=(n=s.value)==null?void 0:n.ui)==null?void 0:t.requestIntervalCap)??10});return{analyticsConfig:s,longRetention:u,defaultQueryTimeForOrg:i,loading:a,analytics:c,percentiles:d,maxParallelRequests:l,requestInterval:y,requestIntervalCap:T}}),m=e.defineComponent({__name:"AnalyticsConfigCheck",props:{requireAnalytics:{type:Boolean},requirePercentiles:{type:Boolean}},setup(s){const r=s,u=f(),{analytics:i,percentiles:a,loading:c}=p.storeToRefs(u),d=e.computed(()=>(r.requireAnalytics?i.value:!0)&&(r.requirePercentiles?a.value:!0));return(l,y)=>!e.unref(c)&&d.value?e.renderSlot(l.$slots,"default",{key:0,hasAnalytics:e.unref(i),hasPercentiles:e.unref(a)}):e.unref(c)?e.createCommentVNode("",!0):e.renderSlot(l.$slots,"fallback",{key:1,hasAnalytics:e.unref(i),hasPercentiles:e.unref(a)})}});o.AnalyticsConfigCheck=m,o.useAnalyticsConfigStore=f,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/analytics-config-store",
3
- "version": "0.8.41",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "main": "./dist/vitals-config-store.umd.js",
6
6
  "module": "./dist/vitals-config-store.es.js",
@@ -23,7 +23,7 @@
23
23
  "devDependencies": {
24
24
  "pinia": ">= 2.1.7 < 3",
25
25
  "vue": "^3.5.13",
26
- "@kong-ui-public/analytics-utilities": "^7.1.0"
26
+ "@kong-ui-public/analytics-utilities": "^7.2.0"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",