(self, input: dict, request: Request)
| 12 | return False |
| 13 | |
| 14 | async def process(self, input: dict, request: Request) -> dict | Response: |
| 15 | try: |
| 16 | # Get input parameters |
| 17 | include_patterns = input.get("include_patterns", []) |
| 18 | exclude_patterns = input.get("exclude_patterns", []) |
| 19 | include_hidden = input.get("include_hidden", True) |
| 20 | max_files = input.get("max_files", 1000) |
| 21 | |
| 22 | # Support legacy string patterns format for backward compatibility |
| 23 | patterns_string = input.get("patterns", "") |
| 24 | if patterns_string and not include_patterns: |
| 25 | # Parse patterns string into arrays |
| 26 | lines = [line.strip() for line in patterns_string.split('\n') if line.strip() and not line.strip().startswith('#')] |
| 27 | for line in lines: |
| 28 | if line.startswith('!'): |
| 29 | exclude_patterns.append(line[1:]) |
| 30 | else: |
| 31 | include_patterns.append(line) |
| 32 | |
| 33 | if not include_patterns: |
| 34 | return { |
| 35 | "success": True, |
| 36 | "files": [], |
| 37 | "total_count": 0, |
| 38 | "truncated": False |
| 39 | } |
| 40 | |
| 41 | # Create metadata object for testing |
| 42 | metadata = { |
| 43 | "include_patterns": include_patterns, |
| 44 | "exclude_patterns": exclude_patterns, |
| 45 | "include_hidden": include_hidden |
| 46 | } |
| 47 | |
| 48 | backup_service = BackupService() |
| 49 | matched_files = await backup_service.test_patterns(metadata, max_files=max_files) |
| 50 | truncated = max_files is not None and len(matched_files) >= max_files |
| 51 | |
| 52 | return { |
| 53 | "success": True, |
| 54 | "files": matched_files, |
| 55 | "total_count": len(matched_files), |
| 56 | "truncated": truncated |
| 57 | } |
| 58 | |
| 59 | except Exception as e: |
| 60 | return { |
| 61 | "success": False, |
| 62 | "error": str(e) |
| 63 | } |
nothing calls this directly
no test coverage detected