From 4be8f6ad9cb97da62610545a1528276b91545c23 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Mon, 23 Jun 2025 04:54:04 +0530 Subject: [PATCH] Update --- packages/har/example/har_example.dart | 4 +- .../collection_apidash.dart | 287 +++++++++--------- .../test/models/collection_apidash_model.dart | 2 +- 3 files changed, 145 insertions(+), 148 deletions(-) diff --git a/packages/har/example/har_example.dart b/packages/har/example/har_example.dart index c0c2a9c6..a074e5f3 100644 --- a/packages/har/example/har_example.dart +++ b/packages/har/example/har_example.dart @@ -7,7 +7,7 @@ void main() { "log": { "version": "1.2", "creator": { - "name": "Postman", + "name": "Client Name", "version": "v8.x.x" }, "entries": [ @@ -163,7 +163,7 @@ void main() { var collectionJson = { "log": { "version": "1.2", - "creator": {"name": "Postman", "version": "v8.x.x"}, + "creator": {"name": "Client Name", "version": "v8.x.x"}, "entries": [ { "startedDateTime": "2025-03-25T12:00:00.000Z", diff --git a/packages/har/test/collection_examples/collection_apidash.dart b/packages/har/test/collection_examples/collection_apidash.dart index 47a1a0a0..1fa2f94e 100644 --- a/packages/har/test/collection_examples/collection_apidash.dart +++ b/packages/har/test/collection_examples/collection_apidash.dart @@ -3,7 +3,7 @@ var collectionJsonStr = r''' "log": { "version": "1.2", "creator": { - "name": "Postman", + "name": "Client Name", "version": "v8.x.x" }, "entries": [ @@ -184,149 +184,146 @@ var collectionJsonStr = r''' }'''; var collectionJson = { - "log": { - "version": "1.2", - "creator": { - "name": "Postman", - "version": "v8.x.x" + "log": { + "version": "1.2", + "creator": {"name": "Client Name", "version": "v8.x.x"}, + "entries": [ + { + "startedDateTime": "2025-03-25T12:00:00.000Z", + "time": 100, + "request": { + "method": "GET", + "url": "https://api.apidash.dev", + "headers": [], + "queryString": [], + "bodySize": 0 }, - "entries": [ - { - "startedDateTime": "2025-03-25T12:00:00.000Z", - "time": 100, - "request": { - "method": "GET", - "url": "https://api.apidash.dev", - "headers": [], - "queryString": [], - "bodySize": 0 - }, - "response": { - "status": 200, - "statusText": "OK", - "headers": [], - "bodySize": 0 - } - }, - { - "startedDateTime": "2025-03-25T12:01:00.000Z", - "time": 150, - "request": { - "method": "GET", - "url": "https://api.apidash.dev/country/data?code=US", - "headers": [], - "queryString": [ - {"name": "code", "value": "US"} - ], - "bodySize": 0 - }, - "response": { - "status": 200, - "statusText": "OK", - "headers": [], - "bodySize": 0 - } - }, - { - "startedDateTime": "2025-03-25T12:02:00.000Z", - "time": 200, - "request": { - "method": "GET", - "url": - "https://api.apidash.dev/humanize/social?num=8700000&digits=3&system=SS&add_space=true&trailing_zeros=true", - "headers": [], - "queryString": [ - {"name": "num", "value": "8700000"}, - {"name": "digits", "value": "3"}, - {"name": "system", "value": "SS"}, - {"name": "add_space", "value": "true"}, - {"name": "trailing_zeros", "value": "true"} - ], - "bodySize": 0 - }, - "response": { - "status": 200, - "statusText": "OK", - "headers": [], - "bodySize": 0 - } - }, - { - "startedDateTime": "2025-03-25T12:03:00.000Z", - "time": 300, - "request": { - "method": "POST", - "url": "https://api.apidash.dev/case/lower", - "headers": [], - "queryString": [], - "bodySize": 50, - "postData": { - "mimeType": "application/json", - "text": "{ \"text\": \"I LOVE Flutter\" }" - } - }, - "response": { - "status": 200, - "statusText": "OK", - "headers": [], - "bodySize": 0 - } - }, - { - "startedDateTime": "2025-03-25T12:04:00.000Z", - "time": 350, - "request": { - "method": "POST", - "url": "https://api.apidash.dev/io/form", - "headers": [ - {"name": "User-Agent", "value": "Test Agent"} - ], - "queryString": [], - "bodySize": 100, - "postData": { - "mimeType": "multipart/form-data", - "params": [ - {"name": "text", "value": "API", "contentType": "text/plain"}, - {"name": "sep", "value": "|", "contentType": "text/plain"}, - {"name": "times", "value": "3", "contentType": "text/plain"} - ] - } - }, - "response": { - "status": 200, - "statusText": "OK", - "headers": [], - "bodySize": 0 - } - }, - { - "startedDateTime": "2025-03-25T12:05:00.000Z", - "time": 400, - "request": { - "method": "POST", - "url": "https://api.apidash.dev/io/img", - "headers": [], - "queryString": [], - "bodySize": 150, - "postData": { - "mimeType": "multipart/form-data", - "params": [ - {"name": "token", "value": "xyz", "contentType": "text/plain"}, - { - "name": "imfile", - "fileName": "hire AI.jpeg", - "contentType": "image/jpeg" - } - ] - } - }, - "response": { - "status": 200, - "statusText": "OK", - "headers": [], - "bodySize": 0 - } + "response": { + "status": 200, + "statusText": "OK", + "headers": [], + "bodySize": 0 } - ] - } - }; + }, + { + "startedDateTime": "2025-03-25T12:01:00.000Z", + "time": 150, + "request": { + "method": "GET", + "url": "https://api.apidash.dev/country/data?code=US", + "headers": [], + "queryString": [ + {"name": "code", "value": "US"} + ], + "bodySize": 0 + }, + "response": { + "status": 200, + "statusText": "OK", + "headers": [], + "bodySize": 0 + } + }, + { + "startedDateTime": "2025-03-25T12:02:00.000Z", + "time": 200, + "request": { + "method": "GET", + "url": + "https://api.apidash.dev/humanize/social?num=8700000&digits=3&system=SS&add_space=true&trailing_zeros=true", + "headers": [], + "queryString": [ + {"name": "num", "value": "8700000"}, + {"name": "digits", "value": "3"}, + {"name": "system", "value": "SS"}, + {"name": "add_space", "value": "true"}, + {"name": "trailing_zeros", "value": "true"} + ], + "bodySize": 0 + }, + "response": { + "status": 200, + "statusText": "OK", + "headers": [], + "bodySize": 0 + } + }, + { + "startedDateTime": "2025-03-25T12:03:00.000Z", + "time": 300, + "request": { + "method": "POST", + "url": "https://api.apidash.dev/case/lower", + "headers": [], + "queryString": [], + "bodySize": 50, + "postData": { + "mimeType": "application/json", + "text": "{ \"text\": \"I LOVE Flutter\" }" + } + }, + "response": { + "status": 200, + "statusText": "OK", + "headers": [], + "bodySize": 0 + } + }, + { + "startedDateTime": "2025-03-25T12:04:00.000Z", + "time": 350, + "request": { + "method": "POST", + "url": "https://api.apidash.dev/io/form", + "headers": [ + {"name": "User-Agent", "value": "Test Agent"} + ], + "queryString": [], + "bodySize": 100, + "postData": { + "mimeType": "multipart/form-data", + "params": [ + {"name": "text", "value": "API", "contentType": "text/plain"}, + {"name": "sep", "value": "|", "contentType": "text/plain"}, + {"name": "times", "value": "3", "contentType": "text/plain"} + ] + } + }, + "response": { + "status": 200, + "statusText": "OK", + "headers": [], + "bodySize": 0 + } + }, + { + "startedDateTime": "2025-03-25T12:05:00.000Z", + "time": 400, + "request": { + "method": "POST", + "url": "https://api.apidash.dev/io/img", + "headers": [], + "queryString": [], + "bodySize": 150, + "postData": { + "mimeType": "multipart/form-data", + "params": [ + {"name": "token", "value": "xyz", "contentType": "text/plain"}, + { + "name": "imfile", + "fileName": "hire AI.jpeg", + "contentType": "image/jpeg" + } + ] + } + }, + "response": { + "status": 200, + "statusText": "OK", + "headers": [], + "bodySize": 0 + } + } + ] + } +}; diff --git a/packages/har/test/models/collection_apidash_model.dart b/packages/har/test/models/collection_apidash_model.dart index 25c1ac3c..93616810 100644 --- a/packages/har/test/models/collection_apidash_model.dart +++ b/packages/har/test/models/collection_apidash_model.dart @@ -3,7 +3,7 @@ import 'package:har/models/models.dart'; var collectionApiDashModel = HarLog( log: Log( version: "1.2", - creator: Creator(name: "Postman", version: "v8.x.x"), + creator: Creator(name: "Client Name", version: "v8.x.x"), entries: [ Entry( startedDateTime: "2025-03-25T12:00:00.000Z",