Skip to content

Add inc/dec #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
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
28 changes: 18 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Change Log

## 16.1.0

* Add `gif` support to `ImageFormat` enum
* Add support for `dart38` and `flutter332` runtimes
* Add `upsertDocument()` method to Databases service
* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map<String, dynamic>`
* Fix `upsertDocuments()` method to have `documents` attribute as required parameter

## 16.0.0

* Add `&lt;REGION&gt;` to doc examples due to the new multi region endpoints
* Add `<REGION>` to doc examples due to the new multi region endpoints
* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc.
* Add doc examples, class and methods for new `Sites` service
* Add doc examples, class and methods for new `Tokens` service
Expand All @@ -15,13 +23,13 @@
## 14.0.0

* Breaking changes:
* Changed the typing of `AppwriteException`&#039;s response parameter from a `dynamic` object to an optional string (`?String`).
* Changed the typing of `AppwriteException`'s response parameter from a `dynamic` object to an optional string (`?String`).

## 13.0.0

* Fixed realtime pong response.
* Fixed issues with `chunkedUpload` method.
* Fixed type mismatch bug where `List&lt;dynamic&gt;` was incorrectly causing runtime type errors.
* Fixed type mismatch bug where `List<dynamic>` was incorrectly causing runtime type errors.
* Updated return type of `updateMfaChallenge()` from raw data to properly typed `models.Session` object.

## 12.0.0
Expand Down Expand Up @@ -151,7 +159,7 @@ You can find the new syntax for breaking changes in the [Appwrite API references
* The `number` argument in phone endpoints have been renamed to `phone`
* List endpoints no longer support `limit`, `offset`, `cursor`, `cursorDirection`, `orderAttributes`, `orderTypes` as they have been moved to the `queries` array
* `read` and `write` permission have been deprecated and they are now included in the `permissions` array
* Parameter `permission` for collections and buckets are now renamed to `documentSecurity` &amp; `fileSecurity` respectively
* Parameter `permission` for collections and buckets are now renamed to `documentSecurity` & `fileSecurity` respectively
* Renamed methods of the Query helper
1. `lesser` renamed to `lessThan`
2. `lesserEqual` renamed to `lessThanEqual`
Expand All @@ -167,8 +175,8 @@ You can find the new syntax for breaking changes in the [Appwrite API references

## 6.0.0
* Support for Appwrite 0.15
* **BREAKING** `Database` -&gt; `Databases`
* **BREAKING** `account.createSession()` -&gt; `account.createEmailSession()`
* **BREAKING** `Database` -> `Databases`
* **BREAKING** `account.createSession()` -> `account.createEmailSession()`
* **BREAKING** `dateCreated` attribute removed from `Team`, `Execution`, `File` models
* **BREAKING** `dateCreated` and `dateUpdated` attribute removed from `Func`, `Deployment`, `Bucket` models
* **BREAKING** Realtime channels
Expand All @@ -182,7 +190,7 @@ You can find the new syntax for breaking changes in the [Appwrite API references

## 5.0.0
* Support for Appwrite 0.14
* **BREAKING** `account.delete()` -&gt; `account.updateStatus()`
* **BREAKING** `account.delete()` -> `account.updateStatus()`
* **BREAKING** Execution model `stdout` renamed to `response`
* **BREAKING** Membership model `name` renamed to `userName` and `email` renamed to `userEmail`
* Added `teamName` to Membership model
Expand All @@ -200,7 +208,7 @@ You can find the new syntax for breaking changes in the [Appwrite API references
* **BREAKING** **Tags** have been renamed to **Deployments**
* **BREAKING** `createFile` function expects Bucket ID as the first parameter
* **BREAKING** `createDeployment` and `createFile` functions expect an instance **InputFile** rather than the instance of **MultipartFile**
* **BREAKING** `list&lt;Entity&gt;` endpoints now contain a `total` attribute instead of `sum`
* **BREAKING** `list<Entity>` endpoints now contain a `total` attribute instead of `sum`
* `onProgress()` callback function for endpoints supporting file uploads
* Support for synchronous function executions
* Bug fixes and Improvements
Expand Down Expand Up @@ -237,7 +245,7 @@ You can find the new syntax for breaking changes in the [Appwrite API references

## 0.7.0
- Support for Appwrite 0.9
- Breaking - removed order type enum, now you should pass string &#039;ASC&#039; or &#039;DESC&#039;
- Breaking - removed order type enum, now you should pass string 'ASC' or 'DESC'
- Breaking - changed param name from `env` to `runtime` in the **Functions** API
- Image Crop Gravity support in image preview service
- New endpoint in Account getSession to get session by ID
Expand All @@ -258,7 +266,7 @@ You can find the new syntax for breaking changes in the [Appwrite API references
- Upgraded all underlying dependencies to null safe version
- BREAKING Renamed users.deleteUser to users.delete
- BREAKING Renamed parameter inviteId to membershipId on teams.updateMembershipStatus, teams.deleteMembership
- JWT Support client.setJWT(&#039;JWT_GENERATED_IN_CLIENT&#039;)
- JWT Support client.setJWT('JWT_GENERATED_IN_CLIENT')
- [Update membership roles](https://appwrite.io/docs/references/cloud/server-dart/teams?sdk=dart#updateMembershipRoles)
- New awesome image preview features, supports borderRadius, borderColor, borderWidth

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[![pub package](https://img.shields.io/pub/v/dart_appwrite.svg?style=flat-square)](https://pub.dartlang.org/packages/dart_appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.x-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.x-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![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.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
**This SDK is compatible with Appwrite server version 1.8.x. 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 @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
dart_appwrite: ^16.0.0
dart_appwrite: ^17.0.0
```

You can install packages from the command line:
Expand Down
1 change: 1 addition & 0 deletions docs/examples/databases/create-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';

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

Databases databases = Databases(client);
Expand Down
17 changes: 17 additions & 0 deletions docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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);

Document result = await databases.decrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
value: 0, // (optional)
min: 0, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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);

Document result = await databases.incrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
value: 0, // (optional)
max: 0, // (optional)
);
15 changes: 15 additions & 0 deletions docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setSession('') // The user session to authenticate with
.setKey('<YOUR_API_KEY>') // Your secret API key
.setJWT('<YOUR_JWT>'); // Your secret JSON Web Token

Databases databases = Databases(client);

Document result = await databases.upsertDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
);
3 changes: 1 addition & 2 deletions docs/examples/databases/upsert-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ 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
.setAdmin('') //
.setKey('<YOUR_API_KEY>'); // Your secret API key

Databases databases = Databases(client);

DocumentList result = await databases.upsertDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: [], // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tables/create-boolean-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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

Tables tables = Tables(client);

ColumnBoolean result = await tables.createBooleanColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: false, // (optional)
array: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tables/create-datetime-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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

Tables tables = Tables(client);

ColumnDatetime result = await tables.createDatetimeColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '', // (optional)
array: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tables/create-email-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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

Tables tables = Tables(client);

ColumnEmail result = await tables.createEmailColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '[email protected]', // (optional)
array: false, // (optional)
);
18 changes: 18 additions & 0 deletions docs/examples/tables/create-enum-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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

Tables tables = Tables(client);

ColumnEnum result = await tables.createEnumColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
elements: [],
xrequired: false,
xdefault: '<DEFAULT>', // (optional)
array: false, // (optional)
);
19 changes: 19 additions & 0 deletions docs/examples/tables/create-float-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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

Tables tables = Tables(client);

ColumnFloat result = await tables.createFloatColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
18 changes: 18 additions & 0 deletions docs/examples/tables/create-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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

Tables tables = Tables(client);

ColumnIndex result = await tables.createIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
type: IndexType.key,
columns: [],
orders: [], // (optional)
lengths: [], // (optional)
);
19 changes: 19 additions & 0 deletions docs/examples/tables/create-integer-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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

Tables tables = Tables(client);

ColumnInteger result = await tables.createIntegerColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tables/create-ip-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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

Tables tables = Tables(client);

ColumnIp result = await tables.createIpColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '', // (optional)
array: false, // (optional)
);
19 changes: 19 additions & 0 deletions docs/examples/tables/create-relationship-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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

Tables tables = Tables(client);

ColumnRelationship result = await tables.createRelationshipColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
relatedTableId: '<RELATED_TABLE_ID>',
type: RelationshipType.oneToOne,
twoWay: false, // (optional)
key: '', // (optional)
twoWayKey: '', // (optional)
onDelete: RelationMutate.cascade, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tables/create-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setSession('') // The user session to authenticate with
.setKey('<YOUR_API_KEY>') // Your secret API key
.setJWT('<YOUR_JWT>'); // Your secret JSON Web Token

Tables tables = Tables(client);

Row result = await tables.createRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {},
permissions: ["read("any")"], // (optional)
);
14 changes: 14 additions & 0 deletions docs/examples/tables/create-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_appwrite/dart_appwrite.dart';

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

Tables tables = Tables(client);

RowList result = await tables.createRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rows: [],
);
Loading