Skip to content
Open
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

## 20.1.0

* Added ability to create attributes and indexes synchronously while creating a collection

## 20.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
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: ^20.0.0
dart_appwrite: ^20.1.0
```

You can install packages from the command line:
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/update-phone-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

Account account = Account(client);

Expand Down
2 changes: 2 additions & 0 deletions docs/examples/databases/create-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ Collection result = await databases.createCollection(
permissions: [Permission.read(Role.any())], // (optional)
documentSecurity: false, // (optional)
enabled: false, // (optional)
attributes: [], // (optional)
indexes: [], // (optional)
);
2 changes: 2 additions & 0 deletions docs/examples/tablesdb/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ Table result = await tablesDB.createTable(
permissions: [Permission.read(Role.any())], // (optional)
rowSecurity: false, // (optional)
enabled: false, // (optional)
columns: [], // (optional)
indexes: [], // (optional)
);
1 change: 1 addition & 0 deletions lib/services/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ class Account extends Service {
if (failure != null) 'failure': failure,
if (scopes != null) 'scopes': scopes,
'project': client.config['project'],
'session': client.config['session'],
};

final List query = [];
Expand Down
6 changes: 5 additions & 1 deletion lib/services/databases.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ class Databases extends Service {
required String name,
List<String>? permissions,
bool? documentSecurity,
bool? enabled}) async {
bool? enabled,
List<Map>? attributes,
List<Map>? indexes}) async {
final String apiPath = '/databases/{databaseId}/collections'
.replaceAll('{databaseId}', databaseId);

Expand All @@ -269,6 +271,8 @@ class Databases extends Service {
'permissions': permissions,
if (documentSecurity != null) 'documentSecurity': documentSecurity,
if (enabled != null) 'enabled': enabled,
if (attributes != null) 'attributes': attributes,
if (indexes != null) 'indexes': indexes,
};

final Map<String, String> apiHeaders = {
Expand Down
6 changes: 5 additions & 1 deletion lib/services/tables_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ class TablesDB extends Service {
required String name,
List<String>? permissions,
bool? rowSecurity,
bool? enabled}) async {
bool? enabled,
List<Map>? columns,
List<Map>? indexes}) async {
final String apiPath =
'/tablesdb/{databaseId}/tables'.replaceAll('{databaseId}', databaseId);

Expand All @@ -253,6 +255,8 @@ class TablesDB extends Service {
'permissions': permissions,
if (rowSecurity != null) 'rowSecurity': rowSecurity,
if (enabled != null) 'enabled': enabled,
if (columns != null) 'columns': columns,
if (indexes != null) 'indexes': indexes,
};

final Map<String, String> apiHeaders = {
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 @@ -33,7 +33,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
'x-sdk-name': 'Dart',
'x-sdk-platform': 'server',
'x-sdk-language': 'dart',
'x-sdk-version': '20.0.0',
'x-sdk-version': '20.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 @@ -42,9 +42,9 @@ class ClientIO extends ClientBase with ClientMixin {
'x-sdk-name': 'Dart',
'x-sdk-platform': 'server',
'x-sdk-language': 'dart',
'x-sdk-version': '20.0.0',
'x-sdk-version': '20.1.0',
'user-agent':
'AppwriteDartSDK/20.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
'AppwriteDartSDK/20.1.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
'X-Appwrite-Response-Format': '1.8.0',
};

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: 20.0.0
version: 20.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