Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔖 release v6.1.3 #436

Merged
merged 70 commits into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f25fbe4
Fix Header Option Casting (#260)
yousinix May 25, 2021
3d47735
Fix for #259 (#263)
JEuler May 31, 2021
8be965b
4.0.1 fixes (#264)
JEuler Jun 1, 2021
bcb0304
analyzer dependency upgraded (#296)
luis901101 Sep 18, 2021
4e4607e
fix(generator): fix PartValueFile value not nullable if arg is (#288)…
rIIh Sep 18, 2021
939a83f
Chopper generator release 4.0.2 (#297)
JEuler Sep 23, 2021
ff0ec87
fix: fix this.body cast of null value when response body is null (#29…
rIIh Sep 23, 2021
ffcd945
Interpolation fixes (#275)
JEuler Sep 23, 2021
82b951f
encodeQueryComponent now encodeComponent (#278)
JEuler Sep 23, 2021
f7255b7
Prevent double call on token refreshment (#276)
JEuler Oct 10, 2021
ddefa94
Fixes for #309 #308 (#310)
JEuler Dec 7, 2021
0386c74
Remove new keyword from interceptors.md (#312)
michalsrutek Jan 3, 2022
d4dab0d
Analyzer upgrade (#320)
JEuler Jan 16, 2022
bbe2c7a
Add unnecessary_brace_in_string_interps to lint ignores (#317)
pingbird Jan 16, 2022
6bdbd63
Extend pragma to quiet the linter (#318)
vipw Jan 22, 2022
4185d14
Fix converter getting called twice if using an authenticator with a J…
maxroehrl Jan 30, 2022
dbf4272
migrate example to nullsafety (#331)
ipcjs Feb 22, 2022
976d457
Resolve problem in main_json_serializable example (#328)
ibadin Apr 24, 2022
cc2da20
Add @FiledMap @PartMap @PartFileMap (#335)
meysam1717 May 1, 2022
659b9f8
Upgrade of analyzer (#340)
JEuler Jun 20, 2022
e167ba6
Fix nullable QueryMap fails to compile (#344)
techouse Jul 14, 2022
f9009ce
Change return type of decodeJson to FutureOr in order to be able to s…
techouse Sep 7, 2022
5f2eb82
Migrate from pedantic to lints ^2.0.0 with lints/recommended.yaml (#349)
techouse Sep 7, 2022
02cf2e0
Version bumped for release (#352)
JEuler Sep 13, 2022
34b3bda
Revert analyzer to ^4.1.0 and silence linters for Element.enclosingEl…
techouse Sep 13, 2022
426a16e
[chopper_generator] Update analyzer to ^4.4.0 and code_builde to ^4.3…
techouse Sep 17, 2022
35fdf8f
Add Makefiles to streamline development (#357)
techouse Sep 17, 2022
5a59ebf
Add Bug Report Github issue template (#359)
techouse Sep 18, 2022
fcf3478
[chopper_generator] Add types to the generated variables (#360)
techouse Sep 19, 2022
6b3b840
Provide an example using an Isolate Worker Pool with Squadron (#361)
techouse Sep 19, 2022
d74790c
mapToQuery changes (#364)
techouse Oct 8, 2022
0882a7e
Version bumped / changelog update (#367)
JEuler Oct 8, 2022
e3fd623
Request extends http.BaseRequest (#370)
techouse Oct 13, 2022
bd8d65f
Exclude null query vars by default and add new @Method annotation inc…
techouse Oct 14, 2022
786c153
5.1.0 (dev) (#373)
JEuler Oct 15, 2022
9b2b867
[workflow] Upgrade mono_repo to v6.4.1 (#375)
techouse Oct 15, 2022
233678e
Update analyzer to >=4.4.0 <6.0.0 (#378)
techouse Oct 17, 2022
1b2f1fa
Update mono_repo to 6.4.2 (#380)
techouse Oct 18, 2022
1e3e7f4
add techouse (#382)
JEuler Oct 18, 2022
b0fd18f
[Feature] Replace the String based path with Uri (#383)
Guldem Oct 31, 2022
9d1d86c
:memo: Add Authenticator example (#386)
techouse Nov 20, 2022
2775a73
Update getting-started.md (#391)
erlangparasu Dec 11, 2022
11a9ca5
Fix #388 Triggering Authenticator double encodes body in POST, PUT, P…
techouse Dec 11, 2022
bdbe210
Add image upload test (#392)
techouse Dec 11, 2022
b6ea960
Release 5.2.0 (#394)
JEuler Dec 13, 2022
1719c83
6.0.0 (#397)
JEuler Dec 14, 2022
7453582
Configurable HttpLoggingInterceptor (#399)
Guldem Jan 6, 2023
fa73de3
Made apply headers field name case insensitive. (#400)
Guldem Jan 8, 2023
bd3d7cc
:bulb: Clean up code in comments (#403)
techouse Jan 9, 2023
a910ede
Fix dead link on FAQs page (#404)
markasselin Jan 26, 2023
adfb1c5
Updated chopper version to 6.0.0 for chopper_built_value (#406)
Guldem Feb 2, 2023
253d69a
#290 implement Equatable (#410)
techouse Feb 22, 2023
9976752
Add Feature request Github issue template (#414)
techouse Mar 13, 2023
617f3f3
:construction_worker: add CODEOWNERS (#415)
techouse Mar 29, 2023
d83ad40
:arrow_up: Bump Dart SDK constraint to ">=2.17.0 <4.0.0" (#417)
techouse May 12, 2023
83f8c25
:green_heart: Fix CI publish (#419)
techouse May 13, 2023
64bd220
:green_heart: Fix CI publish credentials (#421)
techouse May 14, 2023
09774f1
:green_heart: Fix CI coverage reporting (#423)
techouse May 14, 2023
0145064
:construction_worker: only run CI publish / --dry-run when a package'…
techouse May 15, 2023
ef2fbf5
:green_heart: fix publish CI to run only on push (#425)
techouse May 15, 2023
08781c9
:green_heart: fix publish workflow (#427)
techouse May 20, 2023
485ef8f
Adding follow redirects to toHttpRequest (#430)
Joran-Dob May 26, 2023
a88aa3a
:arrow_up: update squadron example (#432)
techouse May 27, 2023
0546452
:arrow_up: update http constraint to ">=0.13.0 <2.0.0" (#431)
techouse May 27, 2023
ae8bff5
Add MultipartRequest log to CurlInterceptor (#435)
JosephNK May 27, 2023
d824ded
:green_heart: add cleanup step to publish workflow (#434)
techouse May 28, 2023
f4f9946
Merge branch 'develop' into release/v6.1.3
techouse May 28, 2023
ce2b115
:bookmark: release v6.1.3
techouse May 28, 2023
b7f278e
:memo: update changelogs
techouse May 28, 2023
d253e97
:memo: update changelogs
techouse May 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
- id: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 2
- run: git checkout HEAD^
- name: Load base version
id: load_base_version
run: |
Expand Down Expand Up @@ -79,4 +80,9 @@ jobs:
- name: Skip publish
id: skip_publish
if: ${{ env.IS_VERSION_GREATER == 0 }}
run: echo "Skipping publish for ${{ matrix.package }} because the version is not greater than the one on pub.dev"
run: echo "Skipping publish for ${{ matrix.package }} because the version is not greater than the one on pub.dev"
- name: Cleanup
id: cleanup
if: ${{ always() }}
run: |
rm -rf "$XDG_CONFIG_HOME/dart/pub-credentials.json"
57 changes: 34 additions & 23 deletions chopper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Changelog

## 6.1.3

- Add follow redirects to toHttpRequest ([#430](https://github.com/lejard-h/chopper/pull/430))
- Update http constraint to ">=0.13.0 <2.0.0" ([#431](https://github.com/lejard-h/chopper/pull/431))
- Add MultipartRequest log to CurlInterceptor ([#435](https://github.com/lejard-h/chopper/pull/435))

## 6.1.2

- Packages upgrade, constraints upgrade

## 6.1.1

- EquatableMixin for Request, Response and PartValue

## 6.1.0
Expand Down Expand Up @@ -37,6 +45,7 @@
## 4.0.1

- Fix for the null safety support

## 4.0.0

- **Null safety support**
Expand Down Expand Up @@ -73,15 +82,15 @@

**Breaking change**
New way to handle errors
if (response.isSuccessful) {
final body = response.body;
} else {
final error = response.error;
}
if (response.isSuccessful) {
final body = response.body;
} else {
final error = response.error;
}

- Fix error handling by introducing `Response.error` getter
- Remove `onError` since every response are available via `onResponse` stream


## 2.5.0

- Unsuccessful response are not throw anymore, use `Response.isSuccessful` getter or `statusCode` instead
Expand All @@ -90,8 +99,8 @@ New way to handle errors
## 2.4.2

- Fix on JsonConverter
If content type header overrided using @Post(headers: {'content-type': '...'})
The converter won't add json header and won't apply json.encode if content type is not JSON
If content type header overrided using @Post(headers: {'content-type': '...'})
The converter won't add json header and won't apply json.encode if content type is not JSON

- add `bool override` on `applyHeader(s)` functions, true by default

Expand All @@ -107,8 +116,9 @@ New way to handle errors
`Response.base` is now a `BaseRequest` instead of a `Request`, which means that you can't do base.body now.
Please use Response.bodyBytes or Response.bodyString instead for non streaming case.
- Now supports streams !
- You can pass `Stream<List<int>>` as a body to a request
- You can also use `Stream<List<int>>` as the BodyType for the response, in this case the returned response will contain a stream in `body`.
- You can pass `Stream<List<int>>` as a body to a request
- You can also use `Stream<List<int>>` as the BodyType for the response, in this case the returned response will
contain a stream in `body`.
- Support passing `MutlipartFile` (from packages:http) directly to `@FileField` annotation

## 2.3.2
Expand Down Expand Up @@ -138,12 +148,12 @@ New way to handle errors
## 2.2.0

- Fix converter issue on List
- ***Breaking Change***
on `Converter.convertResponse<ResultType>(response)`,
it take a new generic type => `Converter.convertResponse<ResultType, ItemType>(response)`
- ***Breaking Change***
on `Converter.convertResponse<ResultType>(response)`,
it take a new generic type => `Converter.convertResponse<ResultType, ItemType>(response)`

- deprecated `Chopper.service<Type>(Type)`, use `Chopper.getservice<Type>()` instead
thanks to @MichaelDark
thanks to @MichaelDark

## 2.1.0

Expand All @@ -159,30 +169,31 @@ thanks to @MichaelDark

- Request is now containing baseUrl
- Can call `Request.toHttpRequest()` direclty to get the `http.BaseRequest` will receive
- If a full url is specified in the `path` (ex: @Get(path: 'https://...')), it won't be concaten with the baseUrl of the ChopperClient and the ChopperAPI
- If a full url is specified in the `path` (ex: @Get(path: 'https://...')), it won't be concaten with the baseUrl of the
ChopperClient and the ChopperAPI
- Add `CurlInterceptor` thanks @edwardaux
- Add `HttpLoggingInterceptor`
- Add `FactoryConverter` annotation `@FactoryConverter(request: convertRequest, response: convertResponse)`

- ***BreakingChange***
- Method.url renamed to path
- `Converter.encode` and `Converter.decode` removed, implement `Converter.convertResponse` and Converter.convertRequest` instead
- `ChopperClient.jsonApi` deprecated, use a `JsonConverter` instead
- `ChopperClient.formUrlEncodedApi`, use `FormUrlEncodedConverter` instead
- remove `JsonEncoded` annotation, use `FactoryConverter` instead
- Method.url renamed to path
- `Converter.encode` and `Converter.decode` removed, implement `Converter.convertResponse` and
Converter.convertRequest` instead
- `ChopperClient.jsonApi` deprecated, use a `JsonConverter` instead
- `ChopperClient.formUrlEncodedApi`, use `FormUrlEncodedConverter` instead
- remove `JsonEncoded` annotation, use `FactoryConverter` instead

## 1.1.0

- ***BreakingChange***
Removed `name` parameter on `ChopperApi`
New way to instanciate a service
Removed `name` parameter on `ChopperApi`
New way to instanciate a service

@ChopperApi()
abstract class MyService extends ChopperService {
static MyService create([ChopperClient client]) => _$MyService(client);
}


## 1.0.0

- Multipart request
Expand Down
10 changes: 10 additions & 0 deletions chopper/lib/src/interceptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ class CurlInterceptor implements RequestInterceptor {
curl += ' -d \'$body\'';
}
}
if (baseRequest is http.MultipartRequest) {
final fields = baseRequest.fields;
final files = baseRequest.files;
fields.forEach((k, v) {
curl += ' -f \'$k: $v\'';
});
for (var file in files) {
curl += ' -f \'${file.field}: ${file.filename ?? ''}\'';
}
}
curl += ' "$url"';
chopperLogger.info(curl);

Expand Down
1 change: 1 addition & 0 deletions chopper/lib/src/request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class Request extends http.BaseRequest with EquatableMixin {
@visibleForTesting
http.Request toHttpRequest() {
final http.Request request = http.Request(method, url)
..followRedirects = followRedirects
..headers.addAll(headers);

if (body != null) {
Expand Down
4 changes: 2 additions & 2 deletions chopper/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: chopper
description: Chopper is an http client generator using source_gen, inspired by Retrofit
version: 6.1.2
version: 6.1.3
documentation: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper

Expand All @@ -9,7 +9,7 @@ environment:

dependencies:
equatable: ^2.0.5
http: ">=0.13.0 <1.0.0"
http: ">=0.13.0 <2.0.0"
logging: ^1.0.0
meta: ^1.3.0

Expand Down
29 changes: 29 additions & 0 deletions chopper/test/interceptors_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,35 @@ void main() {
),
);
});

final fakeRequestMultipart = Request(
'POST',
Uri.parse('/'),
Uri.parse('base'),
headers: {'foo': 'bar'},
parts: [
PartValue<int>('p1', 123),
PartValueFile<http.MultipartFile>(
'p2',
http.MultipartFile.fromBytes('file', [0], filename: 'filename'),
),
],
multipart: true,
);

test('Curl interceptors Multipart', () async {
final curl = CurlInterceptor();
var log = '';
chopperLogger.onRecord.listen((r) => log = r.message);
await curl.onRequest(fakeRequestMultipart);

expect(
log,
equals(
"curl -v -X POST -H 'foo: bar' -f 'p1: 123' -f 'file: filename' \"base/\"",
),
);
});
});
}

Expand Down
4 changes: 4 additions & 0 deletions chopper_built_value/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.2

- Update http constraint to ">=0.13.0 <2.0.0" ([#431](https://github.com/lejard-h/chopper/pull/431))

## 1.2.1

- Packages upgrade, constraints upgrade
Expand Down
4 changes: 2 additions & 2 deletions chopper_built_value/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: chopper_built_value
description: A built_value based Converter for Chopper.
version: 1.2.1
version: 1.2.2
documentation: https://hadrien-lejard.gitbook.io/chopper/converters/built-value-converter
repository: https://github.com/lejard-h/chopper

Expand All @@ -11,7 +11,7 @@ dependencies:
built_value: ^8.0.0
built_collection: ^5.0.0
chopper: ^6.0.0
http: ^0.13.0
http: ">=0.13.0 <2.0.0"

dev_dependencies:
test: ^1.16.4
Expand Down
49 changes: 26 additions & 23 deletions chopper_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
## 4.0.1

- Fix for the null safety support

## 4.0.0

- **Null safety support**
- Fix `@Header` annotation not generating null safe code
- Respect `required` keyword in functions


## 3.0.5

- Packages upgrade
Expand All @@ -66,7 +66,8 @@

## 3.0.0

- Maintenance release to support last version of `chopper` package (3.0.0) that introduced a breaking change on error handling
- Maintenance release to support last version of `chopper` package (3.0.0) that introduced a breaking change on error
handling

## 2.5.0

Expand All @@ -76,8 +77,8 @@
## 2.4.2

- Fix on JsonConverter
If content type header overrided using @Post(headers: {'content-type': '...'})
The converter won't add json header and won't apply json.encode if content type is not JSON
If content type header overrided using @Post(headers: {'content-type': '...'})
The converter won't add json header and won't apply json.encode if content type is not JSON

- add `bool override` on `applyHeader(s)` functions, true by default

Expand All @@ -94,7 +95,7 @@

## 2.3.4

fix trailing slash when empty path
fix trailing slash when empty path

## 2.3.3

Expand Down Expand Up @@ -127,12 +128,12 @@
## 2.2.0

- Fix converter issue on List
- ***Breaking Change***
on `Converter.convertResponse<ResultType>(response)`,
it take a new generic type => `Converter.convertResponse<ResultType, ItemType>(response)`
- ***Breaking Change***
on `Converter.convertResponse<ResultType>(response)`,
it take a new generic type => `Converter.convertResponse<ResultType, ItemType>(response)`

- deprecated `Chopper.service<Type>(Type)`, use `Chopper.getservice<Type>()` instead
thanks to @MichaelDark
thanks to @MichaelDark

## 2.1.0

Expand All @@ -142,29 +143,31 @@ thanks to @MichaelDark

- Request is now containing baseUrl
- Can call `Request.toHttpRequest()` direclty to get the `http.BaseRequest` will receive
- If a full url is specified in the `path` (ex: @Get(path: 'https://...')), it won't be concaten with the baseUrl of the ChopperClient and the ChopperAPI
- If a full url is specified in the `path` (ex: @Get(path: 'https://...')), it won't be concaten with the baseUrl of the
ChopperClient and the ChopperAPI
- Add `CurlInterceptor` thanks @edwardaux
- Add `HttpLoggingInterceptor`
- Add `FactoryConverter` annotation `@FactoryConverter(request: convertRequest, response: convertResponse)`

- ***BreakingChange***
- Method.url renamed to path
- `Converter.encode` and `Converter.decode` removed, implement `Converter.convertResponse` and Converter.convertRequest` instead
- `ChopperClient.jsonApi` deprecated, use a `JsonConverter` instead
- `ChopperClient.formUrlEncodedApi`, use `FormUrlEncodedConverter` instead
- remove `JsonEncoded` annotation, use `FactoryConverter` instead
- Method.url renamed to path
- `Converter.encode` and `Converter.decode` removed, implement `Converter.convertResponse` and
Converter.convertRequest` instead
- `ChopperClient.jsonApi` deprecated, use a `JsonConverter` instead
- `ChopperClient.formUrlEncodedApi`, use `FormUrlEncodedConverter` instead
- remove `JsonEncoded` annotation, use `FactoryConverter` instead

## 1.1.0

- ***BreakingChange***
Removed `name` parameter on `ChopperApi`
New way to instanciate a service
```dart
@ChopperApi()
abstract class MyService extends ChopperService {
static MyService create([ChopperClient client]) => _$MyService(client);
}
```
Removed `name` parameter on `ChopperApi`
New way to instanciate a service
```dart
@ChopperApi()
abstract class MyService extends ChopperService {
static MyService create([ChopperClient client]) => _$MyService(client);
}
```

## 1.0.1

Expand Down
1 change: 1 addition & 0 deletions chopper_generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {
_typeChecker(Map).isExactlyType(type) ||
_typeChecker(BuiltMap).isExactlyType(type)) return type;

// ignore: deprecated_member_use
if (generic.isDynamic) return null;

if (_typeChecker(List).isExactlyType(type) ||
Expand Down
6 changes: 5 additions & 1 deletion example/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ targets:
any_map: false
checked: false
explicit_to_json: true
create_to_json: true
create_to_json: true
squadron_builder:worker_builder:
options:
with_finalizers: true
serialization_type: List
2 changes: 1 addition & 1 deletion example/lib/json_decode_service.vm.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading