@odigos/ui-kit 0.0.33 → 0.0.35

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 (59) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/eslint.config.mjs +17 -0
  3. package/lib/components/data-card/index.d.ts +2 -1
  4. package/lib/components/dropdown/index.d.ts +1 -0
  5. package/lib/components/input/index.d.ts +1 -1
  6. package/lib/components/input-table/index.d.ts +3 -11
  7. package/lib/components/input-table/map-columns-to-fields/index.d.ts +15 -0
  8. package/lib/components/input-table/types.d.ts +15 -0
  9. package/lib/components.js +9 -10
  10. package/lib/constants/strings/index.d.ts +6 -0
  11. package/lib/constants.js +1 -2
  12. package/lib/containers/action-form/custom-fields/add-cluster-info.d.ts +1 -1
  13. package/lib/containers/action-form/custom-fields/delete-attributes.d.ts +1 -1
  14. package/lib/containers/action-form/custom-fields/error-sampler.d.ts +1 -1
  15. package/lib/containers/action-form/custom-fields/k8s-attributes.d.ts +1 -1
  16. package/lib/containers/action-form/custom-fields/latency-sampler.d.ts +1 -1
  17. package/lib/containers/action-form/custom-fields/pii-masking.d.ts +1 -1
  18. package/lib/containers/action-form/custom-fields/probabilistic-sampler.d.ts +1 -1
  19. package/lib/containers/action-form/custom-fields/rename-attributes.d.ts +1 -1
  20. package/lib/containers/action-form/custom-fields/service-name-sampler.d.ts +5 -0
  21. package/lib/containers/action-form/custom-fields/span-attribute-sampler.d.ts +5 -0
  22. package/lib/containers/data-flow/helpers/build-action-nodes.d.ts +7 -1
  23. package/lib/containers/data-flow/helpers/build-destination-nodes.d.ts +7 -1
  24. package/lib/containers/data-flow/helpers/build-rule-nodes.d.ts +7 -1
  25. package/lib/containers/destination-modal/choose-destination/destinations-list/index.d.ts +1 -1
  26. package/lib/containers/destination-modal/choose-destination/index.d.ts +2 -2
  27. package/lib/containers/instrumentation-rule-drawer/build-card.d.ts +1 -1
  28. package/lib/containers.js +515 -201
  29. package/lib/functions/get-action-icon/index.d.ts +2 -2
  30. package/lib/functions/index.d.ts +1 -0
  31. package/lib/functions/numbers-only/index.d.ts +1 -0
  32. package/lib/functions.js +6 -7
  33. package/lib/hooks/index.d.ts +1 -0
  34. package/lib/hooks/useSessionStorage.d.ts +5 -0
  35. package/lib/hooks.js +4 -5
  36. package/lib/icons.js +7 -7
  37. package/lib/{index-1N9wymEq.js → index-9R2N835W.js} +1 -1
  38. package/lib/{index-f8FRaVkE.js → index-BDqd3uNm.js} +1 -1
  39. package/lib/{index-Do3CYz7N.js → index-BVj4fOL3.js} +1 -1
  40. package/lib/{index-CnZlllYu.js → index-BlZKWuxe.js} +7 -1
  41. package/lib/{index-B_Gl6Qa6.js → index-CCX1HLUr.js} +9 -3
  42. package/lib/{index-CNfdJ1X8.js → index-CEWs8CTN.js} +1 -1
  43. package/lib/{index-CVH8Q8Sl.js → index-CKOBXat_.js} +360 -237
  44. package/lib/{index-CaAOgaiC.js → index-CyG_tD3y.js} +2 -2
  45. package/lib/{index-BjVl4-os.js → index-DmCjUtBQ.js} +4 -5
  46. package/lib/{index-BQQZyvRz.js → index-DqaI44fJ.js} +1 -1
  47. package/lib/{index-BedCNcwV.js → index-THrvNIPj.js} +112 -64
  48. package/lib/{index-Iq7U_fzb.js → index-dLZvpGw3.js} +5 -12
  49. package/lib/mock-data/sources/index.d.ts +2 -0
  50. package/lib/snippets.js +8 -9
  51. package/lib/store.js +1 -1
  52. package/lib/theme.js +1 -1
  53. package/lib/types/actions/index.d.ts +137 -41
  54. package/lib/types/common/index.d.ts +10 -16
  55. package/lib/types.js +85 -20
  56. package/lib/{useSourceSelectionFormData-DiwzViqL.js → useSourceSelectionFormData-DqSNROtZ.js} +73 -37
  57. package/lib/{useTransition-B0eagOib.js → useTransition-D9f1CP9n.js} +1 -1
  58. package/package.json +20 -23
  59. package/lib/index-mOgS3e5E.js +0 -101
@@ -1,14 +1,13 @@
1
1
  import React, { useState, useEffect, useRef, forwardRef, createElement, useCallback, useMemo, Fragment } from 'react';
2
- import { T as Theme, n as ImageErrorIcon, M as MONITORS_OPTIONS } from './index-CVH8Q8Sl.js';
2
+ import { T as Theme, o as ImageErrorIcon, M as MONITORS_OPTIONS, B as BUTTON_TEXTS } from './index-CKOBXat_.js';
3
+ import { StatusType, OtherStatus, SortDirection, ProgrammingLanguages, IntrumentationStatus, InputTypes, FieldTypes } from './types.js';
4
+ import { M as MinusIcon, f as CheckIcon, L as ListIcon, C as CodeIcon, E as ExtendArrowIcon, c as SortArrowsIcon, a as CopyIcon, b as NotebookIcon, X as XIcon, d as EyeClosedIcon, e as EyeOpenIcon, N as NoDataIcon, g as CrossIcon, S as SearchIcon, P as PlusIcon, T as TrashIcon, A as ArrowIcon } from './index-CEWs8CTN.js';
5
+ import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, c as capitalizeFirstLetter, g as getMonitorIcon, p as parseJsonStringToPrettyString, a as getProgrammingLanguageIcon, d as splitCamelString, n as numbersOnly } from './index-CCX1HLUr.js';
3
6
  import styled, { css } from 'styled-components';
4
- import { M as MinusIcon, f as CheckIcon, L as ListIcon, C as CodeIcon, E as ExtendArrowIcon, c as SortArrowsIcon, a as CopyIcon, b as NotebookIcon, X as XIcon, d as EyeClosedIcon, e as EyeOpenIcon, N as NoDataIcon, g as CrossIcon, S as SearchIcon, P as PlusIcon, T as TrashIcon, A as ArrowIcon } from './index-CNfdJ1X8.js';
5
- import { StatusType, OtherStatus, SortDirection, ProgrammingLanguages } from './types.js';
6
7
  import { s as safeJsonParse, i as isEmpty } from './index-BV85P9UP.js';
7
- import { B as BUTTON_TEXTS } from './index-mOgS3e5E.js';
8
- import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, c as capitalizeFirstLetter, g as getMonitorIcon, p as parseJsonStringToPrettyString, a as getProgrammingLanguageIcon, d as splitCamelString } from './index-B_Gl6Qa6.js';
9
- import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-B0eagOib.js';
8
+ import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-D9f1CP9n.js';
10
9
  import ReactDOM from 'react-dom';
11
- import { I as InfoIcon } from './index-Do3CYz7N.js';
10
+ import { I as InfoIcon } from './index-BVj4fOL3.js';
12
11
 
13
12
  const TextWrapper$2 = styled.div `
14
13
  color: ${({ $color, theme }) => $color || theme.text.secondary};
@@ -3992,6 +3991,9 @@ const Row = styled.div `
3992
3991
  const TextNoWrap = styled(Text) `
3993
3992
  white-space: nowrap;
3994
3993
  `;
3994
+ const IconWrap$1 = styled(FlexColumn) `
3995
+ width: 16px;
3996
+ `;
3995
3997
  const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed', headerLabelWarning = "Something isn't right", headerLabelSuccess = 'Everything Successful', }) => {
3996
3998
  const theme = Theme.useTheme();
3997
3999
  const [extend, setExtend] = useState(false);
@@ -4022,9 +4024,9 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
4022
4024
  React.createElement(Text, { color: headerSubTextColor, size: 12, family: 'secondary' }, headerSubText),
4023
4025
  React.createElement(ExtendArrow, { extend: extend, align: 'right' })),
4024
4026
  extend && (React.createElement(Body, null, conditions.map(({ status, type, reason, message, lastTransitionTime }, idx) => {
4025
- const Icon = status === 'loading' ? () => React.createElement(FadeLoader, { scale: 0.8 }) : status === 'disabled' ? getStatusIcon(StatusType.Info, theme) : getStatusIcon(status, theme);
4026
- const color = status === 'disabled' ? theme.text.info : status === StatusType.Error ? theme.text.error : status === StatusType.Warning ? theme.text.warning : theme.text.info;
4027
- const boldColor = status === 'disabled'
4027
+ const Icon = status === OtherStatus.Loading ? () => React.createElement(FadeLoader, { scale: 0.8 }) : status === OtherStatus.Disabled ? getStatusIcon(StatusType.Info, theme) : getStatusIcon(status, theme);
4028
+ const color = status === OtherStatus.Disabled ? theme.text.info : status === StatusType.Error ? theme.text.error : status === StatusType.Warning ? theme.text.warning : theme.text.info;
4029
+ const boldColor = status === OtherStatus.Disabled
4028
4030
  ? theme.text.info_secondary
4029
4031
  : status === StatusType.Error
4030
4032
  ? theme.text.error_secondary
@@ -4032,7 +4034,8 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
4032
4034
  ? theme.text.warning_secondary
4033
4035
  : theme.text.info_secondary;
4034
4036
  return (React.createElement(Row, { key: `condition-${idx}` },
4035
- React.createElement(Icon, null),
4037
+ React.createElement(IconWrap$1, null,
4038
+ React.createElement(Icon, null)),
4036
4039
  React.createElement(FlexRow, { "$gap": 12, style: { width: '100%', justifyContent: 'space-between' } },
4037
4040
  React.createElement(Text, { color: color, size: 12 },
4038
4041
  React.createElement(TextNoWrap, { color: boldColor, size: 12, weight: 700 }, type),
@@ -4640,7 +4643,7 @@ const RenderValue = ({ type, value }) => {
4640
4643
  actualDevice: { title: '', subTitle: '', tooltip: '' },
4641
4644
  processes: [{ health: StatusType.Info, message: '', identifyingAttributes: [] }],
4642
4645
  });
4643
- return (React.createElement(DataTab, { title: containerName, subTitle: `${processes.length} Instrumented Processes`, renderActions: () => {
4646
+ return (React.createElement(DataTab, { title: containerName, subTitle: processes.length ? `${processes.length} Instrumented Processes` : undefined, renderActions: () => {
4644
4647
  return React.createElement(Status, { status: StatusType.Info, title: 'Instrumentation Device', subtitle: !actualDevice.subTitle || actualDevice.subTitle === '[]' ? 'none' : actualDevice.subTitle, withBorder: true });
4645
4648
  }, extendableProps: {
4646
4649
  isExtended: !!processes.length,
@@ -4655,29 +4658,29 @@ const RenderValue = ({ type, value }) => {
4655
4658
  } }));
4656
4659
  }
4657
4660
  case DataCardFieldTypes.SourceContainer: {
4658
- const { containerName, language, runtimeVersion, instrumented, instrumentationMessage, otelDistroName } = safeJsonParse(value, {
4661
+ const { containerName, language, runtimeVersion, instrumented, instrumentationMessage, otelDistroName, isDisabled } = safeJsonParse(value, {
4659
4662
  containerName: '',
4660
4663
  language: ProgrammingLanguages.Unknown,
4661
4664
  runtimeVersion: '',
4662
4665
  instrumented: false,
4663
4666
  instrumentationMessage: '',
4664
4667
  otelDistroName: '',
4668
+ isDisabled: false,
4665
4669
  });
4666
4670
  const awaitingInstrumentation = !instrumented && !instrumentationMessage;
4667
- return (React.createElement(DataTab, { title: containerName, subTitle: `${language === ProgrammingLanguages.JavaScript ? 'Node.js' : capitalizeFirstLetter(language)}` + (!!runtimeVersion ? ` • Runtime Version: ${runtimeVersion}` : ''), iconProps: {
4668
- icon: getProgrammingLanguageIcon(language),
4669
- }, extendableProps: {
4671
+ const statusType = isDisabled ? StatusType.Info : instrumented ? StatusType.Success : awaitingInstrumentation ? StatusType.Warning : StatusType.Error;
4672
+ const statusTitle = isDisabled
4673
+ ? IntrumentationStatus.NOT_INSTRUMENTED
4674
+ : instrumented
4675
+ ? IntrumentationStatus.INSTRUMNETED
4676
+ : awaitingInstrumentation
4677
+ ? `${IntrumentationStatus.INSTRUMENTING}...`
4678
+ : IntrumentationStatus.UNINSTRUMENTED;
4679
+ return (React.createElement(DataTab, { title: containerName, subTitle: `${language === ProgrammingLanguages.JavaScript ? 'Node.js' : capitalizeFirstLetter(language)}` + (runtimeVersion ? ` • Runtime Version: ${runtimeVersion}` : ''), iconProps: { icon: getProgrammingLanguageIcon(language) }, extendableProps: {
4670
4680
  isExtended: !!instrumentationMessage,
4671
- renderExtended: () => {
4672
- if (!!instrumentationMessage) {
4673
- return (React.createElement(AlignCenter, null,
4674
- React.createElement(Status, { status: StatusType.Info, title: splitCamelString(instrumentationMessage) })));
4675
- }
4676
- return null;
4677
- },
4678
- }, renderActions: () => {
4679
- return (React.createElement(Status, { status: instrumented ? StatusType.Success : awaitingInstrumentation ? StatusType.Warning : StatusType.Error, title: instrumented ? 'Instrumented' : awaitingInstrumentation ? 'Instrumenting...' : 'Uninstrumented', subtitle: otelDistroName, withIcon: true, withBorder: true }));
4680
- } }));
4681
+ renderExtended: () => (React.createElement(AlignCenter, null,
4682
+ React.createElement(Status, { status: StatusType.Info, title: splitCamelString(instrumentationMessage) }))),
4683
+ }, renderActions: () => React.createElement(Status, { status: statusType, title: statusTitle, subtitle: otelDistroName, withIcon: true, withBorder: true }) }));
4681
4684
  }
4682
4685
  default: {
4683
4686
  return React.createElement(PreWrap, null, parseJsonStringToPrettyString(typeof value === 'string' ? value || '-' : ''));
@@ -4726,7 +4729,7 @@ const DataCard = ({ title = 'Details', titleBadge, description, action: Action,
4726
4729
  !!title || !!description || !!Action ? (React.createElement(Header$1, { "$clickable": withExtend || false, onClick: () => withExtend && setExtend((prev) => !prev), onMouseEnter: () => withExtend && setHovered(true), onMouseLeave: () => withExtend && setHovered(false) },
4727
4730
  (!!title || !!Action) && (React.createElement(Title$8, null,
4728
4731
  title,
4729
- titleBadge !== undefined && React.createElement(Badge, { label: titleBadge }),
4732
+ titleBadge === OtherStatus.Loading ? React.createElement(FadeLoader, null) : titleBadge !== undefined && React.createElement(Badge, { label: titleBadge }),
4730
4733
  React.createElement(ActionWrapper, null,
4731
4734
  typeof Action === 'function' ? React.createElement(Action, null) : Action,
4732
4735
  withExtend && React.createElement(ExtendArrow, { extend: false })))),
@@ -5001,15 +5004,15 @@ const Button$1 = styled.button `
5001
5004
  cursor: not-allowed;
5002
5005
  }
5003
5006
  `;
5004
- const Input = ({ icon: Icon, buttonLabel, onButtonClick, hasError, errorMessage, title, tooltip, required, onChange, type = 'text', name, ...props }) => {
5007
+ const Input = ({ icon: Icon, buttonLabel, onButtonClick, hasError, errorMessage, title, tooltip, required, value, onChange, type = InputTypes.Text, name, ...props }) => {
5005
5008
  const theme = Theme.useTheme();
5006
- const isSecret = type === 'password';
5009
+ const isSecret = type === InputTypes.Password;
5007
5010
  const [revealSecret, setRevealSecret] = useState(false);
5008
5011
  const handleInputChange = (e) => {
5009
5012
  e.stopPropagation();
5010
- const v = e.target.value;
5011
- const actualValue = type === 'number' ? v.replace(/[^\d]/g, '') : v;
5012
- e.target.value = actualValue;
5013
+ if (type === InputTypes.Number) {
5014
+ e.target.value = numbersOnly(e.target.value);
5015
+ }
5013
5016
  onChange?.(e);
5014
5017
  };
5015
5018
  const handleKeyDown = (e) => {
@@ -5021,7 +5024,7 @@ const Input = ({ icon: Icon, buttonLabel, onButtonClick, hasError, errorMessage,
5021
5024
  React.createElement(InputWrapper$1, { "$disabled": props.disabled, "$hasError": hasError || !!errorMessage, "$isActive": !!props.autoFocus },
5022
5025
  isSecret ? (React.createElement(IconWrapperClickable, { onClick: () => setRevealSecret((prev) => !prev) }, revealSecret ? React.createElement(EyeClosedIcon, { size: 14, fill: theme.text.grey }) : React.createElement(EyeOpenIcon, { size: 14, fill: theme.text.grey }))) : Icon ? (React.createElement(IconWrapper$2, null,
5023
5026
  React.createElement(Icon, { size: 14, fill: theme.text.grey }))) : null,
5024
- React.createElement(StyledInput, { "data-id": name, type: revealSecret ? 'text' : type, "$hasIcon": !!Icon || isSecret, name: name, onChange: handleInputChange, onKeyDown: handleKeyDown, ...props }),
5027
+ React.createElement(StyledInput, { "data-id": name, type: revealSecret ? InputTypes.Text : type === InputTypes.Number ? InputTypes.Text : type, "$hasIcon": !!Icon || isSecret, name: name, value: value, onChange: handleInputChange, onKeyDown: handleKeyDown, ...props }),
5025
5028
  buttonLabel && onButtonClick && (React.createElement(Button$1, { onClick: onButtonClick, disabled: props.disabled }, buttonLabel))),
5026
5029
  !!errorMessage && React.createElement(FieldError, null, errorMessage)));
5027
5030
  };
@@ -5098,7 +5101,7 @@ const IconWrapper$1 = styled.div `
5098
5101
  align-items: center;
5099
5102
  gap: 4px;
5100
5103
  `;
5101
- const Dropdown = ({ options, value, onSelect, onDeselect, title, tooltip, placeholder, disabled = false, isMulti = false, showSearch = false, required = false, errorMessage }) => {
5104
+ const Dropdown = ({ options, value, onSelect, onDeselect, title, tooltip, placeholder, disabled = false, isMulti = false, showSearch = false, required = false, errorMessage, hasError = false, }) => {
5102
5105
  const [isOpen, setIsOpen] = useState(false);
5103
5106
  const [openUpwards, setOpenUpwards] = useState(false);
5104
5107
  const containerRef = useRef(null);
@@ -5118,7 +5121,7 @@ const Dropdown = ({ options, value, onSelect, onDeselect, title, tooltip, placeh
5118
5121
  return (React.createElement(RootContainer, { "$disabled": disabled },
5119
5122
  React.createElement(FieldLabel, { title: title, required: required, tooltip: tooltip }),
5120
5123
  React.createElement(RelativeContainer, { ref: containerRef },
5121
- React.createElement(DropdownHeader, { "$isOpen": isOpen, "$isMulti": isMulti, "$hasSelections": Array.isArray(value) ? !!value.length : false, "$hasError": !!errorMessage, "$disabled": disabled, onClick: () => !disabled && toggleOpen() },
5124
+ React.createElement(DropdownHeader, { "$isOpen": isOpen, "$isMulti": isMulti, "$hasSelections": Array.isArray(value) ? !!value.length : false, "$hasError": !!errorMessage || hasError, "$disabled": disabled, onClick: () => !disabled && toggleOpen() },
5122
5125
  React.createElement(DropdownPlaceholder, { value: value, placeholder: placeholder, onDeselect: onDeselect }),
5123
5126
  React.createElement(IconWrapper$1, null,
5124
5127
  isMulti && React.createElement(Badge, { label: arrLen, filled: !!arrLen }),
@@ -5391,22 +5394,44 @@ const InputList = ({ initialValues = [], value, onChange, title, tooltip, requir
5391
5394
  React.createElement(AddButton, { onClick: handleAddInput, disabled: isAddButtonDisabled })));
5392
5395
  };
5393
5396
 
5397
+ const ColumnsToFields = ({ col, colIdx, row, rowIdx, rowsLength, maxWidth, handleChange, errorMessage, limitFieldsPerRow }) => {
5398
+ const { keyName, title, tooltip, placeholder, required, type, componentType, options, renderCondition } = col;
5399
+ const value = row[keyName];
5400
+ if (renderCondition && !renderCondition(row))
5401
+ return null;
5402
+ const render = () => {
5403
+ switch (componentType) {
5404
+ case FieldTypes.Dropdown:
5405
+ const selectedOption = options?.find((opt) => opt.id === value);
5406
+ return (React.createElement(Dropdown, { title: limitFieldsPerRow ? title : undefined, tooltip: limitFieldsPerRow ? tooltip : undefined, placeholder: placeholder, required: required, options: options || [], value: selectedOption, onSelect: (opt) => handleChange(keyName, opt.id, rowIdx), onDeselect: (opt) => handleChange(keyName, '', rowIdx), hasError: !!errorMessage && (!required || (required && isEmpty(value))) }));
5407
+ default:
5408
+ const hasMoreThanOneRow = rowsLength > 1;
5409
+ const isLastRow = rowIdx === rowsLength - 1;
5410
+ const isFirstColumn = colIdx === 0;
5411
+ const shouldAutoFocus = hasMoreThanOneRow && isLastRow && isFirstColumn && isEmpty(value);
5412
+ return (React.createElement(Input, { title: limitFieldsPerRow ? title : undefined, tooltip: limitFieldsPerRow ? tooltip : undefined, placeholder: placeholder, type: type, required: required, autoFocus: shouldAutoFocus, value: value, onChange: ({ target: { value: val } }) => handleChange(keyName, val, rowIdx), style: { maxWidth, paddingLeft: 10 }, hasError: !!errorMessage && (!required || (required && isEmpty(value))) }));
5413
+ }
5414
+ };
5415
+ return (React.createElement("td", { key: `input-table-${rowIdx}-${keyName}`, style: { maxWidth, padding: '4px 6px 4px 0' } }, render()));
5416
+ };
5417
+
5394
5418
  const Container$b = styled.div `
5395
5419
  display: flex;
5396
5420
  flex-direction: column;
5397
5421
  width: 100%;
5398
5422
  `;
5399
5423
  const DeleteButton$1 = styled.button `
5424
+ margin-top: ${({ $marginTop }) => $marginTop};
5400
5425
  background: none;
5401
5426
  border: none;
5402
- cursor: pointer;
5403
5427
  cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
5404
5428
  opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
5405
5429
  `;
5406
- const InputTable = ({ columns, initialValues = [], value, onChange, errorMessage }) => {
5430
+ const InputTable = ({ columns, initialValues = [], value, onChange, errorMessage, limitFieldsPerRow }) => {
5407
5431
  // INITIAL_ROW as state, because it's dynamic to the "columns" prop
5408
5432
  const [initialRow, setInitialRow] = useState({});
5409
5433
  const [rows, setRows] = useState(value || initialValues);
5434
+ const columnMap = useMemo(() => new Map(columns.map((col) => [col.keyName, col])), [columns]);
5410
5435
  useEffect(() => {
5411
5436
  if (!rows.length) {
5412
5437
  const init = {};
@@ -5415,9 +5440,28 @@ const InputTable = ({ columns, initialValues = [], value, onChange, errorMessage
5415
5440
  setRows([{ ...init }]);
5416
5441
  }
5417
5442
  }, []);
5443
+ const isRowValid = (row) => {
5444
+ for (const [key, val] of Object.entries(row)) {
5445
+ const col = columnMap.get(key);
5446
+ if (col?.renderCondition && !col.renderCondition(row)) {
5447
+ // If the column has a render condition and it shouldn't render, skip/pass this column as valid
5448
+ continue;
5449
+ // Else, keep checking it below
5450
+ }
5451
+ if (col?.required && isEmpty(val)) {
5452
+ // If the column is required, and is empty, this row is invalid
5453
+ return false;
5454
+ }
5455
+ }
5456
+ return true;
5457
+ };
5418
5458
  // Filter out rows where either key or value is empty
5419
- const validRows = rows.filter((row) => !Object.values(row).filter((val) => isEmpty(val)).length);
5459
+ const validRows = rows.filter(isRowValid);
5420
5460
  const recordedRows = useRef(JSON.stringify(validRows));
5461
+ const isAddButtonDisabled = validRows.length !== rows.length;
5462
+ // adjust cell-width based on the amount of inputs on-screen,
5463
+ // the "0.4" is to consider the delete button
5464
+ const maxWidth = `${Math.floor(640 / ((limitFieldsPerRow || columns.length) + 0.4))}px`;
5421
5465
  useEffect(() => {
5422
5466
  const stringified = JSON.stringify(validRows);
5423
5467
  // Only trigger onChange if valid key-value pairs have changed
@@ -5435,7 +5479,12 @@ const InputTable = ({ columns, initialValues = [], value, onChange, errorMessage
5435
5479
  });
5436
5480
  };
5437
5481
  const handleDeleteRow = (idx) => {
5438
- setRows((prev) => prev.filter((_, i) => i !== idx));
5482
+ if (rows.length > 1) {
5483
+ setRows((prev) => prev.filter((_, i) => i !== idx));
5484
+ }
5485
+ else {
5486
+ columns.forEach(({ keyName, type }) => handleChange(keyName, type === InputTypes.Number ? '0' : '', idx));
5487
+ }
5439
5488
  };
5440
5489
  const handleChange = (key, val, idx) => {
5441
5490
  setRows((prev) => {
@@ -5444,36 +5493,35 @@ const InputTable = ({ columns, initialValues = [], value, onChange, errorMessage
5444
5493
  return payload;
5445
5494
  });
5446
5495
  };
5447
- // Check if any key or value field is empty
5448
- const isMinRows = rows.length <= 1;
5449
- const isAddButtonDisabled = rows.some((row) => !!Object.values(row).filter((val) => isEmpty(val)).length);
5450
- const isDelButtonDisabled = isMinRows && isAddButtonDisabled;
5451
- // adjust cell-width based on the amount of inputs on-screen,
5452
- // the "0.4" is to consider the delete button
5453
- const maxWidth = `${Math.floor(640 / (columns.length + 0.4))}px`;
5496
+ const matrixColumns = useMemo(() => {
5497
+ if (limitFieldsPerRow) {
5498
+ const matrix = [];
5499
+ for (let i = 0; true; i += limitFieldsPerRow) {
5500
+ const arr = columns.slice(i, i + limitFieldsPerRow);
5501
+ if (!arr.length)
5502
+ break;
5503
+ matrix.push(arr);
5504
+ }
5505
+ return matrix;
5506
+ }
5507
+ return [columns];
5508
+ }, [limitFieldsPerRow, columns]);
5454
5509
  return (React.createElement(Container$b, null,
5455
5510
  React.createElement("table", { style: { borderCollapse: 'collapse' } },
5456
- React.createElement("thead", null,
5511
+ !limitFieldsPerRow && (React.createElement("thead", null,
5457
5512
  React.createElement("tr", null,
5458
5513
  columns.map(({ title, tooltip, required }) => (React.createElement("th", { key: `input-table-head-${title}`, style: { maxWidth } },
5459
5514
  React.createElement(FieldLabel, { title: title, required: required, tooltip: tooltip })))),
5460
- React.createElement("th", null))),
5461
- React.createElement("tbody", null, rows.map((row, idx) => (React.createElement("tr", { key: `input-table-row-${idx}` },
5462
- columns.map(({ type, keyName, placeholder, required }, innerIdx) => {
5463
- const value = row[keyName];
5464
- return (React.createElement("td", { key: `input-table-${idx}-${keyName}`, style: { maxWidth, padding: '4px 6px 4px 0' } },
5465
- React.createElement(Input, { autoFocus: isEmpty(value) && !isMinRows && idx === rows.length - 1 && innerIdx === 0, type: type, placeholder: placeholder, value: value, onChange: ({ target: { value: val } }) => handleChange(keyName, type === 'number' ? Number(val) : val, idx), style: { maxWidth, paddingLeft: 10 }, hasError: !!errorMessage && (!required || (required && isEmpty(value))) })));
5466
- }),
5467
- React.createElement("td", null,
5468
- React.createElement(DeleteButton$1, { disabled: isDelButtonDisabled, onClick: () => {
5469
- if (isMinRows) {
5470
- columns.forEach(({ keyName }) => handleChange(keyName, '', idx));
5471
- }
5472
- else {
5473
- handleDeleteRow(idx);
5474
- }
5475
- } },
5476
- React.createElement(TrashIcon, null)))))))),
5515
+ React.createElement("th", null)))),
5516
+ React.createElement("tbody", null, rows.map((row, rowIdx) => (React.createElement(Fragment, { key: `input-table-row-${rowIdx}` },
5517
+ limitFieldsPerRow && rowIdx > 0 ? (React.createElement("tr", null,
5518
+ React.createElement("td", { colSpan: matrixColumns.length },
5519
+ React.createElement(Divider, null)))) : null,
5520
+ matrixColumns.map((cols, colIdx) => (React.createElement("tr", { key: `input-table-matrix-${rowIdx}-${colIdx}` },
5521
+ cols.map((obj, colIdx) => (React.createElement(ColumnsToFields, { key: `input-table-row-${rowIdx}-col-${colIdx}`, col: obj, colIdx: colIdx, row: row, rowIdx: rowIdx, rowsLength: rows.length, maxWidth: maxWidth, limitFieldsPerRow: limitFieldsPerRow, errorMessage: errorMessage, handleChange: handleChange }))),
5522
+ colIdx === 0 && (React.createElement("td", null,
5523
+ React.createElement(DeleteButton$1, { "$marginTop": limitFieldsPerRow ? '24px' : '0', onClick: () => handleDeleteRow(rowIdx) },
5524
+ React.createElement(TrashIcon, null)))))))))))),
5477
5525
  !!errorMessage && React.createElement(FieldError, null, errorMessage),
5478
5526
  React.createElement(AddButton, { onClick: handleAddRow, disabled: isAddButtonDisabled })));
5479
5527
  };
@@ -1,11 +1,10 @@
1
1
  import { StatusType, OtherStatus, DestinationTypes, EntityTypes, PlatformType } from './types.js';
2
- import { K as K8sLogo } from './index-CVH8Q8Sl.js';
3
- import { D as DEFAULT_DATA_STREAM_NAME } from './index-mOgS3e5E.js';
4
- import { a as getProgrammingLanguageIcon } from './index-B_Gl6Qa6.js';
2
+ import { D as DEFAULT_DATA_STREAM_NAME, K as K8sLogo } from './index-CKOBXat_.js';
3
+ import { a as getProgrammingLanguageIcon } from './index-CCX1HLUr.js';
5
4
  import 'react';
6
5
  import 'styled-components';
7
- import { e as AwsXrayLogo, a2 as VictoriaMetricsLogo, a1 as UptraceLogo, a0 as TraceloopLogo, $ as TingyunLogo, _ as TempoLogo, Z as TelemetryHubLogo, Y as SumoLogicLogo, X as SplunkLogo, W as SignozLogo, U as SeqLogo, d as AwsS3Logo, T as QuickwitLogo, G as GigapipeLogo, S as QrynLogo, R as PrometheusLogo, F as OpenTelemetryLogo, Q as OracleLogo, P as OpsVerseLogo, z as OpenObserveLogo, y as OneUptimeLogo, O as ObserveLogo, N as NewRelicLogo, M as MiddlewareLogo, x as LumigoLogo, w as LokiLogo, v as LogzioLogo, u as LightstepLogo, L as Last9Logo, K as KloudmateLogo, J as JaegerLogo, I as InstanaLogo, t as HyperDxLogo, H as HoneycombLogo, s as GroundcoverLogo, r as GreptimeLogo, q as GrafanaLogo, p as GoogleCloudPlatformLogo, o as ElasticSearchLogo, E as ElasticApmLogo, n as DynatraceLogo, m as DatadogLogo, D as Dash0Logo, l as CoralogixLogo, c as AwsCloudwatchLogo, k as ClickhouseLogo, j as ChronosphereLogo, i as ChecklyLogo, C as CauselyLogo, h as BonreeLogo, B as BetterStackLogo, g as BlobStorageLogo, f as AxiomLogo, b as AppDynamicsLogo, a as AlibabaCloudLogo, A as AlaudaLogo, a6 as RulesIcon, a3 as ActionsIcon, a4 as DestinationsIcon, a7 as SourcesIcon, a5 as NamespacesIcon, V as VmLogo } from './index-1N9wymEq.js';
8
- import { K as KafkaLogo, O as OdigosLogo } from './index-Do3CYz7N.js';
6
+ import { e as AwsXrayLogo, a2 as VictoriaMetricsLogo, a1 as UptraceLogo, a0 as TraceloopLogo, $ as TingyunLogo, _ as TempoLogo, Z as TelemetryHubLogo, Y as SumoLogicLogo, X as SplunkLogo, W as SignozLogo, U as SeqLogo, d as AwsS3Logo, T as QuickwitLogo, G as GigapipeLogo, S as QrynLogo, R as PrometheusLogo, F as OpenTelemetryLogo, Q as OracleLogo, P as OpsVerseLogo, z as OpenObserveLogo, y as OneUptimeLogo, O as ObserveLogo, N as NewRelicLogo, M as MiddlewareLogo, x as LumigoLogo, w as LokiLogo, v as LogzioLogo, u as LightstepLogo, L as Last9Logo, K as KloudmateLogo, J as JaegerLogo, I as InstanaLogo, t as HyperDxLogo, H as HoneycombLogo, s as GroundcoverLogo, r as GreptimeLogo, q as GrafanaLogo, p as GoogleCloudPlatformLogo, o as ElasticSearchLogo, E as ElasticApmLogo, n as DynatraceLogo, m as DatadogLogo, D as Dash0Logo, l as CoralogixLogo, c as AwsCloudwatchLogo, k as ClickhouseLogo, j as ChronosphereLogo, i as ChecklyLogo, C as CauselyLogo, h as BonreeLogo, B as BetterStackLogo, g as BlobStorageLogo, f as AxiomLogo, b as AppDynamicsLogo, a as AlibabaCloudLogo, A as AlaudaLogo, a6 as RulesIcon, a3 as ActionsIcon, a4 as DestinationsIcon, a7 as SourcesIcon, a5 as NamespacesIcon, V as VmLogo } from './index-9R2N835W.js';
7
+ import { K as KafkaLogo, O as OdigosLogo } from './index-BVj4fOL3.js';
9
8
  import { s as safeJsonParse } from './index-BV85P9UP.js';
10
9
 
11
10
  const compareCondition = (renderCondition, fields) => {
@@ -328,12 +327,6 @@ const mapDestinationFieldsForDisplay = (destination, yamlFields) => {
328
327
  .filter((item) => item.value !== null);
329
328
  };
330
329
 
331
- const mapExportedSignals = (exportedSignals) => {
332
- if (!exportedSignals)
333
- return [];
334
- return Object.keys(exportedSignals).filter((signal) => exportedSignals[signal]);
335
- };
336
-
337
330
  const sleep = async (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
338
331
 
339
- export { filterDestinations as a, filterDestinationsByStream as b, compareCondition as c, deepClone as d, filterSources as e, filterActions as f, filterSourcesByStream as g, formatBytes as h, getConditionsBooleans as i, getContainersInstrumentedCount as j, getContainersIcons as k, getDestinationIcon as l, getEntityIcon as m, getEntityLabel as n, getMetricForEntity as o, getPlatformIcon as p, getPlatformLabel as q, getValueForRange as r, getWorkloadId as s, getYamlFieldsForDestination as t, isOverTime as u, mapDestinationFieldsForDisplay as v, mapExportedSignals as w, sleep as x };
332
+ export { filterDestinations as a, filterDestinationsByStream as b, compareCondition as c, deepClone as d, filterSources as e, filterActions as f, filterSourcesByStream as g, formatBytes as h, getConditionsBooleans as i, getContainersInstrumentedCount as j, getContainersIcons as k, getDestinationIcon as l, getEntityIcon as m, getEntityLabel as n, getMetricForEntity as o, getPlatformIcon as p, getPlatformLabel as q, getValueForRange as r, getWorkloadId as s, getYamlFieldsForDestination as t, isOverTime as u, mapDestinationFieldsForDisplay as v, sleep as w };
@@ -1,4 +1,6 @@
1
1
  import { K8sResourceKind, ProgrammingLanguages, type Source } from '@/types';
2
+ export declare const MOCK_SOURCES_SIMPLE_DEMO: Source[];
3
+ export declare const MOCK_SOURCES_GOOGLE: Source[];
2
4
  export declare const MOCK_SOURCES: Source[];
3
5
  export declare const MOCK_SOURCE_JAEGER: {
4
6
  namespace: string;
package/lib/snippets.js CHANGED
@@ -1,14 +1,13 @@
1
- export { A as AddButton } from './index-BedCNcwV.js';
2
- export { E as EditButton, N as NoteBackToSummary } from './index-BjVl4-os.js';
1
+ export { A as AddButton } from './index-THrvNIPj.js';
2
+ export { E as EditButton, N as NoteBackToSummary } from './index-DmCjUtBQ.js';
3
3
  import 'react';
4
- import './index-CVH8Q8Sl.js';
4
+ import './index-CKOBXat_.js';
5
5
  import './types.js';
6
6
  import 'styled-components';
7
- import './index-CNfdJ1X8.js';
7
+ import './index-CEWs8CTN.js';
8
+ import './index-CCX1HLUr.js';
9
+ import './index-BVj4fOL3.js';
8
10
  import './index-BV85P9UP.js';
9
- import './index-mOgS3e5E.js';
10
- import './index-B_Gl6Qa6.js';
11
- import './index-Do3CYz7N.js';
12
- import './useTransition-B0eagOib.js';
11
+ import './useTransition-D9f1CP9n.js';
13
12
  import 'react-dom';
14
- import './index-BQQZyvRz.js';
13
+ import './index-DqaI44fJ.js';
package/lib/store.js CHANGED
@@ -1,4 +1,4 @@
1
- export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-CVH8Q8Sl.js';
1
+ export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-CKOBXat_.js';
2
2
  import 'react';
3
3
  import './types.js';
4
4
  import 'styled-components';
package/lib/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- export { T as default } from './index-CVH8Q8Sl.js';
1
+ export { T as default } from './index-CKOBXat_.js';
2
2
  import 'styled-components';
3
3
  import 'react';
4
4
  import './types.js';
@@ -1,14 +1,37 @@
1
1
  import { SignalType } from '../signals';
2
2
  import type { Condition, SVG } from '../common';
3
+ export declare enum ActionCategory {
4
+ Attributes = "attributes",
5
+ Samplers = "samplers"
6
+ }
3
7
  export declare enum ActionType {
4
8
  K8sAttributes = "K8sAttributesResolver",
5
9
  AddClusterInfo = "AddClusterInfo",
6
10
  DeleteAttributes = "DeleteAttribute",
7
11
  RenameAttributes = "RenameAttribute",
12
+ PiiMasking = "PiiMasking",
8
13
  ErrorSampler = "ErrorSampler",
9
14
  ProbabilisticSampler = "ProbabilisticSampler",
10
15
  LatencySampler = "LatencySampler",
11
- PiiMasking = "PiiMasking"
16
+ ServiceNameSampler = "ServiceNameSampler",
17
+ SpanAttributeSampler = "SpanAttributeSampler"
18
+ }
19
+ export declare enum ActionKeyTypes {
20
+ CollectContainerAttributes = "collectContainerAttributes",
21
+ CollectReplicaSetAttributes = "collectReplicaSetAttributes",
22
+ CollectWorkloadId = "collectWorkloadId",
23
+ CollectClusterId = "collectClusterId",
24
+ LabelsAttributes = "labelsAttributes",
25
+ AnnotationsAttributes = "annotationsAttributes",
26
+ ClusterAttributes = "clusterAttributes",
27
+ AttributeNamesToDelete = "attributeNamesToDelete",
28
+ Renames = "renames",
29
+ PiiCategories = "piiCategories",
30
+ FallbackSamplingRatio = "fallbackSamplingRatio",
31
+ SamplingPercentage = "samplingPercentage",
32
+ EndpointsFilters = "endpointsFilters",
33
+ ServicesNameFilters = "servicesNameFilters",
34
+ AttributeFilters = "attributeFilters"
12
35
  }
13
36
  export interface Action {
14
37
  id: string;
@@ -19,35 +42,23 @@ export interface Action {
19
42
  notes?: string;
20
43
  signals: SignalType[];
21
44
  disabled?: boolean;
22
- collectContainerAttributes?: boolean | null;
23
- collectReplicaSetAttributes?: boolean | null;
24
- collectWorkloadId?: boolean | null;
25
- collectClusterId?: boolean | null;
26
- labelsAttributes?: {
27
- labelKey: string;
28
- attributeKey: string;
29
- }[] | null;
30
- annotationsAttributes?: {
31
- annotationKey: string;
32
- attributeKey: string;
33
- }[] | null;
34
- clusterAttributes?: {
35
- attributeName: string;
36
- attributeStringValue: string;
37
- }[] | null;
38
- attributeNamesToDelete?: string[] | null;
39
- renames?: {
45
+ [ActionKeyTypes.CollectContainerAttributes]?: boolean | null;
46
+ [ActionKeyTypes.CollectReplicaSetAttributes]?: boolean | null;
47
+ [ActionKeyTypes.CollectWorkloadId]?: boolean | null;
48
+ [ActionKeyTypes.CollectClusterId]?: boolean | null;
49
+ [ActionKeyTypes.LabelsAttributes]?: LabelsAttributes[] | null;
50
+ [ActionKeyTypes.AnnotationsAttributes]?: AnnotationsAttributes[] | null;
51
+ [ActionKeyTypes.ClusterAttributes]?: ClusterAttributes[] | null;
52
+ [ActionKeyTypes.AttributeNamesToDelete]?: string[] | null;
53
+ [ActionKeyTypes.Renames]?: {
40
54
  [oldKey: string]: string;
41
55
  } | null;
42
- piiCategories?: string[] | null;
43
- fallbackSamplingRatio?: number | null;
44
- samplingPercentage?: number | null;
45
- endpointsFilters?: {
46
- serviceName: string;
47
- httpRoute: string;
48
- minimumLatencyThreshold: number;
49
- fallbackSamplingRatio: number;
50
- }[] | null;
56
+ [ActionKeyTypes.PiiCategories]?: string[] | null;
57
+ [ActionKeyTypes.FallbackSamplingRatio]?: number | null;
58
+ [ActionKeyTypes.SamplingPercentage]?: number | null;
59
+ [ActionKeyTypes.EndpointsFilters]?: EndpointsFilters[] | null;
60
+ [ActionKeyTypes.ServicesNameFilters]?: ServicesNameFilters[] | null;
61
+ [ActionKeyTypes.AttributeFilters]?: AttributeFilters[] | null;
51
62
  };
52
63
  }
53
64
  export interface ActionOption {
@@ -66,17 +77,102 @@ export interface ActionFormData {
66
77
  notes: Action['spec']['notes'];
67
78
  signals: Action['spec']['signals'];
68
79
  disabled: Action['spec']['disabled'];
69
- collectContainerAttributes: Action['spec']['collectContainerAttributes'];
70
- collectReplicaSetAttributes: Action['spec']['collectReplicaSetAttributes'];
71
- collectWorkloadId: Action['spec']['collectWorkloadId'];
72
- collectClusterId: Action['spec']['collectClusterId'];
73
- labelsAttributes: Action['spec']['labelsAttributes'];
74
- annotationsAttributes: Action['spec']['annotationsAttributes'];
75
- clusterAttributes: Action['spec']['clusterAttributes'];
76
- attributeNamesToDelete: Action['spec']['attributeNamesToDelete'];
77
- renames: Action['spec']['renames'];
78
- piiCategories: Action['spec']['piiCategories'];
79
- fallbackSamplingRatio: Action['spec']['fallbackSamplingRatio'];
80
- samplingPercentage: Action['spec']['samplingPercentage'];
81
- endpointsFilters: Action['spec']['endpointsFilters'];
80
+ [ActionKeyTypes.CollectContainerAttributes]: Action['spec'][ActionKeyTypes.CollectContainerAttributes];
81
+ [ActionKeyTypes.CollectReplicaSetAttributes]: Action['spec'][ActionKeyTypes.CollectReplicaSetAttributes];
82
+ [ActionKeyTypes.CollectWorkloadId]: Action['spec'][ActionKeyTypes.CollectWorkloadId];
83
+ [ActionKeyTypes.CollectClusterId]: Action['spec'][ActionKeyTypes.CollectClusterId];
84
+ [ActionKeyTypes.LabelsAttributes]: Action['spec'][ActionKeyTypes.LabelsAttributes];
85
+ [ActionKeyTypes.AnnotationsAttributes]: Action['spec'][ActionKeyTypes.AnnotationsAttributes];
86
+ [ActionKeyTypes.ClusterAttributes]: Action['spec'][ActionKeyTypes.ClusterAttributes];
87
+ [ActionKeyTypes.AttributeNamesToDelete]: Action['spec'][ActionKeyTypes.AttributeNamesToDelete];
88
+ [ActionKeyTypes.Renames]: Action['spec'][ActionKeyTypes.Renames];
89
+ [ActionKeyTypes.PiiCategories]: Action['spec'][ActionKeyTypes.PiiCategories];
90
+ [ActionKeyTypes.FallbackSamplingRatio]: Action['spec'][ActionKeyTypes.FallbackSamplingRatio];
91
+ [ActionKeyTypes.SamplingPercentage]: Action['spec'][ActionKeyTypes.SamplingPercentage];
92
+ [ActionKeyTypes.EndpointsFilters]: Action['spec'][ActionKeyTypes.EndpointsFilters];
93
+ [ActionKeyTypes.ServicesNameFilters]: Action['spec'][ActionKeyTypes.ServicesNameFilters];
94
+ [ActionKeyTypes.AttributeFilters]: Action['spec'][ActionKeyTypes.AttributeFilters];
95
+ }
96
+ export interface LabelsAttributes {
97
+ labelKey: string;
98
+ attributeKey: string;
99
+ }
100
+ export interface AnnotationsAttributes {
101
+ annotationKey: string;
102
+ attributeKey: string;
103
+ }
104
+ export interface ClusterAttributes {
105
+ attributeName: string;
106
+ attributeStringValue: string;
107
+ }
108
+ export interface EndpointsFilters {
109
+ serviceName: string;
110
+ httpRoute: string;
111
+ minimumLatencyThreshold: number;
112
+ fallbackSamplingRatio: number;
113
+ }
114
+ export interface ServicesNameFilters {
115
+ serviceName: string;
116
+ samplingRatio: number;
117
+ fallbackSamplingRatio: number;
118
+ }
119
+ export declare enum StringOperation {
120
+ EXISTS = "exists",
121
+ EQUALS = "equals",
122
+ NOT_EQUALS = "not_equals",
123
+ CONTAINS = "contains",
124
+ NOT_CONTAINS = "not_contains",
125
+ REGEX = "regex"
126
+ }
127
+ export declare enum NumberOperation {
128
+ EXISTS = "exists",
129
+ EQUALS = "equals",
130
+ NOT_EQUALS = "not_equals",
131
+ GREATER_THAN = "greater_than",
132
+ LESS_THAN = "less_than",
133
+ GREATER_THAN_OR_EQUAL = "greater_than_or_equal",
134
+ LESS_THAN_OR_EQUAL = "less_than_or_equal"
135
+ }
136
+ export declare enum BooleanOperation {
137
+ EXISTS = "exists",
138
+ EQUALS = "equals"
139
+ }
140
+ export declare enum JsonOperation {
141
+ EXISTS = "exists",
142
+ EQUALS = "equals",
143
+ NOT_EQUALS = "not_equals",
144
+ IS_VALID_JSON = "is_valid_json",
145
+ IS_INVALID_JSON = "is_invalid_json",
146
+ JSONPATH_EXISTS = "jsonpath_exists",
147
+ KEY_EQUALS = "key_equals",
148
+ KEY_NOT_EQUALS = "key_not_equals"
149
+ }
150
+ export interface StringCondition {
151
+ operation: StringOperation;
152
+ expectedValue?: string;
153
+ }
154
+ export interface NumberCondition {
155
+ operation: NumberOperation;
156
+ expectedValue?: string | number;
157
+ }
158
+ export interface BooleanCondition {
159
+ operation: BooleanOperation;
160
+ expectedValue?: string | boolean;
161
+ }
162
+ export interface JsonCondition {
163
+ operation: JsonOperation;
164
+ expectedValue?: string;
165
+ jsonPath?: string;
166
+ }
167
+ export interface AttributeFiltersCondition {
168
+ stringCondition?: StringCondition;
169
+ numberCondition?: NumberCondition;
170
+ booleanCondition?: BooleanCondition;
171
+ jsonCondition?: JsonCondition;
172
+ }
173
+ export interface AttributeFilters {
174
+ serviceName: string;
175
+ attributeKey: string;
176
+ fallbackSamplingRatio: number;
177
+ condition: AttributeFiltersCondition;
82
178
  }