Skip to content

Commit a1eac15

Browse files
committed
Update har package name
1 parent 963bc40 commit a1eac15

File tree

20 files changed

+60
-33
lines changed

20 files changed

+60
-33
lines changed

packages/apidash_core/lib/import_export/har_io.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:har_parser/har_parser.dart' as hp;
1+
import 'package:har/har.dart' as har;
22
import 'package:seed/seed.dart';
33
import '../consts.dart';
44
import '../models/models.dart';
@@ -8,8 +8,8 @@ class HarParserIO {
88
List<(String?, HttpRequestModel)>? getHttpRequestModelList(String content) {
99
content = content.trim();
1010
try {
11-
final hl = hp.harLogFromJsonStr(content);
12-
final requests = hp.getRequestsFromHarLog(hl);
11+
final hl = har.harLogFromJsonStr(content);
12+
final requests = har.getRequestsFromHarLog(hl);
1313
return requests
1414
.map((req) => (req.$2.url, harRequestToHttpRequestModel(req.$2)))
1515
.toList();
@@ -18,7 +18,7 @@ class HarParserIO {
1818
}
1919
}
2020

21-
HttpRequestModel harRequestToHttpRequestModel(hp.Request request) {
21+
HttpRequestModel harRequestToHttpRequestModel(har.Request request) {
2222
HTTPVerb method;
2323

2424
try {
@@ -33,15 +33,15 @@ class HarParserIO {
3333
List<NameValueModel> params = [];
3434
List<bool> isParamEnabledList = [];
3535

36-
for (var header in request.headers ?? <hp.Header>[]) {
36+
for (var header in request.headers ?? <har.Header>[]) {
3737
var name = header.name ?? "";
3838
var value = header.value;
3939
var activeHeader = header.disabled ?? false;
4040
headers.add(NameValueModel(name: name, value: value));
4141
isHeaderEnabledList.add(!activeHeader);
4242
}
4343

44-
for (var query in request.queryString ?? <hp.Query>[]) {
44+
for (var query in request.queryString ?? <har.Query>[]) {
4545
var name = query.name ?? "";
4646
var value = query.value;
4747
var activeQuery = query.disabled ?? false;
@@ -77,7 +77,7 @@ class HarParserIO {
7777
if (request.postData?.mimeType == "multipart/form-data") {
7878
bodyContentType = ContentType.formdata;
7979
var name, val;
80-
for (var fd in request.postData?.params ?? <hp.Param>[]) {
80+
for (var fd in request.postData?.params ?? <har.Param>[]) {
8181
name = fd.name;
8282
if (fd.contentType == "text/plain") {
8383
formDataType = FormDataType.text;

packages/apidash_core/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ dependencies:
2121
path: ../insomnia_collection
2222
postman:
2323
path: ../postman
24-
har_parser:
25-
path: ../har_parser
24+
har:
25+
path: ../har
2626
seed: ^0.0.3
2727
xml: ^6.3.0
2828

packages/apidash_core/pubspec_overrides.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# melos_managed_dependency_overrides: har_parser
2-
# melos_managed_dependency_overrides: curl_parser,insomnia_collection,postman,seed
1+
# melos_managed_dependency_overrides: curl_parser,insomnia_collection,postman,seed,har
32
dependency_overrides:
43
curl_parser:
54
path: ../curl_parser
6-
har_parser:
7-
path: ..\\har_parser
5+
har:
6+
path: ../har
87
insomnia_collection:
98
path: ../insomnia_collection
109
postman:
File renamed without changes.
File renamed without changes.

packages/har_parser/LICENSE renamed to packages/har/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 Ashita Prasad, Ankit Mahato
189+
Copyright 2025 Ashita Prasad, Ankit Mahato
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

packages/har_parser/README.md renamed to packages/har/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# insomnia
1+
# har
22

33
Seamlessly convert Har Collection Format v1.2 to Dart.
44

@@ -11,7 +11,7 @@ Currently, this package is being used by [API Dash](https://github.com/foss42/ap
1111
### Example 1: Har collection JSON string to Har model
1212

1313
```dart
14-
import 'package:har_parser/har_parser.dart';
14+
import 'package:har/har.dart';
1515
1616
void main() {
1717
// Example 1: Har collection JSON string to Har model
@@ -173,7 +173,7 @@ void main() {
173173
### Example 2: Har collection from JSON
174174

175175
```dart
176-
import 'package:har_parser/har_parser.dart';
176+
import 'package:har/har.dart';
177177
178178
void main() {
179179
// Example 2: Har collection from JSON
@@ -337,4 +337,4 @@ var collectionJson = {
337337

338338
## License
339339

340-
This project is licensed under the [Apache License 2.0](https://github.com/foss42/apidash/blob/main/packages/har_parser/LICENSE).
340+
This project is licensed under the [Apache License 2.0](https://github.com/foss42/apidash/blob/main/packages/har/LICENSE).
File renamed without changes.

packages/har_parser/example/har_example.dart renamed to packages/har/example/har_example.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:har_parser/har_parser.dart';
1+
import 'package:har/har.dart';
22

33
void main() {
44
//Example 1

packages/har/lib/har.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
library har;
2+
3+
export 'models/models.dart';
4+
export 'utils/har_utils.dart';

0 commit comments

Comments
 (0)