@odigos/ui-kit 0.0.224 → 0.0.225

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 (90) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/DEVELOPMENT.md +27 -0
  3. package/Makefile +7 -0
  4. package/lib/chunks/index-BMJ_MZzY.js +149 -0
  5. package/lib/chunks/{index-Au62BabI.js → index-Dlnglk_e.js} +1 -1
  6. package/lib/chunks/ui-components-BqdkaDt2.js +2543 -0
  7. package/lib/components/_v2/autocomplete/index.d.ts +13 -3
  8. package/lib/components/_v2/drawer/header/index.d.ts +2 -0
  9. package/lib/components/_v2/drop-data/index.d.ts +1 -0
  10. package/lib/components/_v2/index.d.ts +1 -0
  11. package/lib/components/_v2/time-input/index.d.ts +24 -0
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/sampling/index.d.ts +9 -4
  15. package/lib/constants/sources/index.d.ts +1 -0
  16. package/lib/constants.js +1 -1
  17. package/lib/containers/_v2/_drawers/index.d.ts +1 -5
  18. package/lib/containers/_v2/_drawers/sampling-rule-drawer/index.d.ts +50 -0
  19. package/lib/containers/_v2/_forms/index.d.ts +1 -5
  20. package/lib/containers/_v2/_forms/sampling-rule-form/index.d.ts +2 -0
  21. package/lib/containers/_v2/sampling-rules/converters.d.ts +9 -0
  22. package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -2
  23. package/lib/containers/_v2/sampling-rules/rules-table/index.d.ts +1 -1
  24. package/lib/containers/_v2/sampling-rules/toolbar/index.d.ts +1 -1
  25. package/lib/containers/_v2/sampling-rules/types.d.ts +1 -42
  26. package/lib/containers/source-drawer/profiling/index.d.ts +1 -1
  27. package/lib/containers/v2.js +51 -188
  28. package/lib/containers.js +47 -47
  29. package/lib/contexts/index.d.ts +1 -0
  30. package/lib/contexts/sampling-rules-form-context.d.ts +90 -0
  31. package/lib/contexts.js +1 -1
  32. package/lib/functions.js +1 -1
  33. package/lib/hooks/useScrollTo.d.ts +1 -0
  34. package/lib/hooks.js +1 -1
  35. package/lib/snippets/_v2/colored-span/index.d.ts +1 -0
  36. package/lib/snippets/_v2/dynamic-field/index.d.ts +3 -1
  37. package/lib/snippets/_v2/index.d.ts +1 -0
  38. package/lib/snippets/_v2/sampling-rule-form-sections/duration-errors.d.ts +13 -0
  39. package/lib/snippets/_v2/sampling-rule-form-sections/index.d.ts +7 -0
  40. package/lib/snippets/_v2/sampling-rule-form-sections/operation.d.ts +12 -0
  41. package/lib/snippets/_v2/sampling-rule-form-sections/percentage.d.ts +12 -0
  42. package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +29 -0
  43. package/lib/snippets/_v2/sampling-rule-form-sections/rule-info.d.ts +12 -0
  44. package/lib/snippets/_v2/sampling-rule-form-sections/sampling-preview.d.ts +12 -0
  45. package/lib/{containers/_v2/_forms/create-sampling-rule-form/sections → snippets/_v2/sampling-rule-form-sections}/source-scope.d.ts +8 -4
  46. package/lib/snippets/_v2/sampling-rule-form-sections/styled.d.ts +2 -0
  47. package/lib/snippets/v2.js +1 -53
  48. package/lib/snippets.js +1 -1
  49. package/lib/store.js +1 -1
  50. package/lib/theme.js +1 -1
  51. package/lib/types/common/index.d.ts +2 -1
  52. package/lib/types/enum/index.d.ts +1 -0
  53. package/lib/types/sampling.d.ts +77 -0
  54. package/lib/types/sources/index.d.ts +18 -6
  55. package/lib/types.js +1 -1
  56. package/lib/visuals.js +1 -1
  57. package/package.json +1 -1
  58. package/lib/chunks/ui-components-CI2PiWkX.js +0 -2516
  59. package/lib/containers/_v2/_drawers/create-sampling-rule-drawer/index.d.ts +0 -20
  60. package/lib/containers/_v2/_drawers/edit-auto-rule-drawer/index.d.ts +0 -9
  61. package/lib/containers/_v2/_drawers/edit-cost-reduction-auto-rule-drawer/index.d.ts +0 -9
  62. package/lib/containers/_v2/_drawers/edit-highly-relevant-auto-rule-drawer/index.d.ts +0 -8
  63. package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/index.d.ts +0 -21
  64. package/lib/containers/_v2/_forms/create-sampling-rule-form/context.d.ts +0 -34
  65. package/lib/containers/_v2/_forms/create-sampling-rule-form/converters.d.ts +0 -5
  66. package/lib/containers/_v2/_forms/create-sampling-rule-form/form-helpers.d.ts +0 -5
  67. package/lib/containers/_v2/_forms/create-sampling-rule-form/index.d.ts +0 -3
  68. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/duration-errors.d.ts +0 -9
  69. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/operation.d.ts +0 -9
  70. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/percentage.d.ts +0 -9
  71. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/rule-info.d.ts +0 -9
  72. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/sampling-preview.d.ts +0 -9
  73. package/lib/containers/_v2/_forms/create-sampling-rule-form/styled.d.ts +0 -5
  74. package/lib/containers/_v2/_forms/create-sampling-rule-form/types.d.ts +0 -54
  75. package/lib/containers/_v2/_forms/edit-auto-rule-form/context.d.ts +0 -21
  76. package/lib/containers/_v2/_forms/edit-auto-rule-form/index.d.ts +0 -3
  77. package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/context.d.ts +0 -21
  78. package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/index.d.ts +0 -3
  79. package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/context.d.ts +0 -14
  80. package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/index.d.ts +0 -3
  81. package/lib/containers/_v2/_forms/view-sampling-rule-form/context.d.ts +0 -37
  82. package/lib/containers/_v2/_forms/view-sampling-rule-form/index.d.ts +0 -3
  83. package/lib/containers/_v2/_forms/view-sampling-rule-form/reverse-converters.d.ts +0 -3
  84. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/duration-errors.d.ts +0 -6
  85. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/operation-details.d.ts +0 -6
  86. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/percentage.d.ts +0 -6
  87. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/rule-info.d.ts +0 -6
  88. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/sampling-preview.d.ts +0 -6
  89. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/source-scopes.d.ts +0 -6
  90. /package/lib/containers/_v2/{_forms/view-sampling-rule-form/footer.d.ts → _drawers/sampling-rule-drawer/view-footer.d.ts} +0 -0
@@ -1,2 +1,3 @@
1
1
  export * from './odigos-context';
2
+ export * from './sampling-rules-form-context';
2
3
  export * from './storybook-context';
@@ -0,0 +1,90 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ import type { ColoredSpanPart } from '@/snippets/_v2/colored-span';
3
+ import type { SamplingRuleCategory, SamplingRuleFormState, DuplicateValidationResult, ViewRuleData, SamplingRulesSelectOption, PercentagePreset } from '@/types';
4
+ export declare enum SamplingRuleFormType {
5
+ Create = "create",
6
+ View = "view",
7
+ EditAutoNoisy = "edit-auto-noisy",
8
+ EditAutoCostReduction = "edit-auto-cost-reduction",
9
+ EditAutoHighlyRelevant = "edit-auto-highly-relevant"
10
+ }
11
+ interface ManualFormBaseValue {
12
+ formData: SamplingRuleFormState;
13
+ handleChange: (updates: Partial<SamplingRuleFormState>) => void;
14
+ duplicateWarning: DuplicateValidationResult | null;
15
+ setDuplicateWarning: (warning: DuplicateValidationResult | null) => void;
16
+ sourceOptions: SamplingRulesSelectOption[];
17
+ namespaceOptions: SamplingRulesSelectOption[];
18
+ }
19
+ export interface CreateFormContextValue extends ManualFormBaseValue {
20
+ formType: SamplingRuleFormType.Create;
21
+ category: SamplingRuleCategory;
22
+ resetForm: () => void;
23
+ }
24
+ export interface ViewFormContextValue extends ManualFormBaseValue {
25
+ formType: SamplingRuleFormType.View;
26
+ data: ViewRuleData | null;
27
+ isEditing: boolean;
28
+ handleEdit: () => void;
29
+ handleCancelEdit: () => void;
30
+ }
31
+ interface AutoRulePercentageBaseValue {
32
+ localEnabled: boolean;
33
+ setLocalEnabled: (value: boolean) => void;
34
+ percentagePreset: PercentagePreset;
35
+ setPercentagePreset: (value: PercentagePreset) => void;
36
+ customPercentage: string;
37
+ setCustomPercentage: (value: string) => void;
38
+ resolvedPercentage: number;
39
+ summary: ColoredSpanPart[];
40
+ }
41
+ export interface EditAutoNoisyFormContextValue extends AutoRulePercentageBaseValue {
42
+ formType: SamplingRuleFormType.EditAutoNoisy;
43
+ }
44
+ export interface EditAutoCostReductionFormContextValue extends AutoRulePercentageBaseValue {
45
+ formType: SamplingRuleFormType.EditAutoCostReduction;
46
+ }
47
+ export interface EditAutoHighlyRelevantFormContextValue {
48
+ formType: SamplingRuleFormType.EditAutoHighlyRelevant;
49
+ localEnabled: boolean;
50
+ setLocalEnabled: (value: boolean) => void;
51
+ summary: ColoredSpanPart[];
52
+ }
53
+ export type SamplingRulesFormContextValue = CreateFormContextValue | ViewFormContextValue | EditAutoNoisyFormContextValue | EditAutoCostReductionFormContextValue | EditAutoHighlyRelevantFormContextValue;
54
+ interface BaseProviderProps {
55
+ children: ReactNode;
56
+ }
57
+ interface CreateProviderProps extends BaseProviderProps {
58
+ formType: SamplingRuleFormType.Create;
59
+ category: SamplingRuleCategory;
60
+ sourceOptions?: SamplingRulesSelectOption[];
61
+ namespaceOptions?: SamplingRulesSelectOption[];
62
+ }
63
+ interface ViewProviderProps extends BaseProviderProps {
64
+ formType: SamplingRuleFormType.View;
65
+ data: ViewRuleData | null;
66
+ defaultEditMode?: boolean;
67
+ sourceOptions?: SamplingRulesSelectOption[];
68
+ namespaceOptions?: SamplingRulesSelectOption[];
69
+ }
70
+ interface EditAutoNoisyProviderProps extends BaseProviderProps {
71
+ formType: SamplingRuleFormType.EditAutoNoisy;
72
+ enabled: boolean;
73
+ keepPercentage: number;
74
+ }
75
+ interface EditAutoCostReductionProviderProps extends BaseProviderProps {
76
+ formType: SamplingRuleFormType.EditAutoCostReduction;
77
+ enabled: boolean;
78
+ dropPercentage: number;
79
+ }
80
+ interface EditAutoHighlyRelevantProviderProps extends BaseProviderProps {
81
+ formType: SamplingRuleFormType.EditAutoHighlyRelevant;
82
+ enabled: boolean;
83
+ }
84
+ export type SamplingRulesFormProviderProps = CreateProviderProps | ViewProviderProps | EditAutoNoisyProviderProps | EditAutoCostReductionProviderProps | EditAutoHighlyRelevantProviderProps;
85
+ export declare const SamplingRulesFormProvider: FC<SamplingRulesFormProviderProps>;
86
+ export declare function useSamplingRulesFormContext(): SamplingRulesFormContextValue;
87
+ export declare function useSamplingRulesFormContext<T extends SamplingRuleFormType>(expectedType: T): Extract<SamplingRulesFormContextValue, {
88
+ formType: T;
89
+ }>;
90
+ export {};
package/lib/contexts.js CHANGED
@@ -1 +1 @@
1
- export{f9 as OdigosProvider,fa as StorybookProvider,bP as checkVersionSupport,a3 as useOdigos,fb as useStorybook}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{fL as OdigosProvider,ac as SamplingRuleFormType,aJ as SamplingRulesFormProvider,fM as StorybookProvider,b7 as checkVersionSupport,a3 as useOdigos,ab as useSamplingRulesFormContext,fN as useStorybook}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{dL as capitalizeFirstLetter,eI as cleanObjectEmptyStringsValues,z as compareCondition,v as deepClone,df as entityIdKey,cY as filterActions,dq as filterDestinations,dn as filterDestinationsByStream,dp as filterSources,dm as filterSourcesByStream,eJ as flattenObjectKeys,dh as formatBytes,ej as formatDuration,g as generateId,cJ as getActionIcon,cS as getConditionsBooleans,ed as getContainersIcons,eg as getContainersInstrumentedCount,eK as getDeepValue,bi as getDestinationIcon,eL as getDetectedLanguageIcons,d3 as getEntityIcon,cF as getEntityId,de as getEntityIdKey,c_ as getEntityLabel,eM as getIdFromSseTarget,di as getInstrumentationRuleIcon,eN as getMainContainerLanguage,dP as getMetricForEntity,eO as getMonitorIcon,eP as getPlatformIcon,eQ as getPlatformLabel,a2 as getProgrammingLanguageIcon,el as getRecursiveValues,dj as getSourceLanguageIcons,eR as getSseTargetFromId,eS as getStatusColor,bW as getStatusFromPodStatus,cW as getStatusIcon,e2 as getStatusTypeFromOdigosHealth,eT as getValueForRange,dY as getVirtualServiceIcon,dV as getWorkloadId,dK as getYamlFieldsForDestination,e3 as hasUnhealthyInstances,l as isEmpty,eU as isLegalK8sLabel,bH as isOverTime,e8 as isStringABoolean,eV as isTimeElapsed,eW as isValidVersion,cV as mapConditions,dI as mapDestinationFieldsForDisplay,L as mapExportedSignals,H as mapSupportedSignals,eX as numbersOnly,e9 as parseBooleanFromString,eY as parseJsonStringToPrettyString,R as prepareDestinationFormData,eZ as removeEmptyValuesFromObject,M as safeJsonParse,e_ as safeJsonStringify,e$ as setDeepValue,d9 as sleep,dx as splitCamelString,f0 as stringifyNonStringValues,cM as trimVersion}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{dl as capitalizeFirstLetter,fd as cleanObjectEmptyStringsValues,z as compareCondition,v as deepClone,cS as entityIdKey,cz as filterActions,d0 as filterDestinations,c_ as filterDestinationsByStream,c$ as filterSources,cZ as filterSourcesByStream,fe as flattenObjectKeys,cU as formatBytes,dX as formatDuration,g as generateId,ck as getActionIcon,ct as getConditionsBooleans,dR as getContainersIcons,dU as getContainersInstrumentedCount,ff as getDeepValue,au as getDestinationIcon,fg as getDetectedLanguageIcons,cG as getEntityIcon,cg as getEntityId,cR as getEntityIdKey,cB as getEntityLabel,fh as getIdFromSseTarget,cV as getInstrumentationRuleIcon,fi as getMainContainerLanguage,dq as getMetricForEntity,fj as getMonitorIcon,fk as getPlatformIcon,fl as getPlatformLabel,a2 as getProgrammingLanguageIcon,dZ as getRecursiveValues,cW as getSourceLanguageIcons,fm as getSseTargetFromId,fn as getStatusColor,be as getStatusFromPodStatus,cx as getStatusIcon,dG as getStatusTypeFromOdigosHealth,fo as getValueForRange,dz as getVirtualServiceIcon,dw as getWorkloadId,dk as getYamlFieldsForDestination,dH as hasUnhealthyInstances,l as isEmpty,fp as isLegalK8sLabel,b2 as isOverTime,dM as isStringABoolean,fq as isTimeElapsed,fr as isValidVersion,cw as mapConditions,di as mapDestinationFieldsForDisplay,L as mapExportedSignals,H as mapSupportedSignals,fs as numbersOnly,dN as parseBooleanFromString,ft as parseJsonStringToPrettyString,R as prepareDestinationFormData,fu as removeEmptyValuesFromObject,M as safeJsonParse,fv as safeJsonStringify,fw as setDeepValue,cM as sleep,d7 as splitCamelString,fx as stringifyNonStringValues,cn as trimVersion}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -7,5 +7,6 @@ export declare const useScrollTo: ({ sectionNames, threshold }: UseScrollToProps
7
7
  selectedSection: string;
8
8
  setSelectedSection: import("react").Dispatch<import("react").SetStateAction<string>>;
9
9
  setSectionRef: (name: string, el: HTMLDivElement | null) => void;
10
+ setScrollContainerRef: (el: HTMLElement | null) => void;
10
11
  };
11
12
  export {};
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{cE as useActionFormData,fc as useBodyScroll,dr as useClickNode,dW as useClickNotification,dl as useContainerSize,u as useCopy,dC as useDataStreamFormData,dJ as useDestinationFormData,t as useGenericForm,dS as useInstrumentationRuleFormData,bF as useKeyDown,dw as useOnClickOutside,ds as usePopup,ci as useScrollTo,dB as useSessionStorage,ea as useSourceFormData,ee as useSourceSelectionFormData,bG as useTimeAgo}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{cf as useActionFormData,fK as useBodyScroll,d1 as useClickNode,dx as useClickNotification,cY as useContainerSize,u as useCopy,dc as useDataStreamFormData,dj as useDestinationFormData,t as useGenericForm,dt as useInstrumentationRuleFormData,b0 as useKeyDown,d6 as useOnClickOutside,d2 as usePopup,bV as useScrollTo,db as useSessionStorage,dO as useSourceFormData,dS as useSourceSelectionFormData,b1 as useTimeAgo}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -9,6 +9,7 @@ export declare enum ColoredSpanVariant {
9
9
  export interface ColoredSpanPart {
10
10
  text: string;
11
11
  variant: ColoredSpanVariant;
12
+ tooltipItems?: string[];
12
13
  }
13
14
  export interface ColoredSpanProps {
14
15
  parts: ColoredSpanPart[];
@@ -1,7 +1,7 @@
1
1
  import { type FC } from 'react';
2
2
  import { DropdownProps } from '@/components';
3
3
  import { FieldTypes, InputTypes } from '@/types';
4
- import { type FieldMessageProps, type BadgeProps } from '@/components/_v2';
4
+ import { type FieldMessageProps, type TimeUnit, type BadgeProps } from '@/components/_v2';
5
5
  export interface DynamicFieldProps extends FieldMessageProps {
6
6
  componentType: FieldTypes;
7
7
  inputType?: InputTypes;
@@ -17,5 +17,7 @@ export interface DynamicFieldProps extends FieldMessageProps {
17
17
  dropdownOptions?: DropdownProps['options'];
18
18
  dropdownNoSearch?: boolean;
19
19
  dropdownNoCheckbox?: boolean;
20
+ timeUnits?: TimeUnit[];
21
+ timeDefaultUnit?: string;
20
22
  }
21
23
  export declare const DynamicField: FC<DynamicFieldProps>;
@@ -5,6 +5,7 @@ export * from './delete-modal';
5
5
  export * from './dynamic-field';
6
6
  export * from './odigos-logo-text-by-tier';
7
7
  export * from './rich-title';
8
+ export * from './sampling-rule-form-sections';
8
9
  export * from './signals-checkbox-list';
9
10
  export * from './upgrade-modal';
10
11
  export * from './wide-drawer';
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ import type { HighlyRelevantOperationRule } from '@/types';
3
+ import type { HighlyRelevantBadgeType, SamplingRuleFormState } from '@/types';
4
+ export type DurationErrorsSectionProps = {
5
+ readOnly: true;
6
+ rule: HighlyRelevantOperationRule;
7
+ } | {
8
+ readOnly?: false;
9
+ ruleType: HighlyRelevantBadgeType;
10
+ formState: SamplingRuleFormState;
11
+ onChange: (updates: Partial<SamplingRuleFormState>) => void;
12
+ };
13
+ export declare const DurationErrorsSection: FC<DurationErrorsSectionProps>;
@@ -0,0 +1,7 @@
1
+ export * from './duration-errors';
2
+ export * from './operation';
3
+ export * from './percentage';
4
+ export * from './preset-with-custom-input';
5
+ export * from './rule-info';
6
+ export * from './sampling-preview';
7
+ export * from './source-scope';
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import type { SamplingRuleCategory, ViewRuleData, SamplingRuleFormState } from '@/types';
3
+ export type OperationSectionProps = {
4
+ readOnly: true;
5
+ data: ViewRuleData;
6
+ } | {
7
+ readOnly?: false;
8
+ category: SamplingRuleCategory;
9
+ formState: SamplingRuleFormState;
10
+ onChange: (updates: Partial<SamplingRuleFormState>) => void;
11
+ };
12
+ export declare const OperationSection: FC<OperationSectionProps>;
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import type { SamplingRuleCategory, ViewRuleData, SamplingRuleFormState } from '@/types';
3
+ export type PercentageSectionProps = {
4
+ readOnly: true;
5
+ data: ViewRuleData;
6
+ } | {
7
+ readOnly?: false;
8
+ category: SamplingRuleCategory;
9
+ formState: SamplingRuleFormState;
10
+ onChange: (updates: Partial<SamplingRuleFormState>) => void;
11
+ };
12
+ export declare const PercentageSection: FC<PercentageSectionProps>;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { type PercentagePreset, type DurationPreset } from '@/types';
3
+ export declare const PERCENTAGE_OPTIONS: {
4
+ value: PercentagePreset;
5
+ label: string;
6
+ }[];
7
+ export declare const NOISY_PERCENTAGE_OPTIONS: {
8
+ value: PercentagePreset;
9
+ label: string;
10
+ }[];
11
+ export declare const DURATION_OPTIONS: {
12
+ value: DurationPreset;
13
+ label: string;
14
+ }[];
15
+ export interface PresetWithCustomInputProps<T extends string = string> {
16
+ description: string;
17
+ options: {
18
+ value: T;
19
+ label: string;
20
+ }[];
21
+ selected: T;
22
+ onSelect: (value: T) => void;
23
+ customName: string;
24
+ customLabel: string;
25
+ customPlaceholder: string;
26
+ customValue: string;
27
+ onCustomChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
28
+ }
29
+ export declare const PresetWithCustomInput: <T extends string>({ description, options, selected, onSelect, customName, customLabel, customPlaceholder, customValue, onCustomChange, }: PresetWithCustomInputProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import type { SamplingRuleCategory, ViewRuleData, SamplingRuleFormState } from '@/types';
3
+ export type RuleInfoSectionProps = {
4
+ readOnly: true;
5
+ data: ViewRuleData;
6
+ } | {
7
+ readOnly?: false;
8
+ category: SamplingRuleCategory;
9
+ formState: SamplingRuleFormState;
10
+ onChange: (updates: Partial<SamplingRuleFormState>) => void;
11
+ };
12
+ export declare const RuleInfoSection: FC<RuleInfoSectionProps>;
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import { type ColoredSpanPart } from '@/snippets/_v2/colored-span';
3
+ import type { SamplingRuleCategory, SamplingRuleFormState } from '@/types';
4
+ export type SamplingPreviewSectionProps = {
5
+ readOnly: true;
6
+ summary: ColoredSpanPart[];
7
+ } | {
8
+ readOnly?: false;
9
+ category: SamplingRuleCategory;
10
+ formState: SamplingRuleFormState;
11
+ };
12
+ export declare const SamplingPreviewSection: FC<SamplingPreviewSectionProps>;
@@ -1,10 +1,14 @@
1
1
  import { type FC } from 'react';
2
- import type { SamplingRuleFormState } from '../types';
2
+ import { type SourcesScope, type SamplingRuleFormState } from '@/types';
3
3
  import { type AutocompleteOption } from '@/components/_v2';
4
- export interface FormSourceScopeProps {
4
+ export type SourceScopeSectionProps = {
5
+ readOnly: true;
6
+ scopes: SourcesScope[];
7
+ } | {
8
+ readOnly?: false;
5
9
  formState: SamplingRuleFormState;
6
10
  onChange: (updates: Partial<SamplingRuleFormState>) => void;
7
11
  sourceOptions?: AutocompleteOption[];
8
12
  namespaceOptions?: AutocompleteOption[];
9
- }
10
- export declare const FormSourceScope: FC<FormSourceScopeProps>;
13
+ };
14
+ export declare const SourceScopeSection: FC<SourceScopeSectionProps>;
@@ -0,0 +1,2 @@
1
+ export declare const CellsRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const Cell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,53 +1 @@
1
- import{cd as e,r as a,n as r,o as s,d as i,bj as t,y as n,m as o,M as l,p as d,I as c,k as p,a3 as h,a9 as u,v as g,dz as v,F as m,i as b,c as f,j as x,en as y,dg as w,b as $,N as C,Q as M,a as L,br as S,bg as k,e as O,b_ as D,e1 as N}from"../chunks/ui-components-CI2PiWkX.js";export{A as ActionType,b$ as Actions}from"../chunks/ui-components-CI2PiWkX.js";import{jsx as I,Fragment as H,jsxs as T}from"react/jsx-runtime";import{Fragment as j,useState as q,useRef as z,useEffect as V,forwardRef as R,useImperativeHandle as F,useCallback as E,useMemo as P}from"react";import B from"styled-components";import{OdigosLogoTextEnterprise as K,OdigosLogoTextCommunity as X,ArrowLeftIcon as _,ArrowRightIcon as G,VSquareIcon as J}from"../icons.js";export{Y as YamlSectionCard}from"../chunks/index-Au62BabI.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const U=({isOpen:a,onClose:r,onDeny:s,onApprove:i})=>I(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:r,onDeny:s,denyLabel:"Keep editing",onApprove:i,approveLabel:"Discard changes"});var Z;!function(e){e.Default="default",e.Action="action",e.Endpoint="endpoint",e.Scope="scope",e.Duration="duration"}(Z||(Z={}));const Q=[Z.Action,Z.Endpoint,Z.Scope,Z.Duration],W=B.span`
2
- font-family: ${({theme:e,$isMono:a})=>a?e.font_family.secondary:e.font_family.primary};
3
- font-size: ${({theme:e})=>e.v2.text.size.xxs}px;
4
- line-height: 20px;
5
- color: ${({theme:e,$variant:a})=>{const r=e.v2.colors;switch(a){case"action":return r.green[400];case"endpoint":return r.purple[300];case"scope":return r.yellow[400];case"duration":return r.orange[600];default:return r.white[500]}}};
6
- `,ee=({parts:e})=>I(H,{children:e.map((e,a)=>T(j,{children:[0!==a&&I(H,{children:" "}),I(W,{$variant:e.variant,$isMono:Q.includes(e.variant),children:e.text})]},`${e.variant}-${a}`))}),ae=({isOpen:a,onClose:r,onDeny:s,onApprove:i,action:t="delete",target:n})=>{const o=t.charAt(0).toUpperCase()+t.substring(1),l=n?.endsWith("s")?"these":"this";return I(e,{title:`${o}${n?` ${n}`:""}?`,description:`Are you sure you want to ${t}${n?` ${l} ${n}`:""}?`,isOpen:a,onClose:r,onDeny:s,denyLabel:"Go back",onApprove:i,approveLabel:o})},re=({componentType:e,inputType:h,name:u,label:g,tooltip:v,badge:m,placeholder:b,required:f,disabled:x,value:y,setValue:w,errorMessage:$,warnMessage:C,helpMessage:M,dropdownOptions:L,dropdownNoSearch:S,dropdownNoCheckbox:k})=>{switch(e){case a.Input:return I(c,{name:u,type:h,label:g,tooltip:v,badge:m,placeholder:b,required:f,disabled:x,value:y??"",onChange:e=>{const a=e.target.value;w(h===p.Number?""===a?null:Number(a):a)},errorMessage:$,warnMessage:C,helpMessage:M},u);case a.MultiInput:return I(d,{name:u,label:g,tooltip:v,badge:m,placeholder:b,required:f,disabled:x,values:Array.isArray(y)?y:l(y,[]),setValues:e=>w(e),errorMessage:$,warnMessage:C,helpMessage:M},u);case a.KeyValuePair:return I(o,{name:u,label:g,tooltip:v,badge:m,required:f,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(y)?y:l(y,[]),setValues:e=>w(e),errorMessage:$,warnMessage:C,helpMessage:M},u);case a.TextArea:return I(n,{name:u,label:g,tooltip:v,badge:m,required:f,disabled:x,placeholder:b,value:y??"",onChange:e=>w(e.target.value),errorMessage:$,warnMessage:C,helpMessage:M},u);case a.Dropdown:return I(t,{name:u,label:g,tooltip:v,badge:m,placeholder:b,required:f,disabled:x,withSearch:!S,options:L?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!k}))||[],values:y?[String(y)]:[],setValues:e=>w(e[0]),errorMessage:$,warnMessage:C,helpMessage:M},u);case a.Checkbox:return I(i,{name:u,label:g,tooltip:v,badge:m,value:!0===y||"true"===y,onChange:e=>w(e),disabled:x,errorMessage:$,warnMessage:C,helpMessage:M},u);case a.Toggle:return I(r,{name:u,labelAlign:s.Right,label:g,tooltip:v,badge:m,value:!0===y||"true"===y,onChange:e=>w(e),disabled:x,errorMessage:$,warnMessage:C,helpMessage:M},u);default:return null}},se=({size:e=200})=>{const{tier:a}=h();return a===u.Onprem?I(K,{size:e}):I(X,{size:e})},ie=(e,a)=>!a?.length||!!a?.find(a=>a===e),te=({title:e="Signals",required:a,errorMessage:r,allowedSignals:s,selectedSignals:t,setSelectedSignals:n,disabled:o})=>{const[l,d]=q(1===t.length),c=z(JSON.stringify(t));V(()=>{const e=g(t);e.length||v.forEach(({id:a})=>{ie(a,s)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,n(e),d(1===e.length))},[s,t]);return T(m,{$gap:12,children:[I(b,{label:e,required:a}),I(f,{$gap:12,children:v.map(e=>{const a=ie(e.id,s),r=((e,a)=>!!a?.find(a=>a===e))(e.id,t);return a?I(i,{label:e.value,disabled:o||!a||l&&r,value:r,onChange:a=>((e,a)=>{const r=e,s=a?[...t,r]:t.filter(e=>e!==r);n(s),d(1===s.length)})(e.id,a)},e.id):null})}),I(x,{errorMessage:r})]})},ne=({minSupportedVersion:a,currentVersion:r})=>I(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>I(y,{scale:2.4,icon:()=>I("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:I("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${r}.`}),oe=B.div`
7
- display: flex;
8
- flex-direction: column;
9
- justify-content: flex-end;
10
- width: ${({$width:e})=>e};
11
- gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
12
- `,le=B.div`
13
- display: flex;
14
- align-items: center;
15
- min-height: 24px;
16
- padding: 12px;
17
- border-radius: 16px 16px 0 0;
18
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
19
- `,de=B.div`
20
- display: flex;
21
- flex-direction: column;
22
- gap: ${({$gap:e})=>e}px;
23
- padding: 12px 12px 0 12px;
24
- width: calc(100% - 24px);
25
- height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
26
- border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:r})=>e?a?"0 0 0 16px":r?"0 16px 0 0":"0":a?"16px 0 0 16px":r?"0 16px 16px 0":"16px"};
27
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
28
- overflow-y: auto;
29
- overflow-x: hidden;
30
- `,ce=({isLeft:e,isRight:a,heightOffset:r=0,width:s,header:i,list:t})=>T(oe,{$width:s,$columnHasHeader:!!i,children:[i&&I(le,{children:i}),I(de,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:r,$columnHasHeader:!!i,children:t.length?t.length>1?I(w,{gap:8,elements:t}):I(H,{children:t[0]}):I($,{$height:"100%",children:I(C,{})})})]}),pe="75vw",he=B.div`
31
- display: flex;
32
- flex-direction: column;
33
- border-radius: 16px;
34
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
35
- overflow: hidden;
36
- `,ue=B.div`
37
- display: flex;
38
- gap: 12px;
39
- padding: 16px 16px 0 16px;
40
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
41
- position: sticky;
42
- top: 0;
43
- `,ge=B.div`
44
- padding: 12px 12px 0 12px;
45
- `,ve=B.div`
46
- display: flex;
47
- gap: 12px;
48
- padding: 16px;
49
- `,me=B.div`
50
- padding: 5vh 10vw;
51
- border-radius: 12px;
52
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
53
- `,be=R(({isOpen:e,withOverlay:a,disableAnimation:r,onClose:s,onBack:i,onNext:t,nextIsSkip:n,onSave:o,disableSave:l,connectionIds:d,header:c,subHeader:p,leftColumn:h,rightColumn:u,search:g,filters:v,errorMessage:m,isFormDirty:b,hideDirtyNote:f,isFetching:x,progress:y},w)=>{const[C,A]=q(!1),[H,j]=q(!1),[z,V]=q(void 0);F(w,()=>({clearErrors:()=>V(void 0)}));const R=H,B=E(()=>{b&&!C?A(!0):(A(!1),s?.())},[b,C,s]),K=l||H||"boolean"==typeof b&&!b,X=E(async()=>{j(!0);const e=await o();j(!1),e?.error?V(e.error):(d?.setValue([]),s?.())},[o,d,s]),Y=!!g||!!d||!!v,Z=!!p,Q=(Y?48:0)+(Z?50:0),W=P(()=>x?{status:M.Info,message:"Fetching Data..."}:H&&!y?{status:M.Info,message:"Saving Changes..."}:z||m?{status:M.Error,message:z||m}:"boolean"==typeof b&&b&&!f?{status:M.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof b||b||f?void 0:{status:M.Success,message:"The values reflect the current configuration of the selected cluster."},[x,H,y,z,m,b,f]),ee=P(()=>i?{label:"Back",leftIcon:_,variant:L.Secondary,onClick:i}:{label:"Cancel",variant:L.Secondary,onClick:B,disabled:R},[i,B,R]),ae=P(()=>t?n?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:G,variant:L.Secondary,onClick:t}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:G,variant:L.Primary,onClick:t}:{"data-id":"wide-drawer-save",label:"Save",variant:L.Primary,onClick:X,disabled:K},[t,n,X,K]);return T(S,{width:pe,isOpen:e,disableAnimation:r,hideOverlay:!H&&!a,header:{...c,onClose:s?B:void 0,onCloseDisabled:R},footer:{note:W,actions:[ee,ae]},children:[H?I($,{$height:"calc(100vh - 136px)",children:I(me,{children:I(k,{titleSize:O.S,subTitleSize:O.XXXS,withGradient:!0,withSpinner:!0,...y})})}):T(he,{children:[Y&&T(ue,{children:[d&&I(D,{icon:J,title:"Selected Clusters",badge:{label:d.value.length}}),g&&I(N,{width:"100%",...g}),v]}),Z&&I(ge,{children:I(D,{icon:p.icon,title:p.title,subTitle:p.description,badge:p.badge})}),T(ve,{children:[I(ce,{isLeft:!0,heightOffset:Q,...h}),I(ce,{isRight:!0,heightOffset:Q,...u})]})]}),I(U,{isOpen:C,onClose:()=>A(!1),onApprove:B})]})});be.displayName=be.name;export{U as CancelModal,ee as ColoredSpan,Z as ColoredSpanVariant,ae as DeleteModal,re as DynamicField,se as OdigosLogoTextByTier,D as RichTitle,te as SignalsCheckboxList,ne as UpgradeModal,pe as WIDE_DRAWER_WIDTH,be as WideDrawer};
1
+ export{A as ActionType,bj as Actions,bo as ColoredSpan,eD as ColoredSpanVariant,bi as RichTitle}from"../chunks/ui-components-BqdkaDt2.js";export{C as CancelModal,i as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,d as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,f as WIDE_DRAWER_WIDTH,W as WideDrawer}from"../chunks/index-BMJ_MZzY.js";export{Y as YamlSectionCard}from"../chunks/index-Dlnglk_e.js";import"../icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{ct as AddButton,e4 as CopyText,d$ as EditButton,d_ as Flow,fd as MapItemNode,fe as NoDataNode,dG as NoteBackToSummary,e6 as PodContainer,ec as SourceContainer}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{c4 as AddButton,dI as CopyText,dC as EditButton,dB as Flow,fO as MapItemNode,fP as NoDataNode,dg as NoteBackToSummary,dK as PodContainer,dQ as SourceContainer}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{bq as ProgressKeys,dZ as useActiveNodeStore,ei as useDarkMode,E as useDataStreamStore,cA as useDrawerStore,bk as useEntityStore,cX as useFilterStore,cL as useModalStore,dR as useNotificationStore,bp as useProgressStore,db as useSelectedStore,dD as useSetupStore}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{aE as ProgressKeys,dA as useActiveNodeStore,dW as useDarkMode,E as useDataStreamStore,cb as useDrawerStore,ax as useEntityStore,cy as useFilterStore,cm as useModalStore,ds as useNotificationStore,aD as useProgressStore,cO as useSelectedStore,dd as useSetupStore}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{f5 as Provider,f6 as animations,f7 as opacity,f8 as palettes}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{fG as Provider,fH as animations,fI as opacity,fJ as palettes}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -96,7 +96,8 @@ export declare enum FieldTypes {
96
96
  TextArea = "textarea",
97
97
  Dropdown = "dropdown",
98
98
  Checkbox = "checkbox",
99
- Toggle = "toggle"
99
+ Toggle = "toggle",// not used by dests, but is in form components
100
+ Time = "time"
100
101
  }
101
102
  export declare enum InputTypes {
102
103
  Text = "text",
@@ -22,6 +22,7 @@ export declare enum OtelDistroName {
22
22
  PythonEnterprise = "python-enterprise",
23
23
  JavaEnterprise = "java-enterprise",
24
24
  JavaEbpfInstrumentations = "java-ebpf-instrumentations",
25
+ OpentelemetryEbpfInstrumentation = "opentelemetry-ebpf-instrumentation",
25
26
  DotNetLegacy = "dotnet-legacy",
26
27
  DotNetEnterprise = "dotnet-enterprise",
27
28
  RubyEnterprise = "ruby-enterprise",
@@ -1,3 +1,4 @@
1
+ import type { ColoredSpanPart } from '@/snippets/_v2';
1
2
  export interface SourcesScope {
2
3
  workloadName?: string | null;
3
4
  workloadKind?: string | null;
@@ -101,3 +102,79 @@ export interface CostReductionRuleInput {
101
102
  percentageAtMost: number;
102
103
  notes?: string | null;
103
104
  }
105
+ export type SamplingRuleCategory = 'noisy' | 'highlyRelevant' | 'costReduction';
106
+ export type HighlyRelevantBadgeType = 'Relevance' | 'Duration' | 'Error';
107
+ export type TypeFilter = 'all' | HighlyRelevantBadgeType;
108
+ export interface SamplingRuleItem {
109
+ ruleId: string;
110
+ samplingId: string;
111
+ name: string | null;
112
+ disabled: boolean;
113
+ notes: string | null;
114
+ summary: ColoredSpanPart[];
115
+ category: SamplingRuleCategory;
116
+ typeBadge?: HighlyRelevantBadgeType;
117
+ }
118
+ interface BaseViewRule {
119
+ samplingId: string;
120
+ summary: ColoredSpanPart[];
121
+ }
122
+ interface ViewNoisyRule extends BaseViewRule {
123
+ category: Extract<SamplingRuleCategory, 'noisy'>;
124
+ rule: NoisyOperationRule;
125
+ }
126
+ interface ViewHighlyRelevantRule extends BaseViewRule {
127
+ category: Extract<SamplingRuleCategory, 'highlyRelevant'>;
128
+ rule: HighlyRelevantOperationRule;
129
+ }
130
+ interface ViewCostReductionRule extends BaseViewRule {
131
+ category: Extract<SamplingRuleCategory, 'costReduction'>;
132
+ rule: CostReductionRule;
133
+ }
134
+ export type ViewRuleData = ViewNoisyRule | ViewHighlyRelevantRule | ViewCostReductionRule;
135
+ export interface SamplingRulesSelectOption {
136
+ id: string;
137
+ label: string;
138
+ }
139
+ /** Matches effective k8s health-probes sampling config from the API. */
140
+ export interface SamplingRulesK8sHealthConfig {
141
+ enabled: boolean | null;
142
+ keepPercentage: number | null;
143
+ }
144
+ export type ScopeType = 'all' | 'source' | 'namespace' | 'language';
145
+ export type OperationType = 'all' | 'httpServer' | 'httpClient' | 'kafkaConsumer' | 'kafkaProducer';
146
+ export type PercentageMode = 'all' | 'sample';
147
+ export type RouteType = 'route' | 'routePrefix';
148
+ export type DurationPreset = '5000' | '1000' | '500' | '100' | '50' | 'custom';
149
+ export type PercentagePreset = '50' | '25' | '10' | '1' | '0.5' | '0.1' | '0' | 'custom';
150
+ export interface SourceScopeEntry {
151
+ scopeType: ScopeType;
152
+ workloadName: string;
153
+ workloadKind: string;
154
+ workloadNamespace: string;
155
+ workloadLanguage: string;
156
+ }
157
+ export interface SamplingRuleFormState {
158
+ name: string;
159
+ notes: string;
160
+ disabled: boolean;
161
+ ruleType: HighlyRelevantBadgeType;
162
+ sourceScopes: SourceScopeEntry[];
163
+ operationType: OperationType;
164
+ routeType: RouteType;
165
+ route: string;
166
+ serverAddress: string;
167
+ method: string;
168
+ kafkaTopic: string;
169
+ durationPreset: DurationPreset;
170
+ customDurationMs: string;
171
+ keepErrors: boolean;
172
+ percentageMode: PercentageMode;
173
+ percentagePreset: PercentagePreset;
174
+ customPercentage: string;
175
+ }
176
+ export interface DuplicateValidationResult {
177
+ message: string;
178
+ ruleId: string;
179
+ }
180
+ export {};
@@ -14,14 +14,26 @@ export interface PersistSourceInput {
14
14
  export type PersistSourcesFunc = (payload: PersistSourceInput) => Promise<{
15
15
  error?: string;
16
16
  } | undefined>;
17
+ export interface SourceContainerRuntimeInfo {
18
+ language: ProgrammingLanguages;
19
+ runtimeVersion: string | null;
20
+ }
21
+ export interface SourceContainerAgentEnabled {
22
+ agentEnabled: boolean;
23
+ agentEnabledStatus: {
24
+ message: string;
25
+ };
26
+ otelDistroName: OtelDistroName | null;
27
+ }
28
+ export interface SourceContainerOverrides {
29
+ containerName: string;
30
+ runtimeInfo: SourceContainerRuntimeInfo | null;
31
+ }
17
32
  export interface SourceContainer {
18
33
  containerName: string;
19
- language: ProgrammingLanguages;
20
- runtimeVersion: string;
21
- overriden?: boolean;
22
- instrumented: boolean;
23
- instrumentationMessage: string;
24
- otelDistroName?: OtelDistroName | null;
34
+ runtimeInfo: SourceContainerRuntimeInfo | null;
35
+ agentEnabled: SourceContainerAgentEnabled | null;
36
+ overrides: SourceContainerOverrides | null;
25
37
  }
26
38
  export interface Source extends WorkloadId {
27
39
  selected: boolean;
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- export{eo as ActionCategory,f as ActionKeyTypes,s as ActionType,ep as AddNodeTypes,eq as BooleanOperation,U as CodeAttributesKeyTypes,cK as Crud,_ as CustomInstrumentationsKeyTypes,dd as DesiredStateProgress,er as DestinationTypes,es as EdgeTypes,aa as EntityTypes,r as FieldTypes,Y as GolangCustomProbe,W as HeadersCollectionKeyTypes,k as InputTypes,et as InstallationMethod,$ as InstrumentationRuleType,eu as IntrumentationStatus,Z as JavaCustomProbe,ev as JsonOperation,K as K8sAttributesFrom,eb as K8sResourceKind,ew as ListDirection,dX as NodeTypes,ex as NumberOperation,ey as OtelDistroName,dH as OtherEntityTypes,cU as OtherStatus,bm as OtherStatusType,X as PayloadCollectionKeyTypes,ez as PlatformType,eA as PodContainerLifecycleStatus,eB as PodContainerStatus,eC as PodPhase,eD as Profile,aH as ProgrammingLanguages,eE as SIGNAL_KEY_TO_TYPE,dM as SIGNAL_TYPE_TO_KEY,eF as SignalKey,J as SignalType,eG as SortDirection,Q as StatusType,eH as StringOperation,a9 as Tier,c2 as WorkloadRolloutStatus}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{eV as ActionCategory,f as ActionKeyTypes,s as ActionType,eW as AddNodeTypes,eX as BooleanOperation,U as CodeAttributesKeyTypes,cl as Crud,_ as CustomInstrumentationsKeyTypes,cQ as DesiredStateProgress,eY as DestinationTypes,eZ as EdgeTypes,aa as EntityTypes,r as FieldTypes,Y as GolangCustomProbe,W as HeadersCollectionKeyTypes,k as InputTypes,e_ as InstallationMethod,$ as InstrumentationRuleType,e$ as IntrumentationStatus,Z as JavaCustomProbe,f0 as JsonOperation,K as K8sAttributesFrom,dP as K8sResourceKind,f1 as ListDirection,dy as NodeTypes,f2 as NumberOperation,f3 as OtelDistroName,dh as OtherEntityTypes,cv as OtherStatus,az as OtherStatusType,X as PayloadCollectionKeyTypes,f4 as PlatformType,f5 as PodContainerLifecycleStatus,f6 as PodContainerStatus,f7 as PodPhase,f8 as Profile,dE as ProgrammingLanguages,f9 as SIGNAL_KEY_TO_TYPE,dm as SIGNAL_TYPE_TO_KEY,fa as SignalKey,J as SignalType,fb as SortDirection,Q as StatusType,fc as StringOperation,a9 as Tier,bm as WorkloadRolloutStatus}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/visuals.js CHANGED
@@ -1 +1 @@
1
- export{fr as VISUAL_ODIGOS_LOGO_HEIGHT,fs as VISUAL_ODIGOS_LOGO_WIDTH,en as VisualGreenRings,ft as VisualOdigosLogo}from"./chunks/ui-components-CI2PiWkX.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{g0 as VISUAL_ODIGOS_LOGO_HEIGHT,g1 as VISUAL_ODIGOS_LOGO_WIDTH,eU as VisualGreenRings,g2 as VisualOdigosLogo}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.224",
3
+ "version": "0.0.225",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {