Skip to content

Commit cd50db5

Browse files
committed
chore: rename package
1 parent b7de5cc commit cd50db5

File tree

8 files changed

+98
-94
lines changed

8 files changed

+98
-94
lines changed

.github/dependabot.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ updates:
1010
schedule:
1111
interval: "weekly"
1212
ignore:
13-
- dependency-name: "ht_*"
13+
- dependency-name: "core"
14+
- dependency-name: "auth_client"
15+
- dependency-name: "kv_storage_service"

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: main
22

33
concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# ht_auth_repository
1+
# auth_repository
22

33
![coverage: percentage](https://img.shields.io/badge/coverage-100-green)
44
[![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)
55
[![License: PolyForm Free Trial](https://img.shields.io/badge/License-PolyForm%20Free%20Trial-blue)](https://polyformproject.org/licenses/free-trial/1.0.0)
66

7-
A repository package that provides an abstraction layer over authentication operations. It wraps an `HtAuthClient` implementation, offering a clean interface for authentication flows, ensuring standardized exception propagation, and handling authentication token persistence using `HtKVStorageService`.
7+
A repository package that provides an abstraction layer over authentication operations. It wraps an `AuthClient` implementation, offering a clean interface for authentication flows, ensuring standardized exception propagation, and handling authentication token persistence using `HtKVStorageService`.
88

99
## Getting Started
1010

1111
Add the package to your `pubspec.yaml`:
1212

1313
```yaml
1414
dependencies:
15-
ht_auth_repository: any # Use the latest version
15+
auth_repository: any # Use the latest version
1616
```
1717
1818
## Features
@@ -27,24 +27,24 @@ dependencies:
2727
- `signOut`: Signs out the user and clears the auth token.
2828
- Manages authentication token persistence internally using `HtKVStorageService`.
2929
- Exposes `saveAuthToken(String token)`, `getAuthToken()`, and `clearAuthToken()` for direct token manipulation if needed, but these are typically handled by the main auth flow methods.
30-
- Propagates standardized `HtHttpException`s from the underlying client and `StorageException`s from the storage service.
30+
- Propagates standardized `HttpException`s from the underlying client and `StorageException`s from the storage service.
3131

3232
## Usage
3333

34-
Instantiate `HtAuthRepository` by providing implementations of `HtAuthClient` and `HtKVStorageService`:
34+
Instantiate `AuthRepository` by providing implementations of `AuthClient` and `HtKVStorageService`:
3535

3636
```dart
37-
import 'package:ht_auth_client/ht_auth_client.dart';
38-
import 'package:ht_auth_repository/ht_auth_repository.dart';
37+
import 'package:auth_client/auth_client.dart';
38+
import 'package:auth_repository/auth_repository.dart';
3939
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
4040
41-
// Assume ConcreteAuthClient is an implementation of HtAuthClient
41+
// Assume ConcreteAuthClient is an implementation of AuthClient
4242
final authClient = ConcreteAuthClient(...);
4343
4444
// Assume ConcreteKVStorageService is an implementation of HtKVStorageService
4545
final storageService = ConcreteKVStorageService(...);
4646
47-
final authRepository = HtAuthRepository(
47+
final authRepository = AuthRepository(
4848
authClient: authClient,
4949
storageService: storageService,
5050
);
@@ -102,6 +102,8 @@ Future<String?> getTokenForHttpClient() async {
102102
}
103103
```
104104

105-
## License
105+
## 🔑 Licensing
106106

107-
This package is licensed under the [PolyForm Free Trial](LICENSE). Please review the terms before use.
107+
This package is source-available and licensed under the [PolyForm Free Trial 1.0.0](LICENSE). Please review the terms before use.
108+
109+
For commercial licensing options that grant the right to build and distribute unlimited applications, please visit the main [**Flutter News App - Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code) organization.

coverage/lcov.info

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
SF:lib/src/ht_auth_repository.dart
1+
SF:lib\src\auth_repository.dart
22
DA:22,1
33
DA:34,3
44
DA:42,1
55
DA:44,2
66
DA:45,1
7-
DA:58,1
8-
DA:60,2
9-
DA:61,1
10-
DA:72,1
11-
DA:74,2
12-
DA:76,1
13-
DA:77,1
14-
DA:78,1
7+
DA:59,1
8+
DA:64,2
9+
DA:68,1
1510
DA:80,1
16-
DA:82,1
17-
DA:95,1
18-
DA:97,2
19-
DA:99,1
20-
DA:100,1
21-
DA:101,1
22-
DA:103,1
23-
DA:105,1
24-
DA:118,1
25-
DA:120,2
11+
DA:86,2
12+
DA:92,1
13+
DA:93,1
14+
DA:94,1
15+
DA:96,1
16+
DA:98,1
17+
DA:111,1
18+
DA:113,2
19+
DA:115,1
20+
DA:116,1
21+
DA:117,1
22+
DA:119,1
2623
DA:121,1
27-
DA:122,1
28-
DA:124,1
29-
DA:132,1
30-
DA:134,2
31-
DA:135,1
24+
DA:134,1
25+
DA:136,2
26+
DA:137,1
3227
DA:138,1
28+
DA:140,1
3329
DA:148,1
3430
DA:150,2
3531
DA:151,1
36-
DA:153,1
37-
DA:155,1
38-
DA:163,1
39-
DA:165,3
40-
DA:166,1
32+
DA:154,1
33+
DA:164,1
34+
DA:166,2
35+
DA:167,1
36+
DA:169,1
37+
DA:171,1
38+
DA:179,1
39+
DA:181,3
40+
DA:182,1
4141
LF:39
4242
LH:39
4343
end_of_record

lib/ht_auth_repository.dart renamed to lib/auth_repository.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// authentication operations.
33
library;
44

5-
export 'src/ht_auth_repository.dart';
5+
export 'src/auth_repository.dart';

lib/src/ht_auth_repository.dart renamed to lib/src/auth_repository.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,46 @@
33

44
import 'dart:async';
55

6-
import 'package:ht_auth_client/ht_auth_client.dart';
6+
import 'package:auth_client/auth_client.dart';
7+
import 'package:core/core.dart';
78
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
8-
import 'package:ht_shared/ht_shared.dart';
99

10-
/// {@template ht_auth_repository}
10+
/// {@template auth_repository}
1111
/// A repository that manages authentication operations.
1212
///
13-
/// This repository acts as an abstraction layer over an [HtAuthClient],
13+
/// This repository acts as an abstraction layer over an [AuthClient],
1414
/// providing a consistent interface for authentication flows and
1515
/// propagating standardized exceptions.
1616
/// {@endtemplate}
17-
class HtAuthRepository {
18-
/// {@macro ht_auth_repository}
17+
class AuthRepository {
18+
/// {@macro auth_repository}
1919
///
20-
/// Requires an instance of [HtAuthClient] to handle the actual
20+
/// Requires an instance of [AuthClient] to handle the actual
2121
/// authentication operations.
22-
const HtAuthRepository({
23-
required HtAuthClient authClient,
22+
const AuthRepository({
23+
required AuthClient authClient,
2424
required HtKVStorageService storageService,
2525
}) : _authClient = authClient,
2626
_storageService = storageService;
2727

28-
final HtAuthClient _authClient;
28+
final AuthClient _authClient;
2929
final HtKVStorageService _storageService;
3030

3131
/// Stream emitting the current authenticated [User] or `null`.
3232
///
33-
/// Delegates to the underlying [HtAuthClient]'s stream.
33+
/// Delegates to the underlying [AuthClient]'s stream.
3434
Stream<User?> get authStateChanges => _authClient.authStateChanges;
3535

3636
/// Retrieves the currently authenticated [User], if any.
3737
///
38-
/// Delegates to the underlying [HtAuthClient]'s method.
38+
/// Delegates to the underlying [AuthClient]'s method.
3939
///
40-
/// Throws [HtHttpException] or its subtypes on failure, as propagated
40+
/// Throws [HttpException] or its subtypes on failure, as propagated
4141
/// from the client.
4242
Future<User?> getCurrentUser() async {
4343
try {
4444
return await _authClient.getCurrentUser();
45-
} on HtHttpException {
45+
} on HttpException {
4646
rethrow; // Propagate client-level exceptions
4747
}
4848
// Catch-all for unexpected errors is generally avoided here,
@@ -52,9 +52,9 @@ class HtAuthRepository {
5252
/// Initiates the sign-in/sign-up process using the email+code flow.
5353
///
5454
/// This method is context-aware and can signal a dashboard login.
55-
/// Delegates to the underlying [HtAuthClient]'s method.
55+
/// Delegates to the underlying [AuthClient]'s method.
5656
///
57-
/// Throws [HtHttpException] or its subtypes on failure, as propagated
57+
/// Throws [HttpException] or its subtypes on failure, as propagated
5858
/// from the client.
5959
Future<void> requestSignInCode(
6060
String email, {
@@ -65,17 +65,17 @@ class HtAuthRepository {
6565
email,
6666
isDashboardLogin: isDashboardLogin,
6767
);
68-
} on HtHttpException {
68+
} on HttpException {
6969
rethrow; // Propagate client-level exceptions
7070
}
7171
}
7272

7373
/// Verifies the email code provided by the user and completes sign-in/sign-up.
7474
///
7575
/// This method is context-aware and can signal a dashboard login.
76-
/// Delegates to the underlying [HtAuthClient]'s method.
76+
/// Delegates to the underlying [AuthClient]'s method.
7777
///
78-
/// Throws [HtHttpException] or its subtypes on failure, as propagated
78+
/// Throws [HttpException] or its subtypes on failure, as propagated
7979
/// from the client.
8080
Future<User> verifySignInCode(
8181
String email,
@@ -93,7 +93,7 @@ class HtAuthRepository {
9393
final user = authResponse.user;
9494
await saveAuthToken(token);
9595
return user;
96-
} on HtHttpException {
96+
} on HttpException {
9797
rethrow; // Propagate client-level exceptions
9898
} on StorageException {
9999
rethrow; // Propagate storage exceptions during token save
@@ -102,10 +102,10 @@ class HtAuthRepository {
102102

103103
/// Signs in the user anonymously.
104104
///
105-
/// Delegates to the underlying [HtAuthClient]'s method.
105+
/// Delegates to the underlying [AuthClient]'s method.
106106
/// After successful sign-in, saves the token and returns the user.
107107
///
108-
/// Throws [HtHttpException] or its subtypes on failure, as propagated
108+
/// Throws [HttpException] or its subtypes on failure, as propagated
109109
/// from the client.
110110
/// Throws [StorageException] if saving the token fails.
111111
Future<User> signInAnonymously() async {
@@ -116,7 +116,7 @@ class HtAuthRepository {
116116
final user = authResponse.user;
117117
await saveAuthToken(token);
118118
return user;
119-
} on HtHttpException {
119+
} on HttpException {
120120
rethrow; // Propagate client-level exceptions
121121
} on StorageException {
122122
rethrow; // Propagate storage exceptions during token save
@@ -125,17 +125,17 @@ class HtAuthRepository {
125125

126126
/// Signs out the current user (whether authenticated normally or anonymously).
127127
///
128-
/// Delegates to the underlying [HtAuthClient]'s method.
128+
/// Delegates to the underlying [AuthClient]'s method.
129129
/// After successful sign-out, clears the authentication token from storage.
130130
///
131-
/// Throws [HtHttpException] or its subtypes on failure, as propagated
131+
/// Throws [HttpException] or its subtypes on failure, as propagated
132132
/// from the client.
133133
/// Throws [StorageException] if clearing the token fails.
134134
Future<void> signOut() async {
135135
try {
136136
await _authClient.signOut();
137137
await clearAuthToken();
138-
} on HtHttpException {
138+
} on HttpException {
139139
rethrow; // Propagate client-level exceptions
140140
} on StorageException {
141141
rethrow; // Propagate storage exceptions during token clear

pubspec.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: ht_auth_repository
1+
name: auth_repository
22
description: A repository package that provides an abstraction layer over authentication operations.
3-
repository: https://github.com/headlines-toolkit/ht-auth-repository
3+
repository: https://github.com/flutter-news-app-full-source-code/auth-repository
44
publish_to: none
55

66
environment:
77
sdk: ^3.8.0
88

99
dependencies:
10-
ht_auth_client:
10+
auth_client:
1111
git:
12-
url: https://github.com/headlines-toolkit/ht-auth-client.git
13-
ht_kv_storage_service:
12+
url: https://github.com/flutter-news-app-full-source-code/auth-client.git
13+
core:
1414
git:
15-
url: https://github.com/headlines-toolkit/ht-kv-storage-service.git
16-
ht_shared:
15+
url: https://github.com/flutter-news-app-full-source-code/core.git
16+
ht_kv_storage_service:
1717
git:
18-
url: https://github.com/headlines-toolkit/ht-shared.git
19-
18+
url: https://github.com/flutter-news-app-full-source-code/ht-kv-storage-service.git
19+
2020
dev_dependencies:
2121
mocktail: ^1.0.4
2222
test: ^1.25.8
23-
very_good_analysis: ^7.0.0
23+
very_good_analysis: ^9.0.0

0 commit comments

Comments
 (0)