Skip to content

Commit 3080973

Browse files
committed
fix changelog
1 parent 19abf5a commit 3080973

File tree

8 files changed

+31
-27
lines changed

8 files changed

+31
-27
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-
* Fix realtime multiple subscription issues
3+
* Fixed 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<models.User> deleteMfaAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
234+
Future 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 models.User.fromMap(res.data);
247+
return res.data;
248248

249249
}
250250

lib/src/enums/flag.dart

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

lib/src/models/mfa_factors.dart

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

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

1214
MfaFactors({
1315
required this.totp,
1416
required this.phone,
1517
required this.email,
18+
required this.recoveryCode,
1619
});
1720

1821
factory MfaFactors.fromMap(Map<String, dynamic> map) {
1922
return MfaFactors(
2023
totp: map['totp'],
2124
phone: map['phone'],
2225
email: map['email'],
26+
recoveryCode: map['recoveryCode'],
2327
);
2428
}
2529

@@ -28,6 +32,7 @@ class MfaFactors implements Model {
2832
"totp": totp,
2933
"phone": phone,
3034
"email": email,
35+
"recoveryCode": recoveryCode,
3136
};
3237
}
3338
}

lib/src/models/session.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ 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;
911
/// User ID.
1012
final String userId;
1113
/// Session expiration date in ISO 8601 format.
@@ -62,6 +64,7 @@ class Session implements Model {
6264
Session({
6365
required this.$id,
6466
required this.$createdAt,
67+
required this.$updatedAt,
6568
required this.userId,
6669
required this.expire,
6770
required this.provider,
@@ -94,6 +97,7 @@ class Session implements Model {
9497
return Session(
9598
$id: map['\$id'].toString(),
9699
$createdAt: map['\$createdAt'].toString(),
100+
$updatedAt: map['\$updatedAt'].toString(),
97101
userId: map['userId'].toString(),
98102
expire: map['expire'].toString(),
99103
provider: map['provider'].toString(),
@@ -127,6 +131,7 @@ class Session implements Model {
127131
return {
128132
"\$id": $id,
129133
"\$createdAt": $createdAt,
134+
"\$updatedAt": $updatedAt,
130135
"userId": userId,
131136
"expire": expire,
132137
"provider": provider,

test/services/account_test.dart

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

301301
test('test method deleteMfaAuthenticator()', () async {
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-
302+
final data = '';
320303

321304
when(client.call(
322305
HttpMethod.delete,
@@ -327,8 +310,6 @@ void main() {
327310
type: 'totp',
328311
otp: '<OTP>',
329312
);
330-
expect(response, isA<models.User>());
331-
332313
});
333314

334315
test('test method createMfaChallenge()', () async {
@@ -369,7 +350,8 @@ void main() {
369350
final Map<String, dynamic> data = {
370351
'totp': true,
371352
'phone': true,
372-
'email': true,};
353+
'email': true,
354+
'recoveryCode': true,};
373355

374356

375357
when(client.call(
@@ -655,6 +637,7 @@ void main() {
655637
final Map<String, dynamic> data = {
656638
'\$id': '5e5ea5c16897e',
657639
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
640+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
658641
'userId': '5e5bb8c16897e',
659642
'expire': '2020-10-15T06:38:00.000+00:00',
660643
'provider': 'email',
@@ -698,6 +681,7 @@ void main() {
698681
final Map<String, dynamic> data = {
699682
'\$id': '5e5ea5c16897e',
700683
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
684+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
701685
'userId': '5e5bb8c16897e',
702686
'expire': '2020-10-15T06:38:00.000+00:00',
703687
'provider': 'email',
@@ -743,6 +727,7 @@ void main() {
743727
final Map<String, dynamic> data = {
744728
'\$id': '5e5ea5c16897e',
745729
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
730+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
746731
'userId': '5e5bb8c16897e',
747732
'expire': '2020-10-15T06:38:00.000+00:00',
748733
'provider': 'email',
@@ -800,6 +785,7 @@ void main() {
800785
final Map<String, dynamic> data = {
801786
'\$id': '5e5ea5c16897e',
802787
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
788+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
803789
'userId': '5e5bb8c16897e',
804790
'expire': '2020-10-15T06:38:00.000+00:00',
805791
'provider': 'email',
@@ -845,6 +831,7 @@ void main() {
845831
final Map<String, dynamic> data = {
846832
'\$id': '5e5ea5c16897e',
847833
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
834+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
848835
'userId': '5e5bb8c16897e',
849836
'expire': '2020-10-15T06:38:00.000+00:00',
850837
'provider': 'email',
@@ -890,6 +877,7 @@ void main() {
890877
final Map<String, dynamic> data = {
891878
'\$id': '5e5ea5c16897e',
892879
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
880+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
893881
'userId': '5e5bb8c16897e',
894882
'expire': '2020-10-15T06:38:00.000+00:00',
895883
'provider': 'email',
@@ -934,6 +922,7 @@ void main() {
934922
final Map<String, dynamic> data = {
935923
'\$id': '5e5ea5c16897e',
936924
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
925+
'\$updatedAt': '2020-10-15T06:38:00.000+00:00',
937926
'userId': '5e5bb8c16897e',
938927
'expire': '2020-10-15T06:38:00.000+00:00',
939928
'provider': 'email',

test/src/models/mfa_factors_test.dart

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

1415
final map = model.toMap();
@@ -17,6 +18,7 @@ void main() {
1718
expect(result.totp, true);
1819
expect(result.phone, true);
1920
expect(result.email, true);
21+
expect(result.recoveryCode, true);
2022
});
2123
});
2224
}

test/src/models/session_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ 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',
1112
userId: '5e5bb8c16897e',
1213
expire: '2020-10-15T06:38:00.000+00:00',
1314
provider: 'email',
@@ -41,6 +42,7 @@ void main() {
4142

4243
expect(result.$id, '5e5ea5c16897e');
4344
expect(result.$createdAt, '2020-10-15T06:38:00.000+00:00');
45+
expect(result.$updatedAt, '2020-10-15T06:38:00.000+00:00');
4446
expect(result.userId, '5e5bb8c16897e');
4547
expect(result.expire, '2020-10-15T06:38:00.000+00:00');
4648
expect(result.provider, 'email');

0 commit comments

Comments
 (0)