@kong-ui-public/analytics-config-store 1.2.13-pr.2751.7a3f18384.0 → 1.2.14-pr.2694.d983d66d0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/analytics-config-store",
3
- "version": "1.2.13-pr.2751.7a3f18384.0",
3
+ "version": "1.2.14-pr.2694.d983d66d0.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.26",
26
- "@kong-ui-public/analytics-utilities": "^12.7.1-pr.2751.7a3f18384.0"
26
+ "@kong-ui-public/analytics-utilities": "^12.7.2-pr.2694.d983d66d0.0"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",
@@ -1,30 +0,0 @@
1
- type __VLS_Props = {
2
- requireAnalytics?: boolean;
3
- requirePercentiles?: boolean;
4
- };
5
- declare var __VLS_1: {
6
- error: Error;
7
- }, __VLS_3: {
8
- hasAnalytics: boolean;
9
- hasPercentiles: boolean;
10
- }, __VLS_5: {
11
- hasAnalytics: boolean;
12
- hasPercentiles: boolean;
13
- };
14
- type __VLS_Slots = {} & {
15
- error?: (props: typeof __VLS_1) => any;
16
- } & {
17
- default?: (props: typeof __VLS_3) => any;
18
- } & {
19
- fallback?: (props: typeof __VLS_5) => any;
20
- };
21
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
- declare const _default: typeof __VLS_export;
24
- export default _default;
25
- type __VLS_WithSlots<T, S> = T & {
26
- new (): {
27
- $slots: S;
28
- };
29
- };
30
- //# sourceMappingURL=AnalyticsConfigCheck.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyticsConfigCheck.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AnalyticsConfigCheck.vue"],"names":[],"mappings":"AA2CA,KAAK,WAAW,GAAG;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAC;AAkDF,QAAA,IAAI,OAAO;;CAAU,EAAE,OAAO;;;CAAU,EAAE,OAAO;;;CAAW,CAAE;AAC9D,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC1C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAGhD,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,5 +0,0 @@
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;
5
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,4 +0,0 @@
1
- import AnalyticsConfigCheck from './components/AnalyticsConfigCheck.vue';
2
- export { AnalyticsConfigCheck };
3
- export * from './stores';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,uCAAuC,CAAA;AAExE,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAC/B,cAAc,UAAU,CAAA"}
@@ -1,118 +0,0 @@
1
- import type { AnalyticsConfigV2 } from '@kong-ui-public/analytics-utilities';
2
- export type ConfigStoreState = null | AnalyticsConfigV2;
3
- export declare const useAnalyticsConfigStore: import("pinia").StoreDefinition<"analytics-config", import("pinia")._UnwrapAll<Pick<{
4
- analyticsConfig: import("vue").Ref<{
5
- analytics: {
6
- percentiles: boolean;
7
- retention_ms: import("@kong-ui-public/analytics-utilities").AnalyticsRetentionMs;
8
- } | null;
9
- requests: {
10
- retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
11
- } | null;
12
- ui?: {
13
- maxParallelRequests?: number | undefined;
14
- requestInterval?: number | undefined;
15
- requestIntervalCap?: number | undefined;
16
- } | undefined;
17
- } | null, ConfigStoreState | {
18
- analytics: {
19
- percentiles: boolean;
20
- retention_ms: import("@kong-ui-public/analytics-utilities").AnalyticsRetentionMs;
21
- } | null;
22
- requests: {
23
- retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
24
- } | null;
25
- ui?: {
26
- maxParallelRequests?: number | undefined;
27
- requestInterval?: number | undefined;
28
- requestIntervalCap?: number | undefined;
29
- } | undefined;
30
- }>;
31
- longRetention: import("vue").ComputedRef<boolean>;
32
- defaultQueryTimeForOrg: import("vue").ComputedRef<"7d">;
33
- loading: import("vue").ComputedRef<boolean>;
34
- analytics: import("vue").ComputedRef<boolean>;
35
- percentiles: import("vue").ComputedRef<boolean>;
36
- maxParallelRequests: import("vue").ComputedRef<number>;
37
- requestInterval: import("vue").ComputedRef<number>;
38
- requestIntervalCap: import("vue").ComputedRef<number>;
39
- isReady: () => Promise<void>;
40
- configError: import("vue").Ref<Error | null, Error | null>;
41
- }, "analyticsConfig" | "configError">>, Pick<{
42
- analyticsConfig: import("vue").Ref<{
43
- analytics: {
44
- percentiles: boolean;
45
- retention_ms: import("@kong-ui-public/analytics-utilities").AnalyticsRetentionMs;
46
- } | null;
47
- requests: {
48
- retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
49
- } | null;
50
- ui?: {
51
- maxParallelRequests?: number | undefined;
52
- requestInterval?: number | undefined;
53
- requestIntervalCap?: number | undefined;
54
- } | undefined;
55
- } | null, ConfigStoreState | {
56
- analytics: {
57
- percentiles: boolean;
58
- retention_ms: import("@kong-ui-public/analytics-utilities").AnalyticsRetentionMs;
59
- } | null;
60
- requests: {
61
- retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
62
- } | null;
63
- ui?: {
64
- maxParallelRequests?: number | undefined;
65
- requestInterval?: number | undefined;
66
- requestIntervalCap?: number | undefined;
67
- } | undefined;
68
- }>;
69
- longRetention: import("vue").ComputedRef<boolean>;
70
- defaultQueryTimeForOrg: import("vue").ComputedRef<"7d">;
71
- loading: import("vue").ComputedRef<boolean>;
72
- analytics: import("vue").ComputedRef<boolean>;
73
- percentiles: import("vue").ComputedRef<boolean>;
74
- maxParallelRequests: import("vue").ComputedRef<number>;
75
- requestInterval: import("vue").ComputedRef<number>;
76
- requestIntervalCap: import("vue").ComputedRef<number>;
77
- isReady: () => Promise<void>;
78
- configError: import("vue").Ref<Error | null, Error | null>;
79
- }, "analytics" | "percentiles" | "maxParallelRequests" | "requestInterval" | "requestIntervalCap" | "longRetention" | "defaultQueryTimeForOrg" | "loading">, Pick<{
80
- analyticsConfig: import("vue").Ref<{
81
- analytics: {
82
- percentiles: boolean;
83
- retention_ms: import("@kong-ui-public/analytics-utilities").AnalyticsRetentionMs;
84
- } | null;
85
- requests: {
86
- retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
87
- } | null;
88
- ui?: {
89
- maxParallelRequests?: number | undefined;
90
- requestInterval?: number | undefined;
91
- requestIntervalCap?: number | undefined;
92
- } | undefined;
93
- } | null, ConfigStoreState | {
94
- analytics: {
95
- percentiles: boolean;
96
- retention_ms: import("@kong-ui-public/analytics-utilities").AnalyticsRetentionMs;
97
- } | null;
98
- requests: {
99
- retention_ms: import("@kong-ui-public/analytics-utilities").RequestsRetentionMs;
100
- } | null;
101
- ui?: {
102
- maxParallelRequests?: number | undefined;
103
- requestInterval?: number | undefined;
104
- requestIntervalCap?: number | undefined;
105
- } | undefined;
106
- }>;
107
- longRetention: import("vue").ComputedRef<boolean>;
108
- defaultQueryTimeForOrg: import("vue").ComputedRef<"7d">;
109
- loading: import("vue").ComputedRef<boolean>;
110
- analytics: import("vue").ComputedRef<boolean>;
111
- percentiles: import("vue").ComputedRef<boolean>;
112
- maxParallelRequests: import("vue").ComputedRef<number>;
113
- requestInterval: import("vue").ComputedRef<number>;
114
- requestIntervalCap: import("vue").ComputedRef<number>;
115
- isReady: () => Promise<void>;
116
- configError: import("vue").Ref<Error | null, Error | null>;
117
- }, "isReady">>;
118
- //# sourceMappingURL=analytics-config.d.ts.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAgDd,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAb,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAb,OAAO,CAAC,IAAI,CAAC;;cAwCjC,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './analytics-config';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -1,13 +0,0 @@
1
- import type { App } from 'vue';
2
- interface SetupPiniaTestStoreOptions {
3
- /** Should a Vue app be created and initialized? */
4
- createVueApp?: boolean;
5
- }
6
- /**
7
- * Set up the Pinia test store instance for the given runner (Cypress or Vitest).
8
- * @param {'cy.spy' | 'vi.fn} createSpy The test runner your spec file is using.
9
- * @param {TestingOptions} config @pinia/testing options https://pinia.vuejs.org/api/@pinia/testing/interfaces/TestingOptions.html
10
- */
11
- export declare const setupPiniaTestStore: (options?: SetupPiniaTestStoreOptions) => App | undefined;
12
- export {};
13
- //# sourceMappingURL=setupPiniaTestStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setupPiniaTestStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/tests/setupPiniaTestStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,UAAU,0BAA0B;IAClC,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,0BAA0B,KAAG,GAAG,GAAG,SAShF,CAAA"}
@@ -1,88 +0,0 @@
1
- import { ref as g, inject as h, computed as s, watch as q, defineComponent as A, renderSlot as d, createCommentVNode as R, unref as r } from "vue";
2
- import { defineStore as _, storeToRefs as T } from "pinia";
3
- const C = 2592e6, P = 2, b = 2e3, S = 10, w = "analytics-query-provider", I = _("analytics-config", () => {
4
- const t = g(null), o = g(null), y = h(w);
5
- y ? y.configFn().then((e) => {
6
- t.value = e;
7
- }).catch((e) => {
8
- o.value = e, t.value = {
9
- analytics: null,
10
- requests: null
11
- }, console.warn("Error fetching analytics config"), console.warn(e);
12
- }) : (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"), o.value = new Error("No analytics bridge provided"), t.value = {
13
- analytics: null,
14
- requests: null
15
- });
16
- const l = s(() => {
17
- var n, f;
18
- const e = (f = (n = t.value) == null ? void 0 : n.analytics) == null ? void 0 : f.retention_ms;
19
- return !!e && e >= C;
20
- }), i = s(() => "7d"), a = s(() => !t.value), c = s(() => {
21
- var e;
22
- return !!((e = t.value) != null && e.analytics);
23
- }), p = s(() => {
24
- var e, n;
25
- return !!((n = (e = t.value) == null ? void 0 : e.analytics) != null && n.percentiles);
26
- }), u = () => new Promise((e) => {
27
- if (!a.value)
28
- return e();
29
- const n = q(a, () => {
30
- a.value || (n(), e());
31
- });
32
- }), v = s(
33
- () => {
34
- var e, n;
35
- return ((n = (e = t.value) == null ? void 0 : e.ui) == null ? void 0 : n.maxParallelRequests) ?? P;
36
- }
37
- ), m = s(
38
- () => {
39
- var e, n;
40
- return ((n = (e = t.value) == null ? void 0 : e.ui) == null ? void 0 : n.requestInterval) ?? b;
41
- }
42
- ), E = s(
43
- () => {
44
- var e, n;
45
- return ((n = (e = t.value) == null ? void 0 : e.ui) == null ? void 0 : n.requestIntervalCap) ?? S;
46
- }
47
- );
48
- return {
49
- analyticsConfig: t,
50
- longRetention: l,
51
- defaultQueryTimeForOrg: i,
52
- loading: a,
53
- analytics: c,
54
- percentiles: p,
55
- maxParallelRequests: v,
56
- requestInterval: m,
57
- requestIntervalCap: E,
58
- isReady: u,
59
- configError: o
60
- };
61
- }), U = /* @__PURE__ */ A({
62
- __name: "AnalyticsConfigCheck",
63
- props: {
64
- requireAnalytics: { type: Boolean },
65
- requirePercentiles: { type: Boolean }
66
- },
67
- setup(t) {
68
- const o = t, y = I(), { analytics: l, percentiles: i, configError: a, loading: c } = T(y), p = s(
69
- () => (o.requireAnalytics ? l.value : !0) && (o.requirePercentiles ? i.value : !0)
70
- );
71
- return (u, v) => !r(c) && r(a) ? d(u.$slots, "error", {
72
- key: 0,
73
- error: r(a)
74
- }) : !r(c) && p.value ? d(u.$slots, "default", {
75
- key: 1,
76
- hasAnalytics: r(l),
77
- hasPercentiles: r(i)
78
- }) : r(c) ? R("", !0) : d(u.$slots, "fallback", {
79
- key: 2,
80
- hasAnalytics: r(l),
81
- hasPercentiles: r(i)
82
- });
83
- }
84
- });
85
- export {
86
- U as AnalyticsConfigCheck,
87
- I as useAnalyticsConfigStore
88
- };
@@ -1 +0,0 @@
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 m="analytics-query-provider",y=p.defineStore("analytics-config",()=>{const r=e.ref(null),i=e.ref(null),d=e.inject(m);d?d.configFn().then(n=>{r.value=n}).catch(n=>{i.value=n,r.value={analytics:null,requests:null},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=new Error("No analytics bridge provided"),r.value={analytics:null,requests:null});const a=e.computed(()=>{var t,A;const n=(A=(t=r.value)==null?void 0:t.analytics)==null?void 0:A.retention_ms;return!!n&&n>=2592e6}),c=e.computed(()=>"7d"),s=e.computed(()=>!r.value),l=e.computed(()=>{var n;return!!((n=r.value)!=null&&n.analytics)}),f=e.computed(()=>{var n,t;return!!((t=(n=r.value)==null?void 0:n.analytics)!=null&&t.percentiles)}),u=()=>new Promise(n=>{if(!s.value)return n();const t=e.watch(s,()=>{s.value||(t(),n())})}),E=e.computed(()=>{var n,t;return((t=(n=r.value)==null?void 0:n.ui)==null?void 0:t.maxParallelRequests)??2}),g=e.computed(()=>{var n,t;return((t=(n=r.value)==null?void 0:n.ui)==null?void 0:t.requestInterval)??2e3}),_=e.computed(()=>{var n,t;return((t=(n=r.value)==null?void 0:n.ui)==null?void 0:t.requestIntervalCap)??10});return{analyticsConfig:r,longRetention:a,defaultQueryTimeForOrg:c,loading:s,analytics:l,percentiles:f,maxParallelRequests:E,requestInterval:g,requestIntervalCap:_,isReady:u,configError:i}}),T=e.defineComponent({__name:"AnalyticsConfigCheck",props:{requireAnalytics:{type:Boolean},requirePercentiles:{type:Boolean}},setup(r){const i=r,d=y(),{analytics:a,percentiles:c,configError:s,loading:l}=p.storeToRefs(d),f=e.computed(()=>(i.requireAnalytics?a.value:!0)&&(i.requirePercentiles?c.value:!0));return(u,E)=>!e.unref(l)&&e.unref(s)?e.renderSlot(u.$slots,"error",{key:0,error:e.unref(s)}):!e.unref(l)&&f.value?e.renderSlot(u.$slots,"default",{key:1,hasAnalytics:e.unref(a),hasPercentiles:e.unref(c)}):e.unref(l)?e.createCommentVNode("",!0):e.renderSlot(u.$slots,"fallback",{key:2,hasAnalytics:e.unref(a),hasPercentiles:e.unref(c)})}});o.AnalyticsConfigCheck=T,o.useAnalyticsConfigStore=y,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});