mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
Merge remote-tracking branch 'origin/main' into fix-realtime-multiple-subscription
This commit is contained in:
+17
-3
@@ -1,3 +1,11 @@
|
||||
## 11.0.1
|
||||
|
||||
* Fix between queries
|
||||
|
||||
## 11.0.0
|
||||
|
||||
* Parameter `url` is now optional in the `createMembership` endpoint
|
||||
|
||||
## 10.0.1
|
||||
|
||||
* Added a new `label` function to the `Role` helper class
|
||||
@@ -18,6 +26,12 @@
|
||||
* The `updateFile` method now includes the ability to update the file name.
|
||||
* The `updateMembershipRoles` method has been renamed to `updateMembership`.
|
||||
|
||||
## 9.0.1
|
||||
|
||||
* Added documentation comments
|
||||
* Added unit tests
|
||||
* Upgraded dependencies
|
||||
|
||||
## 9.0.0
|
||||
|
||||
* Added relationships support
|
||||
@@ -199,11 +213,11 @@ https://github.com/appwrite/appwrite/blob/master/CHANGES.md
|
||||
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0
|
||||
- Upgraded all underlying dependencies to null safe version
|
||||
- BREAKING Renamed parameter inviteId to membershipId on teams.updateMembershipStatus, teams.deleteMembership
|
||||
- [Anonymous login](https://appwrite.io/docs/client/account?sdk=flutter#accountCreateAnonymousSession)
|
||||
- [JWT Support](https://appwrite.io/docs/client/account?sdk=flutter#accountCreateJWT)
|
||||
- [Anonymous login](https://appwrite.io/docs/references/cloud/client-flutter/account?sdk=flutter#createAnonymousSession)
|
||||
- [JWT Support](https://appwrite.io/docs/references/cloud/client-flutter/account?sdk=flutter#createJWT)
|
||||
- Fallback Cookies for Flutter Web if 3rd party cookies are blocked
|
||||
- Custom User Agent Support
|
||||
- [Update membership roles](https://appwrite.io/docs/client/teams?sdk=flutter#teamsUpdateMembershipRoles)
|
||||
- [Update membership roles](https://appwrite.io/docs/references/cloud/client-flutter/teams?sdk=flutter#updateMembershipRoles)
|
||||
- New awesome image preview features, supports borderRadius, borderColor, borderWidth
|
||||
|
||||
## 0.5.0-dev.1
|
||||
|
||||
@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
|
||||
|
||||
```yml
|
||||
dependencies:
|
||||
appwrite: ^10.0.1
|
||||
appwrite: ^11.0.1
|
||||
```
|
||||
|
||||
You can install packages from the command line:
|
||||
|
||||
@@ -11,7 +11,6 @@ void main() { // Init SDK
|
||||
Future result = teams.createMembership(
|
||||
teamId: '[TEAM_ID]',
|
||||
roles: [],
|
||||
url: 'https://example.com',
|
||||
);
|
||||
|
||||
result
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class Query {
|
||||
|
||||
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
|
||||
static String between(String attribute, dynamic start, dynamic end) =>
|
||||
_addQuery(attribute, 'between', [start, end]);
|
||||
'between("$attribute", ${_parseValues(start)}, ${_parseValues(end)})';
|
||||
|
||||
/// Filter resources where [attribute] starts with [value].
|
||||
static String startsWith(String attribute, String value) =>
|
||||
|
||||
+61
-51
@@ -5,7 +5,7 @@ class Account extends Service {
|
||||
/// Initializes a [Account] service
|
||||
Account(super.client);
|
||||
|
||||
/// Get Account
|
||||
/// Get account
|
||||
///
|
||||
/// Get the currently logged in user.
|
||||
Future<models.User> get() async {
|
||||
@@ -24,14 +24,15 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Account
|
||||
/// Create account
|
||||
///
|
||||
/// Use this endpoint to allow a new user to register a new account in your
|
||||
/// project. After the user registration completes successfully, you can use
|
||||
/// the [/account/verfication](/docs/client/account#accountCreateVerification)
|
||||
/// the
|
||||
/// [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification)
|
||||
/// route to start verifying the user email address. To allow the new user to
|
||||
/// login to their new account, you need to create a new [account
|
||||
/// session](/docs/client/account#accountCreateSession).
|
||||
/// session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
|
||||
Future<models.User> create({required String userId, required String email, required String password, String? name}) async {
|
||||
const String apiPath = '/account';
|
||||
|
||||
@@ -52,7 +53,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Email
|
||||
/// Update email
|
||||
///
|
||||
/// Update currently logged in user account email address. After changing user
|
||||
/// address, the user confirmation status will get reset. A new confirmation
|
||||
@@ -142,7 +143,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Logs
|
||||
/// List logs
|
||||
///
|
||||
/// Get the list of latest security activity logs for the currently logged in
|
||||
/// user. Each log returns user IP address, location and date and time of log.
|
||||
@@ -163,7 +164,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Name
|
||||
/// Update name
|
||||
///
|
||||
/// Update currently logged in user account name.
|
||||
Future<models.User> updateName({required String name}) async {
|
||||
@@ -183,7 +184,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Password
|
||||
/// Update password
|
||||
///
|
||||
/// Update currently logged in user password. For validation, user is required
|
||||
/// to pass in the new password, and the old password. For users created with
|
||||
@@ -206,12 +207,12 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Phone
|
||||
/// Update phone
|
||||
///
|
||||
/// Update the currently logged in user's phone number. After updating the
|
||||
/// phone number, the phone verification status will be reset. A confirmation
|
||||
/// SMS is not sent automatically, however you can use the [POST
|
||||
/// /account/verification/phone](/docs/client/account#accountCreatePhoneVerification)
|
||||
/// /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification)
|
||||
/// endpoint to send a confirmation SMS.
|
||||
Future<models.User> updatePhone({required String phone, required String password}) async {
|
||||
const String apiPath = '/account/phone';
|
||||
@@ -231,7 +232,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Account Preferences
|
||||
/// Get account preferences
|
||||
///
|
||||
/// Get the preferences as a key-value object for the currently logged in user.
|
||||
Future<models.Preferences> getPrefs() async {
|
||||
@@ -250,7 +251,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Preferences
|
||||
/// Update preferences
|
||||
///
|
||||
/// Update currently logged in user account preferences. The object you pass is
|
||||
/// stored as is, and replaces any previous value. The maximum allowed prefs
|
||||
@@ -272,16 +273,16 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Password Recovery
|
||||
/// Create password recovery
|
||||
///
|
||||
/// Sends the user an email with a temporary secret key for password reset.
|
||||
/// When the user clicks the confirmation link he is redirected back to your
|
||||
/// app password reset URL with the secret key and email address values
|
||||
/// attached to the URL query string. Use the query string params to submit a
|
||||
/// request to the [PUT
|
||||
/// /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to
|
||||
/// complete the process. The verification link sent to the user's email
|
||||
/// address is valid for 1 hour.
|
||||
/// /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery)
|
||||
/// endpoint to complete the process. The verification link sent to the user's
|
||||
/// email address is valid for 1 hour.
|
||||
Future<models.Token> createRecovery({required String email, required String url}) async {
|
||||
const String apiPath = '/account/recovery';
|
||||
|
||||
@@ -300,12 +301,13 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Password Recovery (confirmation)
|
||||
/// Create password recovery (confirmation)
|
||||
///
|
||||
/// Use this endpoint to complete the user account password reset. Both the
|
||||
/// **userId** and **secret** arguments will be passed as query parameters to
|
||||
/// the redirect URL you have provided when sending your request to the [POST
|
||||
/// /account/recovery](/docs/client/account#accountCreateRecovery) endpoint.
|
||||
/// /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery)
|
||||
/// endpoint.
|
||||
///
|
||||
/// Please note that in order to avoid a [Redirect
|
||||
/// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
@@ -331,7 +333,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Sessions
|
||||
/// List sessions
|
||||
///
|
||||
/// Get the list of active sessions across different devices for the currently
|
||||
/// logged in user.
|
||||
@@ -351,7 +353,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Delete Sessions
|
||||
/// Delete sessions
|
||||
///
|
||||
/// Delete all sessions from the user account and remove any sessions cookies
|
||||
/// from the end client.
|
||||
@@ -371,14 +373,15 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Anonymous Session
|
||||
/// Create anonymous session
|
||||
///
|
||||
/// Use this endpoint to allow a new user to register an anonymous account in
|
||||
/// your project. This route will also create a new session for the user. To
|
||||
/// allow the new user to convert an anonymous account to a normal account, you
|
||||
/// need to update its [email and
|
||||
/// password](/docs/client/account#accountUpdateEmail) or create an [OAuth2
|
||||
/// session](/docs/client/account#accountCreateOAuth2Session).
|
||||
/// password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail)
|
||||
/// or create an [OAuth2
|
||||
/// session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
|
||||
Future<models.Session> createAnonymousSession() async {
|
||||
const String apiPath = '/account/sessions/anonymous';
|
||||
|
||||
@@ -395,13 +398,14 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Email Session
|
||||
/// Create email session
|
||||
///
|
||||
/// Allow the user to login into their account by providing a valid email and
|
||||
/// password combination. This route will create a new session for the user.
|
||||
///
|
||||
/// A user is limited to 10 active sessions at a time by default. [Learn more
|
||||
/// about session limits](/docs/authentication-security#limits).
|
||||
/// about session
|
||||
/// limits](https://appwrite.io/docs/authentication-security#limits).
|
||||
Future<models.Session> createEmailSession({required String email, required String password}) async {
|
||||
const String apiPath = '/account/sessions/email';
|
||||
|
||||
@@ -420,7 +424,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Magic URL session
|
||||
/// Create magic URL session
|
||||
///
|
||||
/// Sends the user an email with a secret key for creating a session. If the
|
||||
/// provided user ID has not been registered, a new user will be created. When
|
||||
@@ -428,14 +432,15 @@ class Account extends Service {
|
||||
/// URL you provided with the secret key and userId values attached to the URL
|
||||
/// query string. Use the query string parameters to submit a request to the
|
||||
/// [PUT
|
||||
/// /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession)
|
||||
/// /account/sessions/magic-url](https://appwrite.io/docs/references/cloud/client-web/account#updateMagicURLSession)
|
||||
/// endpoint to complete the login process. The link sent to the user's email
|
||||
/// address is valid for 1 hour. If you are on a mobile device you can leave
|
||||
/// the URL parameter empty, so that the login completion will be handled by
|
||||
/// your Appwrite instance by default.
|
||||
///
|
||||
/// A user is limited to 10 active sessions at a time by default. [Learn more
|
||||
/// about session limits](/docs/authentication-security#limits).
|
||||
/// about session
|
||||
/// limits](https://appwrite.io/docs/authentication-security#limits).
|
||||
///
|
||||
Future<models.Token> createMagicURLSession({required String userId, required String email, String? url}) async {
|
||||
const String apiPath = '/account/sessions/magic-url';
|
||||
@@ -456,13 +461,13 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Magic URL session (confirmation)
|
||||
/// Create magic URL session (confirmation)
|
||||
///
|
||||
/// Use this endpoint to complete creating the session with the Magic URL. Both
|
||||
/// the **userId** and **secret** arguments will be passed as query parameters
|
||||
/// to the redirect URL you have provided when sending your request to the
|
||||
/// [POST
|
||||
/// /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession)
|
||||
/// /account/sessions/magic-url](https://appwrite.io/docs/references/cloud/client-web/account#createMagicURLSession)
|
||||
/// endpoint.
|
||||
///
|
||||
/// Please note that in order to avoid a [Redirect
|
||||
@@ -487,7 +492,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create OAuth2 Session
|
||||
/// Create OAuth2 session
|
||||
///
|
||||
/// Allow the user to login to their account using the OAuth2 provider of their
|
||||
/// choice. Each OAuth2 provider should be enabled from the Appwrite console
|
||||
@@ -502,7 +507,8 @@ class Account extends Service {
|
||||
/// user.
|
||||
///
|
||||
/// A user is limited to 10 active sessions at a time by default. [Learn more
|
||||
/// about session limits](/docs/authentication-security#limits).
|
||||
/// about session
|
||||
/// limits](https://appwrite.io/docs/authentication-security#limits).
|
||||
///
|
||||
Future createOAuth2Session({required String provider, String? success, String? failure, List<String>? scopes}) async {
|
||||
final String apiPath = '/account/sessions/oauth2/{provider}'.replaceAll('{provider}', provider);
|
||||
@@ -539,17 +545,18 @@ class Account extends Service {
|
||||
return client.webAuth(url, callbackUrlScheme: success);
|
||||
}
|
||||
|
||||
/// Create Phone session
|
||||
/// Create phone session
|
||||
///
|
||||
/// Sends the user an SMS with a secret key for creating a session. If the
|
||||
/// provided user ID has not be registered, a new user will be created. Use the
|
||||
/// returned user ID and secret and submit a request to the [PUT
|
||||
/// /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession)
|
||||
/// /account/sessions/phone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneSession)
|
||||
/// endpoint to complete the login process. The secret sent to the user's phone
|
||||
/// is valid for 15 minutes.
|
||||
///
|
||||
/// A user is limited to 10 active sessions at a time by default. [Learn more
|
||||
/// about session limits](/docs/authentication-security#limits).
|
||||
/// about session
|
||||
/// limits](https://appwrite.io/docs/authentication-security#limits).
|
||||
Future<models.Token> createPhoneSession({required String userId, required String phone}) async {
|
||||
const String apiPath = '/account/sessions/phone';
|
||||
|
||||
@@ -568,11 +575,11 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Phone Session (confirmation)
|
||||
/// Create phone session (confirmation)
|
||||
///
|
||||
/// Use this endpoint to complete creating a session with SMS. Use the
|
||||
/// **userId** from the
|
||||
/// [createPhoneSession](/docs/client/account#accountCreatePhoneSession)
|
||||
/// [createPhoneSession](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneSession)
|
||||
/// endpoint and the **secret** received via SMS to successfully update and
|
||||
/// confirm the phone session.
|
||||
Future<models.Session> updatePhoneSession({required String userId, required String secret}) async {
|
||||
@@ -593,7 +600,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Session
|
||||
/// Get session
|
||||
///
|
||||
/// Use this endpoint to get a logged in user's session using a Session ID.
|
||||
/// Inputting 'current' will return the current session being used.
|
||||
@@ -613,7 +620,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update OAuth Session (Refresh Tokens)
|
||||
/// Update OAuth session (refresh tokens)
|
||||
///
|
||||
/// Access tokens have limited lifespan and expire to mitigate security risks.
|
||||
/// If session was created using an OAuth provider, this route can be used to
|
||||
@@ -634,12 +641,13 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Delete Session
|
||||
/// Delete session
|
||||
///
|
||||
/// Logout the user. Use 'current' as the session ID to logout on this device,
|
||||
/// use a session ID to logout on another device. If you're looking to logout
|
||||
/// the user on all devices, use [Delete
|
||||
/// Sessions](/docs/client/account#accountDeleteSessions) instead.
|
||||
/// Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions)
|
||||
/// instead.
|
||||
Future deleteSession({required String sessionId}) async {
|
||||
final String apiPath = '/account/sessions/{sessionId}'.replaceAll('{sessionId}', sessionId);
|
||||
|
||||
@@ -656,7 +664,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Status
|
||||
/// Update status
|
||||
///
|
||||
/// Block the currently logged in user account. Behind the scene, the user
|
||||
/// record is not deleted but permanently blocked from any access. To
|
||||
@@ -677,7 +685,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Email Verification
|
||||
/// Create email verification
|
||||
///
|
||||
/// Use this endpoint to send a verification message to your user email address
|
||||
/// to confirm they are the valid owners of that address. Both the **userId**
|
||||
@@ -686,8 +694,8 @@ class Account extends Service {
|
||||
/// should redirect the user back to your app and allow you to complete the
|
||||
/// verification process by verifying both the **userId** and **secret**
|
||||
/// parameters. Learn more about how to [complete the verification
|
||||
/// process](/docs/client/account#accountUpdateEmailVerification). The
|
||||
/// verification link sent to the user's email address is valid for 7 days.
|
||||
/// process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
|
||||
/// The verification link sent to the user's email address is valid for 7 days.
|
||||
///
|
||||
/// Please note that in order to avoid a [Redirect
|
||||
/// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
||||
@@ -711,7 +719,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Email Verification (confirmation)
|
||||
/// Create email verification (confirmation)
|
||||
///
|
||||
/// Use this endpoint to complete the user email verification process. Use both
|
||||
/// the **userId** and **secret** parameters that were attached to your app URL
|
||||
@@ -735,14 +743,16 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Phone Verification
|
||||
/// Create phone verification
|
||||
///
|
||||
/// Use this endpoint to send a verification SMS to the currently logged in
|
||||
/// user. This endpoint is meant for use after updating a user's phone number
|
||||
/// using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone)
|
||||
/// using the
|
||||
/// [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone)
|
||||
/// endpoint. Learn more about how to [complete the verification
|
||||
/// process](/docs/client/account#accountUpdatePhoneVerification). The
|
||||
/// verification code sent to the user's phone number is valid for 15 minutes.
|
||||
/// process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification).
|
||||
/// The verification code sent to the user's phone number is valid for 15
|
||||
/// minutes.
|
||||
Future<models.Token> createPhoneVerification() async {
|
||||
const String apiPath = '/account/verification/phone';
|
||||
|
||||
@@ -759,7 +769,7 @@ class Account extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Phone Verification (confirmation)
|
||||
/// Create phone verification (confirmation)
|
||||
///
|
||||
/// Use this endpoint to complete the user phone verification process. Use the
|
||||
/// **userId** and **secret** that were sent to your user's phone number to
|
||||
|
||||
+11
-10
@@ -6,12 +6,13 @@ class Avatars extends Service {
|
||||
/// Initializes a [Avatars] service
|
||||
Avatars(super.client);
|
||||
|
||||
/// Get Browser Icon
|
||||
/// Get browser icon
|
||||
///
|
||||
/// You can use this endpoint to show different browser icons to your users.
|
||||
/// The code argument receives the browser code as it appears in your user [GET
|
||||
/// /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
|
||||
/// width, height and quality arguments to change the output settings.
|
||||
/// /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
||||
/// endpoint. Use width, height and quality arguments to change the output
|
||||
/// settings.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
@@ -33,7 +34,7 @@ class Avatars extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get Credit Card Icon
|
||||
/// Get credit card icon
|
||||
///
|
||||
/// The credit card endpoint will return you the icon of the credit card
|
||||
/// provider you need. Use width, height and quality arguments to change the
|
||||
@@ -60,7 +61,7 @@ class Avatars extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get Favicon
|
||||
/// Get favicon
|
||||
///
|
||||
/// Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
||||
/// website URL.
|
||||
@@ -79,12 +80,12 @@ class Avatars extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get Country Flag
|
||||
/// Get country flag
|
||||
///
|
||||
/// You can use this endpoint to show different country flags icons to your
|
||||
/// users. The code argument receives the 2 letter country code. Use width,
|
||||
/// height and quality arguments to change the output settings. Country codes
|
||||
/// follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
/// follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
@@ -107,7 +108,7 @@ class Avatars extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get Image from URL
|
||||
/// Get image from URL
|
||||
///
|
||||
/// Use this endpoint to fetch a remote image URL and crop it to any image size
|
||||
/// you want. This endpoint is very useful if you need to crop and display
|
||||
@@ -135,7 +136,7 @@ class Avatars extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get User Initials
|
||||
/// Get user initials
|
||||
///
|
||||
/// Use this endpoint to show your user initials avatar icon on your website or
|
||||
/// app. By default, this route will try to print your logged-in user name or
|
||||
@@ -170,7 +171,7 @@ class Avatars extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get QR Code
|
||||
/// Get QR code
|
||||
///
|
||||
/// Converts a given plain text to a QR code image. You can use the query
|
||||
/// parameters to change the size and style of the resulting image.
|
||||
|
||||
@@ -6,7 +6,7 @@ class Databases extends Service {
|
||||
/// Initializes a [Databases] service
|
||||
Databases(super.client);
|
||||
|
||||
/// List Documents
|
||||
/// List documents
|
||||
///
|
||||
/// Get a list of all the user's documents in a given collection. You can use
|
||||
/// the query params to filter your results.
|
||||
@@ -27,12 +27,12 @@ class Databases extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Document
|
||||
/// Create document
|
||||
///
|
||||
/// Create a new Document. Before using this route, you should create a new
|
||||
/// collection resource using either a [server
|
||||
/// integration](/docs/server/databases#databasesCreateCollection) API or
|
||||
/// directly from your database console.
|
||||
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
||||
/// API or directly from your database console.
|
||||
Future<models.Document> createDocument({required String databaseId, required String collectionId, required String documentId, required Map data, List<String>? permissions}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId);
|
||||
|
||||
@@ -52,7 +52,7 @@ class Databases extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Document
|
||||
/// Get document
|
||||
///
|
||||
/// Get a document by its unique ID. This endpoint response returns a JSON
|
||||
/// object with the document data.
|
||||
@@ -73,7 +73,7 @@ class Databases extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Document
|
||||
/// Update document
|
||||
///
|
||||
/// Update a document by its unique ID. Using the patch method you can pass
|
||||
/// only specific fields that will get updated.
|
||||
@@ -95,7 +95,7 @@ class Databases extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Delete Document
|
||||
/// Delete document
|
||||
///
|
||||
/// Delete a document by its unique ID.
|
||||
Future deleteDocument({required String databaseId, required String collectionId, required String documentId}) async {
|
||||
|
||||
@@ -6,7 +6,7 @@ class Functions extends Service {
|
||||
/// Initializes a [Functions] service
|
||||
Functions(super.client);
|
||||
|
||||
/// List Executions
|
||||
/// List executions
|
||||
///
|
||||
/// Get a list of all the current user function execution logs. You can use the
|
||||
/// query params to filter your results.
|
||||
@@ -28,7 +28,7 @@ class Functions extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Execution
|
||||
/// Create execution
|
||||
///
|
||||
/// Trigger a function execution. The returned object will return you the
|
||||
/// current execution status. You can ping the `Get Execution` endpoint to get
|
||||
@@ -55,7 +55,7 @@ class Functions extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Execution
|
||||
/// Get execution
|
||||
///
|
||||
/// Get a function execution log by its unique ID.
|
||||
Future<models.Execution> getExecution({required String functionId, required String executionId}) async {
|
||||
|
||||
@@ -6,7 +6,7 @@ class Graphql extends Service {
|
||||
/// Initializes a [Graphql] service
|
||||
Graphql(super.client);
|
||||
|
||||
/// GraphQL Endpoint
|
||||
/// GraphQL endpoint
|
||||
///
|
||||
/// Execute a GraphQL mutation.
|
||||
Future query({required Map query}) async {
|
||||
@@ -26,7 +26,7 @@ class Graphql extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// GraphQL Endpoint
|
||||
/// GraphQL endpoint
|
||||
///
|
||||
/// Execute a GraphQL mutation.
|
||||
Future mutation({required Map query}) async {
|
||||
|
||||
@@ -6,7 +6,7 @@ class Locale extends Service {
|
||||
/// Initializes a [Locale] service
|
||||
Locale(super.client);
|
||||
|
||||
/// Get User Locale
|
||||
/// Get user locale
|
||||
///
|
||||
/// Get the current user location based on IP. Returns an object with user
|
||||
/// country code, country name, continent name, continent code, ip address and
|
||||
@@ -50,7 +50,7 @@ class Locale extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Continents
|
||||
/// List continents
|
||||
///
|
||||
/// List of all continents. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
@@ -70,7 +70,7 @@ class Locale extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Countries
|
||||
/// List countries
|
||||
///
|
||||
/// List of all countries. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
@@ -90,7 +90,7 @@ class Locale extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List EU Countries
|
||||
/// List EU countries
|
||||
///
|
||||
/// List of all countries that are currently members of the EU. You can use the
|
||||
/// locale header to get the data in a supported language.
|
||||
@@ -110,7 +110,7 @@ class Locale extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Countries Phone Codes
|
||||
/// List countries phone codes
|
||||
///
|
||||
/// List of all countries phone codes. You can use the locale header to get the
|
||||
/// data in a supported language.
|
||||
@@ -130,7 +130,7 @@ class Locale extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Currencies
|
||||
/// List currencies
|
||||
///
|
||||
/// List of all currencies, including currency symbol, name, plural, and
|
||||
/// decimal digits for all major and minor currencies. You can use the locale
|
||||
@@ -151,7 +151,7 @@ class Locale extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Languages
|
||||
/// List languages
|
||||
///
|
||||
/// List of all languages classified by ISO 639-1 including 2-letter code, name
|
||||
/// in English, and name in the respective language.
|
||||
|
||||
@@ -5,7 +5,7 @@ class Storage extends Service {
|
||||
/// Initializes a [Storage] service
|
||||
Storage(super.client);
|
||||
|
||||
/// List Files
|
||||
/// List files
|
||||
///
|
||||
/// Get a list of all the user files. You can use the query params to filter
|
||||
/// your results.
|
||||
@@ -27,12 +27,12 @@ class Storage extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create File
|
||||
/// Create file
|
||||
///
|
||||
/// Create a new file. Before using this route, you should create a new bucket
|
||||
/// resource using either a [server
|
||||
/// integration](/docs/server/storage#storageCreateBucket) API or directly from
|
||||
/// your Appwrite console.
|
||||
/// integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
|
||||
/// API or directly from your Appwrite console.
|
||||
///
|
||||
/// Larger files should be uploaded using multiple requests with the
|
||||
/// [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
|
||||
@@ -78,7 +78,7 @@ class Storage extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get File
|
||||
/// Get file
|
||||
///
|
||||
/// Get a file by its unique ID. This endpoint response returns a JSON object
|
||||
/// with the file metadata.
|
||||
@@ -98,7 +98,7 @@ class Storage extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update File
|
||||
/// Update file
|
||||
///
|
||||
/// Update a file by its unique ID. Only users with write permissions have
|
||||
/// access to update this resource.
|
||||
@@ -140,7 +140,7 @@ class Storage extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get File for Download
|
||||
/// Get file for download
|
||||
///
|
||||
/// Get a file content by its unique ID. The endpoint response return with a
|
||||
/// 'Content-Disposition: attachment' header that tells the browser to start
|
||||
@@ -158,7 +158,7 @@ class Storage extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get File Preview
|
||||
/// Get file preview
|
||||
///
|
||||
/// Get a file preview image. Currently, this method supports preview for image
|
||||
/// files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
||||
@@ -189,7 +189,7 @@ class Storage extends Service {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get File for View
|
||||
/// Get file for view
|
||||
///
|
||||
/// Get a file content by its unique ID. This endpoint is similar to the
|
||||
/// download method but returns with no 'Content-Disposition: attachment'
|
||||
|
||||
+18
-18
@@ -6,7 +6,7 @@ class Teams extends Service {
|
||||
/// Initializes a [Teams] service
|
||||
Teams(super.client);
|
||||
|
||||
/// List Teams
|
||||
/// List teams
|
||||
///
|
||||
/// Get a list of all the teams in which the current user is a member. You can
|
||||
/// use the parameters to filter your results.
|
||||
@@ -28,7 +28,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Team
|
||||
/// Create team
|
||||
///
|
||||
/// Create a new team. The user who creates the team will automatically be
|
||||
/// assigned as the owner of the team. Only the users with the owner role can
|
||||
@@ -52,7 +52,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Team
|
||||
/// Get team
|
||||
///
|
||||
/// Get a team by its ID. All team members have read access for this resource.
|
||||
Future<models.Team> get({required String teamId}) async {
|
||||
@@ -71,7 +71,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Name
|
||||
/// Update name
|
||||
///
|
||||
/// Update the team's name by its unique ID.
|
||||
Future<models.Team> updateName({required String teamId, required String name}) async {
|
||||
@@ -91,7 +91,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Delete Team
|
||||
/// Delete team
|
||||
///
|
||||
/// Delete a team using its ID. Only team members with the owner role can
|
||||
/// delete the team.
|
||||
@@ -111,7 +111,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// List Team Memberships
|
||||
/// List team memberships
|
||||
///
|
||||
/// Use this endpoint to list a team's members using the team's ID. All team
|
||||
/// members have read access to this endpoint.
|
||||
@@ -133,7 +133,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Create Team Membership
|
||||
/// Create team membership
|
||||
///
|
||||
/// Invite a new member to join your team. Provide an ID for existing users, or
|
||||
/// invite unregistered users using an email or phone number. If initiated from
|
||||
@@ -148,15 +148,15 @@ class Teams extends Service {
|
||||
///
|
||||
/// Use the `url` parameter to redirect the user from the invitation email to
|
||||
/// your app. After the user is redirected, use the [Update Team Membership
|
||||
/// Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
|
||||
/// the user to accept the invitation to the team.
|
||||
/// Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
|
||||
/// endpoint to allow the user to accept the invitation to the team.
|
||||
///
|
||||
/// Please note that to avoid a [Redirect
|
||||
/// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// Appwrite will accept the only redirect URLs under the domains you have
|
||||
/// added as a platform on the Appwrite Console.
|
||||
///
|
||||
Future<models.Membership> createMembership({required String teamId, required List<String> roles, required String url, String? email, String? userId, String? phone, String? name}) async {
|
||||
Future<models.Membership> createMembership({required String teamId, required List<String> roles, String? email, String? userId, String? phone, String? url, String? name}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
@@ -178,7 +178,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Team Membership
|
||||
/// Get team membership
|
||||
///
|
||||
/// Get a team member by the membership unique id. All team members have read
|
||||
/// access for this resource.
|
||||
@@ -198,11 +198,11 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Membership
|
||||
/// Update membership
|
||||
///
|
||||
/// Modify the roles of a team member. Only team members with the owner role
|
||||
/// have access to this endpoint. Learn more about [roles and
|
||||
/// permissions](/docs/permissions).
|
||||
/// permissions](https://appwrite.io/docs/permissions).
|
||||
///
|
||||
Future<models.Membership> updateMembership({required String teamId, required String membershipId, required List<String> roles}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'.replaceAll('{teamId}', teamId).replaceAll('{membershipId}', membershipId);
|
||||
@@ -221,7 +221,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Delete Team Membership
|
||||
/// Delete team membership
|
||||
///
|
||||
/// This endpoint allows a user to leave a team or for a team owner to delete
|
||||
/// the membership of any other team member. You can also use this endpoint to
|
||||
@@ -242,7 +242,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Team Membership Status
|
||||
/// Update team membership status
|
||||
///
|
||||
/// Use this endpoint to allow a user to accept an invitation to join a team
|
||||
/// after being redirected back to your app from the invitation email received
|
||||
@@ -269,11 +269,11 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Get Team Preferences
|
||||
/// Get team preferences
|
||||
///
|
||||
/// Get the team's shared preferences by its unique ID. If a preference doesn't
|
||||
/// need to be shared by all team members, prefer storing them in [user
|
||||
/// preferences](/docs/client/account#accountGetPrefs).
|
||||
/// preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
Future<models.Preferences> getPrefs({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);
|
||||
|
||||
@@ -290,7 +290,7 @@ class Teams extends Service {
|
||||
|
||||
}
|
||||
|
||||
/// Update Preferences
|
||||
/// Update preferences
|
||||
///
|
||||
/// Update the team's preferences by its unique ID. The object you pass is
|
||||
/// stored as is and replaces any previous value. The maximum allowed prefs
|
||||
|
||||
@@ -43,7 +43,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
'x-sdk-name': 'Flutter',
|
||||
'x-sdk-platform': 'client',
|
||||
'x-sdk-language': 'flutter',
|
||||
'x-sdk-version': '10.0.1',
|
||||
'x-sdk-version': '11.0.1',
|
||||
'X-Appwrite-Response-Format': '1.4.0',
|
||||
};
|
||||
|
||||
@@ -156,7 +156,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
|
||||
while (offset < size) {
|
||||
var chunk;
|
||||
final end = min(offset + CHUNK_SIZE - 1, size - 1);
|
||||
final end = min(offset + CHUNK_SIZE, size);
|
||||
chunk = file.bytes!.getRange(offset, end).toList();
|
||||
params[paramName] =
|
||||
http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename);
|
||||
|
||||
@@ -64,7 +64,7 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
'x-sdk-name': 'Flutter',
|
||||
'x-sdk-platform': 'client',
|
||||
'x-sdk-language': 'flutter',
|
||||
'x-sdk-version': '10.0.1',
|
||||
'x-sdk-version': '11.0.1',
|
||||
'X-Appwrite-Response-Format' : '1.4.0',
|
||||
};
|
||||
|
||||
@@ -283,7 +283,7 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
while (offset < size) {
|
||||
List<int> chunk = [];
|
||||
if (file.bytes != null) {
|
||||
final end = min(offset + CHUNK_SIZE - 1, size - 1);
|
||||
final end = min(offset + CHUNK_SIZE, size);
|
||||
chunk = file.bytes!.getRange(offset, end).toList();
|
||||
} else {
|
||||
raf!.setPositionSync(offset);
|
||||
|
||||
@@ -12,7 +12,7 @@ class Document implements Model {
|
||||
final String $createdAt;
|
||||
/// Document update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Document permissions. [Learn more about permissions](/docs/permissions).
|
||||
/// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class File implements Model {
|
||||
final String $createdAt;
|
||||
/// File update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// File permissions. [Learn more about permissions](/docs/permissions).
|
||||
/// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
/// File name.
|
||||
final String name;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name: appwrite
|
||||
version: 10.0.1
|
||||
version: 11.0.1
|
||||
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-flutter
|
||||
|
||||
@@ -194,7 +194,6 @@ void main() {
|
||||
final response = await teams.createMembership(
|
||||
teamId: '[TEAM_ID]',
|
||||
roles: [],
|
||||
url: 'https://example.com',
|
||||
);
|
||||
expect(response, isA<models.Membership>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user