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

fix: Add access client in parse clients #1025

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions packages/dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [8.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-8.0.0...flutter-8.1.0) (2024-11-28)

### Features

* Add access client in parse clients ([#1025](https://github.com/parse-community/Parse-SDK-Flutter/pull/1025))

## [8.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-7.0.1...dart-8.0.0) (2024-10-17)

### BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/base/parse_constants.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
part of '../../parse_server_sdk.dart';

// Library
const String keySdkVersion = '8.0.0';
const String keySdkVersion = '8.1.0';
const String keyLibraryName = 'Flutter Parse SDK';

// End Points
Expand Down
2 changes: 2 additions & 0 deletions packages/dart/lib/src/network/parse_dio_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class ParseDioClient extends ParseClient {

late _ParseDioClient _client;

dio.Dio get dioClient => _client;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code cov missing, add tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.


@override
Future<ParseNetworkResponse> get(
String path, {
Expand Down
2 changes: 2 additions & 0 deletions packages/dart/lib/src/network/parse_http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class ParseHTTPClient extends ParseClient {

late _ParseHTTPClient _client;

http.BaseClient get httpClient => _client;

Map<String, String>? get additionalHeaders => _client.additionalHeaders;

set additionalHeaders(Map<String, String>? additionalHeaders) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: parse_server_sdk
description: The Dart SDK to connect to Parse Server. Build your apps faster with Parse Platform, the complete application stack.
version: 8.0.0
version: 8.1.0
homepage: https://parseplatform.org
repository: https://github.com/parse-community/Parse-SDK-Flutter
issue_tracker: https://github.com/parse-community/Parse-SDK-Flutter/issues
Expand Down
28 changes: 28 additions & 0 deletions packages/dart/test/src/network/parse_dio_client_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:dio/dio.dart';
import 'package:parse_server_sdk/parse_server_sdk.dart';
import 'package:test/test.dart';

import '../../test_utils.dart';

void main() {
setUpAll(() async {
await initializeParse();
});

group('ParseDioClient Tests', () {
late ParseDioClient parseDioClient;

setUp(() async {
parseDioClient = ParseDioClient();
});

test('should return an instance of Dio from dioClient', () {
// arrange
final dioClient = parseDioClient.dioClient;

// assert
expect(dioClient, isNotNull);
expect(dioClient, isA<Dio>());
});
});
}
28 changes: 28 additions & 0 deletions packages/dart/test/src/network/parse_http_client_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:http/http.dart' as http;
import 'package:parse_server_sdk/parse_server_sdk.dart';
import 'package:test/test.dart';

import '../../test_utils.dart';

void main() {
setUpAll(() async {
await initializeParse();
});

group('ParseDioClient Tests', () {
late ParseHTTPClient parseHTTPClient;

setUp(() async {
parseHTTPClient = ParseHTTPClient();
});

test('should return an instance of Dio from dioClient', () {
// arrange
final dioClient = parseHTTPClient.httpClient;

// assert
expect(dioClient, isNotNull);
expect(dioClient, isA<http.BaseClient>());
});
});
}
Loading