Skip to content

Commit 18c5342

Browse files
committed
fix: minor bugs
1 parent b285025 commit 18c5342

File tree

15 files changed

+47
-38
lines changed

15 files changed

+47
-38
lines changed

CHANGELOG.md

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

3-
* Upgraded dependencies
3+
* Minor bugfixes
44

55
## 11.0.2
66

docs/examples/messaging/update-email.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ Message result = await messaging.updateEmail(
1919
cc: [], // (optional)
2020
bcc: [], // (optional)
2121
scheduledAt: '', // (optional)
22+
attachments: [], // (optional)
2223
);

lib/services/account.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class Account extends Service {
211211
///
212212
/// Add an authenticator app to be used as an MFA factor. Verify the
213213
/// authenticator using the [verify
214-
/// authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator)
214+
/// authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator)
215215
/// method.
216216
Future<models.MfaType> createMfaAuthenticator({required enums.AuthenticatorType type}) async {
217217
final String apiPath = '/account/mfa/authenticators/{type}'.replaceAll('{type}', type.value);
@@ -235,8 +235,8 @@ class Account extends Service {
235235
/// Verify Authenticator
236236
///
237237
/// Verify an authenticator app after adding it using the [add
238-
/// authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
239-
/// method.
238+
/// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
239+
/// method. add
240240
Future<models.User> updateMfaAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
241241
final String apiPath = '/account/mfa/authenticators/{type}'.replaceAll('{type}', type.value);
242242

@@ -260,7 +260,7 @@ class Account extends Service {
260260
/// Delete Authenticator
261261
///
262262
/// Delete an authenticator for a user by ID.
263-
Future<models.User> deleteMfaAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
263+
Future deleteMfaAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
264264
final String apiPath = '/account/mfa/authenticators/{type}'.replaceAll('{type}', type.value);
265265

266266
final Map<String, dynamic> apiParams = {
@@ -276,7 +276,7 @@ class Account extends Service {
276276

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

279-
return models.User.fromMap(res.data);
279+
return res.data;
280280

281281
}
282282

lib/services/messaging.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Messaging extends Service {
6767
///
6868
/// Update an email message by its unique ID.
6969
///
70-
Future<models.Message> updateEmail({required String messageId, List<String>? topics, List<String>? users, List<String>? targets, String? subject, String? content, bool? draft, bool? html, List<String>? cc, List<String>? bcc, String? scheduledAt}) async {
70+
Future<models.Message> updateEmail({required String messageId, List<String>? topics, List<String>? users, List<String>? targets, String? subject, String? content, bool? draft, bool? html, List<String>? cc, List<String>? bcc, String? scheduledAt, List<String>? attachments}) async {
7171
final String apiPath = '/messaging/messages/email/{messageId}'.replaceAll('{messageId}', messageId);
7272

7373
final Map<String, dynamic> apiParams = {
@@ -82,6 +82,7 @@ class Messaging extends Service {
8282
'cc': cc,
8383
'bcc': bcc,
8484
'scheduledAt': scheduledAt,
85+
'attachments': attachments,
8586

8687
};
8788

lib/services/users.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,11 @@ class Users extends Service {
956956

957957
/// Create token
958958
///
959-
/// Returns a token with a secret key for creating a session. If the provided
960-
/// user ID has not be registered, a new user will be created. Use the returned
961-
/// user ID and secret and submit a request to the [PUT
962-
/// /account/sessions/custom](https://appwrite.io/docs/references/cloud/client-web/account#updateCustomSession)
959+
/// Returns a token with a secret key for creating a session. Use the user ID
960+
/// and secret and submit a request to the [PUT
961+
/// /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
963962
/// endpoint to complete the login process.
963+
///
964964
Future<models.Token> createToken({required String userId, int? length, int? expire}) async {
965965
final String apiPath = '/users/{userId}/tokens'.replaceAll('{userId}', userId);
966966

lib/src/client_browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
155155
}
156156

157157
while (offset < size) {
158-
var chunk;
158+
List<int> chunk = [];
159159
final end = min(offset + CHUNK_SIZE, size);
160160
chunk = file.bytes!.getRange(offset, end).toList();
161161
params[paramName] =

lib/src/enums/credit_card.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ enum CreditCard {
44
americanExpress(value: 'amex'),
55
argencard(value: 'argencard'),
66
cabal(value: 'cabal'),
7-
consosud(value: 'censosud'),
7+
cencosud(value: 'cencosud'),
88
dinersClub(value: 'diners'),
99
discover(value: 'discover'),
1010
elo(value: 'elo'),

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/enums/runtime.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ enum Runtime {
2020
python310(value: 'python-3.10'),
2121
python311(value: 'python-3.11'),
2222
python312(value: 'python-3.12'),
23+
pythonMl311(value: 'python-ml-3.11'),
2324
deno140(value: 'deno-1.40'),
2425
dart215(value: 'dart-2.15'),
2526
dart216(value: 'dart-2.16'),

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
}

0 commit comments

Comments
 (0)