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

## 23.1.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
* Added: Introduced `bigint` create/update APIs for `TablesDB` columns
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 23.0.0

* [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**

> This is the Dart SDK for integrating with Appwrite from your Dart server-side code. If you're looking for the Flutter SDK you should check [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter)

Expand All @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
dart_appwrite: ^23.0.0
dart_appwrite: ^23.1.0
```

You can install packages from the command line:
Expand Down
21 changes: 21 additions & 0 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Databases databases = Databases(client);

AttributeBigint result = await databases.createBigIntAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
```
21 changes: 21 additions & 0 deletions docs/examples/databases/update-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Databases databases = Databases(client);

AttributeBigint result = await databases.updateBigIntAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
xdefault: 0,
min: 0, // (optional)
max: 0, // (optional)
newKey: '', // (optional)
);
```
1 change: 1 addition & 0 deletions docs/examples/functions/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Functions functions = Functions(client);

Variable result = await functions.createVariable(
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Func result = await functions.create(
logging: false, // (optional)
entrypoint: '<ENTRYPOINT>', // (optional)
commands: '<COMMANDS>', // (optional)
scopes: [enums.Scopes.sessionsWrite], // (optional)
scopes: [enums.Scopes.projectRead], // (optional)
installationId: '<INSTALLATION_ID>', // (optional)
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional)
providerBranch: '<PROVIDER_BRANCH>', // (optional)
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/functions/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ Functions functions = Functions(client);

VariableList result = await functions.listVariables(
functionId: '<FUNCTION_ID>',
queries: [], // (optional)
total: false, // (optional)
);
```
2 changes: 1 addition & 1 deletion docs/examples/functions/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Functions functions = Functions(client);
Variable result = await functions.updateVariable(
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', // (optional)
value: '<VALUE>', // (optional)
secret: false, // (optional)
);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Func result = await functions.update(
logging: false, // (optional)
entrypoint: '<ENTRYPOINT>', // (optional)
commands: '<COMMANDS>', // (optional)
scopes: [enums.Scopes.sessionsWrite], // (optional)
scopes: [enums.Scopes.projectRead], // (optional)
installationId: '<INSTALLATION_ID>', // (optional)
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional)
providerBranch: '<PROVIDER_BRANCH>', // (optional)
Expand Down
14 changes: 14 additions & 0 deletions docs/examples/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Presences presences = Presences(client);

await presences.delete(
presenceId: '<PRESENCE_ID>',
);
```
14 changes: 14 additions & 0 deletions docs/examples/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Presences presences = Presences(client);

Presence result = await presences.get(
presenceId: '<PRESENCE_ID>',
);
```
16 changes: 16 additions & 0 deletions docs/examples/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Presences presences = Presences(client);

PresenceList result = await presences.list(
queries: [], // (optional)
total: false, // (optional)
ttl: 0, // (optional)
);
```
22 changes: 22 additions & 0 deletions docs/examples/presences/update-presence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/permission.dart';
import 'package:dart_appwrite/role.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

Presences presences = Presences(client);

Presence result = await presences.updatePresence(
presenceId: '<PRESENCE_ID>',
userId: '<USER_ID>',
status: '<STATUS>', // (optional)
expiresAt: '2020-10-15T06:38:00.000+00:00', // (optional)
metadata: {}, // (optional)
permissions: [Permission.read(Role.any())], // (optional)
purge: false, // (optional)
);
```
21 changes: 21 additions & 0 deletions docs/examples/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/permission.dart';
import 'package:dart_appwrite/role.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

Presences presences = Presences(client);

Presence result = await presences.upsert(
presenceId: '<PRESENCE_ID>',
userId: '<USER_ID>',
status: '<STATUS>',
permissions: [Permission.read(Role.any())], // (optional)
expiresAt: '2020-10-15T06:38:00.000+00:00', // (optional)
metadata: {}, // (optional)
);
```
16 changes: 16 additions & 0 deletions docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

EphemeralKey result = await project.createEphemeralKey(
scopes: [enums.Scopes.projectRead],
duration: 600,
);
```
2 changes: 1 addition & 1 deletion docs/examples/project/create-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Project project = Project(client);
Key result = await project.createKey(
keyId: '<KEY_ID>',
name: '<NAME>',
scopes: [enums.Scopes.sessionsWrite],
scopes: [enums.Scopes.projectRead],
expire: '2020-10-15T06:38:00.000+00:00', // (optional)
);
```
15 changes: 15 additions & 0 deletions docs/examples/project/create-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

MockNumber result = await project.createMockPhone(
number: '+12065550100',
otp: '<OTP>',
);
```
14 changes: 14 additions & 0 deletions docs/examples/project/create-smtp-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

result = await project.createSMTPTest(
emails: [],
);
```
14 changes: 14 additions & 0 deletions docs/examples/project/delete-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

await project.deleteMockPhone(
number: '+12065550100',
);
```
12 changes: 12 additions & 0 deletions docs/examples/project/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

await project.delete();
```
16 changes: 16 additions & 0 deletions docs/examples/project/get-email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

EmailTemplate result = await project.getEmailTemplate(
templateId: enums.EmailTemplateType.verification,
locale: enums.EmailTemplateLocale.af, // (optional)
);
```
14 changes: 14 additions & 0 deletions docs/examples/project/get-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

MockNumber result = await project.getMockPhone(
number: '+12065550100',
);
```
15 changes: 15 additions & 0 deletions docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

dynamic result = await project.getOAuth2Provider(
providerId: enums.ProviderId.amazon,
);
```
15 changes: 15 additions & 0 deletions docs/examples/project/get-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

dynamic result = await project.getPolicy(
policyId: enums.PolicyId.passwordDictionary,
);
```
15 changes: 15 additions & 0 deletions docs/examples/project/list-email-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

EmailTemplateList result = await project.listEmailTemplates(
queries: [], // (optional)
total: false, // (optional)
);
```
15 changes: 15 additions & 0 deletions docs/examples/project/list-mock-phones.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

Project project = Project(client);

MockNumberList result = await project.listMockPhones(
queries: [], // (optional)
total: false, // (optional)
);
```
Loading