@kong-ui-public/analytics-utilities 14.2.2-pr.3992.307487082.0 → 14.2.3

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.
Files changed (109) hide show
  1. package/dist/types/captureProtocol.d.ts +28 -0
  2. package/dist/types/captureProtocol.d.ts.map +1 -0
  3. package/dist/types/constants.d.ts +4 -0
  4. package/dist/types/constants.d.ts.map +1 -0
  5. package/dist/types/coordination/color-overrides.d.ts +7 -0
  6. package/dist/types/coordination/color-overrides.d.ts.map +1 -0
  7. package/dist/types/coordination/color.d.ts +54 -0
  8. package/dist/types/coordination/color.d.ts.map +1 -0
  9. package/dist/types/coordination/djb2.d.ts +11 -0
  10. package/dist/types/coordination/djb2.d.ts.map +1 -0
  11. package/dist/types/coordination/index.d.ts +4 -0
  12. package/dist/types/coordination/index.d.ts.map +1 -0
  13. package/dist/types/coordination/useColorCoordinator.d.ts +21 -0
  14. package/dist/types/coordination/useColorCoordinator.d.ts.map +1 -0
  15. package/dist/types/coordination/useInteractionCoordinator.d.ts +25 -0
  16. package/dist/types/coordination/useInteractionCoordinator.d.ts.map +1 -0
  17. package/dist/types/dashboardSchema.v2.d.ts +12509 -0
  18. package/dist/types/dashboardSchema.v2.d.ts.map +1 -0
  19. package/dist/types/filters.d.ts +6 -0
  20. package/dist/types/filters.d.ts.map +1 -0
  21. package/dist/types/format.d.ts +34 -0
  22. package/dist/types/format.d.ts.map +1 -0
  23. package/dist/types/granularity.d.ts +14 -0
  24. package/dist/types/granularity.d.ts.map +1 -0
  25. package/dist/types/index.d.ts +11 -0
  26. package/dist/types/index.d.ts.map +1 -0
  27. package/dist/types/queryTime.d.ts +36 -0
  28. package/dist/types/queryTime.d.ts.map +1 -0
  29. package/dist/types/specUtils.d.ts +3 -0
  30. package/dist/types/specUtils.d.ts.map +1 -0
  31. package/dist/types/timeframes.d.ts +33 -0
  32. package/dist/types/timeframes.d.ts.map +1 -0
  33. package/dist/types/types/analytics-config.d.ts +24 -0
  34. package/dist/types/types/analytics-config.d.ts.map +1 -0
  35. package/dist/types/types/chart-types.d.ts +6 -0
  36. package/dist/types/types/chart-types.d.ts.map +1 -0
  37. package/dist/types/types/country-codes.d.ts +745 -0
  38. package/dist/types/types/country-codes.d.ts.map +1 -0
  39. package/dist/types/types/datasource-config.d.ts +42 -0
  40. package/dist/types/types/datasource-config.d.ts.map +1 -0
  41. package/dist/types/types/datepicker-selection.d.ts +6 -0
  42. package/dist/types/types/datepicker-selection.d.ts.map +1 -0
  43. package/dist/types/types/druid-granularity.d.ts +6 -0
  44. package/dist/types/types/druid-granularity.d.ts.map +1 -0
  45. package/dist/types/types/explore/advanced.d.ts +20 -0
  46. package/dist/types/types/explore/advanced.d.ts.map +1 -0
  47. package/dist/types/types/explore/agentic.d.ts +23 -0
  48. package/dist/types/types/explore/agentic.d.ts.map +1 -0
  49. package/dist/types/types/explore/ai.d.ts +20 -0
  50. package/dist/types/types/explore/ai.d.ts.map +1 -0
  51. package/dist/types/types/explore/all.d.ts +48 -0
  52. package/dist/types/types/explore/all.d.ts.map +1 -0
  53. package/dist/types/types/explore/basic.d.ts +31 -0
  54. package/dist/types/types/explore/basic.d.ts.map +1 -0
  55. package/dist/types/types/explore/common.d.ts +34 -0
  56. package/dist/types/types/explore/common.d.ts.map +1 -0
  57. package/dist/types/types/explore/index.d.ts +11 -0
  58. package/dist/types/types/explore/index.d.ts.map +1 -0
  59. package/dist/types/types/explore/managed-cache.d.ts +20 -0
  60. package/dist/types/types/explore/managed-cache.d.ts.map +1 -0
  61. package/dist/types/types/explore/platform.d.ts +42 -0
  62. package/dist/types/types/explore/platform.d.ts.map +1 -0
  63. package/dist/types/types/explore/requests.d.ts +76 -0
  64. package/dist/types/types/explore/requests.d.ts.map +1 -0
  65. package/dist/types/types/explore/result.d.ts +51 -0
  66. package/dist/types/types/explore/result.d.ts.map +1 -0
  67. package/dist/types/types/explore/util.d.ts +2 -0
  68. package/dist/types/types/explore/util.d.ts.map +1 -0
  69. package/dist/types/types/index.d.ts +16 -0
  70. package/dist/types/types/index.d.ts.map +1 -0
  71. package/dist/types/types/interaction-coordinator.d.ts +117 -0
  72. package/dist/types/types/interaction-coordinator.d.ts.map +1 -0
  73. package/dist/types/types/query-bridge.d.ts +64 -0
  74. package/dist/types/types/query-bridge.d.ts.map +1 -0
  75. package/dist/types/types/query-time.d.ts +13 -0
  76. package/dist/types/types/query-time.d.ts.map +1 -0
  77. package/dist/types/types/request-export.d.ts +11 -0
  78. package/dist/types/types/request-export.d.ts.map +1 -0
  79. package/dist/types/types/time-period.d.ts +9 -0
  80. package/dist/types/types/time-period.d.ts.map +1 -0
  81. package/dist/types/types/timeframe-keys.d.ts +21 -0
  82. package/dist/types/types/timeframe-keys.d.ts.map +1 -0
  83. package/dist/types/types/timeframe-options.d.ts +17 -0
  84. package/dist/types/types/timeframe-options.d.ts.map +1 -0
  85. package/dist/types/types/timeframe.d.ts +16 -0
  86. package/dist/types/types/timeframe.d.ts.map +1 -0
  87. package/dist/types/utils/GeoLookup.d.ts +4 -0
  88. package/dist/types/utils/GeoLookup.d.ts.map +1 -0
  89. package/dist/types/utils/SeedRandom.d.ts +6 -0
  90. package/dist/types/utils/SeedRandom.d.ts.map +1 -0
  91. package/dist/types/utils/chartDataGenerator.d.ts +16 -0
  92. package/dist/types/utils/chartDataGenerator.d.ts.map +1 -0
  93. package/dist/types/utils/fetchAllRequests.d.ts +16 -0
  94. package/dist/types/utils/fetchAllRequests.d.ts.map +1 -0
  95. package/dist/types/utils/formatUnit.d.ts +23 -0
  96. package/dist/types/utils/formatUnit.d.ts.map +1 -0
  97. package/dist/types/utils/helpers.d.ts +2 -0
  98. package/dist/types/utils/helpers.d.ts.map +1 -0
  99. package/dist/types/utils/index.d.ts +7 -0
  100. package/dist/types/utils/index.d.ts.map +1 -0
  101. package/dist/vitals-utilities-coordination.cjs +2 -0
  102. package/dist/vitals-utilities-coordination.cjs.map +1 -0
  103. package/dist/vitals-utilities-coordination.es.js +239 -0
  104. package/dist/vitals-utilities-coordination.es.js.map +1 -0
  105. package/dist/vitals-utilities.cjs +2 -0
  106. package/dist/vitals-utilities.cjs.map +1 -0
  107. package/dist/vitals-utilities.es.js +4905 -0
  108. package/dist/vitals-utilities.es.js.map +1 -0
  109. package/package.json +2 -2
@@ -0,0 +1,28 @@
1
+ export declare const CAPTURE_PREPARE_EVENT = "kapture:prepare";
2
+ export declare const CAPTURE_RESTORE_EVENT = "kapture:restore";
3
+ export interface CapturePrepareDetail {
4
+ waitUntil: (promise: Promise<void>) => void;
5
+ }
6
+ export declare function prepareForCapture(): Promise<void>;
7
+ export declare function restoreAfterCapture(): void;
8
+ export type CaptureRestore = (() => void) | void;
9
+ /**
10
+ * Use this for anything that isn't a plain WebGL canvas. For WebGL
11
+ * canvases use {@link registerWebglCapture} instead.
12
+ *
13
+ * @param prepare Runs when a capture starts; Return a {@link CaptureRestore} to undo itself
14
+ * @returns An unregister function, **call it on unmount!**
15
+ */
16
+ export declare function registerCapture(prepare: () => Promise<CaptureRestore> | CaptureRestore): () => void;
17
+ export interface WebglCaptureOptions {
18
+ redraw?: () => void;
19
+ }
20
+ /**
21
+ * This will temporarily swap the canvas for a static <img> while capturing.
22
+ *
23
+ * @param getCanvas Returns the canvas to capture
24
+ * @param options See {@link WebglCaptureOptions}
25
+ * @returns An unregister function, **call it on unmount!**
26
+ */
27
+ export declare function registerWebglCapture(getCanvas: () => HTMLCanvasElement | null | undefined, options?: WebglCaptureOptions): () => void;
28
+ //# sourceMappingURL=captureProtocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captureProtocol.d.ts","sourceRoot":"","sources":["../../src/captureProtocol.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AACtD,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAEtD,MAAM,WAAW,oBAAoB;IAEnC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAA;CAC5C;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQvD;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAGD,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;AAEhD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,GACtD,MAAM,IAAI,CAyBZ;AAED,MAAM,WAAW,mBAAmB;IAIlC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACrD,OAAO,GAAE,mBAAwB,GAChC,MAAM,IAAI,CA0BZ"}
@@ -0,0 +1,4 @@
1
+ export declare const REFRESH_INTERVAL_MS: number;
2
+ export declare const EXPORT_RECORD_LIMIT = 1000;
3
+ export declare const INJECT_QUERY_PROVIDER = "analytics-query-provider";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAAY,CAAA;AAE5C,eAAO,MAAM,mBAAmB,OAAO,CAAA;AAEvC,eAAO,MAAM,qBAAqB,6BAA6B,CAAA"}
@@ -0,0 +1,7 @@
1
+ export type ColorMap = Record<string, string>;
2
+ export type ColorState = 'empty' | 'warning' | 'error' | 'neutral' | '____OTHER____';
3
+ export declare const statusCodeColors: ColorMap;
4
+ export declare const unknownStatusCodeColors: ColorMap;
5
+ export declare const statusCodeGroupColors: ColorMap;
6
+ export declare const stateColors: Record<ColorState, string>;
7
+ //# sourceMappingURL=color-overrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-overrides.d.ts","sourceRoot":"","sources":["../../../src/coordination/color-overrides.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC7C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,eAAe,CAAA;AAEpF,eAAO,MAAM,gBAAgB,EAAE,QA+D9B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,QAMrC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,QAMnC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAMlD,CAAA"}
@@ -0,0 +1,54 @@
1
+ import { type ColorState } from './color-overrides';
2
+ import type { ColorCoordinator } from '../types/interaction-coordinator';
3
+ export declare const lightPalette: string[];
4
+ export declare const darkPalette: string[];
5
+ export declare const generateDiscriminator: (id: string) => number;
6
+ /**
7
+ * Returns the palette that `color()`/`colorByDiscriminator()` will index into for
8
+ * the given theme. Useful for callers (e.g. a color coordinator) that need to
9
+ * know the palette length in order to assign and spread discriminator indices
10
+ * consistently with how colors are ultimately resolved.
11
+ */
12
+ export declare const getActivePalette: ({ theme, }?: {
13
+ theme?: "light" | "dark";
14
+ }) => string[];
15
+ export declare const colorByDiscriminator: ({ discriminator, theme, }: {
16
+ discriminator: number;
17
+ theme?: "light" | "dark";
18
+ }) => string;
19
+ export declare const colorByState: ({ state, }: {
20
+ state: ColorState;
21
+ }) => string;
22
+ export declare const colorByStatusCode: ({ statusCode, }: {
23
+ statusCode: string | number;
24
+ }) => string;
25
+ export declare const colorByStatusCodeGroup: ({ group, }: {
26
+ group: string;
27
+ }) => string;
28
+ export declare const color: ({ discriminator, state, dimension, dimensionValue, metric, coordinator, order, chartUuid, customDimensionColors, }: {
29
+ discriminator?: number;
30
+ state?: ColorState;
31
+ dimension?: string;
32
+ dimensionValue?: string;
33
+ metric?: string;
34
+ /**
35
+ * An optional cross-chart color coordinator (e.g. from
36
+ * `useInteractionCoordinator().color`). When provided, generic series colors
37
+ * are assigned through it so they stay consistent across charts and distinct
38
+ * within a chart. Has no effect on override colors (status codes, states,
39
+ * empty/other) or when an explicit `discriminator` is given.
40
+ */
41
+ coordinator?: ColorCoordinator;
42
+ /**
43
+ * This series' rank within its chart (e.g. 1 for the highest value). Used by
44
+ * the coordinator to avoid giving adjacent series the same color.
45
+ */
46
+ order?: number;
47
+ /**
48
+ * The uuid of the chart requesting the color. Allows the coordinator to
49
+ * correctly group a chart's series when avoiding adjacent collisions.
50
+ */
51
+ chartUuid?: string;
52
+ customDimensionColors?: Record<string, string>;
53
+ }) => string;
54
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/coordination/color.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAGxE,eAAO,MAAM,YAAY,UAQxB,CAAA;AAED,eAAO,MAAM,WAAW,UAQvB,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG,MAAkB,CAAA;AAErE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAE9B;IACD,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CACpB,KAAG,MAAM,EAEd,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,2BAGlC;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CACzB,KAAG,MAMH,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,YAE1B;IACD,KAAK,EAAE,UAAU,CAAA;CAClB,KAAG,MAEH,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,iBAE/B;IACD,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B,KAAG,MAQH,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,YAEpC;IACD,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,MAIH,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,oHAUnB;IACD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/C,KAAG,MAuDH,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This hashes a string and turns it into a positive integer very quickly. It is
3
+ * relatively decent at generating values that are distributed evenly. However,
4
+ * it is NOT cryptographically secure in any way. Used to turn a string into a
5
+ * consistent number.
6
+ *
7
+ * implementation from: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765
8
+ * use case article: https://mojoauth.com/hashing/bernsteins-hash-djb2-in-javascript-in-browser#use-cases-for-bernsteins-hash-djb2
9
+ */
10
+ export declare const djb2: (str: string) => number;
11
+ //# sourceMappingURL=djb2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"djb2.d.ts","sourceRoot":"","sources":["../../../src/coordination/djb2.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,KAAG,MAQlC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { default as useInteractionCoordinator } from './useInteractionCoordinator';
2
+ export * from './color';
3
+ export * from './djb2';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/coordination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAClF,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { ColorCoordinator } from '../types';
2
+ /**
3
+ * Coordinates series colors across multiple charts
4
+ *
5
+ * Intended to be composed privately by `useInteractionCoordinator` and exposed
6
+ * under its `color` namespace. State here is deliberately plain (non-reactive):
7
+ * charts resolve each color once at render time and freeze it.
8
+ *
9
+ * The algorithm is incremental, append-only, and locked-on-first-assignment:
10
+ * - A series string is keyed by its value, so the same string always resolves
11
+ * to the same palette index across every chart (consistency).
12
+ * - When a newly seen string is resolved, it is given the least-used palette
13
+ * index, avoiding the color of the immediately preceding series of the same
14
+ * chart (adjacency), then locked.
15
+ * - Because the palette has several colors and we only ever forbid one neighbor,
16
+ * a newly assigned string can always avoid colliding with the previous series.
17
+ * The only adjacent collisions that can occur are those inherited from strings
18
+ * already locked by an earlier-loading chart.
19
+ */
20
+ export default function useColorCoordinator(): ColorCoordinator;
21
+ //# sourceMappingURL=useColorCoordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColorCoordinator.d.ts","sourceRoot":"","sources":["../../../src/coordination/useColorCoordinator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,UAAU,CAAA;AAIjB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,IAAI,gBAAgB,CA6F9D"}
@@ -0,0 +1,25 @@
1
+ import type { InteractionCoordinator } from '../types';
2
+ /**
3
+ * The interaction coordinator is used for
4
+ *
5
+ * * reporting any interaction between a user and a chart so that other charts
6
+ * can react to it
7
+ * * coordinating multiple charts to use the same colors while minimizing
8
+ * sequential series with the same color
9
+ *
10
+ * Use one instance of the coordinator for each logical grouping of charts. So,
11
+ * dashboards use `provide`/`inject` to provide an instance of this coordinator
12
+ * to each of its charts. Each of those charts then calls the color util with
13
+ * that instance.
14
+ *
15
+ * Within each chart component we `watch` the things that we want the component
16
+ * to react to (e.g. `watch(coordinatorInstance.activeDimension, (dim) =>
17
+ * highlight(dim)`). Also each of those chart components call `activate` when
18
+ * the user interacts with them.
19
+ *
20
+ * For performance concerns, please try to respect the `<foo>_DEBOUNCE_MS` constants
21
+ * so that we're only firing certain kinds of interaction (and thereby triggering
22
+ * redraws and updates) no more frequently than those constants suggest.
23
+ */
24
+ export default function useInteractionCoordinator(): InteractionCoordinator;
25
+ //# sourceMappingURL=useInteractionCoordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInteractionCoordinator.d.ts","sourceRoot":"","sources":["../../../src/coordination/useInteractionCoordinator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAGvB,MAAM,UAAU,CAAA;AAEjB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,IAAI,sBAAsB,CAmD1E"}