@wallarm-org/design-system 4.8.0-rc-feat-parser.1 → 4.8.0-rc-fix-claude-code.2

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 (176) hide show
  1. package/README.md +4 -2
  2. package/dist/components/BulkBar/index.d.ts +5 -0
  3. package/dist/components/Drawer/classes.js +1 -1
  4. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
  5. package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
  6. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  7. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  8. package/dist/components/NotificationCenter/NotificationCenter.d.ts +20 -0
  9. package/dist/components/NotificationCenter/NotificationCenter.js +65 -0
  10. package/dist/components/NotificationCenter/NotificationCenterBody.d.ts +18 -0
  11. package/dist/components/NotificationCenter/NotificationCenterBody.js +202 -0
  12. package/dist/components/NotificationCenter/NotificationCenterContent.d.ts +5 -0
  13. package/dist/components/NotificationCenter/NotificationCenterContent.js +42 -0
  14. package/dist/components/NotificationCenter/NotificationCenterHeader.d.ts +20 -0
  15. package/dist/components/NotificationCenter/NotificationCenterHeader.js +202 -0
  16. package/dist/components/NotificationCenter/NotificationCenterItem.d.ts +26 -0
  17. package/dist/components/NotificationCenter/NotificationCenterItem.js +211 -0
  18. package/dist/components/NotificationCenter/NotificationCenterItemTime.d.ts +9 -0
  19. package/dist/components/NotificationCenter/NotificationCenterItemTime.js +148 -0
  20. package/dist/components/NotificationCenter/NotificationCenterItemTitle.d.ts +14 -0
  21. package/dist/components/NotificationCenter/NotificationCenterItemTitle.js +115 -0
  22. package/dist/components/NotificationCenter/NotificationCenterTabs.d.ts +10 -0
  23. package/dist/components/NotificationCenter/NotificationCenterTabs.js +77 -0
  24. package/dist/components/NotificationCenter/NotificationCenterTrigger.d.ts +13 -0
  25. package/dist/components/NotificationCenter/NotificationCenterTrigger.js +138 -0
  26. package/dist/components/NotificationCenter/index.d.ts +9 -0
  27. package/dist/components/NotificationCenter/index.js +9 -0
  28. package/dist/components/Overlay/Overlay.js +1 -1
  29. package/dist/components/SearchInput/SearchInput.d.ts +7 -5
  30. package/dist/components/SearchInput/SearchInput.js +119 -101
  31. package/dist/components/Select/SelectSearchInput.d.ts +1 -1
  32. package/dist/components/Table/types.d.ts +1 -1
  33. package/dist/components/Tabs/Tabs.d.ts +1 -0
  34. package/dist/components/Tabs/Tabs.js +30 -28
  35. package/dist/components/Tabs/TabsList/index.d.ts +1 -1
  36. package/dist/components/Tabs/index.d.ts +2 -2
  37. package/dist/components/Tour/TourPositioner.d.ts +3 -0
  38. package/dist/components/Tour/TourPositioner.js +4 -4
  39. package/dist/guidelines/foundations/color.md +157 -0
  40. package/dist/guidelines/foundations/focus.md +122 -0
  41. package/dist/guidelines/foundations/layering.md +131 -0
  42. package/dist/guidelines/foundations/radius-elevation.md +111 -0
  43. package/dist/guidelines/foundations/spacing.md +117 -0
  44. package/dist/guidelines/foundations/typography.md +114 -0
  45. package/dist/guidelines/patterns/app-layout.md +1567 -0
  46. package/dist/guidelines/patterns/auth-page.md +668 -0
  47. package/dist/guidelines/patterns/confirmation-dialogs.md +605 -0
  48. package/dist/guidelines/patterns/create-edit-forms.md +768 -0
  49. package/dist/guidelines/patterns/detail-drawer.md +868 -0
  50. package/dist/guidelines/patterns/empty-states.md +461 -0
  51. package/dist/guidelines/patterns/entity-table.md +533 -0
  52. package/dist/guidelines/patterns/feedback-toasts.md +493 -0
  53. package/dist/guidelines/patterns/filtering.md +630 -0
  54. package/dist/guidelines/patterns/resource-list-page.md +558 -0
  55. package/dist/guidelines/patterns/settings-page.md +752 -0
  56. package/dist/guidelines/rules.md +25 -0
  57. package/dist/index.d.ts +2 -3
  58. package/dist/index.js +1 -2
  59. package/dist/metadata/components.json +12431 -9208
  60. package/dist/metadata/guidelines.json +1705 -0
  61. package/dist/theme/typography.css +5 -0
  62. package/dist/utils/formatDateTime.d.ts +6 -0
  63. package/dist/utils/formatDateTime.js +13 -1
  64. package/package.json +6 -4
  65. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
  66. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
  67. package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
  68. package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
  69. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
  70. package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
  71. package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
  72. package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
  73. package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
  74. package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
  75. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
  76. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
  77. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
  78. package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
  79. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
  80. package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
  81. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
  82. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
  83. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
  84. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
  85. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
  86. package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
  87. package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
  88. package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
  89. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
  90. package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
  91. package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
  92. package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
  93. package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
  94. package/dist/components/Rules/PointSelector/classes.js +0 -22
  95. package/dist/components/Rules/PointSelector/index.d.ts +0 -20
  96. package/dist/components/Rules/PointSelector/index.js +0 -18
  97. package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
  98. package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
  99. package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
  100. package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
  101. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
  102. package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
  103. package/dist/components/Rules/PointSelector/types.d.ts +0 -304
  104. package/dist/components/Rules/PointSelector/types.js +0 -0
  105. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
  106. package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
  107. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
  108. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
  109. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
  110. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
  111. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
  112. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
  113. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
  114. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
  115. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
  116. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
  117. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
  118. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
  119. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
  120. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
  121. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
  122. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
  123. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
  124. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
  125. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
  126. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
  127. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
  128. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
  129. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
  130. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
  131. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
  132. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
  133. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
  134. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
  135. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
  136. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
  137. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
  138. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
  139. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
  140. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
  141. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
  142. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
  143. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
  144. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
  145. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
  146. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
  147. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
  148. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
  149. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
  150. package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
  151. package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
  152. package/dist/components/Rules/RuleBuilder/classes.js +0 -18
  153. package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
  154. package/dist/components/Rules/RuleBuilder/index.js +0 -11
  155. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
  156. package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
  157. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
  158. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
  159. package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
  160. package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
  161. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
  162. package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
  163. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
  164. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
  165. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
  166. package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
  167. package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
  168. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  169. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
  170. package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
  171. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
  172. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
  173. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
  174. package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
  175. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
  176. package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
@@ -1,356 +0,0 @@
1
- const OPERATOR_CHOICES = [
2
- {
3
- value: 'and',
4
- label: 'All of',
5
- description: 'Every condition must be true'
6
- },
7
- {
8
- value: 'or',
9
- label: 'Any of',
10
- description: 'At least one condition must be true'
11
- },
12
- {
13
- value: 'not',
14
- label: 'None of',
15
- description: 'No condition must be true'
16
- }
17
- ];
18
- const ACTION_KIND_CHOICES = [
19
- {
20
- value: 'add_attack',
21
- label: 'Mark the request as an attack'
22
- },
23
- {
24
- value: 'add_tag',
25
- label: 'Tag the request'
26
- },
27
- {
28
- value: 'suppress_attack',
29
- label: 'Ignore detected attacks'
30
- },
31
- {
32
- value: 'mark_attack',
33
- label: 'Report detected attacks without blocking'
34
- },
35
- {
36
- value: 'combine',
37
- label: 'Join repeated keys into one value'
38
- },
39
- {
40
- value: 'processing_time_limit',
41
- label: 'Limit processing time'
42
- },
43
- {
44
- value: 'processing_space_limit',
45
- label: 'Limit processing memory'
46
- },
47
- {
48
- value: 'entry_limits',
49
- label: 'Limit the size of values'
50
- },
51
- {
52
- value: 'disable_parsers',
53
- label: 'Disable specific parsers'
54
- },
55
- {
56
- value: 'allow_parsers',
57
- label: 'Allow only specific parsers'
58
- },
59
- {
60
- value: 'force_parser',
61
- label: 'Force a specific parser'
62
- },
63
- {
64
- value: 'disable_rule',
65
- label: 'Disable other rules'
66
- }
67
- ];
68
- const SIGNAL_TYPE_CHOICES = [
69
- {
70
- value: 'key_duplicate',
71
- label: 'Duplicate keys',
72
- description: 'Same key appears multiple times'
73
- },
74
- {
75
- value: 'resource_overlimit',
76
- label: 'Resource limit exceeded',
77
- description: 'Processing limits exceeded'
78
- }
79
- ];
80
- const CHECK_TYPE_CHOICES = [
81
- {
82
- value: 'equal',
83
- label: 'equals'
84
- },
85
- {
86
- value: 'nequal',
87
- label: 'does not equal'
88
- },
89
- {
90
- value: 'contains',
91
- label: 'contains'
92
- },
93
- {
94
- value: 'startswith',
95
- label: 'starts with'
96
- },
97
- {
98
- value: 'endswith',
99
- label: 'ends with'
100
- },
101
- {
102
- value: 'regexp',
103
- label: 'matches regex'
104
- },
105
- {
106
- value: 'nregexp',
107
- label: 'does not match regex'
108
- },
109
- {
110
- value: 'exists',
111
- label: 'exists'
112
- },
113
- {
114
- value: 'absent',
115
- label: 'is absent'
116
- }
117
- ];
118
- const CONTEXT_CHOICES = [
119
- {
120
- value: 'http_request',
121
- label: 'Request'
122
- },
123
- {
124
- value: 'http_response',
125
- label: 'Response'
126
- },
127
- {
128
- value: 'grpc_request',
129
- label: 'gRPC Request'
130
- },
131
- {
132
- value: 'grpc_response',
133
- label: 'gRPC Response'
134
- }
135
- ];
136
- const DUPLICATE_CONTAINERS = [
137
- {
138
- value: '[http:header]',
139
- label: 'HTTP headers'
140
- },
141
- {
142
- value: '[http:query]',
143
- label: 'Query parameters'
144
- },
145
- {
146
- value: '[http:form]',
147
- label: 'Form data'
148
- },
149
- {
150
- value: '[http:cookie]',
151
- label: 'Cookies'
152
- }
153
- ];
154
- const RESOURCE_LIMITS = [
155
- {
156
- value: 'processing_time_limit',
157
- label: 'Processing time limit',
158
- description: 'Microseconds allowed for processing'
159
- },
160
- {
161
- value: 'processing_space_limit',
162
- label: 'Processing space limit',
163
- description: 'Bytes allowed for retention'
164
- },
165
- {
166
- value: 'entry_size_soft_limit',
167
- label: 'Entry size soft limit',
168
- description: 'Soft size limit per entry (data keeps flowing)'
169
- },
170
- {
171
- value: 'entry_size_hard_limit',
172
- label: 'Entry size hard limit',
173
- description: 'Hard size limit per entry (entry cut)'
174
- }
175
- ];
176
- const TARGET_REQUIREMENT = {
177
- add_attack: 'either',
178
- add_tag: 'either',
179
- suppress_attack: 'either',
180
- mark_attack: 'either',
181
- combine: 'point',
182
- processing_time_limit: 'flow',
183
- processing_space_limit: 'flow',
184
- entry_limits: 'point',
185
- disable_parsers: 'point',
186
- allow_parsers: 'point',
187
- force_parser: 'point',
188
- disable_rule: 'flow'
189
- };
190
- const ADDABLE_NODE_KINDS = [
191
- 'field',
192
- 'attack',
193
- 'signal',
194
- 'tag',
195
- 'sample',
196
- 'group'
197
- ];
198
- const DEFAULT_SEPARATOR = ', ';
199
- const DEFAULT_PRIORITY = '0';
200
- const PARSER_CHOICES = [
201
- {
202
- value: 'json',
203
- label: 'JSON',
204
- description: 'JSON format parser'
205
- },
206
- {
207
- value: 'xml',
208
- label: 'XML',
209
- description: 'XML format parser'
210
- },
211
- {
212
- value: 'form',
213
- label: 'Form',
214
- description: 'URL-encoded form parser'
215
- },
216
- {
217
- value: 'multipart',
218
- label: 'Multipart',
219
- description: 'Multipart form data parser'
220
- },
221
- {
222
- value: 'cookie',
223
- label: 'Cookie',
224
- description: 'Cookie parser'
225
- },
226
- {
227
- value: 'auth',
228
- label: 'Auth',
229
- description: 'Authorization header parser'
230
- },
231
- {
232
- value: 'jwt',
233
- label: 'JWT',
234
- description: 'JWT token parser'
235
- },
236
- {
237
- value: 'zip',
238
- label: 'ZIP',
239
- description: 'ZIP archive parser'
240
- },
241
- {
242
- value: 'base64',
243
- label: 'Base64',
244
- description: 'Base64 encoding'
245
- },
246
- {
247
- value: 'percent',
248
- label: 'Percent',
249
- description: 'Percent encoding'
250
- },
251
- {
252
- value: 'utf16',
253
- label: 'UTF-16',
254
- description: 'UTF-16 encoding (format 0.10.7+)'
255
- },
256
- {
257
- value: 'gzip',
258
- label: 'Gzip',
259
- description: 'Gzip compression'
260
- },
261
- {
262
- value: 'deflate',
263
- label: 'Deflate',
264
- description: 'Deflate compression'
265
- },
266
- {
267
- value: 'brotli',
268
- label: 'Brotli',
269
- description: 'Brotli compression'
270
- }
271
- ];
272
- const ATTACK_SOURCE_CHOICES = [
273
- {
274
- value: 'rule',
275
- label: 'Rule',
276
- description: 'Attack detected by a rule'
277
- },
278
- {
279
- value: 'stamp',
280
- label: 'Stamp',
281
- description: 'Attack detected by a stamp'
282
- },
283
- {
284
- value: 'xml',
285
- label: 'XML',
286
- description: 'XML parser-detected attack'
287
- },
288
- {
289
- value: 'gzip',
290
- label: 'Gzip',
291
- description: 'Gzip decoder-detected attack'
292
- },
293
- {
294
- value: 'deflate',
295
- label: 'Deflate',
296
- description: 'Deflate decoder-detected attack'
297
- },
298
- {
299
- value: 'brotli',
300
- label: 'Brotli',
301
- description: 'Brotli decoder-detected attack'
302
- },
303
- {
304
- value: 'zip',
305
- label: 'ZIP',
306
- description: 'ZIP decoder-detected attack'
307
- },
308
- {
309
- value: 'json',
310
- label: 'JSON',
311
- description: 'JSON parser-detected attack'
312
- }
313
- ];
314
- const XML_PROPERTY_CHOICES = [
315
- {
316
- value: 'dtd',
317
- label: 'DTD',
318
- description: 'Document Type Definition'
319
- },
320
- {
321
- value: 'xinclude',
322
- label: 'XInclude',
323
- description: 'XML Inclusions'
324
- },
325
- {
326
- value: 'stylesheet',
327
- label: 'Stylesheet',
328
- description: 'XSLT stylesheet'
329
- },
330
- {
331
- value: 'xslt',
332
- label: 'XSLT',
333
- description: 'XSLT transformation'
334
- },
335
- {
336
- value: 'schema',
337
- label: 'Schema',
338
- description: 'XML Schema'
339
- },
340
- {
341
- value: 'xml_base',
342
- label: 'XML Base',
343
- description: 'xml:base attribute'
344
- },
345
- {
346
- value: 'parameter_entity',
347
- label: 'Parameter Entity',
348
- description: 'Parameter entity (format 0.10.4+)'
349
- },
350
- {
351
- value: 'entity_markup',
352
- label: 'Entity Markup',
353
- description: 'Entity markup (format 0.10.4+)'
354
- }
355
- ];
356
- export { ACTION_KIND_CHOICES, ADDABLE_NODE_KINDS, ATTACK_SOURCE_CHOICES, CHECK_TYPE_CHOICES, CONTEXT_CHOICES, DEFAULT_PRIORITY, DEFAULT_SEPARATOR, DUPLICATE_CONTAINERS, OPERATOR_CHOICES, PARSER_CHOICES, RESOURCE_LIMITS, SIGNAL_TYPE_CHOICES, TARGET_REQUIREMENT, XML_PROPERTY_CHOICES };
@@ -1,48 +0,0 @@
1
- /**
2
- * Extract Bindings
3
- *
4
- * Extracts bind_attack and bind_point references from condition tree.
5
- * These are used to populate reference selectors in ActionEditor.
6
- */
7
- import type { GroupCondition } from '../types.js';
8
- export interface BindingInfo {
9
- /** Binding ID (e.g., "a", "n", "v") */
10
- id: string;
11
- /** Binding type: attack bindings or point bindings */
12
- type: 'attack' | 'point';
13
- /** Human-readable label (e.g., "Attack 'a' from sqli condition") */
14
- label: string;
15
- }
16
- /**
17
- * Extract all bindings from condition tree.
18
- *
19
- * Walks the condition tree and collects all bind_attack and bind_point IDs.
20
- * Returns array of BindingInfo for UI selection.
21
- *
22
- * @param root - Root group condition
23
- * @returns Array of available bindings
24
- *
25
- * @example
26
- * ```typescript
27
- * const bindings = extractBindings(condition);
28
- * // [
29
- * // { id: "a", type: "attack", label: "Attack 'a' from sqli" },
30
- * // { id: "n", type: "point", label: "Point 'n' from regexp" }
31
- * // ]
32
- * ```
33
- */
34
- export declare function extractBindings(root: GroupCondition): BindingInfo[];
35
- /**
36
- * Check if action kind supports attack_ref.
37
- *
38
- * @param kind - Action kind
39
- * @returns True if action supports attack_ref
40
- */
41
- export declare function supportsAttackRef(kind: string): boolean;
42
- /**
43
- * Check if action kind supports target_ref.
44
- *
45
- * @param kind - Action kind
46
- * @returns True if action supports target_ref
47
- */
48
- export declare function supportsTargetRef(kind: string): boolean;
@@ -1,42 +0,0 @@
1
- function extractBindings(root) {
2
- const bindings = [];
3
- function walk(node) {
4
- if ('group' === node.kind) {
5
- for (const child of node.children)walk(child);
6
- return;
7
- }
8
- if ('attack' === node.kind && node.bindAttack) {
9
- const attackTypeLabel = node.attackType || 'any attack';
10
- bindings.push({
11
- id: node.bindAttack,
12
- type: 'attack',
13
- label: `Attack '${node.bindAttack}' (${attackTypeLabel})`
14
- });
15
- }
16
- if ('field' === node.kind && node.bindPoint) {
17
- const conditionLabel = node.value.condition || 'field';
18
- bindings.push({
19
- id: node.bindPoint,
20
- type: 'point',
21
- label: `Point '${node.bindPoint}' (${conditionLabel})`
22
- });
23
- }
24
- if ('signal' === node.kind && node.bindPoint) {
25
- const signalLabel = node.signalType || 'signal';
26
- bindings.push({
27
- id: node.bindPoint,
28
- type: 'point',
29
- label: `Point '${node.bindPoint}' (${signalLabel})`
30
- });
31
- }
32
- }
33
- walk(root);
34
- return bindings;
35
- }
36
- function supportsAttackRef(kind) {
37
- return 'suppress_attack' === kind || 'mark_attack' === kind;
38
- }
39
- function supportsTargetRef(kind) {
40
- return 'disable_rule' !== kind;
41
- }
42
- export { extractBindings, supportsAttackRef, supportsTargetRef };
@@ -1,92 +0,0 @@
1
- /**
2
- * RuleBuilder Utility Helpers
3
- *
4
- * Helper functions for tree traversal, counting, and manipulation.
5
- */
6
- import type { ConditionNode } from '../types.js';
7
- /**
8
- * Check if a condition tree contains a descendant of any of the specified kinds.
9
- *
10
- * @param node - Root node to search
11
- * @param kinds - Array of node kinds to search for
12
- * @returns True if any descendant matches the kinds
13
- *
14
- * @example
15
- * ```typescript
16
- * const hasSignals = hasDescendantOfKind(condition, ['attack', 'signal']);
17
- * ```
18
- */
19
- export declare function hasDescendantOfKind(node: ConditionNode, kinds: ConditionNode['kind'][]): boolean;
20
- /**
21
- * Count the total number of checks (leaf nodes) in a condition tree.
22
- * Groups are not counted, only actual condition checks.
23
- *
24
- * @param node - Root node to count from
25
- * @returns Total number of leaf condition nodes
26
- *
27
- * @example
28
- * ```typescript
29
- * const checkCount = countChecks(condition);
30
- * ```
31
- */
32
- export declare function countChecks(node: ConditionNode): number;
33
- /**
34
- * Calculate the maximum depth of a condition tree.
35
- * Root has depth 0, its children have depth 1, etc.
36
- *
37
- * @param node - Root node
38
- * @returns Maximum depth of the tree
39
- *
40
- * @example
41
- * ```typescript
42
- * const depth = maxDepth(condition);
43
- * ```
44
- */
45
- export declare function maxDepth(node: ConditionNode): number;
46
- /**
47
- * Find a node in the tree by its ID.
48
- *
49
- * @param root - Root node to search from
50
- * @param targetId - ID to search for
51
- * @returns The found node or null
52
- */
53
- export declare function findNodeById(root: ConditionNode, targetId: string): ConditionNode | null;
54
- /**
55
- * Map over all nodes in the tree, transforming each one.
56
- *
57
- * @param node - Root node
58
- * @param fn - Transform function
59
- * @returns Transformed tree
60
- */
61
- export declare function mapNode(node: ConditionNode, fn: (node: ConditionNode) => ConditionNode): ConditionNode;
62
- /**
63
- * Remove a node from the tree by its ID.
64
- * Returns the modified tree, or null if the root was removed.
65
- *
66
- * @param root - Root node
67
- * @param targetId - ID of node to remove
68
- * @returns Modified tree or null if root was removed
69
- */
70
- export declare function removeNode(root: ConditionNode, targetId: string): ConditionNode | null;
71
- /**
72
- * Check if a node is a leaf (not a group).
73
- *
74
- * @param node - Node to check
75
- * @returns True if the node is a leaf node
76
- */
77
- export declare function isLeafNode(node: ConditionNode): boolean;
78
- /**
79
- * Get all leaf nodes in the tree.
80
- *
81
- * @param node - Root node
82
- * @returns Array of all leaf nodes
83
- */
84
- export declare function getLeafNodes(node: ConditionNode): ConditionNode[];
85
- /**
86
- * Count nodes of a specific kind in the tree.
87
- *
88
- * @param node - Root node
89
- * @param kind - Kind to count
90
- * @returns Count of nodes with that kind
91
- */
92
- export declare function countNodesOfKind(node: ConditionNode, kind: ConditionNode['kind']): number;
@@ -1,54 +0,0 @@
1
- function hasDescendantOfKind(node, kinds) {
2
- if (kinds.includes(node.kind)) return true;
3
- if ('group' === node.kind) return node.children.some((child)=>hasDescendantOfKind(child, kinds));
4
- return false;
5
- }
6
- function countChecks(node) {
7
- if ('group' === node.kind) return node.children.reduce((sum, child)=>sum + countChecks(child), 0);
8
- return 1;
9
- }
10
- function maxDepth(node) {
11
- if ('group' !== node.kind) return 0;
12
- if (0 === node.children.length) return 0;
13
- const childDepths = node.children.map((child)=>maxDepth(child));
14
- return 1 + Math.max(...childDepths);
15
- }
16
- function findNodeById(root, targetId) {
17
- if (root.id === targetId) return root;
18
- if ('group' === root.kind) for (const child of root.children){
19
- const found = findNodeById(child, targetId);
20
- if (found) return found;
21
- }
22
- return null;
23
- }
24
- function mapNode(node, fn) {
25
- const transformed = fn(node);
26
- if ('group' === transformed.kind) return {
27
- ...transformed,
28
- children: transformed.children.map((child)=>mapNode(child, fn))
29
- };
30
- return transformed;
31
- }
32
- function removeNode(root, targetId) {
33
- if (root.id === targetId) return null;
34
- if ('group' === root.kind) return {
35
- ...root,
36
- children: root.children.map((child)=>removeNode(child, targetId)).filter((child)=>null !== child)
37
- };
38
- return root;
39
- }
40
- function isLeafNode(node) {
41
- return 'group' !== node.kind;
42
- }
43
- function getLeafNodes(node) {
44
- if ('group' !== node.kind) return [
45
- node
46
- ];
47
- return node.children.flatMap((child)=>getLeafNodes(child));
48
- }
49
- function countNodesOfKind(node, kind) {
50
- let count = node.kind === kind ? 1 : 0;
51
- if ('group' === node.kind) count += node.children.reduce((sum, child)=>sum + countNodesOfKind(child, kind), 0);
52
- return count;
53
- }
54
- export { countChecks, countNodesOfKind, findNodeById, getLeafNodes, hasDescendantOfKind, isLeafNode, mapNode, maxDepth, removeNode };
@@ -1,2 +0,0 @@
1
- export * from './constants.js';
2
- export * from './helpers.js';
@@ -1,2 +0,0 @@
1
- export * from "./constants.js";
2
- export * from "./helpers.js";