Skip to content

Commit a2ce845

Browse files
committed
Commit from GitHub Actions (Format and push)
1 parent 5dbaec8 commit a2ce845

File tree

134 files changed

+11725
-11109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+11725
-11109
lines changed

lib/client_browser.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'src/client_browser.dart';
1+
export 'src/client_browser.dart';

lib/client_io.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'src/client_io.dart';
1+
export 'src/client_io.dart';

lib/dart_appwrite.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Appwrite Dart SDK
22
///
3-
/// This SDK is compatible with Appwrite server version 1.6.x.
3+
/// This SDK is compatible with Appwrite server version 1.6.x.
44
/// For older versions, please check
55
/// [previous releases](https://github.com/appwrite/sdk-for-dart/releases).
66
library dart_appwrite;

lib/id.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ class ID {
1010
final now = DateTime.now();
1111
final sec = (now.millisecondsSinceEpoch / 1000).floor();
1212
final usec = now.microsecondsSinceEpoch - (sec * 1000000);
13-
return sec.toRadixString(16) +
14-
usec.toRadixString(16).padLeft(5, '0');
13+
return sec.toRadixString(16) + usec.toRadixString(16).padLeft(5, '0');
1514
}
1615

1716
// Generate a unique ID with padding to have a longer ID

lib/payload.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class Payload {
1414

1515
/// Convert to binary, with optional offset and length
1616
List<int> toBinary({int offset = 0, int? length}) {
17-
if(data == null) {
17+
if (data == null) {
1818
throw AppwriteException('`data` is not defined.');
1919
}
20-
if(offset == 0 && length == null) {
20+
if (offset == 0 && length == null) {
2121
return data!;
2222
} else if (length == null) {
2323
return data!.sublist(offset);
@@ -29,7 +29,7 @@ class Payload {
2929
/// Convert binary data to string (utf8)
3030
@override
3131
String toString() {
32-
if(data == null) {
32+
if (data == null) {
3333
return '';
3434
}
3535
return utf8.decode(data!);

lib/query.dart

+26-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
part of 'dart_appwrite.dart';
22

3-
43
/// Helper class to generate query strings.
54
class Query {
65
final String method;
@@ -14,11 +13,11 @@ class Query {
1413
'method': method,
1514
};
1615

17-
if(attribute != null) {
16+
if (attribute != null) {
1817
map['attribute'] = attribute;
1918
}
20-
21-
if(values != null) {
19+
20+
if (values != null) {
2221
map['values'] = values is List ? values : [values];
2322
}
2423

@@ -29,7 +28,7 @@ class Query {
2928
String toString() => jsonEncode(toJson());
3029

3130
/// Filter resources where [attribute] is equal to [value].
32-
///
31+
///
3332
/// [value] can be a single value or a list. If a list is used
3433
/// the query will return resources where [attribute] is equal
3534
/// to any of the values in the list.
@@ -61,10 +60,12 @@ class Query {
6160
Query._('search', attribute, value).toString();
6261

6362
/// Filter resources where [attribute] is null.
64-
static String isNull(String attribute) => Query._('isNull', attribute).toString();
63+
static String isNull(String attribute) =>
64+
Query._('isNull', attribute).toString();
6565

6666
/// Filter resources where [attribute] is not null.
67-
static String isNotNull(String attribute) => Query._('isNotNull', attribute).toString();
67+
static String isNotNull(String attribute) =>
68+
Query._('isNotNull', attribute).toString();
6869

6970
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
7071
static String between(String attribute, dynamic start, dynamic end) =>
@@ -84,40 +85,46 @@ class Query {
8485
Query._('contains', attribute, value).toString();
8586

8687
static String or(List<String> queries) =>
87-
Query._('or', null, queries.map((query) => jsonDecode(query)).toList()).toString();
88+
Query._('or', null, queries.map((query) => jsonDecode(query)).toList())
89+
.toString();
8890

8991
static String and(List<String> queries) =>
90-
Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString();
92+
Query._('and', null, queries.map((query) => jsonDecode(query)).toList())
93+
.toString();
9194

9295
/// Specify which attributes should be returned by the API call.
9396
static String select(List<String> attributes) =>
9497
Query._('select', null, attributes).toString();
9598

9699
/// Sort results by [attribute] ascending.
97-
static String orderAsc(String attribute) => Query._('orderAsc', attribute).toString();
100+
static String orderAsc(String attribute) =>
101+
Query._('orderAsc', attribute).toString();
98102

99103
/// Sort results by [attribute] descending.
100-
static String orderDesc(String attribute) => Query._('orderDesc', attribute).toString();
104+
static String orderDesc(String attribute) =>
105+
Query._('orderDesc', attribute).toString();
101106

102107
/// Return results before [id].
103-
///
108+
///
104109
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
105110
/// docs for more information.
106-
static String cursorBefore(String id) => Query._('cursorBefore', null, id).toString();
111+
static String cursorBefore(String id) =>
112+
Query._('cursorBefore', null, id).toString();
107113

108114
/// Return results after [id].
109-
///
115+
///
110116
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
111117
/// docs for more information.
112-
static String cursorAfter(String id) => Query._('cursorAfter', null, id).toString();
118+
static String cursorAfter(String id) =>
119+
Query._('cursorAfter', null, id).toString();
113120

114121
/// Return only [limit] results.
115122
static String limit(int limit) => Query._('limit', null, limit).toString();
116123

117124
/// Return results from [offset].
118-
///
125+
///
119126
/// Refer to the [Offset Pagination](https://appwrite.io/docs/pagination#offset-pagination)
120127
/// docs for more information.
121-
static String offset(int offset) => Query._('offset', null, offset).toString();
122-
123-
}
128+
static String offset(int offset) =>
129+
Query._('offset', null, offset).toString();
130+
}

lib/role.dart

+53-53
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,65 @@ part of 'dart_appwrite.dart';
22

33
/// Helper class to generate role strings for [Permission].
44
class Role {
5-
Role._();
6-
7-
/// Grants access to anyone.
8-
///
9-
/// This includes authenticated and unauthenticated users.
10-
static String any() {
11-
return 'any';
12-
}
5+
Role._();
136

14-
/// Grants access to a specific user by user ID.
15-
///
16-
/// You can optionally pass verified or unverified for
17-
/// [status] to target specific types of users.
18-
static String user(String id, [String status = '']) {
19-
if(status.isEmpty) {
20-
return 'user:$id';
21-
}
22-
return 'user:$id/$status';
23-
}
7+
/// Grants access to anyone.
8+
///
9+
/// This includes authenticated and unauthenticated users.
10+
static String any() {
11+
return 'any';
12+
}
2413

25-
/// Grants access to any authenticated or anonymous user.
26-
///
27-
/// You can optionally pass verified or unverified for
28-
/// [status] to target specific types of users.
29-
static String users([String status = '']) {
30-
if(status.isEmpty) {
31-
return 'users';
32-
}
33-
return 'users/$status';
14+
/// Grants access to a specific user by user ID.
15+
///
16+
/// You can optionally pass verified or unverified for
17+
/// [status] to target specific types of users.
18+
static String user(String id, [String status = '']) {
19+
if (status.isEmpty) {
20+
return 'user:$id';
3421
}
22+
return 'user:$id/$status';
23+
}
3524

36-
/// Grants access to any guest user without a session.
37-
///
38-
/// Authenticated users don't have access to this role.
39-
static String guests() {
40-
return 'guests';
25+
/// Grants access to any authenticated or anonymous user.
26+
///
27+
/// You can optionally pass verified or unverified for
28+
/// [status] to target specific types of users.
29+
static String users([String status = '']) {
30+
if (status.isEmpty) {
31+
return 'users';
4132
}
33+
return 'users/$status';
34+
}
4235

43-
/// Grants access to a team by team ID.
44-
///
45-
/// You can optionally pass a role for [role] to target
46-
/// team members with the specified role.
47-
static String team(String id, [String role = '']) {
48-
if(role.isEmpty) {
49-
return 'team:$id';
50-
}
51-
return 'team:$id/$role';
52-
}
36+
/// Grants access to any guest user without a session.
37+
///
38+
/// Authenticated users don't have access to this role.
39+
static String guests() {
40+
return 'guests';
41+
}
5342

54-
/// Grants access to a specific member of a team.
55-
///
56-
/// When the member is removed from the team, they will
57-
/// no longer have access.
58-
static String member(String id) {
59-
return 'member:$id';
43+
/// Grants access to a team by team ID.
44+
///
45+
/// You can optionally pass a role for [role] to target
46+
/// team members with the specified role.
47+
static String team(String id, [String role = '']) {
48+
if (role.isEmpty) {
49+
return 'team:$id';
6050
}
51+
return 'team:$id/$role';
52+
}
6153

62-
/// Grants access to a user with the specified label.
63-
static String label(String name) {
64-
return 'label:$name';
65-
}
66-
}
54+
/// Grants access to a specific member of a team.
55+
///
56+
/// When the member is removed from the team, they will
57+
/// no longer have access.
58+
static String member(String id) {
59+
return 'member:$id';
60+
}
61+
62+
/// Grants access to a user with the specified label.
63+
static String label(String name) {
64+
return 'label:$name';
65+
}
66+
}

0 commit comments

Comments
 (0)