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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 18.1.0

* Add `orderRandom` query support

## 18.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 @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
dart_appwrite: ^18.0.0
dart_appwrite: ^18.1.0
```

You can install packages from the command line:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ AttributeLine result = await databases.createLineAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ AttributePoint result = await databases.createPointAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [1, 2], // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ AttributePolygon result = await databases.createPolygonAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/databases/update-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ AttributeLine result = await databases.updateLineAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
newKey: '', // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/databases/update-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ AttributePoint result = await databases.updatePointAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [1, 2], // (optional)
newKey: '', // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/databases/update-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ AttributePolygon result = await databases.updatePolygonAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
newKey: '', // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-line-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ ColumnLine result = await tablesDB.createLineColumn(
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-point-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ ColumnPoint result = await tablesDB.createPointColumn(
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [1, 2], // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-polygon-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ ColumnPolygon result = await tablesDB.createPolygonColumn(
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-line-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ ColumnLine result = await tablesDB.updateLineColumn(
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
newKey: '', // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-point-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ ColumnPoint result = await tablesDB.updatePointColumn(
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [1, 2], // (optional)
newKey: '', // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-polygon-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ ColumnPolygon result = await tablesDB.updatePolygonColumn(
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1,2], [3, 4]], // (optional)
xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
newKey: '', // (optional)
);
3 changes: 3 additions & 0 deletions lib/query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down
2 changes: 1 addition & 1 deletion lib/src/client_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
'x-sdk-name': 'Dart',
'x-sdk-platform': 'server',
'x-sdk-language': 'dart',
'x-sdk-version': '18.0.0',
'x-sdk-version': '18.1.0',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
4 changes: 2 additions & 2 deletions lib/src/client_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class ClientIO extends ClientBase with ClientMixin {
'x-sdk-name': 'Dart',
'x-sdk-platform': 'server',
'x-sdk-language': 'dart',
'x-sdk-version': '18.0.0',
'x-sdk-version': '18.1.0',
'user-agent':
'AppwriteDartSDK/18.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
'AppwriteDartSDK/18.1.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
12 changes: 6 additions & 6 deletions lib/src/models/deployment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ class Deployment implements Model {
/// The url of the vcs provider repository
final String providerRepositoryUrl;

/// The branch of the vcs repository
final String providerBranch;

/// The commit hash of the vcs commit
final String providerCommitHash;

Expand All @@ -80,6 +77,9 @@ class Deployment implements Model {
/// The url of the vcs commit
final String providerCommitUrl;

/// The branch of the vcs repository
final String providerBranch;

/// The branch of the vcs repository
final String providerBranchUrl;

Expand All @@ -104,12 +104,12 @@ class Deployment implements Model {
required this.providerRepositoryName,
required this.providerRepositoryOwner,
required this.providerRepositoryUrl,
required this.providerBranch,
required this.providerCommitHash,
required this.providerCommitAuthorUrl,
required this.providerCommitAuthor,
required this.providerCommitMessage,
required this.providerCommitUrl,
required this.providerBranch,
required this.providerBranchUrl,
});

Expand All @@ -135,12 +135,12 @@ class Deployment implements Model {
providerRepositoryName: map['providerRepositoryName'].toString(),
providerRepositoryOwner: map['providerRepositoryOwner'].toString(),
providerRepositoryUrl: map['providerRepositoryUrl'].toString(),
providerBranch: map['providerBranch'].toString(),
providerCommitHash: map['providerCommitHash'].toString(),
providerCommitAuthorUrl: map['providerCommitAuthorUrl'].toString(),
providerCommitAuthor: map['providerCommitAuthor'].toString(),
providerCommitMessage: map['providerCommitMessage'].toString(),
providerCommitUrl: map['providerCommitUrl'].toString(),
providerBranch: map['providerBranch'].toString(),
providerBranchUrl: map['providerBranchUrl'].toString(),
);
}
Expand All @@ -167,12 +167,12 @@ class Deployment implements Model {
"providerRepositoryName": providerRepositoryName,
"providerRepositoryOwner": providerRepositoryOwner,
"providerRepositoryUrl": providerRepositoryUrl,
"providerBranch": providerBranch,
"providerCommitHash": providerCommitHash,
"providerCommitAuthorUrl": providerCommitAuthorUrl,
"providerCommitAuthor": providerCommitAuthor,
"providerCommitMessage": providerCommitMessage,
"providerCommitUrl": providerCommitUrl,
"providerBranch": providerBranch,
"providerBranchUrl": providerBranchUrl,
};
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/execution.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Execution implements Model {
/// HTTP request path and query.
final String requestPath;

/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
/// HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
final List<Headers> requestHeaders;

/// HTTP response status code.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/health_antivirus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class HealthAntivirus implements Model {
/// Antivirus version.
final String version;

/// Antivirus status. Possible values can are: `disabled`, `offline`, `online`
/// Antivirus status. Possible values are: `disabled`, `offline`, `online`
final String status;

HealthAntivirus({required this.version, required this.status});
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/health_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class HealthStatus implements Model {
/// Duration in milliseconds how long the health check took.
final int ping;

/// Service status. Possible values can are: `pass`, `fail`
/// Service status. Possible values are: `pass`, `fail`
final String status;

HealthStatus({required this.name, required this.ping, required this.status});
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dart_appwrite
version: 18.0.0
version: 18.1.0
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
homepage: https://appwrite.io
repository: https://github.com/appwrite/sdk-for-dart
Expand Down
7 changes: 7 additions & 0 deletions test/query_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ void main() {
expect(query['method'], 'orderDesc');
});

test('returns orderRandom', () {
final query = jsonDecode(Query.orderRandom());
expect(query['attribute'], null);
expect(query['values'], null);
expect(query['method'], 'orderRandom');
});

test('returns cursorBefore', () {
final query = jsonDecode(Query.cursorBefore('custom'));
expect(query['attribute'], null);
Expand Down
12 changes: 6 additions & 6 deletions test/services/functions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ void main() {
'providerRepositoryName': 'database',
'providerRepositoryOwner': 'utopia',
'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function',
'providerBranch': '0.7.x',
'providerCommitHash': '7c3f25d',
'providerCommitAuthorUrl': 'https://github.com/vermakhushboo',
'providerCommitAuthor': 'Khushboo Verma',
'providerCommitMessage': 'Update index.js',
'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb',
'providerBranch': '0.7.x',
'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',};


Expand Down Expand Up @@ -383,12 +383,12 @@ void main() {
'providerRepositoryName': 'database',
'providerRepositoryOwner': 'utopia',
'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function',
'providerBranch': '0.7.x',
'providerCommitHash': '7c3f25d',
'providerCommitAuthorUrl': 'https://github.com/vermakhushboo',
'providerCommitAuthor': 'Khushboo Verma',
'providerCommitMessage': 'Update index.js',
'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb',
'providerBranch': '0.7.x',
'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',};


Expand Down Expand Up @@ -427,12 +427,12 @@ void main() {
'providerRepositoryName': 'database',
'providerRepositoryOwner': 'utopia',
'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function',
'providerBranch': '0.7.x',
'providerCommitHash': '7c3f25d',
'providerCommitAuthorUrl': 'https://github.com/vermakhushboo',
'providerCommitAuthor': 'Khushboo Verma',
'providerCommitMessage': 'Update index.js',
'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb',
'providerBranch': '0.7.x',
'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',};


Expand Down Expand Up @@ -474,12 +474,12 @@ void main() {
'providerRepositoryName': 'database',
'providerRepositoryOwner': 'utopia',
'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function',
'providerBranch': '0.7.x',
'providerCommitHash': '7c3f25d',
'providerCommitAuthorUrl': 'https://github.com/vermakhushboo',
'providerCommitAuthor': 'Khushboo Verma',
'providerCommitMessage': 'Update index.js',
'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb',
'providerBranch': '0.7.x',
'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',};


Expand Down Expand Up @@ -519,12 +519,12 @@ void main() {
'providerRepositoryName': 'database',
'providerRepositoryOwner': 'utopia',
'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function',
'providerBranch': '0.7.x',
'providerCommitHash': '7c3f25d',
'providerCommitAuthorUrl': 'https://github.com/vermakhushboo',
'providerCommitAuthor': 'Khushboo Verma',
'providerCommitMessage': 'Update index.js',
'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb',
'providerBranch': '0.7.x',
'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',};


Expand Down Expand Up @@ -592,12 +592,12 @@ void main() {
'providerRepositoryName': 'database',
'providerRepositoryOwner': 'utopia',
'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function',
'providerBranch': '0.7.x',
'providerCommitHash': '7c3f25d',
'providerCommitAuthorUrl': 'https://github.com/vermakhushboo',
'providerCommitAuthor': 'Khushboo Verma',
'providerCommitMessage': 'Update index.js',
'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb',
'providerBranch': '0.7.x',
'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',};


Expand Down
Loading