Skip to content

Commit 6c41778

Browse files
committed
feat: fix dart templates
1 parent 3fa7a0e commit 6c41778

File tree

7 files changed

+70
-270
lines changed

7 files changed

+70
-270
lines changed

lib/services/account.dart

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class Account extends Service {
5151
/// This endpoint can also be used to convert an anonymous account to a normal
5252
/// one, by passing an email address and a new password.
5353
///
54-
Future<Response> updateEmail({required String email
55-
, required String password
56-
}) {
54+
Future<Response> updateEmail({required String email, required String password}) {
5755
final String path = '/account/email';
5856

5957
final Map<String, dynamic> params = {
@@ -90,8 +88,7 @@ class Account extends Service {
9088
///
9189
/// Update currently logged in user account name.
9290
///
93-
Future<Response> updateName({required String name
94-
}) {
91+
Future<Response> updateName({required String name}) {
9592
final String path = '/account/name';
9693

9794
final Map<String, dynamic> params = {
@@ -111,9 +108,7 @@ class Account extends Service {
111108
/// to pass in the new password, and the old password. For users created with
112109
/// OAuth and Team Invites, oldPassword is optional.
113110
///
114-
Future<Response> updatePassword({required String password
115-
, String? oldPassword
116-
}) {
111+
Future<Response> updatePassword({required String password, String? oldPassword}) {
117112
final String path = '/account/password';
118113

119114
final Map<String, dynamic> params = {
@@ -150,8 +145,7 @@ class Account extends Service {
150145
/// Update currently logged in user account preferences. You can pass only the
151146
/// specific settings you wish to update.
152147
///
153-
Future<Response> updatePrefs({required Map prefs
154-
}) {
148+
Future<Response> updatePrefs({required Map prefs}) {
155149
final String path = '/account/prefs';
156150

157151
final Map<String, dynamic> params = {
@@ -176,9 +170,7 @@ class Account extends Service {
176170
/// complete the process. The verification link sent to the user's email
177171
/// address is valid for 1 hour.
178172
///
179-
Future<Response> createRecovery({required String email
180-
, required String url
181-
}) {
173+
Future<Response> createRecovery({required String email, required String url}) {
182174
final String path = '/account/recovery';
183175

184176
final Map<String, dynamic> params = {
@@ -205,11 +197,7 @@ class Account extends Service {
205197
/// the only valid redirect URLs are the ones from domains you have set when
206198
/// adding your platforms in the console interface.
207199
///
208-
Future<Response> updateRecovery({required String userId
209-
, required String secret
210-
, required String password
211-
, required String passwordAgain
212-
}) {
200+
Future<Response> updateRecovery({required String userId, required String secret, required String password, required String passwordAgain}) {
213201
final String path = '/account/recovery';
214202

215203
final Map<String, dynamic> params = {
@@ -267,8 +255,7 @@ class Account extends Service {
267255
/// Use this endpoint to get a logged in user's session using a Session ID.
268256
/// Inputting 'current' will return the current session being used.
269257
///
270-
Future<Response> getSession({required String sessionId
271-
}) {
258+
Future<Response> getSession({required String sessionId}) {
272259
final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId);
273260

274261
final Map<String, dynamic> params = {
@@ -287,8 +274,7 @@ class Account extends Service {
287274
/// account sessions across all of their different devices. When using the
288275
/// option id argument, only the session unique ID provider will be deleted.
289276
///
290-
Future<Response> deleteSession({required String sessionId
291-
}) {
277+
Future<Response> deleteSession({required String sessionId}) {
292278
final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId);
293279

294280
final Map<String, dynamic> params = {
@@ -319,8 +305,7 @@ class Account extends Service {
319305
/// adding your platforms in the console interface.
320306
///
321307
///
322-
Future<Response> createVerification({required String url
323-
}) {
308+
Future<Response> createVerification({required String url}) {
324309
final String path = '/account/verification';
325310

326311
final Map<String, dynamic> params = {
@@ -341,9 +326,7 @@ class Account extends Service {
341326
/// to verify the user email ownership. If confirmed this route will return a
342327
/// 200 status code.
343328
///
344-
Future<Response> updateVerification({required String userId
345-
, required String secret
346-
}) {
329+
Future<Response> updateVerification({required String userId, required String secret}) {
347330
final String path = '/account/verification';
348331

349332
final Map<String, dynamic> params = {

lib/services/avatars.dart

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ class Avatars extends Service {
1111
/// /account/sessions endpoint. Use width, height and quality arguments to
1212
/// change the output settings.
1313
///
14-
Future<Response> getBrowser({required String code
15-
, int? width
16-
, int? height
17-
, int? quality
18-
}) {
14+
Future<Response> getBrowser({required String code, int? width, int? height, int? quality}) {
1915
final String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code);
2016

2117
final Map<String, dynamic> params = {
@@ -39,11 +35,7 @@ class Avatars extends Service {
3935
/// provider you need. Use width, height and quality arguments to change the
4036
/// output settings.
4137
///
42-
Future<Response> getCreditCard({required String code
43-
, int? width
44-
, int? height
45-
, int? quality
46-
}) {
38+
Future<Response> getCreditCard({required String code, int? width, int? height, int? quality}) {
4739
final String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code);
4840

4941
final Map<String, dynamic> params = {
@@ -67,8 +59,7 @@ class Avatars extends Service {
6759
/// website URL.
6860
///
6961
///
70-
Future<Response> getFavicon({required String url
71-
}) {
62+
Future<Response> getFavicon({required String url}) {
7263
final String path = '/avatars/favicon';
7364

7465
final Map<String, dynamic> params = {
@@ -90,11 +81,7 @@ class Avatars extends Service {
9081
/// users. The code argument receives the 2 letter country code. Use width,
9182
/// height and quality arguments to change the output settings.
9283
///
93-
Future<Response> getFlag({required String code
94-
, int? width
95-
, int? height
96-
, int? quality
97-
}) {
84+
Future<Response> getFlag({required String code, int? width, int? height, int? quality}) {
9885
final String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code);
9986

10087
final Map<String, dynamic> params = {
@@ -119,10 +106,7 @@ class Avatars extends Service {
119106
/// remote images in your app or in case you want to make sure a 3rd party
120107
/// image is properly served using a TLS protocol.
121108
///
122-
Future<Response> getImage({required String url
123-
, int? width
124-
, int? height
125-
}) {
109+
Future<Response> getImage({required String url, int? width, int? height}) {
126110
final String path = '/avatars/image';
127111

128112
final Map<String, dynamic> params = {
@@ -153,12 +137,7 @@ class Avatars extends Service {
153137
/// the user's initials when reloading the same theme will always return for
154138
/// the same initials.
155139
///
156-
Future<Response> getInitials({String? name
157-
, int? width
158-
, int? height
159-
, String? color
160-
, String? background
161-
}) {
140+
Future<Response> getInitials({String? name, int? width, int? height, String? color, String? background}) {
162141
final String path = '/avatars/initials';
163142

164143
final Map<String, dynamic> params = {
@@ -183,11 +162,7 @@ class Avatars extends Service {
183162
/// Converts a given plain text to a QR code image. You can use the query
184163
/// parameters to change the size and style of the resulting image.
185164
///
186-
Future<Response> getQR({required String text
187-
, int? size
188-
, int? margin
189-
, bool? download
190-
}) {
165+
Future<Response> getQR({required String text, int? size, int? margin, bool? download}) {
191166
final String path = '/avatars/qr';
192167

193168
final Map<String, dynamic> params = {

lib/services/database.dart

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ class Database extends Service {
1111
/// of the project's collections. [Learn more about different API
1212
/// modes](/docs/admin).
1313
///
14-
Future<Response> listCollections({String? search
15-
, int? limit
16-
, int? offset
17-
, String? orderType
18-
}) {
14+
Future<Response> listCollections({String? search, int? limit, int? offset, String? orderType}) {
1915
final String path = '/database/collections';
2016

2117
final Map<String, dynamic> params = {
@@ -36,11 +32,7 @@ class Database extends Service {
3632
///
3733
/// Create a new Collection.
3834
///
39-
Future<Response> createCollection({required String name
40-
, required List read
41-
, required List write
42-
, required List rules
43-
}) {
35+
Future<Response> createCollection({required String name, required List read, required List write, required List rules}) {
4436
final String path = '/database/collections';
4537

4638
final Map<String, dynamic> params = {
@@ -62,8 +54,7 @@ class Database extends Service {
6254
/// Get a collection by its unique ID. This endpoint response returns a JSON
6355
/// object with the collection metadata.
6456
///
65-
Future<Response> getCollection({required String collectionId
66-
}) {
57+
Future<Response> getCollection({required String collectionId}) {
6758
final String path = '/database/collections/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId);
6859

6960
final Map<String, dynamic> params = {
@@ -80,12 +71,7 @@ class Database extends Service {
8071
///
8172
/// Update a collection by its unique ID.
8273
///
83-
Future<Response> updateCollection({required String collectionId
84-
, required String name
85-
, List? read
86-
, List? write
87-
, List? rules
88-
}) {
74+
Future<Response> updateCollection({required String collectionId, required String name, List? read, List? write, List? rules}) {
8975
final String path = '/database/collections/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId);
9076

9177
final Map<String, dynamic> params = {
@@ -107,8 +93,7 @@ class Database extends Service {
10793
/// Delete a collection by its unique ID. Only users with write permissions
10894
/// have access to delete this resource.
10995
///
110-
Future<Response> deleteCollection({required String collectionId
111-
}) {
96+
Future<Response> deleteCollection({required String collectionId}) {
11297
final String path = '/database/collections/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId);
11398

11499
final Map<String, dynamic> params = {
@@ -128,15 +113,7 @@ class Database extends Service {
128113
/// of the project's documents. [Learn more about different API
129114
/// modes](/docs/admin).
130115
///
131-
Future<Response> listDocuments({required String collectionId
132-
, List? filters
133-
, int? limit
134-
, int? offset
135-
, String? orderField
136-
, String? orderType
137-
, String? orderCast
138-
, String? search
139-
}) {
116+
Future<Response> listDocuments({required String collectionId, List? filters, int? limit, int? offset, String? orderField, String? orderType, String? orderCast, String? search}) {
140117
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
141118

142119
final Map<String, dynamic> params = {
@@ -163,14 +140,7 @@ class Database extends Service {
163140
/// integration](/docs/server/database#databaseCreateCollection) API or
164141
/// directly from your database console.
165142
///
166-
Future<Response> createDocument({required String collectionId
167-
, required Map data
168-
, List? read
169-
, List? write
170-
, String? parentDocument
171-
, String? parentProperty
172-
, String? parentPropertyType
173-
}) {
143+
Future<Response> createDocument({required String collectionId, required Map data, List? read, List? write, String? parentDocument, String? parentProperty, String? parentPropertyType}) {
174144
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
175145

176146
final Map<String, dynamic> params = {
@@ -194,9 +164,7 @@ class Database extends Service {
194164
/// Get a document by its unique ID. This endpoint response returns a JSON
195165
/// object with the document data.
196166
///
197-
Future<Response> getDocument({required String collectionId
198-
, required String documentId
199-
}) {
167+
Future<Response> getDocument({required String collectionId, required String documentId}) {
200168
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
201169

202170
final Map<String, dynamic> params = {
@@ -214,12 +182,7 @@ class Database extends Service {
214182
/// Update a document by its unique ID. Using the patch method you can pass
215183
/// only specific fields that will get updated.
216184
///
217-
Future<Response> updateDocument({required String collectionId
218-
, required String documentId
219-
, required Map data
220-
, List? read
221-
, List? write
222-
}) {
185+
Future<Response> updateDocument({required String collectionId, required String documentId, required Map data, List? read, List? write}) {
223186
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
224187

225188
final Map<String, dynamic> params = {
@@ -241,9 +204,7 @@ class Database extends Service {
241204
/// documents, its attributes and relations to other documents. Child documents
242205
/// **will not** be deleted.
243206
///
244-
Future<Response> deleteDocument({required String collectionId
245-
, required String documentId
246-
}) {
207+
Future<Response> deleteDocument({required String collectionId, required String documentId}) {
247208
final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
248209

249210
final Map<String, dynamic> params = {

0 commit comments

Comments
 (0)