import 'package:pipelines_app/core/api_gateway.dart'; /// A minimal recorded [stage artifact], named so tests read like the web /// client's fixtures. Every field the server records is present. JsonMap artifact( String name, { String? url, String contentType = '', int sizeBytes = 0, Map extra = const {}, }) { return { 'name': name, 'url': url ?? '/artifacts/1/1/$name', 'content_type': contentType, 'size_bytes': sizeBytes, ...extra, }; } /// A minimal recorded step. [includeArtifacts] false omits the field entirely /// (an unavailable capture); a null [artifacts] records an explicit null. JsonMap step({ String stage = 'review', int sequence = 1, String status = 'completed', int visit = 1, List? artifacts, bool includeArtifacts = true, int? skipped, int? truncated, List? repairs, }) { return { 'stage': stage, 'sequence': sequence, 'status': status, 'control': {'visit': visit}, if (includeArtifacts) 'artifacts': artifacts, 'artifacts_skipped': ?skipped, 'artifacts_truncated': ?truncated, 'session_export_repairs': ?repairs, }; }