Skip to content

Commit 19abf5a

Browse files
committed
fix changelog
1 parent 8b01d6f commit 19abf5a

File tree

8 files changed

+27
-31
lines changed

8 files changed

+27
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 12.0.2
22

3-
* Fixed realtime multiple subscription issues
3+
* Fix realtime multiple subscription issues
44

55
## 12.0.1
66

lib/services/account.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class Account extends Service {
231231
/// Delete Authenticator
232232
///
233233
/// Delete an authenticator for a user by ID.
234-
Future deleteMfaAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
234+
Future<models.User> deleteMfaAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
235235
final String apiPath = '/account/mfa/authenticators/{type}'.replaceAll('{type}', type.value);
236236

237237
final Map<String, dynamic> apiParams = {
@@ -244,7 +244,7 @@ class Account extends Service {
244244

245245
final res = await client.call(HttpMethod.delete, path: apiPath, params: apiParams, headers: apiHeaders);
246246

247-
return res.data;
247+
return models.User.fromMap(res.data);
248248

249249
}
250250

lib/src/enums/flag.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ enum Flag {
142142
palau(value: 'pw'),
143143
papuaNewGuinea(value: 'pg'),
144144
poland(value: 'pl'),
145-
frenchPolynesia(value: 'pf'),
146145
northKorea(value: 'kp'),
147146
portugal(value: 'pt'),
148147
paraguay(value: 'py'),

lib/src/models/mfa_factors.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,24 @@ part of '../../models.dart';
22

33
/// MFAFactors
44
class MfaFactors implements Model {
5-
/// Can TOTP be used for MFA challenge for this account.
5+
/// TOTP
66
final bool totp;
7-
/// Can phone (SMS) be used for MFA challenge for this account.
7+
/// Phone
88
final bool phone;
9-
/// Can email be used for MFA challenge for this account.
9+
/// Email
1010
final bool email;
11-
/// Can recovery code be used for MFA challenge for this account.
12-
final bool recoveryCode;
1311

1412
MfaFactors({
1513
required this.totp,
1614
required this.phone,
1715
required this.email,
18-
required this.recoveryCode,
1916
});
2017

2118
factory MfaFactors.fromMap(Map<String, dynamic> map) {
2219
return MfaFactors(
2320
totp: map['totp'],
2421
phone: map['phone'],
2522
email: map['email'],
26-
recoveryCode: map['recoveryCode'],
2723
);
2824
}
2925

@@ -32,7 +28,6 @@ class MfaFactors implements Model {
3228
"totp": totp,
3329
"phone": phone,
3430
"email": email,
35-
"recoveryCode": recoveryCode,
3631
};
3732
}
3833
}

lib/src/models/session.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ class Session implements Model {
66
final String $id;
77
/// Session creation date in ISO 8601 format.
88
final String $createdAt;
9-
/// Session update date in ISO 8601 format.
10-
final String $updatedAt;
119
/// User ID.
1210
final String userId;
1311
/// Session expiration date in ISO 8601 format.
@@ -64,7 +62,6 @@ class Session implements Model {
6462
Session({
6563
required this.$id,
6664
required this.$createdAt,
67-
required this.$updatedAt,
6865
required this.userId,
6966
required this.expire,
7067
required this.provider,
@@ -97,7 +94,6 @@ class Session implements Model {
9794
return Session(
9895
$id: map['\$id'].toString(),
9996
$createdAt: map['\$createdAt'].toString(),
100-
$updatedAt: map['\$updatedAt'].toString(),
10197
userId: map['userId'].toString(),
10298
expire: map['expire'].toString(),
10399
provider: map['provider'].toString(),
@@ -131,7 +127,6 @@ class Session implements Model {
131127
return {
132128
"\$id": $id,
133129
"\$createdAt": $createdAt,
134-
"\$updatedAt": $updatedAt,
135130
"userId": userId,
136131
"expire": expire,
137132
"provider": provider,

test/services/account_test.dart

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,24 @@ void main() {
299299
});
300300

301301
test('test method deleteMfaAuthenticator()', () async {
302-
final data = '';
302+
final Map<String, dynamic> data = {
303+
'\$id': '5e5ea5c16897e',
304+
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
305+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
306+
'name': 'John Doe',
307+
'registration': '2020-10-15T06:38:00.000+00:00',
308+
'status': true,
309+
'labels': [],
310+
'passwordUpdate': '2020-10-15T06:38:00.000+00:00',
311+
'email': '[email protected]',
312+
'phone': '+4930901820',
313+
'emailVerification': true,
314+
'phoneVerification': true,
315+
'mfa': true,
316+
'prefs': <String, dynamic>{},
317+
'targets': [],
318+
'accessedAt': '2020-10-15T06:38:00.000+00:00',};
319+
303320

304321
when(client.call(
305322
HttpMethod.delete,
@@ -310,6 +327,8 @@ void main() {
310327
type: 'totp',
311328
otp: '<OTP>',
312329
);
330+
expect(response, isA<models.User>());
331+
313332
});
314333

315334
test('test method createMfaChallenge()', () async {
@@ -350,8 +369,7 @@ void main() {
350369
final Map<String, dynamic> data = {
351370
'totp': true,
352371
'phone': true,
353-
'email': true,
354-
'recoveryCode': true,};
372+
'email': true,};
355373

356374

357375
when(client.call(
@@ -637,7 +655,6 @@ void main() {
637655
final Map<String, dynamic> data = {
638656
'\$id': '5e5ea5c16897e',
639657
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
640-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
641658
'userId': '5e5bb8c16897e',
642659
'expire': '2020-10-15T06:38:00.000+00:00',
643660
'provider': 'email',
@@ -681,7 +698,6 @@ void main() {
681698
final Map<String, dynamic> data = {
682699
'\$id': '5e5ea5c16897e',
683700
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
684-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
685701
'userId': '5e5bb8c16897e',
686702
'expire': '2020-10-15T06:38:00.000+00:00',
687703
'provider': 'email',
@@ -727,7 +743,6 @@ void main() {
727743
final Map<String, dynamic> data = {
728744
'\$id': '5e5ea5c16897e',
729745
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
730-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
731746
'userId': '5e5bb8c16897e',
732747
'expire': '2020-10-15T06:38:00.000+00:00',
733748
'provider': 'email',
@@ -785,7 +800,6 @@ void main() {
785800
final Map<String, dynamic> data = {
786801
'\$id': '5e5ea5c16897e',
787802
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
788-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
789803
'userId': '5e5bb8c16897e',
790804
'expire': '2020-10-15T06:38:00.000+00:00',
791805
'provider': 'email',
@@ -831,7 +845,6 @@ void main() {
831845
final Map<String, dynamic> data = {
832846
'\$id': '5e5ea5c16897e',
833847
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
834-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
835848
'userId': '5e5bb8c16897e',
836849
'expire': '2020-10-15T06:38:00.000+00:00',
837850
'provider': 'email',
@@ -877,7 +890,6 @@ void main() {
877890
final Map<String, dynamic> data = {
878891
'\$id': '5e5ea5c16897e',
879892
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
880-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
881893
'userId': '5e5bb8c16897e',
882894
'expire': '2020-10-15T06:38:00.000+00:00',
883895
'provider': 'email',
@@ -922,7 +934,6 @@ void main() {
922934
final Map<String, dynamic> data = {
923935
'\$id': '5e5ea5c16897e',
924936
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
925-
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
926937
'userId': '5e5bb8c16897e',
927938
'expire': '2020-10-15T06:38:00.000+00:00',
928939
'provider': 'email',

test/src/models/mfa_factors_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ void main() {
99
totp: true,
1010
phone: true,
1111
email: true,
12-
recoveryCode: true,
1312
);
1413

1514
final map = model.toMap();
@@ -18,7 +17,6 @@ void main() {
1817
expect(result.totp, true);
1918
expect(result.phone, true);
2019
expect(result.email, true);
21-
expect(result.recoveryCode, true);
2220
});
2321
});
2422
}

test/src/models/session_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ void main() {
88
final model = Session(
99
$id: '5e5ea5c16897e',
1010
$createdAt: '2020-10-15T06:38:00.000+00:00',
11-
$updatedAt: '2020-10-15T06:38:00.000+00:00',
1211
userId: '5e5bb8c16897e',
1312
expire: '2020-10-15T06:38:00.000+00:00',
1413
provider: 'email',
@@ -42,7 +41,6 @@ void main() {
4241

4342
expect(result.$id, '5e5ea5c16897e');
4443
expect(result.$createdAt, '2020-10-15T06:38:00.000+00:00');
45-
expect(result.$updatedAt, '2020-10-15T06:38:00.000+00:00');
4644
expect(result.userId, '5e5bb8c16897e');
4745
expect(result.expire, '2020-10-15T06:38:00.000+00:00');
4846
expect(result.provider, 'email');

0 commit comments

Comments
 (0)