From 4adba1f6ec64bae1eab9b289842dc9c464abf571 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 25 Feb 2024 00:29:30 +1300 Subject: [PATCH] Release candidate for 1.5.x --- .travis.yml | 2 +- README.md | 14 ++-- ...e2f-a-challenge.md => create-challenge.md} | 2 +- docs/examples/account/create-email-token.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../examples/account/create-o-auth2session.md | 1 - docs/examples/account/create-o-auth2token.md | 21 ++++++ docs/examples/account/create-phone-token.md | 2 +- docs/examples/account/create-push-target.md | 6 +- docs/examples/account/create-session.md | 4 +- docs/examples/account/create.md | 4 +- docs/examples/account/delete-authenticator.md | 2 +- docs/examples/account/delete-identity.md | 2 +- docs/examples/account/delete-push-target.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/update-challenge.md | 4 +- .../account/update-magic-u-r-l-session.md | 4 +- docs/examples/account/update-name.md | 2 +- .../account/update-phone-verification.md | 4 +- docs/examples/account/update-push-target.md | 4 +- docs/examples/account/update-recovery.md | 4 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-verification.md | 4 +- docs/examples/account/verify-authenticator.md | 2 +- docs/examples/avatars/get-initials.md | 4 +- docs/examples/avatars/get-q-r.md | 4 +- docs/examples/databases/create-document.md | 6 +- docs/examples/databases/delete-document.md | 6 +- docs/examples/databases/get-document.md | 6 +- docs/examples/databases/list-documents.md | 4 +- docs/examples/databases/update-document.md | 6 +- docs/examples/functions/create-execution.md | 6 +- docs/examples/functions/get-execution.md | 4 +- docs/examples/functions/list-executions.md | 4 +- docs/examples/messaging/create-subscriber.md | 6 +- docs/examples/messaging/delete-subscriber.md | 4 +- docs/examples/storage/create-file.md | 4 +- docs/examples/storage/delete-file.md | 4 +- docs/examples/storage/get-file-download.md | 8 +-- docs/examples/storage/get-file-preview.md | 8 +-- docs/examples/storage/get-file-view.md | 8 +-- docs/examples/storage/get-file.md | 4 +- docs/examples/storage/list-files.md | 4 +- docs/examples/storage/update-file.md | 6 +- docs/examples/teams/create-membership.md | 6 +- docs/examples/teams/create.md | 4 +- docs/examples/teams/delete-membership.md | 4 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 4 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-memberships.md | 4 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 8 +-- docs/examples/teams/update-membership.md | 4 +- docs/examples/teams/update-name.md | 4 +- docs/examples/teams/update-prefs.md | 2 +- example/README.md | 4 +- lib/services/account.dart | 58 +++++++++++++-- lib/src/client_browser.dart | 2 +- lib/src/client_io.dart | 2 +- pubspec.yaml | 2 +- test/services/account_test.dart | 72 +++++++++++-------- test/services/avatars_test.dart | 2 +- test/services/databases_test.dart | 28 ++++---- test/services/functions_test.dart | 8 +-- test/services/messaging_test.dart | 10 +-- test/services/storage_test.dart | 30 ++++---- test/services/teams_test.dart | 40 +++++------ 70 files changed, 294 insertions(+), 218 deletions(-) rename docs/examples/account/{create2f-a-challenge.md => create-challenge.md} (89%) create mode 100644 docs/examples/account/create-o-auth2token.md diff --git a/.travis.yml b/.travis.yml index 1b299c3..0e2d215 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,6 @@ install: deploy: provider: script skip_cleanup: true - script: cd $TRAVIS_BUILD_DIR && dart format ./lib/ && flutter pub publish -f + script: cd $TRAVIS_BUILD_DIR && dart format ./lib/ && dart format ./test/ && flutter pub publish -f on: tags: true diff --git a/README.md b/README.md index c8bfbe3..06659da 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^12.0.0-rc.4 + appwrite: ^12.0.0-rc.5 ``` You can install packages from the command line: @@ -138,10 +138,7 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos Account account = Account(client); final user = await account .create( - userId: ID.unique(), - email: 'me@appwrite.io', - password: 'password', - name: 'My Name' + userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien" ); ``` @@ -166,10 +163,7 @@ void main() { final user = await account .create( - userId: ID.unique(), - email: 'me@appwrite.io', - password: 'password', - name: 'My Name' + userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien" ); } ``` @@ -181,7 +175,7 @@ The Appwrite Flutter SDK raises `AppwriteException` object with `message`, `type Account account = Account(client); try { - final user = await account.create(userId: ID.unique(), email: ‘email@example.com’,password: ‘password’, name: ‘name’); + final user = await account.create(userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien"); print(user.toMap()); } on AppwriteException catch(e) { //show message to user or do other operation based on error as required diff --git a/docs/examples/account/create2f-a-challenge.md b/docs/examples/account/create-challenge.md similarity index 89% rename from docs/examples/account/create2f-a-challenge.md rename to docs/examples/account/create-challenge.md index f987391..9264bd7 100644 --- a/docs/examples/account/create2f-a-challenge.md +++ b/docs/examples/account/create-challenge.md @@ -6,7 +6,7 @@ Client client = Client() Account account = Account(client); -Future result = account.create2FAChallenge( +Future result = account.createChallenge( factor: AuthenticationFactor.totp, ); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index ec5c9b6..c67c6f2 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.createEmailToken( - userId: '[USER_ID]', + userId: '', email: 'email@example.com', phrase: false, // (optional) ); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index b024252..6411ad7 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.createMagicURLToken( - userId: '[USER_ID]', + userId: '', email: 'email@example.com', url: 'https://example.com', // (optional) phrase: false, // (optional) diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md index e9bc060..e6f3244 100644 --- a/docs/examples/account/create-o-auth2session.md +++ b/docs/examples/account/create-o-auth2session.md @@ -10,7 +10,6 @@ Future result = account.createOAuth2Session( provider: OAuthProvider.amazon, success: 'https://example.com', // (optional) failure: 'https://example.com', // (optional) - token: false, // (optional) scopes: [], // (optional) ); diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md new file mode 100644 index 0000000..637ee93 --- /dev/null +++ b/docs/examples/account/create-o-auth2token.md @@ -0,0 +1,21 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +Account account = Account(client); + +Future result = account.createOAuth2Token( + provider: OAuthProvider.amazon, + success: 'https://example.com', // (optional) + failure: 'https://example.com', // (optional) + scopes: [], // (optional) +); + +result.then((response) { + print(response); +}).catchError((error) { + print(error.response); +}); + diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index c419f19..a8c8cb7 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.createPhoneToken( - userId: '[USER_ID]', + userId: '', phone: '+12065550100', ); diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index 95affb2..7cbd4db 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -7,9 +7,9 @@ Client client = Client() Account account = Account(client); Future result = account.createPushTarget( - targetId: '[TARGET_ID]', - identifier: '[IDENTIFIER]', - providerId: '[PROVIDER_ID]', // (optional) + targetId: '', + identifier: '', + providerId: '', // (optional) ); result.then((response) { diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index a6be958..55b0bfe 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.createSession( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); result.then((response) { diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 57fd7cf..1715cd5 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -7,10 +7,10 @@ Client client = Client() Account account = Account(client); Future result = account.create( - userId: '[USER_ID]', + userId: '', email: 'email@example.com', password: '', - name: '[NAME]', // (optional) + name: '', // (optional) ); result.then((response) { diff --git a/docs/examples/account/delete-authenticator.md b/docs/examples/account/delete-authenticator.md index 7cdc4f8..a85a9ec 100644 --- a/docs/examples/account/delete-authenticator.md +++ b/docs/examples/account/delete-authenticator.md @@ -8,7 +8,7 @@ Account account = Account(client); Future result = account.deleteAuthenticator( type: AuthenticatorType.totp, - otp: '[OTP]', + otp: '', ); result.then((response) { diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 74088f9..e2a75b5 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.deleteIdentity( - identityId: '[IDENTITY_ID]', + identityId: '', ); result.then((response) { diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md index f7e7a9e..af9f7d5 100644 --- a/docs/examples/account/delete-push-target.md +++ b/docs/examples/account/delete-push-target.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.deletePushTarget( - targetId: '[TARGET_ID]', + targetId: '', ); result.then((response) { diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index ea895cd..e824846 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.deleteSession( - sessionId: '[SESSION_ID]', + sessionId: '', ); result.then((response) { diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 0384ef3..a1be49d 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.getSession( - sessionId: '[SESSION_ID]', + sessionId: '', ); result.then((response) { diff --git a/docs/examples/account/update-challenge.md b/docs/examples/account/update-challenge.md index 10d0819..44e9f46 100644 --- a/docs/examples/account/update-challenge.md +++ b/docs/examples/account/update-challenge.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.updateChallenge( - challengeId: '[CHALLENGE_ID]', - otp: '[OTP]', + challengeId: '', + otp: '', ); result.then((response) { diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index f8ffc15..4b73483 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.updateMagicURLSession( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); result.then((response) { diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 0bf17f1..676672a 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.updateName( - name: '[NAME]', + name: '', ); result.then((response) { diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index df88109..2fef2e7 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.updatePhoneVerification( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); result.then((response) { diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index 875b628..2d50a5f 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.updatePushTarget( - targetId: '[TARGET_ID]', - identifier: '[IDENTIFIER]', + targetId: '', + identifier: '', ); result.then((response) { diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 769f02c..cb0bb09 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.updateRecovery( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', password: '', ); diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 27800c2..ba32e14 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -7,7 +7,7 @@ Client client = Client() Account account = Account(client); Future result = account.updateSession( - sessionId: '[SESSION_ID]', + sessionId: '', ); result.then((response) { diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 17bc125..d2b3920 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -7,8 +7,8 @@ Client client = Client() Account account = Account(client); Future result = account.updateVerification( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); result.then((response) { diff --git a/docs/examples/account/verify-authenticator.md b/docs/examples/account/verify-authenticator.md index 75d5779..cbfb597 100644 --- a/docs/examples/account/verify-authenticator.md +++ b/docs/examples/account/verify-authenticator.md @@ -8,7 +8,7 @@ Account account = Account(client); Future result = account.verifyAuthenticator( type: AuthenticatorType.totp, - otp: '[OTP]', + otp: '', ); result.then((response) { diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index dff834e..82d0d7b 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -8,7 +8,7 @@ Avatars avatars = Avatars(client); // Downloading file Future result = avatars.getInitials( - name: '[NAME]', // (optional) + name: '', // (optional) width: 0, // (optional) height: 0, // (optional) background: '', // (optional) @@ -22,7 +22,7 @@ Future result = avatars.getInitials( // Displaying image preview FutureBuilder( future: avatars.getInitials( - name:'[NAME]' , // (optional) + name:'' , // (optional) width:0 , // (optional) height:0 , // (optional) background:'' , // (optional) diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 8939312..f621cfe 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -8,7 +8,7 @@ Avatars avatars = Avatars(client); // Downloading file Future result = avatars.getQR( - text: '[TEXT]', + text: '', size: 1, // (optional) margin: 0, // (optional) download: false, // (optional) @@ -22,7 +22,7 @@ Future result = avatars.getQR( // Displaying image preview FutureBuilder( future: avatars.getQR( - text:'[TEXT]' , + text:'' , size:1 , // (optional) margin:0 , // (optional) download:false , // (optional) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index bfe00de..2d3f9b1 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -7,9 +7,9 @@ Client client = Client() Databases databases = Databases(client); Future result = databases.createDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', data: {}, permissions: ["read("any")"], // (optional) ); diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index ca40172..6b843f3 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -7,9 +7,9 @@ Client client = Client() Databases databases = Databases(client); Future result = databases.deleteDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', ); result.then((response) { diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 23dd043..d189e33 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -7,9 +7,9 @@ Client client = Client() Databases databases = Databases(client); Future result = databases.getDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', queries: [], // (optional) ); diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 15dbfcd..f16fdbb 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -7,8 +7,8 @@ Client client = Client() Databases databases = Databases(client); Future result = databases.listDocuments( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', + databaseId: '', + collectionId: '', queries: [], // (optional) ); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 2a2da03..e8d1362 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -7,9 +7,9 @@ Client client = Client() Databases databases = Databases(client); Future result = databases.updateDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', data: {}, // (optional) permissions: ["read("any")"], // (optional) ); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 290016f..020e727 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -7,10 +7,10 @@ Client client = Client() Functions functions = Functions(client); Future result = functions.createExecution( - functionId: '[FUNCTION_ID]', - body: '[BODY]', // (optional) + functionId: '', + body: '', // (optional) xasync: false, // (optional) - path: '[PATH]', // (optional) + path: '', // (optional) method: ExecutionMethod.gET, // (optional) headers: {}, // (optional) ); diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 09cebfa..aac2ff6 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -7,8 +7,8 @@ Client client = Client() Functions functions = Functions(client); Future result = functions.getExecution( - functionId: '[FUNCTION_ID]', - executionId: '[EXECUTION_ID]', + functionId: '', + executionId: '', ); result.then((response) { diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 6644169..6471028 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -7,9 +7,9 @@ Client client = Client() Functions functions = Functions(client); Future result = functions.listExecutions( - functionId: '[FUNCTION_ID]', + functionId: '', queries: [], // (optional) - search: '[SEARCH]', // (optional) + search: '', // (optional) ); result.then((response) { diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 97977a5..1e57a61 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -7,9 +7,9 @@ Client client = Client() Messaging messaging = Messaging(client); Future result = messaging.createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', - targetId: '[TARGET_ID]', + topicId: '', + subscriberId: '', + targetId: '', ); result.then((response) { diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 51d829c..280df58 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -7,8 +7,8 @@ Client client = Client() Messaging messaging = Messaging(client); Future result = messaging.deleteSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', + topicId: '', + subscriberId: '', ); result.then((response) { diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 2d8a06b..1c4cacb 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -8,8 +8,8 @@ Client client = Client() Storage storage = Storage(client); Future result = storage.createFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), permissions: ["read("any")"], // (optional) ); diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 0448315..60973a7 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -7,8 +7,8 @@ Client client = Client() Storage storage = Storage(client); Future result = storage.deleteFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); result.then((response) { diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 28ed65f..530bbb2 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -8,8 +8,8 @@ Storage storage = Storage(client); // Downloading file Future result = storage.getFileDownload( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ).then((bytes) { final file = File('path_to_file/filename.ext'); file.writeAsBytesSync(bytes) @@ -20,8 +20,8 @@ Future result = storage.getFileDownload( // Displaying image preview FutureBuilder( future: storage.getFileDownload( - bucketId:'[BUCKET_ID]' , - fileId:'[FILE_ID]' , + bucketId:'' , + fileId:'' , ), // Works for both public file and private file, for private files you need to be logged in builder: (context, snapshot) { return snapshot.hasData && snapshot.data != null diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 85ff2a1..8a8768e 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -8,8 +8,8 @@ Storage storage = Storage(client); // Downloading file Future result = storage.getFilePreview( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', width: 0, // (optional) height: 0, // (optional) gravity: ImageGravity.center, // (optional) @@ -31,8 +31,8 @@ Future result = storage.getFilePreview( // Displaying image preview FutureBuilder( future: storage.getFilePreview( - bucketId:'[BUCKET_ID]' , - fileId:'[FILE_ID]' , + bucketId:'' , + fileId:'' , width:0 , // (optional) height:0 , // (optional) gravity: ImageGravity.center.value, // (optional) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index fa069e2..65fb5ca 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -8,8 +8,8 @@ Storage storage = Storage(client); // Downloading file Future result = storage.getFileView( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ).then((bytes) { final file = File('path_to_file/filename.ext'); file.writeAsBytesSync(bytes) @@ -20,8 +20,8 @@ Future result = storage.getFileView( // Displaying image preview FutureBuilder( future: storage.getFileView( - bucketId:'[BUCKET_ID]' , - fileId:'[FILE_ID]' , + bucketId:'' , + fileId:'' , ), // Works for both public file and private file, for private files you need to be logged in builder: (context, snapshot) { return snapshot.hasData && snapshot.data != null diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index f0fbbf0..f7bc1f6 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -7,8 +7,8 @@ Client client = Client() Storage storage = Storage(client); Future result = storage.getFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); result.then((response) { diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 6f6c3d3..756d8be 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -7,9 +7,9 @@ Client client = Client() Storage storage = Storage(client); Future result = storage.listFiles( - bucketId: '[BUCKET_ID]', + bucketId: '', queries: [], // (optional) - search: '[SEARCH]', // (optional) + search: '', // (optional) ); result.then((response) { diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index f63d72f..0e73582 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -7,9 +7,9 @@ Client client = Client() Storage storage = Storage(client); Future result = storage.updateFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', - name: '[NAME]', // (optional) + bucketId: '', + fileId: '', + name: '', // (optional) permissions: ["read("any")"], // (optional) ); diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 40f0516..9687ad1 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -7,13 +7,13 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.createMembership( - teamId: '[TEAM_ID]', + teamId: '', roles: [], email: 'email@example.com', // (optional) - userId: '[USER_ID]', // (optional) + userId: '', // (optional) phone: '+12065550100', // (optional) url: 'https://example.com', // (optional) - name: '[NAME]', // (optional) + name: '', // (optional) ); result.then((response) { diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 284f8f1..4f6b5d1 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -7,8 +7,8 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.create( - teamId: '[TEAM_ID]', - name: '[NAME]', + teamId: '', + name: '', roles: [], // (optional) ); diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 7e4afcc..abbad3c 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -7,8 +7,8 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.deleteMembership( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', + teamId: '', + membershipId: '', ); result.then((response) { diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index c23ba4a..6b39c0f 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -7,7 +7,7 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.delete( - teamId: '[TEAM_ID]', + teamId: '', ); result.then((response) { diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 6823cb1..a1bef4a 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -7,8 +7,8 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.getMembership( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', + teamId: '', + membershipId: '', ); result.then((response) { diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 246bd12..d9e0bdb 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -7,7 +7,7 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.getPrefs( - teamId: '[TEAM_ID]', + teamId: '', ); result.then((response) { diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index a495e41..d135a03 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -7,7 +7,7 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.get( - teamId: '[TEAM_ID]', + teamId: '', ); result.then((response) { diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 6b807e6..69b746c 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -7,9 +7,9 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.listMemberships( - teamId: '[TEAM_ID]', + teamId: '', queries: [], // (optional) - search: '[SEARCH]', // (optional) + search: '', // (optional) ); result.then((response) { diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 0651eb3..60ec072 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -8,7 +8,7 @@ Teams teams = Teams(client); Future result = teams.list( queries: [], // (optional) - search: '[SEARCH]', // (optional) + search: '', // (optional) ); result.then((response) { diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 1b6c737..21c062a 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -7,10 +7,10 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.updateMembershipStatus( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', - userId: '[USER_ID]', - secret: '[SECRET]', + teamId: '', + membershipId: '', + userId: '', + secret: '', ); result.then((response) { diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index bb23506..161db11 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -7,8 +7,8 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.updateMembership( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', + teamId: '', + membershipId: '', roles: [], ); diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 0a74672..4a79481 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -7,8 +7,8 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.updateName( - teamId: '[TEAM_ID]', - name: '[NAME]', + teamId: '', + name: '', ); result.then((response) { diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 89b6499..363a36e 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -7,7 +7,7 @@ Client client = Client() Teams teams = Teams(client); Future result = teams.updatePrefs( - teamId: '[TEAM_ID]', + teamId: '', prefs: {}, ); diff --git a/example/README.md b/example/README.md index 23b6319..d0cb0c2 100644 --- a/example/README.md +++ b/example/README.md @@ -17,7 +17,7 @@ Create a new user and session: ```dart Account account = Account(client); -final user = await account.create(userId: '[USER_ID]', email: 'me@appwrite.io', password: 'password', name: 'My Name'); +final user = await account.create(userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien"); final session = await account.createEmailSession(email: 'me@appwrite.io', password: 'password'); @@ -60,4 +60,4 @@ storage.createFile( }); ``` -All examples and API features are available at the [official Appwrite docs](https://appwrite.io/docs) \ No newline at end of file +All examples and API features are available at the [official Appwrite docs](https://appwrite.io/docs) diff --git a/lib/services/account.dart b/lib/services/account.dart index 8caa330..e0c5bb7 100644 --- a/lib/services/account.dart +++ b/lib/services/account.dart @@ -185,7 +185,7 @@ class Account extends Service { /// Create 2FA Challenge /// - Future create2FAChallenge({required enums.AuthenticationFactor factor}) async { + Future createChallenge({required enums.AuthenticationFactor factor}) async { const String apiPath = '/account/mfa/challenge'; final Map apiParams = { @@ -596,14 +596,13 @@ class Account extends Service { /// about session /// limits](https://appwrite.io/docs/authentication-security#limits). /// - Future createOAuth2Session({required enums.OAuthProvider provider, String? success, String? failure, bool? token, List? scopes}) async { + Future createOAuth2Session({required enums.OAuthProvider provider, String? success, String? failure, List? scopes}) async { final String apiPath = '/account/sessions/oauth2/{provider}'.replaceAll('{provider}', provider.value); final Map params = { 'success': success, 'failure': failure, - 'token': token, 'scopes': scopes, 'project': client.config['project'], @@ -629,7 +628,7 @@ class Account extends Service { query: query.join('&') ); - return client.webAuth(url, callbackUrlScheme: success); + return client.webAuth(url, callbackUrlScheme: success); } /// Create session @@ -866,6 +865,57 @@ class Account extends Service { } + /// Create OAuth2 token + /// + /// 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 + /// first. Use the success and failure arguments to provide a redirect URL's + /// back to your app when login is completed. + /// + /// If authentication succeeds, `userId` and `secret` of a token will be + /// appended to the success URL as query parameters. These can be used to + /// create a new session using the [Create + /// session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) + /// endpoint. + /// + /// A user is limited to 10 active sessions at a time by default. [Learn more + /// about session + /// limits](https://appwrite.io/docs/authentication-security#limits). + Future createOAuth2Token({required enums.OAuthProvider provider, String? success, String? failure, List? scopes}) async { + final String apiPath = '/account/tokens/oauth2/{provider}'.replaceAll('{provider}', provider.value); + + final Map params = { + + 'success': success, + 'failure': failure, + 'scopes': scopes, + + 'project': client.config['project'], + }; + + final List query = []; + + params.forEach((key, value) { + if (value is List) { + for (var item in value) { + query.add(Uri.encodeComponent(key + '[]') + '=' + Uri.encodeComponent(item)); + } + } else if(value != null) { + query.add(Uri.encodeComponent(key) + '=' + Uri.encodeComponent(value)); + } + }); + + Uri endpoint = Uri.parse(client.endPoint); + Uri url = Uri(scheme: endpoint.scheme, + host: endpoint.host, + port: endpoint.port, + path: endpoint.path + apiPath, + query: query.join('&') + ); + + return client.webAuth(url, callbackUrlScheme: success); + } + /// Create phone token /// /// Sends the user an SMS with a secret key for creating a session. If the diff --git a/lib/src/client_browser.dart b/lib/src/client_browser.dart index ec40718..59dbe93 100644 --- a/lib/src/client_browser.dart +++ b/lib/src/client_browser.dart @@ -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': '12.0.0-rc.4', + 'x-sdk-version': '12.0.0-rc.5', 'X-Appwrite-Response-Format': '1.5.0', }; diff --git a/lib/src/client_io.dart b/lib/src/client_io.dart index df27a64..15acd14 100644 --- a/lib/src/client_io.dart +++ b/lib/src/client_io.dart @@ -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': '12.0.0-rc.4', + 'x-sdk-version': '12.0.0-rc.5', 'X-Appwrite-Response-Format' : '1.5.0', }; diff --git a/pubspec.yaml b/pubspec.yaml index ca5b58a..8a6be05 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: appwrite -version: 12.0.0-rc.4 +version: 12.0.0-rc.5 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 diff --git a/test/services/account_test.dart b/test/services/account_test.dart index e82475b..c6ef367 100644 --- a/test/services/account_test.dart +++ b/test/services/account_test.dart @@ -113,7 +113,7 @@ void main() { final response = await account.create( - userId: '[USER_ID]', + userId: '', email: 'email@example.com', password: '', ); @@ -181,7 +181,7 @@ void main() { final response = await account.deleteIdentity( - identityId: '[IDENTITY_ID]', + identityId: '', ); }); @@ -251,7 +251,7 @@ void main() { }); - test('test method create2FAChallenge()', () async { + test('test method createChallenge()', () async { final Map data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -264,7 +264,7 @@ void main() { )).thenAnswer((_) async => Response(data: data)); - final response = await account.create2FAChallenge( + final response = await account.createChallenge( factor: 'totp', ); expect(response, isA()); @@ -280,8 +280,8 @@ void main() { final response = await account.updateChallenge( - challengeId: '[CHALLENGE_ID]', - otp: '[OTP]', + challengeId: '', + otp: '', ); }); @@ -350,7 +350,7 @@ void main() { final response = await account.verifyAuthenticator( type: 'totp', - otp: '[OTP]', + otp: '', ); expect(response, isA()); @@ -384,7 +384,7 @@ void main() { final response = await account.deleteAuthenticator( type: 'totp', - otp: '[OTP]', + otp: '', ); expect(response, isA()); @@ -417,7 +417,7 @@ void main() { final response = await account.updateName( - name: '[NAME]', + name: '', ); expect(response, isA()); @@ -577,8 +577,8 @@ void main() { final response = await account.updateRecovery( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', password: '', ); expect(response, isA()); @@ -737,8 +737,8 @@ void main() { final response = await account.updateMagicURLSession( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); expect(response, isA()); @@ -793,8 +793,8 @@ void main() { final response = await account.createSession( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); expect(response, isA()); @@ -837,7 +837,7 @@ void main() { final response = await account.getSession( - sessionId: '[SESSION_ID]', + sessionId: '', ); expect(response, isA()); @@ -880,7 +880,7 @@ void main() { final response = await account.updateSession( - sessionId: '[SESSION_ID]', + sessionId: '', ); expect(response, isA()); @@ -895,7 +895,7 @@ void main() { final response = await account.deleteSession( - sessionId: '[SESSION_ID]', + sessionId: '', ); }); @@ -948,8 +948,8 @@ void main() { final response = await account.createPushTarget( - targetId: '[TARGET_ID]', - identifier: '[IDENTIFIER]', + targetId: '', + identifier: '', ); expect(response, isA()); @@ -972,8 +972,8 @@ void main() { final response = await account.updatePushTarget( - targetId: '[TARGET_ID]', - identifier: '[IDENTIFIER]', + targetId: '', + identifier: '', ); expect(response, isA()); @@ -988,7 +988,7 @@ void main() { final response = await account.deletePushTarget( - targetId: '[TARGET_ID]', + targetId: '', ); }); @@ -1008,7 +1008,7 @@ void main() { final response = await account.createEmailToken( - userId: '[USER_ID]', + userId: '', email: 'email@example.com', ); expect(response, isA()); @@ -1031,13 +1031,25 @@ void main() { final response = await account.createMagicURLToken( - userId: '[USER_ID]', + userId: '', email: 'email@example.com', ); expect(response, isA()); }); + test('test method createOAuth2Token()', () async { + + when(client.webAuth( + Uri(), + )).thenAnswer((_) async => 'done'); + + + final response = await account.createOAuth2Token( + provider: 'amazon', + ); + }); + test('test method createPhoneToken()', () async { final Map data = { '\$id': 'bb8ea5c16897e', @@ -1054,7 +1066,7 @@ void main() { final response = await account.createPhoneToken( - userId: '[USER_ID]', + userId: '', phone: '+12065550100', ); expect(response, isA()); @@ -1099,8 +1111,8 @@ void main() { final response = await account.updateVerification( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); expect(response, isA()); @@ -1143,8 +1155,8 @@ void main() { final response = await account.updatePhoneVerification( - userId: '[USER_ID]', - secret: '[SECRET]', + userId: '', + secret: '', ); expect(response, isA()); diff --git a/test/services/avatars_test.dart b/test/services/avatars_test.dart index 60c20f9..0adcd7d 100644 --- a/test/services/avatars_test.dart +++ b/test/services/avatars_test.dart @@ -145,7 +145,7 @@ void main() { final response = await avatars.getQR( - text: '[TEXT]', + text: '', ); expect(response, isA()); diff --git a/test/services/databases_test.dart b/test/services/databases_test.dart index cee69ed..1164948 100644 --- a/test/services/databases_test.dart +++ b/test/services/databases_test.dart @@ -66,8 +66,8 @@ void main() { final response = await databases.listDocuments( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', + databaseId: '', + collectionId: '', ); expect(response, isA()); @@ -89,9 +89,9 @@ void main() { final response = await databases.createDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', data: {}, ); expect(response, isA()); @@ -114,9 +114,9 @@ void main() { final response = await databases.getDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', ); expect(response, isA()); @@ -138,9 +138,9 @@ void main() { final response = await databases.updateDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', ); expect(response, isA()); @@ -155,9 +155,9 @@ void main() { final response = await databases.deleteDocument( - databaseId: '[DATABASE_ID]', - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', + databaseId: '', + collectionId: '', + documentId: '', ); }); diff --git a/test/services/functions_test.dart b/test/services/functions_test.dart index 67ddc8f..8707d05 100644 --- a/test/services/functions_test.dart +++ b/test/services/functions_test.dart @@ -66,7 +66,7 @@ void main() { final response = await functions.listExecutions( - functionId: '[FUNCTION_ID]', + functionId: '', ); expect(response, isA()); @@ -98,7 +98,7 @@ void main() { final response = await functions.createExecution( - functionId: '[FUNCTION_ID]', + functionId: '', ); expect(response, isA()); @@ -130,8 +130,8 @@ void main() { final response = await functions.getExecution( - functionId: '[FUNCTION_ID]', - executionId: '[EXECUTION_ID]', + functionId: '', + executionId: '', ); expect(response, isA()); diff --git a/test/services/messaging_test.dart b/test/services/messaging_test.dart index bc90a29..ba3564a 100644 --- a/test/services/messaging_test.dart +++ b/test/services/messaging_test.dart @@ -73,9 +73,9 @@ void main() { final response = await messaging.createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', - targetId: '[TARGET_ID]', + topicId: '', + subscriberId: '', + targetId: '', ); expect(response, isA()); @@ -90,8 +90,8 @@ void main() { final response = await messaging.deleteSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', + topicId: '', + subscriberId: '', ); }); diff --git a/test/services/storage_test.dart b/test/services/storage_test.dart index 477a76f..0e15362 100644 --- a/test/services/storage_test.dart +++ b/test/services/storage_test.dart @@ -66,7 +66,7 @@ void main() { final response = await storage.listFiles( - bucketId: '[BUCKET_ID]', + bucketId: '', ); expect(response, isA()); @@ -97,8 +97,8 @@ void main() { final response = await storage.createFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', file: InputFile.fromPath(path: './image.png'), ); expect(response, isA()); @@ -126,8 +126,8 @@ void main() { final response = await storage.getFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); expect(response, isA()); @@ -154,8 +154,8 @@ void main() { final response = await storage.updateFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); expect(response, isA()); @@ -170,8 +170,8 @@ void main() { final response = await storage.deleteFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); }); @@ -183,8 +183,8 @@ void main() { final response = await storage.getFileDownload( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); expect(response, isA()); @@ -198,8 +198,8 @@ void main() { final response = await storage.getFilePreview( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); expect(response, isA()); @@ -213,8 +213,8 @@ void main() { final response = await storage.getFileView( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', + bucketId: '', + fileId: '', ); expect(response, isA()); diff --git a/test/services/teams_test.dart b/test/services/teams_test.dart index 9b8217f..da943b2 100644 --- a/test/services/teams_test.dart +++ b/test/services/teams_test.dart @@ -87,8 +87,8 @@ void main() { final response = await teams.create( - teamId: '[TEAM_ID]', - name: '[NAME]', + teamId: '', + name: '', ); expect(response, isA()); @@ -110,7 +110,7 @@ void main() { final response = await teams.get( - teamId: '[TEAM_ID]', + teamId: '', ); expect(response, isA()); @@ -132,8 +132,8 @@ void main() { final response = await teams.updateName( - teamId: '[TEAM_ID]', - name: '[NAME]', + teamId: '', + name: '', ); expect(response, isA()); @@ -148,7 +148,7 @@ void main() { final response = await teams.delete( - teamId: '[TEAM_ID]', + teamId: '', ); }); @@ -164,7 +164,7 @@ void main() { final response = await teams.listMemberships( - teamId: '[TEAM_ID]', + teamId: '', ); expect(response, isA()); @@ -193,7 +193,7 @@ void main() { final response = await teams.createMembership( - teamId: '[TEAM_ID]', + teamId: '', roles: [], ); expect(response, isA()); @@ -223,8 +223,8 @@ void main() { final response = await teams.getMembership( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', + teamId: '', + membershipId: '', ); expect(response, isA()); @@ -253,8 +253,8 @@ void main() { final response = await teams.updateMembership( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', + teamId: '', + membershipId: '', roles: [], ); expect(response, isA()); @@ -270,8 +270,8 @@ void main() { final response = await teams.deleteMembership( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', + teamId: '', + membershipId: '', ); }); @@ -298,10 +298,10 @@ void main() { final response = await teams.updateMembershipStatus( - teamId: '[TEAM_ID]', - membershipId: '[MEMBERSHIP_ID]', - userId: '[USER_ID]', - secret: '[SECRET]', + teamId: '', + membershipId: '', + userId: '', + secret: '', ); expect(response, isA()); @@ -317,7 +317,7 @@ void main() { final response = await teams.getPrefs( - teamId: '[TEAM_ID]', + teamId: '', ); expect(response, isA()); @@ -333,7 +333,7 @@ void main() { final response = await teams.updatePrefs( - teamId: '[TEAM_ID]', + teamId: '', prefs: {}, ); expect(response, isA());