@wallarm-org/design-system 4.10.0-rc-feat-parser.1 → 4.10.1

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 (150) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Badge/generateBadgeVariants.js +9 -28
  3. package/dist/components/Checkbox/CheckboxGroup.d.ts +2 -1
  4. package/dist/components/Checkbox/CheckboxGroup.js +16 -13
  5. package/dist/components/CodeSnippet/internal/FoldToggle.js +1 -1
  6. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
  7. package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
  8. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  9. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  10. package/dist/components/Radio/RadioGroup.d.ts +2 -1
  11. package/dist/components/Radio/RadioGroup.js +16 -13
  12. package/dist/components/SimpleCharts/Chart/classes.js +1 -1
  13. package/dist/components/SimpleCharts/HorizontalBarStack/classes.js +1 -1
  14. package/dist/components/SimpleCharts/Metric/classes.d.ts +2 -2
  15. package/dist/components/SimpleCharts/Metric/classes.js +2 -2
  16. package/dist/components/Table/TableBody/TableBodyCell.js +4 -1
  17. package/dist/guidelines/patterns/complex-drawer.md +1084 -0
  18. package/dist/guidelines/patterns/confirmation-dialogs.md +3 -11
  19. package/dist/guidelines/patterns/detail-drawer.md +31 -13
  20. package/dist/guidelines/patterns/empty-states.md +6 -5
  21. package/dist/guidelines/patterns/entity-table.md +25 -29
  22. package/dist/guidelines/patterns/feedback-toasts.md +3 -11
  23. package/dist/guidelines/patterns/resource-list-page.md +14 -16
  24. package/dist/guidelines/rules.md +6 -5
  25. package/dist/guidelines/templates/ai-assistant.md +1133 -0
  26. package/dist/guidelines/templates/api-inventory.md +905 -0
  27. package/dist/guidelines/templates/attack-events.md +2722 -0
  28. package/dist/guidelines/templates/incident-detail.md +2085 -0
  29. package/dist/guidelines/templates/integrations-settings.md +836 -0
  30. package/dist/guidelines/templates/page-states.md +798 -0
  31. package/dist/guidelines/templates/rule-editor.md +886 -0
  32. package/dist/guidelines/templates/security-dashboard.md +681 -0
  33. package/dist/index.d.ts +0 -2
  34. package/dist/index.js +0 -2
  35. package/dist/metadata/components.json +20 -108
  36. package/dist/metadata/guidelines.json +1204 -37
  37. package/dist/theme/tokens.test.ts +52 -0
  38. package/package.json +1 -4
  39. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
  40. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
  41. package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
  42. package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
  43. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
  44. package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
  45. package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
  46. package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
  47. package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
  48. package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
  49. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
  50. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
  51. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
  52. package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
  53. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
  54. package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
  55. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
  56. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
  57. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
  58. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
  59. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
  60. package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
  61. package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
  62. package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
  63. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
  64. package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
  65. package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
  66. package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
  67. package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
  68. package/dist/components/Rules/PointSelector/classes.js +0 -22
  69. package/dist/components/Rules/PointSelector/index.d.ts +0 -20
  70. package/dist/components/Rules/PointSelector/index.js +0 -18
  71. package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
  72. package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
  73. package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
  74. package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
  75. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
  76. package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
  77. package/dist/components/Rules/PointSelector/types.d.ts +0 -304
  78. package/dist/components/Rules/PointSelector/types.js +0 -0
  79. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
  80. package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
  81. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
  82. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
  83. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
  84. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
  85. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
  86. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
  87. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
  88. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
  89. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
  90. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
  91. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
  92. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
  93. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
  94. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
  95. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
  96. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
  97. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
  98. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
  99. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
  100. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
  101. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
  102. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
  103. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
  104. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
  105. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
  106. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
  107. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
  108. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
  109. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
  110. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
  111. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
  112. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
  113. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
  114. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
  115. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
  116. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
  117. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
  118. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
  119. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
  120. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
  121. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
  122. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
  123. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
  124. package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
  125. package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
  126. package/dist/components/Rules/RuleBuilder/classes.js +0 -18
  127. package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
  128. package/dist/components/Rules/RuleBuilder/index.js +0 -11
  129. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
  130. package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
  131. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
  132. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
  133. package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
  134. package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
  135. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
  136. package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
  137. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
  138. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
  139. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
  140. package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
  141. package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
  142. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  143. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
  144. package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
  145. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
  146. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
  147. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
  148. package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
  149. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
  150. package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
@@ -1,276 +0,0 @@
1
- import { pointOf } from "../../PointSelector/sdkBridge.js";
2
- import { DEFAULT_SEPARATOR, TARGET_REQUIREMENT } from "../utils/constants.js";
3
- const WHOLE_REQUEST = {
4
- whole: true,
5
- context: 'http_request',
6
- segments: []
7
- };
8
- function newAction(kind = 'add_attack') {
9
- const targetType = TARGET_REQUIREMENT[kind];
10
- const needsPoint = 'point' === targetType;
11
- return {
12
- kind,
13
- attackType: '',
14
- comment: '',
15
- experimental: false,
16
- tagKey: '',
17
- tagValue: '',
18
- separator: DEFAULT_SEPARATOR,
19
- limit: '',
20
- softLimit: '',
21
- hardLimit: '',
22
- priority: '',
23
- parsers: [],
24
- parser: '',
25
- ruleIds: [],
26
- target: needsPoint ? {
27
- ...WHOLE_REQUEST,
28
- whole: false
29
- } : WHOLE_REQUEST
30
- };
31
- }
32
- function targetToProton(target, proton) {
33
- let point;
34
- point = target.whole ? 'flow' : target.canonical ? target.canonical : pointOf(target.segments, proton);
35
- return [
36
- {
37
- context: target.context,
38
- point
39
- }
40
- ];
41
- }
42
- function priorityOf(draft) {
43
- const trimmed = draft.priority?.trim() ?? '';
44
- if ('' !== trimmed && Number.isInteger(Number(trimmed))) return {
45
- priority: Number(trimmed)
46
- };
47
- return {};
48
- }
49
- function bindingFields(draft) {
50
- const result = {};
51
- if (draft.attackRef) result.attack_ref = draft.attackRef;
52
- if (draft.targetRef) result.target_ref = draft.targetRef;
53
- if (draft.targetRole) result.target_role = draft.targetRole;
54
- return result;
55
- }
56
- function toProtonAction(draft, proton) {
57
- const target = targetToProton(draft.target, proton);
58
- switch(draft.kind){
59
- case 'raw':
60
- return draft.raw ?? {};
61
- case 'add_attack':
62
- {
63
- const action = {
64
- action_type: 'add_attack',
65
- target,
66
- attack: {
67
- attack_type: draft.attackType ?? ''
68
- },
69
- ...bindingFields(draft)
70
- };
71
- if (draft.comment?.trim()) action.attack.comment = draft.comment.trim();
72
- if (draft.known) action.attack.known = draft.known;
73
- if (draft.knownFalse) action.attack.known_false = draft.knownFalse;
74
- if (draft.experimental) action.experimental = true;
75
- return action;
76
- }
77
- case 'add_tag':
78
- {
79
- const action = {
80
- action_type: 'add_tag',
81
- target,
82
- tag: {
83
- key: draft.tagKey ?? '',
84
- value: draft.tagValue ?? ''
85
- },
86
- ...bindingFields(draft)
87
- };
88
- if (draft.experimental) action.experimental = true;
89
- return action;
90
- }
91
- case 'suppress_attack':
92
- {
93
- const action = {
94
- action_type: 'suppress_attack',
95
- target,
96
- ...bindingFields(draft)
97
- };
98
- if (draft.attackType?.trim()) action.attack = {
99
- attack_type: draft.attackType.trim()
100
- };
101
- return action;
102
- }
103
- case 'mark_attack':
104
- {
105
- const action = {
106
- action_type: 'mark_attack',
107
- target,
108
- ...bindingFields(draft)
109
- };
110
- if (void 0 !== draft.experimental) action.experimental = draft.experimental;
111
- if (draft.attackType?.trim() || draft.known || draft.knownFalse) {
112
- action.attack = {};
113
- if (draft.attackType?.trim()) action.attack.attack_type = draft.attackType.trim();
114
- if (draft.known) action.attack.known = draft.known;
115
- if (draft.knownFalse) action.attack.known_false = draft.knownFalse;
116
- }
117
- return action;
118
- }
119
- case 'combine':
120
- return {
121
- action_type: 'combine',
122
- target,
123
- separator: draft.separator ?? DEFAULT_SEPARATOR,
124
- ...bindingFields(draft)
125
- };
126
- case 'processing_time_limit':
127
- return {
128
- action_type: 'processing_time_limit',
129
- target: targetToProton(WHOLE_REQUEST, proton),
130
- limit: draft.limit?.trim() ?? '',
131
- ...priorityOf(draft)
132
- };
133
- case 'processing_space_limit':
134
- return {
135
- action_type: 'processing_space_limit',
136
- target: targetToProton(WHOLE_REQUEST, proton),
137
- limit: draft.limit?.trim() ?? '',
138
- ...priorityOf(draft)
139
- };
140
- case 'entry_limits':
141
- {
142
- const action = {
143
- action_type: 'entry_limits',
144
- target,
145
- ...priorityOf(draft),
146
- ...bindingFields(draft)
147
- };
148
- if (draft.softLimit?.trim()) action.entry_size_soft_limit = draft.softLimit.trim();
149
- if (draft.hardLimit?.trim()) action.entry_size_hard_limit = draft.hardLimit.trim();
150
- return action;
151
- }
152
- case 'disable_parsers':
153
- return {
154
- action_type: 'disable_parsers',
155
- target,
156
- parsers: draft.parsers ?? [],
157
- ...priorityOf(draft),
158
- ...bindingFields(draft)
159
- };
160
- case 'allow_parsers':
161
- return {
162
- action_type: 'allow_parsers',
163
- target,
164
- parsers: draft.parsers ?? [],
165
- ...priorityOf(draft),
166
- ...bindingFields(draft)
167
- };
168
- case 'force_parser':
169
- return {
170
- action_type: 'force_parser',
171
- target,
172
- parser: draft.parser ?? '',
173
- ...priorityOf(draft),
174
- ...bindingFields(draft)
175
- };
176
- case 'disable_rule':
177
- return {
178
- action_type: 'disable_rule',
179
- rule_ids: draft.ruleIds ?? []
180
- };
181
- default:
182
- return {
183
- action_type: 'unknown',
184
- target
185
- };
186
- }
187
- }
188
- function segmentsOfPoint(point, context, proton) {
189
- if (!point) return [];
190
- if (!proton) return [];
191
- try {
192
- const result = proton.point.parse(point);
193
- return result;
194
- } catch (error) {
195
- console.warn('Failed to parse canonical point string with SDK', {
196
- point,
197
- error: error instanceof Error ? error.message : String(error)
198
- });
199
- return [];
200
- }
201
- }
202
- function parseTarget(target, proton) {
203
- const context = target?.context ?? 'http_request';
204
- const point = target?.point ?? 'flow';
205
- if ('flow' === point) return WHOLE_REQUEST;
206
- const segments = segmentsOfPoint(point, context, proton);
207
- const currentVersion = proton ? proton.version().canonical : void 0;
208
- return {
209
- whole: false,
210
- context,
211
- segments,
212
- canonical: point,
213
- canonicalVersion: currentVersion
214
- };
215
- }
216
- const KNOWN_KINDS = [
217
- 'add_attack',
218
- 'add_tag',
219
- 'suppress_attack',
220
- 'mark_attack',
221
- 'combine',
222
- 'processing_time_limit',
223
- 'processing_space_limit',
224
- 'entry_limits',
225
- 'disable_parsers',
226
- 'allow_parsers',
227
- 'force_parser',
228
- 'disable_rule'
229
- ];
230
- function fromProtonAction(action, proton = null) {
231
- const obj = Array.isArray(action) ? action[0] : action;
232
- const raw = ()=>({
233
- ...newAction(),
234
- kind: 'raw',
235
- raw: obj ?? {}
236
- });
237
- if (!obj || 'object' != typeof obj) return raw();
238
- const kind = obj.action_type;
239
- if (!kind || !KNOWN_KINDS.includes(kind)) return raw();
240
- if ('disable_rule' === kind) {
241
- const ruleIds = Array.isArray(obj.rule_ids) ? obj.rule_ids : [];
242
- return {
243
- ...newAction(kind),
244
- ruleIds: ruleIds.map((id)=>String(id))
245
- };
246
- }
247
- if (!Array.isArray(obj.target) || 1 !== obj.target.length) return raw();
248
- const target = parseTarget(obj.target[0], proton);
249
- const attack = obj.attack ?? {};
250
- const tag = obj.tag ?? {};
251
- const draft = {
252
- ...newAction(kind),
253
- attackType: 'string' == typeof attack.attack_type ? attack.attack_type : '',
254
- comment: 'string' == typeof attack.comment ? attack.comment : '',
255
- experimental: true === obj.experimental,
256
- tagKey: tag.key ?? '',
257
- tagValue: tag.value ?? '',
258
- separator: 'string' == typeof obj.separator ? obj.separator : DEFAULT_SEPARATOR,
259
- limit: 'string' == typeof obj.limit ? obj.limit : '',
260
- softLimit: 'string' == typeof obj.entry_size_soft_limit ? obj.entry_size_soft_limit : '',
261
- hardLimit: 'string' == typeof obj.entry_size_hard_limit ? obj.entry_size_hard_limit : '',
262
- priority: 'number' == typeof obj.priority ? String(obj.priority) : '',
263
- target
264
- };
265
- if (attack.known && 'object' == typeof attack.known) draft.known = attack.known;
266
- if (void 0 !== attack.known_false) draft.knownFalse = attack.known_false;
267
- if ('string' == typeof obj.attack_ref) draft.attackRef = obj.attack_ref;
268
- if ('string' == typeof obj.target_ref) draft.targetRef = obj.target_ref;
269
- if ('string' == typeof obj.target_role) draft.targetRole = obj.target_role;
270
- if ('disable_parsers' === kind || 'allow_parsers' === kind) if ('string' == typeof obj.parsers) draft.parsers = obj.parsers;
271
- else if (Array.isArray(obj.parsers)) draft.parsers = obj.parsers.map((p)=>String(p));
272
- else draft.parsers = [];
273
- if ('force_parser' === kind) draft.parser = 'string' == typeof obj.parser ? obj.parser : '';
274
- return draft;
275
- }
276
- export { fromProtonAction, newAction, toProtonAction };
@@ -1,95 +0,0 @@
1
- /**
2
- * Condition Model
3
- *
4
- * Converts between UI tree structure and Proton API format.
5
- * Handles condition tree transformations, factory functions, and validation.
6
- */
7
- import type { Proton } from '@wallarm-org/rules-lib';
8
- import type { PointSelectorValue, RuleContext } from '../../PointSelector/types.js';
9
- import type { AttackCondition, FieldCondition, GroupCondition, GroupOperator, ProtonCondition, SampleCondition, SignalCondition, SignalType, TagCondition } from '../types.js';
10
- /**
11
- * Generate a unique ID for a condition node.
12
- *
13
- * @returns Unique node ID
14
- */
15
- export declare function nodeId(): string;
16
- /**
17
- * Empty PointSelector value for new field conditions.
18
- */
19
- export declare const EMPTY_FIELD_VALUE: PointSelectorValue;
20
- /**
21
- * Create a new field condition with default values.
22
- *
23
- * @param context - Rule context (default: 'http_request')
24
- * @returns New FieldCondition
25
- */
26
- export declare function newField(context?: RuleContext): FieldCondition;
27
- /**
28
- * Create a new attack condition with default values.
29
- *
30
- * @param attackType - Attack type (default: '')
31
- * @param point - Point where attack is detected (default: 'flow')
32
- * @returns New AttackCondition
33
- */
34
- export declare function newAttack(attackType?: string, point?: string): AttackCondition;
35
- /**
36
- * Create a new signal condition with default values.
37
- *
38
- * @param signalType - Signal type (default: '')
39
- * @param point - Point where signal is detected (default: '[http:header]')
40
- * @returns New SignalCondition
41
- */
42
- export declare function newSignal(signalType?: SignalType | '', point?: string): SignalCondition;
43
- /**
44
- * Create a new tag condition with default values.
45
- *
46
- * @param tagKey - Tag key (default: '')
47
- * @param tagValue - Tag value (default: '')
48
- * @param point - Point where tag is checked (default: 'flow')
49
- * @returns New TagCondition
50
- */
51
- export declare function newTag(tagKey?: string, tagValue?: string, point?: string): TagCondition;
52
- /**
53
- * Create a new sample condition with default values.
54
- *
55
- * @param percent - Percentage of flows to sample (default: 10)
56
- * @returns New SampleCondition
57
- */
58
- export declare function newSample(percent?: number): SampleCondition;
59
- /**
60
- * Create a new group condition with default values.
61
- *
62
- * @param operator - Group operator (default: 'and')
63
- * @returns New GroupCondition with one empty field
64
- */
65
- export declare function newGroup(operator?: GroupOperator): GroupCondition;
66
- /**
67
- * Check if a field condition is complete enough to serialize.
68
- *
69
- * @param condition - Field condition to check
70
- * @returns True if condition has segments, a condition type, and value if required
71
- */
72
- export declare function fieldComplete(condition: FieldCondition): boolean;
73
- /**
74
- * Convert UI condition tree to Proton API format.
75
- *
76
- * @param root - Root group condition
77
- * @param proton - Optional Proton SDK instance for canonical point rendering
78
- * @returns Proton condition or null if empty/incomplete
79
- */
80
- export declare function toProtonCondition(root: GroupCondition, proton?: Proton | null): ProtonCondition | null;
81
- /**
82
- * Convert Proton API format to UI condition tree.
83
- *
84
- * @param condition - Proton condition (null/undefined = empty tree)
85
- * @param proton - SDK instance for parsing point strings (optional)
86
- * @returns Group condition (always returns a group, even if empty)
87
- */
88
- export declare function fromProtonCondition(condition: unknown, proton?: Proton | null): GroupCondition;
89
- /**
90
- * Validate a condition tree and return problems.
91
- *
92
- * @param root - Root group condition
93
- * @returns Array of problem descriptions (empty if valid)
94
- */
95
- export declare function conditionProblems(root: GroupCondition): string[];