Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,15 @@ on:
jobs:
format:
runs-on: ubuntu-latest
container:
image: dart:stable

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
ref: ${{ github.event.pull_request.head.ref }}

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Install dependencies
run: flutter pub get

- name: Format Dart code
run: dart format .
Expand All @@ -35,5 +29,5 @@ jobs:
- name: Add & Commit
uses: EndBug/[email protected]
with:
add: '["lib", "test"]'
add: lib
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Potential regression: only committing lib/ changes now.
Previously both lib/ and test/ were added; with add: lib, formatted test files won’t be committed, causing drift and CI flakiness. Re-include test/.

Apply one of the following:

-            add: lib
+            add: '["lib","test"]'

or

-            add: lib
+            add: |
+              lib
+              test
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
add: lib
add: '["lib","test"]'
🤖 Prompt for AI Agents
.github/workflows/format.yml around line 32: the workflow currently only adds
the lib directory (add: lib), which omits formatted test files and can cause
drift; update the add setting so both lib and test directories are
staged/committed (for example, use an array or list that includes both "lib" and
"test") so formatted test files are also committed by the workflow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excepted? to only format lib and not tests?


4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 19.1.0

* Add `orderRandom` query support

## 19.0.0

* Rename `CreditCard` enum value `unionChinaPay` to `unionPay`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
appwrite: ^19.0.0
appwrite: ^19.1.0
```

You can install packages from the command line:
Expand Down
67 changes: 39 additions & 28 deletions lib/query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ class Query {
Query._('updatedBetween', null, [start, end]).toString();

static String or(List<String> queries) => Query._(
'or',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();
'or',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();

static String and(List<String> queries) => Query._(
'and',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();
'and',
null,
queries.map((query) => jsonDecode(query)).toList(),
).toString();

/// Specify which attributes should be returned by the API call.
static String select(List<String> attributes) =>
Expand All @@ -153,6 +153,9 @@ class Query {
static String orderDesc(String attribute) =>
Query._('orderDesc', attribute).toString();

/// Sort results randomly.
static String orderRandom() => Query._('orderRandom').toString();

/// Return results before [id].
///
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
Expand All @@ -179,35 +182,43 @@ class Query {

/// Filter resources where [attribute] is at a specific distance from the given coordinates.
static String distanceEqual(
String attribute, List<dynamic> values, num distance,
[bool meters = true]) =>
Query._('distanceEqual', attribute, [
[values, distance, meters]
]).toString();
String attribute,
List<dynamic> values,
num distance, [
bool meters = true,
]) => Query._('distanceEqual', attribute, [
[values, distance, meters],
]).toString();

/// Filter resources where [attribute] is not at a specific distance from the given coordinates.
static String distanceNotEqual(
String attribute, List<dynamic> values, num distance,
[bool meters = true]) =>
Query._('distanceNotEqual', attribute, [
[values, distance, meters]
]).toString();
String attribute,
List<dynamic> values,
num distance, [
bool meters = true,
]) => Query._('distanceNotEqual', attribute, [
[values, distance, meters],
]).toString();

/// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
static String distanceGreaterThan(
String attribute, List<dynamic> values, num distance,
[bool meters = true]) =>
Query._('distanceGreaterThan', attribute, [
[values, distance, meters]
]).toString();
String attribute,
List<dynamic> values,
num distance, [
bool meters = true,
]) => Query._('distanceGreaterThan', attribute, [
[values, distance, meters],
]).toString();

/// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
static String distanceLessThan(
String attribute, List<dynamic> values, num distance,
[bool meters = true]) =>
Query._('distanceLessThan', attribute, [
[values, distance, meters]
]).toString();
String attribute,
List<dynamic> values,
num distance, [
bool meters = true,
]) => Query._('distanceLessThan', attribute, [
[values, distance, meters],
]).toString();

/// Filter resources where [attribute] intersects with the given geometry.
static String intersects(String attribute, List<dynamic> values) =>
Expand Down
10 changes: 8 additions & 2 deletions lib/services/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,9 @@ class Account extends Service {
/// Use this endpoint to create a session from token. Provide the **userId**
/// and **secret** parameters from the successful response of authentication
/// flows initiated by token creation. For example, magic URL and phone login.
@Deprecated('This API has been deprecated.')
@Deprecated(
'This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.',
)
Future<models.Session> updateMagicURLSession({
required String userId,
required String secret,
Expand Down Expand Up @@ -942,6 +944,7 @@ class Account extends Service {
'success': success,
'failure': failure,
'scopes': scopes,

'project': client.config['project'],
};

Expand Down Expand Up @@ -974,7 +977,9 @@ class Account extends Service {
/// Use this endpoint to create a session from token. Provide the **userId**
/// and **secret** parameters from the successful response of authentication
/// flows initiated by token creation. For example, magic URL and phone login.
@Deprecated('This API has been deprecated.')
@Deprecated(
'This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.',
)
Future<models.Session> updatePhoneSession({
required String userId,
required String secret,
Expand Down Expand Up @@ -1298,6 +1303,7 @@ class Account extends Service {
'success': success,
'failure': failure,
'scopes': scopes,

'project': client.config['project'],
};

Expand Down
7 changes: 7 additions & 0 deletions lib/services/avatars.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Avatars extends Service {
'width': width,
'height': height,
'quality': quality,

'project': client.config['project'],
};

Expand Down Expand Up @@ -67,6 +68,7 @@ class Avatars extends Service {
'width': width,
'height': height,
'quality': quality,

'project': client.config['project'],
};

Expand All @@ -88,6 +90,7 @@ class Avatars extends Service {

final Map<String, dynamic> params = {
'url': url,

'project': client.config['project'],
};

Expand Down Expand Up @@ -125,6 +128,7 @@ class Avatars extends Service {
'width': width,
'height': height,
'quality': quality,

'project': client.config['project'],
};

Expand Down Expand Up @@ -159,6 +163,7 @@ class Avatars extends Service {
'url': url,
'width': width,
'height': height,

'project': client.config['project'],
};

Expand Down Expand Up @@ -200,6 +205,7 @@ class Avatars extends Service {
'width': width,
'height': height,
'background': background,

'project': client.config['project'],
};

Expand Down Expand Up @@ -228,6 +234,7 @@ class Avatars extends Service {
'size': size,
'margin': margin,
'download': download,

'project': client.config['project'],
};

Expand Down
Loading