@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.
- package/dist/types/constants.d.ts +3 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/stores/analytics-config.d.ts +40 -1
- package/dist/types/stores/analytics-config.d.ts.map +1 -1
- package/dist/vitals-config-store.es.js +52 -34
- package/dist/vitals-config-store.umd.js +1 -1
- package/package.json +2 -2
|
@@ -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
|
-
|
|
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;
|
|
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
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
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"),
|
|
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
|
|
14
|
-
var
|
|
15
|
-
const e = (
|
|
16
|
-
return !!e && e >=
|
|
17
|
-
}),
|
|
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 =
|
|
20
|
-
}),
|
|
21
|
-
var e,
|
|
22
|
-
return !!((
|
|
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:
|
|
26
|
-
longRetention:
|
|
27
|
-
defaultQueryTimeForOrg:
|
|
28
|
-
loading:
|
|
40
|
+
analyticsConfig: t,
|
|
41
|
+
longRetention: u,
|
|
42
|
+
defaultQueryTimeForOrg: o,
|
|
43
|
+
loading: l,
|
|
29
44
|
analytics: c,
|
|
30
|
-
percentiles:
|
|
45
|
+
percentiles: y,
|
|
46
|
+
maxParallelRequests: i,
|
|
47
|
+
requestInterval: p,
|
|
48
|
+
requestIntervalCap: v
|
|
31
49
|
};
|
|
32
|
-
}),
|
|
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(
|
|
39
|
-
const
|
|
40
|
-
() => (
|
|
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 (
|
|
60
|
+
return (i, p) => !a(c) && y.value ? f(i.$slots, "default", {
|
|
43
61
|
key: 0,
|
|
44
|
-
hasAnalytics:
|
|
45
|
-
hasPercentiles:
|
|
46
|
-
}) :
|
|
62
|
+
hasAnalytics: a(o),
|
|
63
|
+
hasPercentiles: a(l)
|
|
64
|
+
}) : a(c) ? q("", !0) : f(i.$slots, "fallback", {
|
|
47
65
|
key: 1,
|
|
48
|
-
hasAnalytics:
|
|
49
|
-
hasPercentiles:
|
|
66
|
+
hasAnalytics: a(o),
|
|
67
|
+
hasPercentiles: a(l)
|
|
50
68
|
});
|
|
51
69
|
}
|
|
52
70
|
});
|
|
53
71
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
L as AnalyticsConfigCheck,
|
|
73
|
+
S as useAnalyticsConfigStore
|
|
56
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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.
|
|
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.
|
|
26
|
+
"@kong-ui-public/analytics-utilities": "^7.2.0"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|