mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
Update har package name
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import 'package:har_parser/har_parser.dart' as hp;
|
||||
import 'package:har/har.dart' as har;
|
||||
import 'package:seed/seed.dart';
|
||||
import '../consts.dart';
|
||||
import '../models/models.dart';
|
||||
@@ -8,8 +8,8 @@ class HarParserIO {
|
||||
List<(String?, HttpRequestModel)>? getHttpRequestModelList(String content) {
|
||||
content = content.trim();
|
||||
try {
|
||||
final hl = hp.harLogFromJsonStr(content);
|
||||
final requests = hp.getRequestsFromHarLog(hl);
|
||||
final hl = har.harLogFromJsonStr(content);
|
||||
final requests = har.getRequestsFromHarLog(hl);
|
||||
return requests
|
||||
.map((req) => (req.$2.url, harRequestToHttpRequestModel(req.$2)))
|
||||
.toList();
|
||||
@@ -18,7 +18,7 @@ class HarParserIO {
|
||||
}
|
||||
}
|
||||
|
||||
HttpRequestModel harRequestToHttpRequestModel(hp.Request request) {
|
||||
HttpRequestModel harRequestToHttpRequestModel(har.Request request) {
|
||||
HTTPVerb method;
|
||||
|
||||
try {
|
||||
@@ -33,7 +33,7 @@ class HarParserIO {
|
||||
List<NameValueModel> params = [];
|
||||
List<bool> isParamEnabledList = [];
|
||||
|
||||
for (var header in request.headers ?? <hp.Header>[]) {
|
||||
for (var header in request.headers ?? <har.Header>[]) {
|
||||
var name = header.name ?? "";
|
||||
var value = header.value;
|
||||
var activeHeader = header.disabled ?? false;
|
||||
@@ -41,7 +41,7 @@ class HarParserIO {
|
||||
isHeaderEnabledList.add(!activeHeader);
|
||||
}
|
||||
|
||||
for (var query in request.queryString ?? <hp.Query>[]) {
|
||||
for (var query in request.queryString ?? <har.Query>[]) {
|
||||
var name = query.name ?? "";
|
||||
var value = query.value;
|
||||
var activeQuery = query.disabled ?? false;
|
||||
@@ -77,7 +77,7 @@ class HarParserIO {
|
||||
if (request.postData?.mimeType == "multipart/form-data") {
|
||||
bodyContentType = ContentType.formdata;
|
||||
var name, val;
|
||||
for (var fd in request.postData?.params ?? <hp.Param>[]) {
|
||||
for (var fd in request.postData?.params ?? <har.Param>[]) {
|
||||
name = fd.name;
|
||||
if (fd.contentType == "text/plain") {
|
||||
formDataType = FormDataType.text;
|
||||
|
||||
@@ -21,8 +21,8 @@ dependencies:
|
||||
path: ../insomnia_collection
|
||||
postman:
|
||||
path: ../postman
|
||||
har_parser:
|
||||
path: ../har_parser
|
||||
har:
|
||||
path: ../har
|
||||
seed: ^0.0.3
|
||||
xml: ^6.3.0
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# melos_managed_dependency_overrides: har_parser
|
||||
# melos_managed_dependency_overrides: curl_parser,insomnia_collection,postman,seed
|
||||
# melos_managed_dependency_overrides: curl_parser,insomnia_collection,postman,seed,har
|
||||
dependency_overrides:
|
||||
curl_parser:
|
||||
path: ../curl_parser
|
||||
har_parser:
|
||||
path: ..\\har_parser
|
||||
har:
|
||||
path: ../har
|
||||
insomnia_collection:
|
||||
path: ../insomnia_collection
|
||||
postman:
|
||||
|
||||
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2023 Ashita Prasad, Ankit Mahato
|
||||
Copyright 2025 Ashita Prasad, Ankit Mahato
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -1,4 +1,4 @@
|
||||
# insomnia
|
||||
# har
|
||||
|
||||
Seamlessly convert Har Collection Format v1.2 to Dart.
|
||||
|
||||
@@ -11,7 +11,7 @@ Currently, this package is being used by [API Dash](https://github.com/foss42/ap
|
||||
### Example 1: Har collection JSON string to Har model
|
||||
|
||||
```dart
|
||||
import 'package:har_parser/har_parser.dart';
|
||||
import 'package:har/har.dart';
|
||||
|
||||
void main() {
|
||||
// Example 1: Har collection JSON string to Har model
|
||||
@@ -173,7 +173,7 @@ void main() {
|
||||
### Example 2: Har collection from JSON
|
||||
|
||||
```dart
|
||||
import 'package:har_parser/har_parser.dart';
|
||||
import 'package:har/har.dart';
|
||||
|
||||
void main() {
|
||||
// Example 2: Har collection from JSON
|
||||
@@ -337,4 +337,4 @@ var collectionJson = {
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [Apache License 2.0](https://github.com/foss42/apidash/blob/main/packages/har_parser/LICENSE).
|
||||
This project is licensed under the [Apache License 2.0](https://github.com/foss42/apidash/blob/main/packages/har/LICENSE).
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:har_parser/har_parser.dart';
|
||||
import 'package:har/har.dart';
|
||||
|
||||
void main() {
|
||||
//Example 1
|
||||
4
packages/har/lib/har.dart
Normal file
4
packages/har/lib/har.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
library har;
|
||||
|
||||
export 'models/models.dart';
|
||||
export 'utils/har_utils.dart';
|
||||
@@ -1,4 +1,4 @@
|
||||
name: har_parser
|
||||
name: har
|
||||
description: "Seamlessly convert har Format to Dart and vice versa."
|
||||
version: 0.0.1
|
||||
homepage: https://github.com/foss42/apidash
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:har_parser/har_parser.dart';
|
||||
import 'package:har/har.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'collection_examples/collection_apidash.dart';
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:har_parser/models/models.dart';
|
||||
import 'package:har/models/models.dart';
|
||||
|
||||
var collectionApiDashModel = HarLog(
|
||||
log: Log(
|
||||
@@ -62,7 +62,8 @@ var collectionApiDashModel = HarLog(
|
||||
time: 200,
|
||||
request: Request(
|
||||
method: "GET",
|
||||
url: "https://api.apidash.dev/humanize/social?num=8700000&digits=3&system=SS&add_space=true&trailing_zeros=true",
|
||||
url:
|
||||
"https://api.apidash.dev/humanize/social?num=8700000&digits=3&system=SS&add_space=true&trailing_zeros=true",
|
||||
httpVersion: null,
|
||||
cookies: null,
|
||||
headers: [],
|
||||
@@ -122,15 +123,32 @@ var collectionApiDashModel = HarLog(
|
||||
request: Request(
|
||||
method: "POST",
|
||||
url: "https://api.apidash.dev/io/form",
|
||||
headers: [Header(name: "User-Agent", value: "Test Agent", disabled: null)],
|
||||
headers: [
|
||||
Header(name: "User-Agent", value: "Test Agent", disabled: null)
|
||||
],
|
||||
queryString: [],
|
||||
bodySize: 100,
|
||||
postData: PostData(
|
||||
mimeType: "multipart/form-data",
|
||||
params: [
|
||||
Param(name: "text", value: "API", fileName: null, contentType: "text/plain", disabled: null),
|
||||
Param(name: "sep", value: "|", fileName: null, contentType: "text/plain", disabled: null),
|
||||
Param(name: "times", value: "3", fileName: null, contentType: "text/plain", disabled: null)
|
||||
Param(
|
||||
name: "text",
|
||||
value: "API",
|
||||
fileName: null,
|
||||
contentType: "text/plain",
|
||||
disabled: null),
|
||||
Param(
|
||||
name: "sep",
|
||||
value: "|",
|
||||
fileName: null,
|
||||
contentType: "text/plain",
|
||||
disabled: null),
|
||||
Param(
|
||||
name: "times",
|
||||
value: "3",
|
||||
fileName: null,
|
||||
contentType: "text/plain",
|
||||
disabled: null)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -160,8 +178,18 @@ var collectionApiDashModel = HarLog(
|
||||
mimeType: "multipart/form-data",
|
||||
text: null,
|
||||
params: [
|
||||
Param(name: "token", value: "xyz", fileName: null, contentType: "text/plain", disabled: null),
|
||||
Param(name: "imfile", value: null, fileName: "hire AI.jpeg", contentType: "image/jpeg", disabled: null)
|
||||
Param(
|
||||
name: "token",
|
||||
value: "xyz",
|
||||
fileName: null,
|
||||
contentType: "text/plain",
|
||||
disabled: null),
|
||||
Param(
|
||||
name: "imfile",
|
||||
value: null,
|
||||
fileName: "hire AI.jpeg",
|
||||
contentType: "image/jpeg",
|
||||
disabled: null)
|
||||
],
|
||||
),
|
||||
headersSize: null,
|
||||
@@ -1,4 +0,0 @@
|
||||
library har_parser;
|
||||
|
||||
export 'models/models.dart';
|
||||
export 'utils/har_parser_utils.dart';
|
||||
Reference in New Issue
Block a user