From 31207a1ed05e18c6e59562f4966a3231166c488d Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 14 Feb 2020 08:28:54 +0200 Subject: [PATCH] Updated SDKs --- app/sdks/dart/README.md | 4 +- app/sdks/dart/lib/services/account.dart | 89 ++--- app/sdks/dart/lib/services/database.dart | 62 --- app/sdks/dart/lib/services/teams.dart | 30 +- app/sdks/go/README.md | 2 +- app/sdks/go/database.go | 4 +- .../docs/examples/database/create-document.md | 2 +- .../docs/examples/database/update-document.md | 2 +- app/sdks/go/docs/examples/storage/create.md | 25 -- app/sdks/go/docs/examples/storage/delete.md | 25 -- .../go/docs/examples/storage/get-download.md | 25 -- .../go/docs/examples/storage/get-preview.md | 25 -- app/sdks/go/docs/examples/storage/get-view.md | 25 -- app/sdks/go/docs/examples/storage/get.md | 25 -- app/sdks/go/docs/examples/storage/list.md | 25 -- app/sdks/go/docs/examples/storage/update.md | 25 -- .../go/docs/examples/users/update-prefs.md | 2 +- app/sdks/go/teams.go | 14 +- app/sdks/go/users.go | 2 +- app/sdks/javascript/README.md | 2 +- .../examples/account/create-o-auth-session.md | 3 - .../docs/examples/account/create-recovery.md | 3 - .../docs/examples/account/create-session.md | 3 - .../examples/account/create-verification.md | 1 - .../docs/examples/account/create.md | 3 - .../account/delete-current-session.md | 13 - .../docs/examples/account/delete-session.md | 2 +- .../docs/examples/account/update-prefs.md | 2 +- .../docs/examples/account/update-recovery.md | 3 - .../examples/account/update-verification.md | 5 +- .../examples/database/create-collection.md | 13 - .../docs/examples/database/create-document.md | 2 +- .../examples/database/delete-collection.md | 13 - .../docs/examples/database/get-collection.md | 13 - .../examples/database/list-collections.md | 13 - .../examples/database/update-collection.md | 13 - .../docs/examples/database/update-document.md | 2 +- .../docs/examples/projects/create-key.md | 14 - .../docs/examples/projects/create-platform.md | 14 - .../docs/examples/projects/create-task.md | 14 - .../docs/examples/projects/create-webhook.md | 14 - .../docs/examples/projects/create.md | 14 - .../docs/examples/projects/delete-key.md | 14 - .../docs/examples/projects/delete-platform.md | 14 - .../docs/examples/projects/delete-task.md | 14 - .../docs/examples/projects/delete-webhook.md | 14 - .../docs/examples/projects/delete.md | 14 - .../docs/examples/projects/get-key.md | 14 - .../docs/examples/projects/get-platform.md | 14 - .../docs/examples/projects/get-task.md | 14 - .../docs/examples/projects/get-usage.md | 14 - .../docs/examples/projects/get-webhook.md | 14 - .../javascript/docs/examples/projects/get.md | 14 - .../docs/examples/projects/list-keys.md | 14 - .../docs/examples/projects/list-platforms.md | 14 - .../docs/examples/projects/list-tasks.md | 14 - .../docs/examples/projects/list-webhooks.md | 14 - .../javascript/docs/examples/projects/list.md | 14 - .../docs/examples/projects/update-key.md | 14 - .../docs/examples/projects/update-o-auth.md | 14 - .../docs/examples/projects/update-platform.md | 14 - .../docs/examples/projects/update-task.md | 14 - .../docs/examples/projects/update-webhook.md | 14 - .../docs/examples/projects/update.md | 14 - .../docs/examples/storage/create.md | 13 - .../docs/examples/storage/delete.md | 13 - .../docs/examples/storage/get-download.md | 13 - .../docs/examples/storage/get-preview.md | 13 - .../docs/examples/storage/get-view.md | 13 - .../javascript/docs/examples/storage/get.md | 13 - .../javascript/docs/examples/storage/list.md | 13 - .../docs/examples/storage/update.md | 13 - .../teams/update-membership-status.md | 3 - .../javascript/docs/examples/users/create.md | 14 - .../docs/examples/users/delete-session.md | 14 - .../docs/examples/users/delete-sessions.md | 14 - .../docs/examples/users/get-logs.md | 14 - .../docs/examples/users/get-prefs.md | 14 - .../docs/examples/users/get-sessions.md | 14 - .../javascript/docs/examples/users/get.md | 14 - .../javascript/docs/examples/users/list.md | 14 - .../docs/examples/users/update-prefs.md | 14 - .../docs/examples/users/update-status.md | 14 - app/sdks/javascript/src/sdk.js | 376 ++++-------------- app/sdks/javascript/src/sdk.min.js | 34 +- app/sdks/nodejs/README.md | 2 +- .../docs/examples/database/create-document.md | 2 +- .../docs/examples/database/update-document.md | 2 +- .../docs/examples/storage/create-file.md | 2 +- .../nodejs/docs/examples/storage/create.md | 19 - .../nodejs/docs/examples/storage/delete.md | 19 - .../docs/examples/storage/get-download.md | 19 - .../docs/examples/storage/get-preview.md | 19 - .../nodejs/docs/examples/storage/get-view.md | 19 - app/sdks/nodejs/docs/examples/storage/get.md | 19 - app/sdks/nodejs/docs/examples/storage/list.md | 19 - .../nodejs/docs/examples/storage/update.md | 19 - .../docs/examples/users/update-prefs.md | 2 +- app/sdks/nodejs/lib/client.js | 36 +- app/sdks/nodejs/lib/services/database.js | 4 +- app/sdks/nodejs/lib/services/teams.js | 12 +- app/sdks/nodejs/lib/services/users.js | 2 +- app/sdks/php/README.md | 2 +- app/sdks/php/docs/avatars.md | 24 +- app/sdks/php/docs/database.md | 26 +- .../docs/examples/database/create-document.md | 2 +- .../docs/examples/database/update-document.md | 2 +- app/sdks/php/docs/examples/storage/create.md | 15 - app/sdks/php/docs/examples/storage/delete.md | 15 - .../php/docs/examples/storage/get-download.md | 15 - .../php/docs/examples/storage/get-preview.md | 15 - .../php/docs/examples/storage/get-view.md | 15 - app/sdks/php/docs/examples/storage/get.md | 15 - app/sdks/php/docs/examples/storage/list.md | 15 - app/sdks/php/docs/examples/storage/update.md | 15 - .../php/docs/examples/users/update-prefs.md | 2 +- app/sdks/php/docs/storage.md | 10 +- app/sdks/php/docs/teams.md | 12 +- app/sdks/php/docs/users.md | 8 +- .../php/src/Appwrite/Services/Database.php | 8 +- app/sdks/php/src/Appwrite/Services/Teams.php | 12 +- app/sdks/php/src/Appwrite/Services/Users.php | 4 +- app/sdks/python/README.md | 2 +- .../docs/examples/database/create-document.md | 2 +- .../docs/examples/database/update-document.md | 2 +- .../python/docs/examples/storage/create.md | 13 - .../python/docs/examples/storage/delete.md | 13 - .../docs/examples/storage/get-download.md | 13 - .../docs/examples/storage/get-preview.md | 13 - .../python/docs/examples/storage/get-view.md | 13 - app/sdks/python/docs/examples/storage/get.md | 13 - app/sdks/python/docs/examples/storage/list.md | 13 - .../python/docs/examples/storage/update.md | 13 - .../docs/examples/users/update-prefs.md | 2 +- app/sdks/ruby/README.md | 2 +- composer.lock | 12 +- 136 files changed, 260 insertions(+), 1871 deletions(-) delete mode 100644 app/sdks/go/docs/examples/storage/create.md delete mode 100644 app/sdks/go/docs/examples/storage/delete.md delete mode 100644 app/sdks/go/docs/examples/storage/get-download.md delete mode 100644 app/sdks/go/docs/examples/storage/get-preview.md delete mode 100644 app/sdks/go/docs/examples/storage/get-view.md delete mode 100644 app/sdks/go/docs/examples/storage/get.md delete mode 100644 app/sdks/go/docs/examples/storage/list.md delete mode 100644 app/sdks/go/docs/examples/storage/update.md delete mode 100644 app/sdks/javascript/docs/examples/account/delete-current-session.md delete mode 100644 app/sdks/javascript/docs/examples/database/create-collection.md delete mode 100644 app/sdks/javascript/docs/examples/database/delete-collection.md delete mode 100644 app/sdks/javascript/docs/examples/database/get-collection.md delete mode 100644 app/sdks/javascript/docs/examples/database/list-collections.md delete mode 100644 app/sdks/javascript/docs/examples/database/update-collection.md delete mode 100644 app/sdks/javascript/docs/examples/projects/create-key.md delete mode 100644 app/sdks/javascript/docs/examples/projects/create-platform.md delete mode 100644 app/sdks/javascript/docs/examples/projects/create-task.md delete mode 100644 app/sdks/javascript/docs/examples/projects/create-webhook.md delete mode 100644 app/sdks/javascript/docs/examples/projects/create.md delete mode 100644 app/sdks/javascript/docs/examples/projects/delete-key.md delete mode 100644 app/sdks/javascript/docs/examples/projects/delete-platform.md delete mode 100644 app/sdks/javascript/docs/examples/projects/delete-task.md delete mode 100644 app/sdks/javascript/docs/examples/projects/delete-webhook.md delete mode 100644 app/sdks/javascript/docs/examples/projects/delete.md delete mode 100644 app/sdks/javascript/docs/examples/projects/get-key.md delete mode 100644 app/sdks/javascript/docs/examples/projects/get-platform.md delete mode 100644 app/sdks/javascript/docs/examples/projects/get-task.md delete mode 100644 app/sdks/javascript/docs/examples/projects/get-usage.md delete mode 100644 app/sdks/javascript/docs/examples/projects/get-webhook.md delete mode 100644 app/sdks/javascript/docs/examples/projects/get.md delete mode 100644 app/sdks/javascript/docs/examples/projects/list-keys.md delete mode 100644 app/sdks/javascript/docs/examples/projects/list-platforms.md delete mode 100644 app/sdks/javascript/docs/examples/projects/list-tasks.md delete mode 100644 app/sdks/javascript/docs/examples/projects/list-webhooks.md delete mode 100644 app/sdks/javascript/docs/examples/projects/list.md delete mode 100644 app/sdks/javascript/docs/examples/projects/update-key.md delete mode 100644 app/sdks/javascript/docs/examples/projects/update-o-auth.md delete mode 100644 app/sdks/javascript/docs/examples/projects/update-platform.md delete mode 100644 app/sdks/javascript/docs/examples/projects/update-task.md delete mode 100644 app/sdks/javascript/docs/examples/projects/update-webhook.md delete mode 100644 app/sdks/javascript/docs/examples/projects/update.md delete mode 100644 app/sdks/javascript/docs/examples/storage/create.md delete mode 100644 app/sdks/javascript/docs/examples/storage/delete.md delete mode 100644 app/sdks/javascript/docs/examples/storage/get-download.md delete mode 100644 app/sdks/javascript/docs/examples/storage/get-preview.md delete mode 100644 app/sdks/javascript/docs/examples/storage/get-view.md delete mode 100644 app/sdks/javascript/docs/examples/storage/get.md delete mode 100644 app/sdks/javascript/docs/examples/storage/list.md delete mode 100644 app/sdks/javascript/docs/examples/storage/update.md delete mode 100644 app/sdks/javascript/docs/examples/users/create.md delete mode 100644 app/sdks/javascript/docs/examples/users/delete-session.md delete mode 100644 app/sdks/javascript/docs/examples/users/delete-sessions.md delete mode 100644 app/sdks/javascript/docs/examples/users/get-logs.md delete mode 100644 app/sdks/javascript/docs/examples/users/get-prefs.md delete mode 100644 app/sdks/javascript/docs/examples/users/get-sessions.md delete mode 100644 app/sdks/javascript/docs/examples/users/get.md delete mode 100644 app/sdks/javascript/docs/examples/users/list.md delete mode 100644 app/sdks/javascript/docs/examples/users/update-prefs.md delete mode 100644 app/sdks/javascript/docs/examples/users/update-status.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/create.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/delete.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/get-download.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/get-preview.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/get-view.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/get.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/list.md delete mode 100644 app/sdks/nodejs/docs/examples/storage/update.md delete mode 100644 app/sdks/php/docs/examples/storage/create.md delete mode 100644 app/sdks/php/docs/examples/storage/delete.md delete mode 100644 app/sdks/php/docs/examples/storage/get-download.md delete mode 100644 app/sdks/php/docs/examples/storage/get-preview.md delete mode 100644 app/sdks/php/docs/examples/storage/get-view.md delete mode 100644 app/sdks/php/docs/examples/storage/get.md delete mode 100644 app/sdks/php/docs/examples/storage/list.md delete mode 100644 app/sdks/php/docs/examples/storage/update.md delete mode 100644 app/sdks/python/docs/examples/storage/create.md delete mode 100644 app/sdks/python/docs/examples/storage/delete.md delete mode 100644 app/sdks/python/docs/examples/storage/get-download.md delete mode 100644 app/sdks/python/docs/examples/storage/get-preview.md delete mode 100644 app/sdks/python/docs/examples/storage/get-view.md delete mode 100644 app/sdks/python/docs/examples/storage/get.md delete mode 100644 app/sdks/python/docs/examples/storage/list.md delete mode 100644 app/sdks/python/docs/examples/storage/update.md diff --git a/app/sdks/dart/README.md b/app/sdks/dart/README.md index 5988469846..84bcd1d809 100644 --- a/app/sdks/dart/README.md +++ b/app/sdks/dart/README.md @@ -1,7 +1,9 @@ # Appwrite SDK for Dart ![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) + +**This SDK is compatible with Appwrite server version . For older versions, please check previous releases.** Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/dart/lib/services/account.dart b/app/sdks/dart/lib/services/account.dart index d0230c628d..5a430e0969 100644 --- a/app/sdks/dart/lib/services/account.dart +++ b/app/sdks/dart/lib/services/account.dart @@ -15,26 +15,12 @@ class Account extends Service { return await this.client.call('get', path: path, params: params); } - /// Use this endpoint to allow a new user to register an account in your - /// project. Use the success and failure URLs to redirect users back to your - /// application after signup completes. - /// - /// If registration completes successfully user will be sent with a - /// confirmation email in order to confirm he is the owner of the account email - /// address. Use the confirmation parameter to redirect the user from the - /// confirmation email back to your app. When the user is redirected, use the - /// /auth/confirm endpoint to complete the account confirmation. - /// - /// 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) - /// the only valid redirect URLs are the ones from domains you have set when - /// adding your platforms in the console interface. - /// - /// When accessing this route using Javascript from the browser, success and - /// failure parameter URLs are required. Appwrite server will respond with a - /// 301 redirect status code and will set the user session cookie. This - /// behavior is enforced because modern browsers are limiting 3rd party cookies - /// in XHR of fetch requests to protect user privacy. + /// 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/account#createVerification) route to start + /// verifying the user email address. To allow your new user to login to his + /// new account, you need to create a new [account + /// session](/docs/account#createSession). Future create({email, password, name = null}) async { String path = '/account'; @@ -105,7 +91,7 @@ class Account extends Service { return await this.client.call('patch', path: path, params: params); } - /// Get currently logged in user preferences key-value object. + /// Get currently logged in user preferences as a key-value object. Future getPrefs() async { String path = '/account/prefs'; @@ -129,7 +115,8 @@ class Account extends Service { /// 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 /auth/password/reset endpoint to complete the process. + /// request to the [PUT /account/recovery](/docs/account#updateRecovery) + /// endpoint to complete the process. Future createRecovery({email, url}) async { String path = '/account/recovery'; @@ -142,8 +129,8 @@ class Account extends Service { } /// 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 - /// /auth/recovery endpoint. + /// the redirect URL you have provided when sending your request to the [POST + /// /account/recovery](/docs/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) @@ -172,19 +159,7 @@ class Account extends Service { return await this.client.call('get', path: path, params: params); } /// Allow the user to login into his account by providing a valid email and - /// password combination. Use the success and failure arguments to provide a - /// redirect URL's back to your app when login is completed. - /// - /// 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) - /// the only valid redirect URLs are the ones from domains you have set when - /// adding your platforms in the console interface. - /// - /// When accessing this route using Javascript from the browser, success and - /// failure parameter URLs are required. Appwrite server will respond with a - /// 301 redirect status code and will set the user session cookie. This - /// behavior is enforced because modern browsers are limiting 3rd party cookies - /// in XHR of fetch requests to protect user privacy. + /// password combination. This route will create a new session for the user. Future createSession({email, password}) async { String path = '/account/sessions'; @@ -205,17 +180,6 @@ class Account extends Service { return await this.client.call('delete', path: path, params: params); } - /// Use this endpoint to log out the currently logged in user from his account. - /// When successful this endpoint will delete the user session and remove the - /// session secret cookie from the user client. - Future deleteCurrentSession() async { - String path = '/account/sessions/current'; - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } /// Allow the user to login to his account using the OAuth provider of his /// choice. Each OAuth provider should be enabled from the Appwrite console /// first. Use the success and failure arguments to provide a redirect URL's @@ -233,25 +197,46 @@ class Account extends Service { /// Use this endpoint to log out the currently logged in user from all his /// account sessions across all his different devices. When using the option id /// argument, only the session unique ID provider will be deleted. - Future deleteSession({id}) async { - String path = '/account/sessions/{id}'.replaceAll(RegExp('{id}'), id); + Future deleteSession({sessionUid}) async { + String path = '/account/sessions/{sessionUid}'.replaceAll(RegExp('{sessionUid}'), sessionUid); Map params = { }; return await this.client.call('delete', path: path, params: params); + } + /// 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** + /// and **secret** arguments will be passed as query parameters to the URL you + /// have provider to be attached to the verification email. The provided URL + /// should redirect the user back for 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/account#updateAccountVerification). + /// + /// 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) + /// the only valid redirect URLs are the ones from domains you have set when + /// adding your platforms in the console interface. + Future createVerification({url}) async { + String path = '/account/verification'; + + Map params = { + 'url': url, + }; + + return await this.client.call('post', path: path, params: params); } /// Use this endpoint to complete the user email verification process. Use both /// the **userId** and **secret** parameters that were attached to your app URL /// to verify the user email ownership. If confirmed this route will return a /// 200 status code. - Future updateVerification({userId, secret, passwordB}) async { + Future updateVerification({userId, secret}) async { String path = '/account/verification'; Map params = { 'userId': userId, 'secret': secret, - 'password-b': passwordB, }; return await this.client.call('put', path: path, params: params); diff --git a/app/sdks/dart/lib/services/database.dart b/app/sdks/dart/lib/services/database.dart index fe475e2afc..edb7be6759 100644 --- a/app/sdks/dart/lib/services/database.dart +++ b/app/sdks/dart/lib/services/database.dart @@ -6,68 +6,6 @@ class Database extends Service { Database(Client client): super(client); - /// Get a list of all the user collections. You can use the query params to - /// filter your results. On admin mode, this endpoint will return a list of all - /// of the project collections. [Learn more about different API - /// modes](/docs/admin). - Future listCollections({search = null, limit = 25, offset = null, orderType = 'ASC'}) async { - String path = '/database/collections'; - - Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Create a new Collection. - Future createCollection({name, read, write, rules}) async { - String path = '/database/collections'; - - Map params = { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Get collection by its unique ID. This endpoint response returns a JSON - /// object with the collection metadata. - Future getCollection({collectionId}) async { - String path = '/database/collections/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Update collection by its unique ID. - Future updateCollection({collectionId, name, read, write, rules = const []}) async { - String path = '/database/collections/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId); - - Map params = { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules, - }; - - return await this.client.call('put', path: path, params: params); - } - /// Delete a collection by its unique ID. Only users with write permissions - /// have access to delete this resource. - Future deleteCollection({collectionId}) async { - String path = '/database/collections/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } /// Get a list of all the user documents. You can use the query params to /// filter your results. On admin mode, this endpoint will return a list of all /// of the project documents. [Learn more about different API diff --git a/app/sdks/dart/lib/services/teams.dart b/app/sdks/dart/lib/services/teams.dart index 486b43a027..fb5ce16c00 100644 --- a/app/sdks/dart/lib/services/teams.dart +++ b/app/sdks/dart/lib/services/teams.dart @@ -76,14 +76,14 @@ class Teams extends Service { return await this.client.call('get', path: path, params: params); } - /// Use this endpoint to invite a new member to your team. An email with a link - /// to join the team will be sent to the new member email address. If member - /// doesn't exists in the project it will be automatically created. + /// Use this endpoint to invite a new member to join your team. An email with a + /// link to join the team will be sent to the new member email address if the + /// member doesn't exist in the project it will be created automatically. /// - /// Use the 'url' parameter to redirect the user from the invitation email back + /// Use the 'URL' parameter to redirect the user from the invitation email back /// to your app. When the user is redirected, use the [Update Team Membership - /// Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join - /// the user to the team. + /// Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to + /// accept the invitation to the team. /// /// Please note that in order to avoid a [Redirect /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -112,21 +112,9 @@ class Teams extends Service { return await this.client.call('delete', path: path, params: params); } - /// Use this endpoint to let user accept an invitation to join a team after he - /// is being redirect back to your app from the invitation email. Use the - /// success and failure URL's to redirect users back to your application after - /// the request completes. - /// - /// Please note that in order to avoid a [Redirect - /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - /// the only valid redirect URL's are the once from domains you have set when - /// added your platforms in the console interface. - /// - /// When not using the success or failure redirect arguments this endpoint will - /// result with a 200 status code on success and with 401 status error on - /// failure. This behavior was applied to help the web clients deal with - /// browsers who don't allow to set 3rd party HTTP cookies needed for saving - /// the account session key. + /// Use this endpoint to allow a user to accept an invitation to join a team + /// after he is being redirected back to your app from the invitation email he + /// was sent. Future updateMembershipStatus({teamId, inviteId, userId, secret}) async { String path = '/teams/{teamId}/memberships/{inviteId}/status'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); diff --git a/app/sdks/go/README.md b/app/sdks/go/README.md index 35fd446507..f11b213ddf 100644 --- a/app/sdks/go/README.md +++ b/app/sdks/go/README.md @@ -1,7 +1,7 @@ # Appwrite SDK for Go ![License](https://img.shields.io/github/license/appwrite/sdk-for-go.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) **This SDK is compatible with Appwrite server version . For older versions, please check previous releases.** diff --git a/app/sdks/go/database.go b/app/sdks/go/database.go index 9a26c19374..7e5f686bdb 100644 --- a/app/sdks/go/database.go +++ b/app/sdks/go/database.go @@ -111,7 +111,7 @@ func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, O } // CreateDocument create a new Document. -func (srv *Database) CreateDocument(CollectionId string, Data string, Read []interface{}, Write []interface{}, ParentDocument string, ParentProperty string, ParentPropertyType string) (map[string]interface{}, error) { +func (srv *Database) CreateDocument(CollectionId string, Data object, Read []interface{}, Write []interface{}, ParentDocument string, ParentProperty string, ParentPropertyType string) (map[string]interface{}, error) { r := strings.NewReplacer("{collectionId}", CollectionId) path := r.Replace("/database/collections/{collectionId}/documents") @@ -140,7 +140,7 @@ func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[st } // UpdateDocument -func (srv *Database) UpdateDocument(CollectionId string, DocumentId string, Data string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { +func (srv *Database) UpdateDocument(CollectionId string, DocumentId string, Data object, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) path := r.Replace("/database/collections/{collectionId}/documents/{documentId}") diff --git a/app/sdks/go/docs/examples/database/create-document.md b/app/sdks/go/docs/examples/database/create-document.md index 64abf25349..d57b6c7c99 100644 --- a/app/sdks/go/docs/examples/database/create-document.md +++ b/app/sdks/go/docs/examples/database/create-document.md @@ -15,7 +15,7 @@ func main() { client: &client } - var response, error := service.CreateDocument("[COLLECTION_ID]", "{}", [], [], "[PARENT_DOCUMENT]", "", "assign") + var response, error := service.CreateDocument("[COLLECTION_ID]", , [], [], "[PARENT_DOCUMENT]", "", "assign") if error != nil { panic(error) diff --git a/app/sdks/go/docs/examples/database/update-document.md b/app/sdks/go/docs/examples/database/update-document.md index 50d2166bcd..74e507ae33 100644 --- a/app/sdks/go/docs/examples/database/update-document.md +++ b/app/sdks/go/docs/examples/database/update-document.md @@ -15,7 +15,7 @@ func main() { client: &client } - var response, error := service.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", "{}", [], []) + var response, error := service.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", , [], []) if error != nil { panic(error) diff --git a/app/sdks/go/docs/examples/storage/create.md b/app/sdks/go/docs/examples/storage/create.md deleted file mode 100644 index edfe6466fc..0000000000 --- a/app/sdks/go/docs/examples/storage/create.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.Create(file, [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/delete.md b/app/sdks/go/docs/examples/storage/delete.md deleted file mode 100644 index e1d6ebf227..0000000000 --- a/app/sdks/go/docs/examples/storage/delete.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.Delete("[FILE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/get-download.md b/app/sdks/go/docs/examples/storage/get-download.md deleted file mode 100644 index e4b44e0bef..0000000000 --- a/app/sdks/go/docs/examples/storage/get-download.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetDownload("[FILE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/get-preview.md b/app/sdks/go/docs/examples/storage/get-preview.md deleted file mode 100644 index 5c59b45223..0000000000 --- a/app/sdks/go/docs/examples/storage/get-preview.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetPreview("[FILE_ID]", 0, 0, 0, "", "jpg") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/get-view.md b/app/sdks/go/docs/examples/storage/get-view.md deleted file mode 100644 index 983b76c05e..0000000000 --- a/app/sdks/go/docs/examples/storage/get-view.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetView("[FILE_ID]", "pdf") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/get.md b/app/sdks/go/docs/examples/storage/get.md deleted file mode 100644 index 7c203b1092..0000000000 --- a/app/sdks/go/docs/examples/storage/get.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.Get("[FILE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/list.md b/app/sdks/go/docs/examples/storage/list.md deleted file mode 100644 index 836098be57..0000000000 --- a/app/sdks/go/docs/examples/storage/list.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.List("[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/storage/update.md b/app/sdks/go/docs/examples/storage/update.md deleted file mode 100644 index a46025b485..0000000000 --- a/app/sdks/go/docs/examples/storage/update.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("") - client.SetKey("") - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.Update("[FILE_ID]", [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/users/update-prefs.md b/app/sdks/go/docs/examples/users/update-prefs.md index 405d631f8f..7c0f274c88 100644 --- a/app/sdks/go/docs/examples/users/update-prefs.md +++ b/app/sdks/go/docs/examples/users/update-prefs.md @@ -15,7 +15,7 @@ func main() { client: &client } - var response, error := service.UpdatePrefs("[USER_ID]", "") + var response, error := service.UpdatePrefs("[USER_ID]", ) if error != nil { panic(error) diff --git a/app/sdks/go/teams.go b/app/sdks/go/teams.go index ce0ff645e8..14b89e0dda 100644 --- a/app/sdks/go/teams.go +++ b/app/sdks/go/teams.go @@ -98,15 +98,15 @@ func (srv *Teams) GetMemberships(TeamId string) (map[string]interface{}, error) return srv.client.Call("GET", path, nil, params) } -// CreateMembership use this endpoint to invite a new member to your team. An -// email with a link to join the team will be sent to the new member email -// address. If member doesn't exists in the project it will be automatically -// created. +// CreateMembership use this endpoint to invite a new member to join your +// team. An email with a link to join the team will be sent to the new member +// email address if the member doesn't exist in the project it will be created +// automatically. // -// Use the 'url' parameter to redirect the user from the invitation email back +// Use the 'URL' parameter to redirect the user from the invitation email back // to your app. When the user is redirected, use the [Update Team Membership -// Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join -// the user to the team. +// Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to +// accept the invitation to the team. // // Please note that in order to avoid a [Redirect // Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/go/users.go b/app/sdks/go/users.go index 86e4457f1a..dc1b6be977 100644 --- a/app/sdks/go/users.go +++ b/app/sdks/go/users.go @@ -80,7 +80,7 @@ func (srv *Users) GetPrefs(UserId string) (map[string]interface{}, error) { // UpdatePrefs update user preferences by its unique ID. You can pass only the // specific settings you wish to update. -func (srv *Users) UpdatePrefs(UserId string, Prefs string) (map[string]interface{}, error) { +func (srv *Users) UpdatePrefs(UserId string, Prefs object) (map[string]interface{}, error) { r := strings.NewReplacer("{userId}", UserId) path := r.Replace("/users/{userId}/prefs") diff --git a/app/sdks/javascript/README.md b/app/sdks/javascript/README.md index 581527d4a0..fcd2a9abbe 100644 --- a/app/sdks/javascript/README.md +++ b/app/sdks/javascript/README.md @@ -1,7 +1,7 @@ # Appwrite SDK for JavaScript ![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/javascript/docs/examples/account/create-o-auth-session.md b/app/sdks/javascript/docs/examples/account/create-o-auth-session.md index a6e19c5475..234910e08a 100644 --- a/app/sdks/javascript/docs/examples/account/create-o-auth-session.md +++ b/app/sdks/javascript/docs/examples/account/create-o-auth-session.md @@ -1,8 +1,5 @@ let sdk = new Appwrite(); -sdk -; - let promise = sdk.account.createOAuthSession('bitbucket', 'https://example.com', 'https://example.com'); promise.then(function (response) { diff --git a/app/sdks/javascript/docs/examples/account/create-recovery.md b/app/sdks/javascript/docs/examples/account/create-recovery.md index a20628d283..c1c5da791c 100644 --- a/app/sdks/javascript/docs/examples/account/create-recovery.md +++ b/app/sdks/javascript/docs/examples/account/create-recovery.md @@ -1,8 +1,5 @@ let sdk = new Appwrite(); -sdk -; - let promise = sdk.account.createRecovery('email@example.com', 'https://example.com'); promise.then(function (response) { diff --git a/app/sdks/javascript/docs/examples/account/create-session.md b/app/sdks/javascript/docs/examples/account/create-session.md index caef5ee9f2..37ba16aa92 100644 --- a/app/sdks/javascript/docs/examples/account/create-session.md +++ b/app/sdks/javascript/docs/examples/account/create-session.md @@ -1,8 +1,5 @@ let sdk = new Appwrite(); -sdk -; - let promise = sdk.account.createSession('email@example.com', 'password'); promise.then(function (response) { diff --git a/app/sdks/javascript/docs/examples/account/create-verification.md b/app/sdks/javascript/docs/examples/account/create-verification.md index eebdfbf193..1512198769 100644 --- a/app/sdks/javascript/docs/examples/account/create-verification.md +++ b/app/sdks/javascript/docs/examples/account/create-verification.md @@ -2,7 +2,6 @@ let sdk = new Appwrite(); sdk .setProject('') - .setKey('') ; let promise = sdk.account.createVerification('https://example.com'); diff --git a/app/sdks/javascript/docs/examples/account/create.md b/app/sdks/javascript/docs/examples/account/create.md index a956373ecf..07628280d5 100644 --- a/app/sdks/javascript/docs/examples/account/create.md +++ b/app/sdks/javascript/docs/examples/account/create.md @@ -1,8 +1,5 @@ let sdk = new Appwrite(); -sdk -; - let promise = sdk.account.create('email@example.com', 'password'); promise.then(function (response) { diff --git a/app/sdks/javascript/docs/examples/account/delete-current-session.md b/app/sdks/javascript/docs/examples/account/delete-current-session.md deleted file mode 100644 index a0ba8e88f4..0000000000 --- a/app/sdks/javascript/docs/examples/account/delete-current-session.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.deleteCurrentSession(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/account/delete-session.md b/app/sdks/javascript/docs/examples/account/delete-session.md index 56562c9007..b4aca274e0 100644 --- a/app/sdks/javascript/docs/examples/account/delete-session.md +++ b/app/sdks/javascript/docs/examples/account/delete-session.md @@ -4,7 +4,7 @@ sdk .setProject('') ; -let promise = sdk.account.deleteSession('[ID]'); +let promise = sdk.account.deleteSession('[SESSION_UID]'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/javascript/docs/examples/account/update-prefs.md b/app/sdks/javascript/docs/examples/account/update-prefs.md index 9deb78a41f..cae954eada 100644 --- a/app/sdks/javascript/docs/examples/account/update-prefs.md +++ b/app/sdks/javascript/docs/examples/account/update-prefs.md @@ -4,7 +4,7 @@ sdk .setProject('') ; -let promise = sdk.account.updatePrefs(''); +let promise = sdk.account.updatePrefs({}); promise.then(function (response) { console.log(response); diff --git a/app/sdks/javascript/docs/examples/account/update-recovery.md b/app/sdks/javascript/docs/examples/account/update-recovery.md index a04f31f4d6..ca19b1be39 100644 --- a/app/sdks/javascript/docs/examples/account/update-recovery.md +++ b/app/sdks/javascript/docs/examples/account/update-recovery.md @@ -1,8 +1,5 @@ let sdk = new Appwrite(); -sdk -; - let promise = sdk.account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); promise.then(function (response) { diff --git a/app/sdks/javascript/docs/examples/account/update-verification.md b/app/sdks/javascript/docs/examples/account/update-verification.md index 61d7282d11..9606e22985 100644 --- a/app/sdks/javascript/docs/examples/account/update-verification.md +++ b/app/sdks/javascript/docs/examples/account/update-verification.md @@ -1,9 +1,6 @@ let sdk = new Appwrite(); -sdk -; - -let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]', 'password'); +let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); diff --git a/app/sdks/javascript/docs/examples/database/create-collection.md b/app/sdks/javascript/docs/examples/database/create-collection.md deleted file mode 100644 index a93fe45778..0000000000 --- a/app/sdks/javascript/docs/examples/database/create-collection.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.createCollection('[NAME]', [], [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/database/create-document.md b/app/sdks/javascript/docs/examples/database/create-document.md index aa251ae2b2..aaaf3db39c 100644 --- a/app/sdks/javascript/docs/examples/database/create-document.md +++ b/app/sdks/javascript/docs/examples/database/create-document.md @@ -4,7 +4,7 @@ sdk .setProject('') ; -let promise = sdk.database.createDocument('[COLLECTION_ID]', '{}', [], []); +let promise = sdk.database.createDocument('[COLLECTION_ID]', {}, [], []); promise.then(function (response) { console.log(response); diff --git a/app/sdks/javascript/docs/examples/database/delete-collection.md b/app/sdks/javascript/docs/examples/database/delete-collection.md deleted file mode 100644 index 1a116c58b9..0000000000 --- a/app/sdks/javascript/docs/examples/database/delete-collection.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.deleteCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/database/get-collection.md b/app/sdks/javascript/docs/examples/database/get-collection.md deleted file mode 100644 index abe8d482d4..0000000000 --- a/app/sdks/javascript/docs/examples/database/get-collection.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.getCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/database/list-collections.md b/app/sdks/javascript/docs/examples/database/list-collections.md deleted file mode 100644 index 3160903309..0000000000 --- a/app/sdks/javascript/docs/examples/database/list-collections.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.listCollections(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/database/update-collection.md b/app/sdks/javascript/docs/examples/database/update-collection.md deleted file mode 100644 index 726c244c79..0000000000 --- a/app/sdks/javascript/docs/examples/database/update-collection.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.updateCollection('[COLLECTION_ID]', '[NAME]', [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/database/update-document.md b/app/sdks/javascript/docs/examples/database/update-document.md index 7809b97bfd..c3fb684ae3 100644 --- a/app/sdks/javascript/docs/examples/database/update-document.md +++ b/app/sdks/javascript/docs/examples/database/update-document.md @@ -4,7 +4,7 @@ sdk .setProject('') ; -let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', [], []); +let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []); promise.then(function (response) { console.log(response); diff --git a/app/sdks/javascript/docs/examples/projects/create-key.md b/app/sdks/javascript/docs/examples/projects/create-key.md deleted file mode 100644 index b120df0831..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-key.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.createKey('[PROJECT_ID]', '[NAME]', []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/create-platform.md b/app/sdks/javascript/docs/examples/projects/create-platform.md deleted file mode 100644 index f6e371981b..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.createPlatform('[PROJECT_ID]', 'web', '[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/create-task.md b/app/sdks/javascript/docs/examples/projects/create-task.md deleted file mode 100644 index 8c035d232d..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-task.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/create-webhook.md b/app/sdks/javascript/docs/examples/projects/create-webhook.md deleted file mode 100644 index 2041909b10..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/create.md b/app/sdks/javascript/docs/examples/projects/create.md deleted file mode 100644 index 35d825f677..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.create('[NAME]', '[TEAM_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/delete-key.md b/app/sdks/javascript/docs/examples/projects/delete-key.md deleted file mode 100644 index a4e5dfc8ad..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-key.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.deleteKey('[PROJECT_ID]', '[KEY_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/delete-platform.md b/app/sdks/javascript/docs/examples/projects/delete-platform.md deleted file mode 100644 index 88f6ae4d30..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.deletePlatform('[PROJECT_ID]', '[PLATFORM_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/delete-task.md b/app/sdks/javascript/docs/examples/projects/delete-task.md deleted file mode 100644 index 5e20417eaf..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-task.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.deleteTask('[PROJECT_ID]', '[TASK_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/delete-webhook.md b/app/sdks/javascript/docs/examples/projects/delete-webhook.md deleted file mode 100644 index 36d3ae8b83..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.deleteWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/delete.md b/app/sdks/javascript/docs/examples/projects/delete.md deleted file mode 100644 index ecf2c5cfac..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.delete('[PROJECT_ID]', '[PASSWORD]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/get-key.md b/app/sdks/javascript/docs/examples/projects/get-key.md deleted file mode 100644 index c62792dc32..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-key.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.getKey('[PROJECT_ID]', '[KEY_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/get-platform.md b/app/sdks/javascript/docs/examples/projects/get-platform.md deleted file mode 100644 index 2bdceda0af..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.getPlatform('[PROJECT_ID]', '[PLATFORM_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/get-task.md b/app/sdks/javascript/docs/examples/projects/get-task.md deleted file mode 100644 index ab66126e37..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-task.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.getTask('[PROJECT_ID]', '[TASK_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/get-usage.md b/app/sdks/javascript/docs/examples/projects/get-usage.md deleted file mode 100644 index 2554533143..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-usage.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.getUsage('[PROJECT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/get-webhook.md b/app/sdks/javascript/docs/examples/projects/get-webhook.md deleted file mode 100644 index f98be87cde..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.getWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/get.md b/app/sdks/javascript/docs/examples/projects/get.md deleted file mode 100644 index 783e73368d..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.get('[PROJECT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/list-keys.md b/app/sdks/javascript/docs/examples/projects/list-keys.md deleted file mode 100644 index 58b7743df6..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-keys.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.listKeys('[PROJECT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/list-platforms.md b/app/sdks/javascript/docs/examples/projects/list-platforms.md deleted file mode 100644 index 3e64d8698c..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-platforms.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.listPlatforms('[PROJECT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/list-tasks.md b/app/sdks/javascript/docs/examples/projects/list-tasks.md deleted file mode 100644 index 5e85a64f35..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-tasks.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.listTasks('[PROJECT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/list-webhooks.md b/app/sdks/javascript/docs/examples/projects/list-webhooks.md deleted file mode 100644 index a77ca5e7de..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-webhooks.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.listWebhooks('[PROJECT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/list.md b/app/sdks/javascript/docs/examples/projects/list.md deleted file mode 100644 index d703219e00..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.list(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/update-key.md b/app/sdks/javascript/docs/examples/projects/update-key.md deleted file mode 100644 index 32cecac287..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-key.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.updateKey('[PROJECT_ID]', '[KEY_ID]', '[NAME]', []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/update-o-auth.md b/app/sdks/javascript/docs/examples/projects/update-o-auth.md deleted file mode 100644 index d3aa11079b..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-o-auth.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.updateOAuth('[PROJECT_ID]', 'bitbucket'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/update-platform.md b/app/sdks/javascript/docs/examples/projects/update-platform.md deleted file mode 100644 index e5936795f4..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.updatePlatform('[PROJECT_ID]', '[PLATFORM_ID]', '[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/update-task.md b/app/sdks/javascript/docs/examples/projects/update-task.md deleted file mode 100644 index e0cd73f285..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-task.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/update-webhook.md b/app/sdks/javascript/docs/examples/projects/update-webhook.md deleted file mode 100644 index 923bd74a09..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/projects/update.md b/app/sdks/javascript/docs/examples/projects/update.md deleted file mode 100644 index 80e34b5155..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.projects.update('[PROJECT_ID]', '[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/create.md b/app/sdks/javascript/docs/examples/storage/create.md deleted file mode 100644 index a994d2134b..0000000000 --- a/app/sdks/javascript/docs/examples/storage/create.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.create(document.getElementById('uploader').files[0], [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/delete.md b/app/sdks/javascript/docs/examples/storage/delete.md deleted file mode 100644 index eb05232cf6..0000000000 --- a/app/sdks/javascript/docs/examples/storage/delete.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.delete('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/get-download.md b/app/sdks/javascript/docs/examples/storage/get-download.md deleted file mode 100644 index def50c957f..0000000000 --- a/app/sdks/javascript/docs/examples/storage/get-download.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getDownload('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/get-preview.md b/app/sdks/javascript/docs/examples/storage/get-preview.md deleted file mode 100644 index 52f7e64a41..0000000000 --- a/app/sdks/javascript/docs/examples/storage/get-preview.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getPreview('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/get-view.md b/app/sdks/javascript/docs/examples/storage/get-view.md deleted file mode 100644 index 93490036ae..0000000000 --- a/app/sdks/javascript/docs/examples/storage/get-view.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getView('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/get.md b/app/sdks/javascript/docs/examples/storage/get.md deleted file mode 100644 index 730a62d975..0000000000 --- a/app/sdks/javascript/docs/examples/storage/get.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.get('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/list.md b/app/sdks/javascript/docs/examples/storage/list.md deleted file mode 100644 index 1ab4777ce5..0000000000 --- a/app/sdks/javascript/docs/examples/storage/list.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.list(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/storage/update.md b/app/sdks/javascript/docs/examples/storage/update.md deleted file mode 100644 index da3c6d4675..0000000000 --- a/app/sdks/javascript/docs/examples/storage/update.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.update('[FILE_ID]', [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/teams/update-membership-status.md b/app/sdks/javascript/docs/examples/teams/update-membership-status.md index ab01bd36fb..25317a398c 100644 --- a/app/sdks/javascript/docs/examples/teams/update-membership-status.md +++ b/app/sdks/javascript/docs/examples/teams/update-membership-status.md @@ -1,8 +1,5 @@ let sdk = new Appwrite(); -sdk -; - let promise = sdk.teams.updateMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); promise.then(function (response) { diff --git a/app/sdks/javascript/docs/examples/users/create.md b/app/sdks/javascript/docs/examples/users/create.md deleted file mode 100644 index 9ac8eeff72..0000000000 --- a/app/sdks/javascript/docs/examples/users/create.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.create('email@example.com', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/delete-session.md b/app/sdks/javascript/docs/examples/users/delete-session.md deleted file mode 100644 index c9747a4cfc..0000000000 --- a/app/sdks/javascript/docs/examples/users/delete-session.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.deleteSession('[USER_ID]', '[SESSION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/delete-sessions.md b/app/sdks/javascript/docs/examples/users/delete-sessions.md deleted file mode 100644 index c0c0d3683b..0000000000 --- a/app/sdks/javascript/docs/examples/users/delete-sessions.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.deleteSessions('[USER_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/get-logs.md b/app/sdks/javascript/docs/examples/users/get-logs.md deleted file mode 100644 index 0c53367aa8..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-logs.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.getLogs('[USER_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/get-prefs.md b/app/sdks/javascript/docs/examples/users/get-prefs.md deleted file mode 100644 index cf979ad265..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-prefs.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.getPrefs('[USER_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/get-sessions.md b/app/sdks/javascript/docs/examples/users/get-sessions.md deleted file mode 100644 index 1260680564..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-sessions.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.getSessions('[USER_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/get.md b/app/sdks/javascript/docs/examples/users/get.md deleted file mode 100644 index 0c92b1f593..0000000000 --- a/app/sdks/javascript/docs/examples/users/get.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.get('[USER_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/list.md b/app/sdks/javascript/docs/examples/users/list.md deleted file mode 100644 index 2add615b19..0000000000 --- a/app/sdks/javascript/docs/examples/users/list.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.list(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/update-prefs.md b/app/sdks/javascript/docs/examples/users/update-prefs.md deleted file mode 100644 index 9ffaf75a4f..0000000000 --- a/app/sdks/javascript/docs/examples/users/update-prefs.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.updatePrefs('[USER_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/docs/examples/users/update-status.md b/app/sdks/javascript/docs/examples/users/update-status.md deleted file mode 100644 index afd66aed2e..0000000000 --- a/app/sdks/javascript/docs/examples/users/update-status.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') - .setKey('') -; - -let promise = sdk.users.updateStatus('[USER_ID]', '1'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/javascript/src/sdk.js b/app/sdks/javascript/src/sdk.js index 4b93188a00..37ad8f559c 100644 --- a/app/sdks/javascript/src/sdk.js +++ b/app/sdks/javascript/src/sdk.js @@ -321,26 +321,12 @@ /** * Create Account * - * Use this endpoint to allow a new user to register an account in your - * project. Use the success and failure URLs to redirect users back to your - * application after signup completes. - * - * If registration completes successfully user will be sent with a - * confirmation email in order to confirm he is the owner of the account email - * address. Use the confirmation parameter to redirect the user from the - * confirmation email back to your app. When the user is redirected, use the - * /auth/confirm endpoint to complete the account confirmation. - * - * 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) - * the only valid redirect URLs are the ones from domains you have set when - * adding your platforms in the console interface. - * - * When accessing this route using Javascript from the browser, success and - * failure parameter URLs are required. Appwrite server will respond with a - * 301 redirect status code and will set the user session cookie. This - * behavior is enforced because modern browsers are limiting 3rd party cookies - * in XHR of fetch requests to protect user privacy. + * 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/account#createVerification) route to start + * verifying the user email address. To allow your new user to login to his + * new account, you need to create a new [account + * session](/docs/account#createSession). * * @param {string} email * @param {string} password @@ -531,7 +517,7 @@ /** * Get Account Preferences * - * Get currently logged in user preferences key-value object. + * Get currently logged in user preferences as a key-value object. * * @throws {Error} * @return {Promise} @@ -553,7 +539,7 @@ * Update currently logged in user account preferences. You can pass only the * specific settings you wish to update. * - * @param {string} prefs + * @param {object} prefs * @throws {Error} * @return {Promise} */ @@ -577,13 +563,14 @@ }, /** - * 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 /auth/password/reset endpoint to complete the process. + * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * endpoint to complete the process. * * @param {string} email * @param {string} url @@ -618,12 +605,12 @@ }, /** - * Password Reset + * Complete Password Recovery * * 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 - * /auth/recovery endpoint. + * the redirect URL you have provided when sending your request to the [POST + * /account/recovery](/docs/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) @@ -704,19 +691,7 @@ * Create Account Session * * Allow the user to login into his account by providing a valid email and - * password combination. Use the success and failure arguments to provide a - * redirect URL's back to your app when login is completed. - * - * 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) - * the only valid redirect URLs are the ones from domains you have set when - * adding your platforms in the console interface. - * - * When accessing this route using Javascript from the browser, success and - * failure parameter URLs are required. Appwrite server will respond with a - * 301 redirect status code and will set the user session cookie. This - * behavior is enforced because modern browsers are limiting 3rd party cookies - * in XHR of fetch requests to protect user privacy. + * password combination. This route will create a new session for the user. * * @param {string} email * @param {string} password @@ -770,27 +745,6 @@ }, payload); }, - /** - * Delete Current Account Session - * - * Use this endpoint to log out the currently logged in user from his account. - * When successful this endpoint will delete the user session and remove the - * session secret cookie from the user client. - * - * @throws {Error} - * @return {Promise} - */ - deleteCurrentSession: function() { - let path = '/account/sessions/current'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - /** * Create Account Session with OAuth * @@ -843,16 +797,16 @@ * account sessions across all his different devices. When using the option id * argument, only the session unique ID provider will be deleted. * - * @param {string} id + * @param {string} sessionUid * @throws {Error} * @return {Promise} */ - deleteSession: function(id) { - if(id === undefined) { - throw new Error('Missing required parameter: "id"'); + deleteSession: function(sessionUid) { + if(sessionUid === undefined) { + throw new Error('Missing required parameter: "sessionUid"'); } - let path = '/account/sessions/{id}'.replace(new RegExp('{id}', 'g'), id); + let path = '/account/sessions/{sessionUid}'.replace(new RegExp('{sessionUid}', 'g'), sessionUid); let payload = {}; @@ -863,7 +817,47 @@ }, /** - * Updated 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** + * and **secret** arguments will be passed as query parameters to the URL you + * have provider to be attached to the verification email. The provided URL + * should redirect the user back for 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/account#updateAccountVerification). + * + * 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) + * the only valid redirect URLs are the ones from domains you have set when + * adding your platforms in the console interface. + * + * @param {string} url + * @throws {Error} + * @return {Promise} + */ + createVerification: function(url) { + if(url === undefined) { + throw new Error('Missing required parameter: "url"'); + } + + let path = '/account/verification'; + + let payload = {}; + + if(url) { + payload['url'] = url; + } + + return http + .post(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Complete Email Verification * * Use this endpoint to complete the user email verification process. Use both * the **userId** and **secret** parameters that were attached to your app URL @@ -872,11 +866,10 @@ * * @param {string} userId * @param {string} secret - * @param {string} passwordB * @throws {Error} * @return {Promise} */ - updateVerification: function(userId, secret, passwordB) { + updateVerification: function(userId, secret) { if(userId === undefined) { throw new Error('Missing required parameter: "userId"'); } @@ -885,10 +878,6 @@ throw new Error('Missing required parameter: "secret"'); } - if(passwordB === undefined) { - throw new Error('Missing required parameter: "passwordB"'); - } - let path = '/account/verification'; let payload = {}; @@ -901,10 +890,6 @@ payload['secret'] = secret; } - if(passwordB) { - payload['password-b'] = passwordB; - } - return http .put(path, { 'content-type': 'application/json', @@ -1156,209 +1141,6 @@ let database = { - /** - * List Collections - * - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project collections. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listCollections: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/database/collections'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Collection - * - * Create a new Collection. - * - * @param {string} name - * @param {array} read - * @param {array} write - * @param {array} rules - * @throws {Error} - * @return {Promise} - */ - createCollection: function(name, read, write, rules) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - if(rules === undefined) { - throw new Error('Missing required parameter: "rules"'); - } - - let path = '/database/collections'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(rules) { - payload['rules'] = rules; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - getCollection: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param {string} collectionId - * @param {string} name - * @param {array} read - * @param {array} write - * @param {array} rules - * @throws {Error} - * @return {Promise} - */ - updateCollection: function(collectionId, name, read, write, rules = []) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(rules) { - payload['rules'] = rules; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - deleteCollection: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - /** * List Documents * @@ -1437,7 +1219,7 @@ * Create a new Document. * * @param {string} collectionId - * @param {string} data + * @param {object} data * @param {array} read * @param {array} write * @param {string} parentDocument @@ -1533,7 +1315,7 @@ * * @param {string} collectionId * @param {string} documentId - * @param {string} data + * @param {object} data * @param {array} read * @param {array} write * @throws {Error} @@ -2226,14 +2008,14 @@ /** * Create Team Membership * - * Use this endpoint to invite a new member to your team. An email with a link - * to join the team will be sent to the new member email address. If member - * doesn't exists in the project it will be automatically created. + * Use this endpoint to invite a new member to join your team. An email with a + * link to join the team will be sent to the new member email address if the + * member doesn't exist in the project it will be created automatically. * - * Use the 'url' parameter to redirect the user from the invitation email back + * Use the 'URL' parameter to redirect the user from the invitation email back * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join - * the user to the team. + * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to + * accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -2325,21 +2107,9 @@ /** * Update Team Membership Status * - * Use this endpoint to let user accept an invitation to join a team after he - * is being redirect back to your app from the invitation email. Use the - * success and failure URL's to redirect users back to your application after - * the request completes. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * When not using the success or failure redirect arguments this endpoint will - * result with a 200 status code on success and with 401 status error on - * failure. This behavior was applied to help the web clients deal with - * browsers who don't allow to set 3rd party HTTP cookies needed for saving - * the account session key. + * Use this endpoint to allow a user to accept an invitation to join a team + * after he is being redirected back to your app from the invitation email he + * was sent. * * @param {string} teamId * @param {string} inviteId diff --git a/app/sdks/javascript/src/sdk.min.js b/app/sdks/javascript/src/sdk.min.js index 360d18dc2a..44ba4231b6 100644 --- a/app/sdks/javascript/src/sdk.min.js +++ b/app/sdks/javascript/src/sdk.min.js @@ -44,18 +44,18 @@ return http.put(path,{'content-type':'application/json',},payload)},getSessions: if(password===undefined){throw new Error('Missing required parameter: "password"')} let path='/account/sessions';let payload={};if(email){payload.email=email} if(password){payload.password=password} -return http.post(path,{'content-type':'application/json',},payload)},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},deleteCurrentSession:function(){let path='/account/sessions/current';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createOAuthSession:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} +return http.post(path,{'content-type':'application/json',},payload)},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createOAuthSession:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} if(success===undefined){throw new Error('Missing required parameter: "success"')} if(failure===undefined){throw new Error('Missing required parameter: "failure"')} let path='/account/sessions/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success} if(failure){payload.failure=failure} -return http.get(path,{'content-type':'application/json',},payload)},deleteSession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')} -let path='/account/sessions/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateVerification:function(userId,secret,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} +return http.get(path,{'content-type':'application/json',},payload)},deleteSession:function(sessionUid){if(sessionUid===undefined){throw new Error('Missing required parameter: "sessionUid"')} +let path='/account/sessions/{sessionUid}'.replace(new RegExp('{sessionUid}','g'),sessionUid);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createVerification:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} +let path='/account/verification';let payload={};if(url){payload.url=url} +return http.post(path,{'content-type':'application/json',},payload)},updateVerification:function(userId,secret){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} if(secret===undefined){throw new Error('Missing required parameter: "secret"')} -if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')} let path='/account/verification';let payload={};if(userId){payload.userId=userId} if(secret){payload.secret=secret} -if(passwordB){payload['password-b']=passwordB} return http.put(path,{'content-type':'application/json',},payload)}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width} if(height){payload.height=height} @@ -79,29 +79,7 @@ let path='/avatars/qr';let payload={};if(text){payload.text=text} if(size){payload.size=size} if(margin){payload.margin=margin} if(download){payload.download=download} -return http.get(path,{'content-type':'application/json',},payload)}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload.search=search} -if(limit){payload.limit=limit} -if(offset){payload.offset=offset} -if(orderType){payload.orderType=orderType} -return http.get(path,{'content-type':'application/json',},payload)},createCollection:function(name,read,write,rules){if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(read===undefined){throw new Error('Missing required parameter: "read"')} -if(write===undefined){throw new Error('Missing required parameter: "write"')} -if(rules===undefined){throw new Error('Missing required parameter: "rules"')} -let path='/database/collections';let payload={};if(name){payload.name=name} -if(read){payload.read=read} -if(write){payload.write=write} -if(rules){payload.rules=rules} -return http.post(path,{'content-type':'application/json',},payload)},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateCollection:function(collectionId,name,read,write,rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(read===undefined){throw new Error('Missing required parameter: "read"')} -if(write===undefined){throw new Error('Missing required parameter: "write"')} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(name){payload.name=name} -if(read){payload.read=read} -if(write){payload.write=write} -if(rules){payload.rules=rules} -return http.put(path,{'content-type':'application/json',},payload)},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} +return http.get(path,{'content-type':'application/json',},payload)}};let database={listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} let path='/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(filters){payload.filters=filters} if(offset){payload.offset=offset} if(limit){payload.limit=limit} diff --git a/app/sdks/nodejs/README.md b/app/sdks/nodejs/README.md index eac061f52e..3e0b06818b 100644 --- a/app/sdks/nodejs/README.md +++ b/app/sdks/nodejs/README.md @@ -1,7 +1,7 @@ # Appwrite SDK for NodeJS ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/nodejs/docs/examples/database/create-document.md b/app/sdks/nodejs/docs/examples/database/create-document.md index 9a15f133d5..f6bd242d32 100644 --- a/app/sdks/nodejs/docs/examples/database/create-document.md +++ b/app/sdks/nodejs/docs/examples/database/create-document.md @@ -10,7 +10,7 @@ client .setKey('') ; -let promise = database.createDocument('[COLLECTION_ID]', '{}', [], []); +let promise = database.createDocument('[COLLECTION_ID]', {}, [], []); promise.then(function (response) { console.log(response); diff --git a/app/sdks/nodejs/docs/examples/database/update-document.md b/app/sdks/nodejs/docs/examples/database/update-document.md index b281187da4..f94b9ca45f 100644 --- a/app/sdks/nodejs/docs/examples/database/update-document.md +++ b/app/sdks/nodejs/docs/examples/database/update-document.md @@ -10,7 +10,7 @@ client .setKey('') ; -let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', [], []); +let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []); promise.then(function (response) { console.log(response); diff --git a/app/sdks/nodejs/docs/examples/storage/create-file.md b/app/sdks/nodejs/docs/examples/storage/create-file.md index f0c9d4c5a8..a1317b3bec 100644 --- a/app/sdks/nodejs/docs/examples/storage/create-file.md +++ b/app/sdks/nodejs/docs/examples/storage/create-file.md @@ -10,7 +10,7 @@ client .setKey('') ; -let promise = storage.createFile(document.getElementById('uploader').files[0], [], []); +let promise = storage.createFile(fs.createReadStream(__dirname + '/file.png')), [], []); promise.then(function (response) { console.log(response); diff --git a/app/sdks/nodejs/docs/examples/storage/create.md b/app/sdks/nodejs/docs/examples/storage/create.md deleted file mode 100644 index cdb7fe2c6f..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/create.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.create(document.getElementById('uploader').files[0], [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/delete.md b/app/sdks/nodejs/docs/examples/storage/delete.md deleted file mode 100644 index 593b55ed34..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/delete.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.delete('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/get-download.md b/app/sdks/nodejs/docs/examples/storage/get-download.md deleted file mode 100644 index 38883b83aa..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/get-download.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.getDownload('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/get-preview.md b/app/sdks/nodejs/docs/examples/storage/get-preview.md deleted file mode 100644 index 8cea246614..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/get-preview.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.getPreview('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/get-view.md b/app/sdks/nodejs/docs/examples/storage/get-view.md deleted file mode 100644 index ce10394fda..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/get-view.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.getView('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/get.md b/app/sdks/nodejs/docs/examples/storage/get.md deleted file mode 100644 index 0014cfa389..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/get.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.get('[FILE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/list.md b/app/sdks/nodejs/docs/examples/storage/list.md deleted file mode 100644 index acaf8194e9..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/list.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.list(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/storage/update.md b/app/sdks/nodejs/docs/examples/storage/update.md deleted file mode 100644 index 055c1d0b90..0000000000 --- a/app/sdks/nodejs/docs/examples/storage/update.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let storage = new sdk.Storage(client); - -client - .setProject('') - .setKey('') -; - -let promise = storage.update('[FILE_ID]', [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/users/update-prefs.md b/app/sdks/nodejs/docs/examples/users/update-prefs.md index f2bfb26bb2..5a7f5407a5 100644 --- a/app/sdks/nodejs/docs/examples/users/update-prefs.md +++ b/app/sdks/nodejs/docs/examples/users/update-prefs.md @@ -10,7 +10,7 @@ client .setKey('') ; -let promise = users.updatePrefs('[USER_ID]', ''); +let promise = users.updatePrefs('[USER_ID]', {}); promise.then(function (response) { console.log(response); diff --git a/app/sdks/nodejs/lib/client.js b/app/sdks/nodejs/lib/client.js index 253bf95f02..eb1adacca9 100644 --- a/app/sdks/nodejs/lib/client.js +++ b/app/sdks/nodejs/lib/client.js @@ -99,23 +99,49 @@ class Client { return this; } - call(method, path = '', headers = {}, params = {}) { + async call(method, path = '', headers = {}, params = {}) { if(this.selfSigned) { // Allow self signed requests process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; } headers = Object.assign(this.headers, headers); - + + let contentType = headers['content-type'].toLowerCase(); let options = { method: method.toUpperCase(), uri: this.endpoint + path, qs: (method.toUpperCase() === 'GET') ? params : {}, headers: headers, - body: (method.toUpperCase() === 'GET') ? '' : params, - json: (headers['content-type'].toLowerCase().startsWith('application/json')), + body: (method.toUpperCase() === 'GET' || contentType.startsWith('multipart/form-data')) ? null : params, + json: (contentType.startsWith('application/json')), + formData: (contentType.startsWith('multipart/form-data')) ? this.flatten(params) : null, }; - return request(options); + let response = await request(options); + + if(contentType.startsWith('multipart/form-data')) { + response = JSON.parse(response); + } + + return response; + } + + flatten(data, prefix = '') { + let output = {}; + + for (const key in data) { + let value = data[key]; + let finalKey = prefix ? prefix + '[' + key +']' : key; + + if (Array.isArray(value)) { + output = Object.assign(output, this.flatten(value, finalKey)); // @todo: handle name collision here if needed + } + else { + output[finalKey] = value; + } + } + + return output; } } diff --git a/app/sdks/nodejs/lib/services/database.js b/app/sdks/nodejs/lib/services/database.js index 78c5e78f4b..547753a4cd 100644 --- a/app/sdks/nodejs/lib/services/database.js +++ b/app/sdks/nodejs/lib/services/database.js @@ -170,7 +170,7 @@ class Database extends Service { * Create a new Document. * * @param string collectionId - * @param string data + * @param object data * @param array read * @param array write * @param string parentDocument @@ -221,7 +221,7 @@ class Database extends Service { * * @param string collectionId * @param string documentId - * @param string data + * @param object data * @param array read * @param array write * @throws Exception diff --git a/app/sdks/nodejs/lib/services/teams.js b/app/sdks/nodejs/lib/services/teams.js index 7d6657fa5e..ed9924bbee 100644 --- a/app/sdks/nodejs/lib/services/teams.js +++ b/app/sdks/nodejs/lib/services/teams.js @@ -140,14 +140,14 @@ class Teams extends Service { /** * Create Team Membership * - * Use this endpoint to invite a new member to your team. An email with a link - * to join the team will be sent to the new member email address. If member - * doesn't exists in the project it will be automatically created. + * Use this endpoint to invite a new member to join your team. An email with a + * link to join the team will be sent to the new member email address if the + * member doesn't exist in the project it will be created automatically. * - * Use the 'url' parameter to redirect the user from the invitation email back + * Use the 'URL' parameter to redirect the user from the invitation email back * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join - * the user to the team. + * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to + * accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/nodejs/lib/services/users.js b/app/sdks/nodejs/lib/services/users.js index 5bb638a43e..abcdd4ed9f 100644 --- a/app/sdks/nodejs/lib/services/users.js +++ b/app/sdks/nodejs/lib/services/users.js @@ -117,7 +117,7 @@ class Users extends Service { * settings you wish to update. * * @param string userId - * @param string prefs + * @param object prefs * @throws Exception * @return {} */ diff --git a/app/sdks/php/README.md b/app/sdks/php/README.md index 03ce462fe9..b0a8bc90bd 100644 --- a/app/sdks/php/README.md +++ b/app/sdks/php/README.md @@ -1,7 +1,7 @@ # Appwrite SDK for PHP ![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/php/docs/avatars.md b/app/sdks/php/docs/avatars.md index 7f5796d07a..cf506e0db1 100644 --- a/app/sdks/php/docs/avatars.md +++ b/app/sdks/php/docs/avatars.md @@ -13,9 +13,9 @@ GET https://appwrite.io/v1/avatars/browsers/{code} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | code | string | **Required** Browser Code. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100 | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100 | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100 | 100 | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | ## Get Credit Card Icon @@ -30,9 +30,9 @@ GET https://appwrite.io/v1/avatars/credit-cards/{code} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100 | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100 | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100 | 100 | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | ## Get Favicon @@ -61,9 +61,9 @@ GET https://appwrite.io/v1/avatars/flags/{code} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | code | string | **Required** Country Code. ISO Alpha-2 country code format. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100 | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100 | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100 | 100 | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | ## Get Image from URL @@ -78,8 +78,8 @@ GET https://appwrite.io/v1/avatars/image | Field Name | Type | Description | Default | | --- | --- | --- | --- | | url | string | **Required** Image URL which you want to crop. | | -| width | integer | Resize preview image width, Pass an integer between 0 to 4000 | 400 | -| height | integer | Resize preview image height, Pass an integer between 0 to 4000 | 400 | +| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 | +| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 | ## Get QR Code @@ -93,7 +93,7 @@ GET https://appwrite.io/v1/avatars/qr | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| text | string | **Required** Plain text to be converted to QR code image | | +| text | string | **Required** Plain text to be converted to QR code image. | | | size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 | | margin | integer | Margin From Edge. Pass an integer between 0 to 10. Defaults to 1. | 1 | | download | integer | Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. | 0 | diff --git a/app/sdks/php/docs/database.md b/app/sdks/php/docs/database.md index 9bf9cf14e0..421a1139cb 100644 --- a/app/sdks/php/docs/database.md +++ b/app/sdks/php/docs/database.md @@ -32,7 +32,7 @@ POST https://appwrite.io/v1/database/collections | name | string | Collection name. | | | read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation | | +| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation. | | ## Get Collection @@ -64,7 +64,7 @@ PUT https://appwrite.io/v1/database/collections/{collectionId} | name | string | Collection name. | | | read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions. | | | write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation | [] | +| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation. | [] | ## Delete Collection @@ -92,8 +92,8 @@ GET https://appwrite.io/v1/database/collections/{collectionId}/documents | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. | | -| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$uid>=5bed2d152c362' | [] | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | +| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$uid>=5bed2d152c362'. | [] | | offset | integer | Offset value. Use this value to manage pagination. | 0 | | limit | integer | Maximum number of documents to return in response. Use this value to manage pagination. | 50 | | order-field | string | Document field that results will be sorted by. | $uid | @@ -115,8 +115,8 @@ POST https://appwrite.io/v1/database/collections/{collectionId}/documents | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. | | -| data | string | Document data as JSON string. | | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | +| data | object | Document data as JSON string. | | | read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | parentDocument | string | Parent document unique ID. Use when you want your new document to be a child of a parent document. | | @@ -135,8 +135,8 @@ GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{docume | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID | | -| documentId | string | **Required** Document unique ID | | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | +| documentId | string | **Required** Document unique ID. | | ## Update Document @@ -148,9 +148,9 @@ PATCH https://appwrite.io/v1/database/collections/{collectionId}/documents/{docu | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID | | -| documentId | string | **Required** Document unique ID | | -| data | string | Document data as JSON string | | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | +| documentId | string | **Required** Document unique ID. | | +| data | object | Document data as JSON string. | | | read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | @@ -166,6 +166,6 @@ DELETE https://appwrite.io/v1/database/collections/{collectionId}/documents/{doc | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID | | -| documentId | string | **Required** Document unique ID | | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | +| documentId | string | **Required** Document unique ID. | | diff --git a/app/sdks/php/docs/examples/database/create-document.md b/app/sdks/php/docs/examples/database/create-document.md index 84c4d7fd06..ff5b429e4a 100644 --- a/app/sdks/php/docs/examples/database/create-document.md +++ b/app/sdks/php/docs/examples/database/create-document.md @@ -12,4 +12,4 @@ $client $database = new Database($client); -$result = $database->createDocument('[COLLECTION_ID]', '{}', [], []); \ No newline at end of file +$result = $database->createDocument('[COLLECTION_ID]', [], [], []); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/database/update-document.md b/app/sdks/php/docs/examples/database/update-document.md index 2051d09772..2e065caed2 100644 --- a/app/sdks/php/docs/examples/database/update-document.md +++ b/app/sdks/php/docs/examples/database/update-document.md @@ -12,4 +12,4 @@ $client $database = new Database($client); -$result = $database->updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', [], []); \ No newline at end of file +$result = $database->updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', [], [], []); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/create.md b/app/sdks/php/docs/examples/storage/create.md deleted file mode 100644 index 789e163dd2..0000000000 --- a/app/sdks/php/docs/examples/storage/create.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->create(new \CURLFile('/path/to/file.png', 'image/png', 'file.png'), [], []); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/delete.md b/app/sdks/php/docs/examples/storage/delete.md deleted file mode 100644 index c1cf02b71d..0000000000 --- a/app/sdks/php/docs/examples/storage/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->delete('[FILE_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/get-download.md b/app/sdks/php/docs/examples/storage/get-download.md deleted file mode 100644 index 4d871c2956..0000000000 --- a/app/sdks/php/docs/examples/storage/get-download.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->getDownload('[FILE_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/get-preview.md b/app/sdks/php/docs/examples/storage/get-preview.md deleted file mode 100644 index f3bf8cf2c0..0000000000 --- a/app/sdks/php/docs/examples/storage/get-preview.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->getPreview('[FILE_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/get-view.md b/app/sdks/php/docs/examples/storage/get-view.md deleted file mode 100644 index 62979c4e91..0000000000 --- a/app/sdks/php/docs/examples/storage/get-view.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->getView('[FILE_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/get.md b/app/sdks/php/docs/examples/storage/get.md deleted file mode 100644 index 47f1534483..0000000000 --- a/app/sdks/php/docs/examples/storage/get.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->get('[FILE_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/list.md b/app/sdks/php/docs/examples/storage/list.md deleted file mode 100644 index d5fc5b6691..0000000000 --- a/app/sdks/php/docs/examples/storage/list.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->list(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/update.md b/app/sdks/php/docs/examples/storage/update.md deleted file mode 100644 index a2967d94d6..0000000000 --- a/app/sdks/php/docs/examples/storage/update.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$storage = new Storage($client); - -$result = $storage->update('[FILE_ID]', [], []); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/users/update-prefs.md b/app/sdks/php/docs/examples/users/update-prefs.md index d6854bb54d..dcb56d8d2a 100644 --- a/app/sdks/php/docs/examples/users/update-prefs.md +++ b/app/sdks/php/docs/examples/users/update-prefs.md @@ -12,4 +12,4 @@ $client $users = new Users($client); -$result = $users->updatePrefs('[USER_ID]', ''); \ No newline at end of file +$result = $users->updatePrefs('[USER_ID]', []); \ No newline at end of file diff --git a/app/sdks/php/docs/storage.md b/app/sdks/php/docs/storage.md index cb13a9968b..2138f901a8 100644 --- a/app/sdks/php/docs/storage.md +++ b/app/sdks/php/docs/storage.md @@ -29,7 +29,7 @@ POST https://appwrite.io/v1/storage/files | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| file | file | Binary Files. | | +| file | file | Binary File. | | | read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | @@ -104,11 +104,11 @@ GET https://appwrite.io/v1/storage/files/{fileId}/preview | Field Name | Type | Description | Default | | --- | --- | --- | --- | | fileId | string | **Required** File unique ID | | -| width | integer | Resize preview image width, Pass an integer between 0 to 4000 | 0 | -| height | integer | Resize preview image height, Pass an integer between 0 to 4000 | 0 | -| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100 | 100 | +| width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 | +| height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 | +| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | | background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | | -| output | string | Output format type (jpeg, jpg, png, gif and webp) | | +| output | string | Output format type (jpeg, jpg, png, gif and webp). | | ## Get File for View diff --git a/app/sdks/php/docs/teams.md b/app/sdks/php/docs/teams.md index 5f181ad21e..7b2646c0ce 100644 --- a/app/sdks/php/docs/teams.md +++ b/app/sdks/php/docs/teams.md @@ -30,7 +30,7 @@ POST https://appwrite.io/v1/teams | Field Name | Type | Description | Default | | --- | --- | --- | --- | | name | string | Team name. | | -| roles | array | User roles array. Use this param to set the roles in the team for the user who created the team. The default role is **owner**, a role can be any string. | ["owner"] | +| roles | array | Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | ["owner"] | ## Get Team @@ -95,9 +95,9 @@ GET https://appwrite.io/v1/teams/{teamId}/memberships POST https://appwrite.io/v1/teams/{teamId}/memberships ``` -** Use this endpoint to invite a new member to your team. An email with a link to join the team will be sent to the new member email address. If member doesn't exists in the project it will be automatically created. +** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically. -Use the 'url' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join the user to the team. +Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. ** @@ -106,9 +106,9 @@ Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP | Field Name | Type | Description | Default | | --- | --- | --- | --- | | teamId | string | **Required** Team unique ID. | | -| email | string | New team member email address. | | +| email | string | New team member email. | | | name | string | New team member name. | | -| roles | array | Invite roles array. Learn more about [roles and permissions](/docs/permissions). | | +| roles | array | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | | | url | string | URL to redirect the user back to your app from the invitation email. | | ## Delete Team Membership @@ -124,5 +124,5 @@ DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | teamId | string | **Required** Team unique ID. | | -| inviteId | string | **Required** Invite unique ID | | +| inviteId | string | **Required** Invite unique ID. | | diff --git a/app/sdks/php/docs/users.md b/app/sdks/php/docs/users.md index c1056933d3..fe68614cab 100644 --- a/app/sdks/php/docs/users.md +++ b/app/sdks/php/docs/users.md @@ -29,9 +29,9 @@ POST https://appwrite.io/v1/users | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| email | string | User account email. | | -| password | string | User account password. | | -| name | string | User account name. | | +| email | string | User email. | | +| password | string | User password. | | +| name | string | User name. | | ## Get User @@ -88,7 +88,7 @@ PATCH https://appwrite.io/v1/users/{userId}/prefs | Field Name | Type | Description | Default | | --- | --- | --- | --- | | userId | string | **Required** User unique ID. | | -| prefs | string | Prefs key-value JSON object. | | +| prefs | object | Prefs key-value JSON object. | | ## Get User Sessions diff --git a/app/sdks/php/src/Appwrite/Services/Database.php b/app/sdks/php/src/Appwrite/Services/Database.php index cf9135d4a2..9cec81bc33 100644 --- a/app/sdks/php/src/Appwrite/Services/Database.php +++ b/app/sdks/php/src/Appwrite/Services/Database.php @@ -182,7 +182,7 @@ class Database extends Service * Create a new Document. * * @param string $collectionId - * @param string $data + * @param array $data * @param array $read * @param array $write * @param string $parentDocument @@ -191,7 +191,7 @@ class Database extends Service * @throws Exception * @return array */ - public function createDocument(string $collectionId, string $data, array $read, array $write, string $parentDocument = '', string $parentProperty = '', string $parentPropertyType = 'assign'):array + public function createDocument(string $collectionId, array $data, array $read, array $write, string $parentDocument = '', string $parentProperty = '', string $parentPropertyType = 'assign'):array { $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/documents'); $params = []; @@ -235,13 +235,13 @@ class Database extends Service * * @param string $collectionId * @param string $documentId - * @param string $data + * @param array $data * @param array $read * @param array $write * @throws Exception * @return array */ - public function updateDocument(string $collectionId, string $documentId, string $data, array $read, array $write):array + public function updateDocument(string $collectionId, string $documentId, array $data, array $read, array $write):array { $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); $params = []; diff --git a/app/sdks/php/src/Appwrite/Services/Teams.php b/app/sdks/php/src/Appwrite/Services/Teams.php index 60b73231e5..7ef2240ab7 100644 --- a/app/sdks/php/src/Appwrite/Services/Teams.php +++ b/app/sdks/php/src/Appwrite/Services/Teams.php @@ -152,14 +152,14 @@ class Teams extends Service /** * Create Team Membership * - * Use this endpoint to invite a new member to your team. An email with a link - * to join the team will be sent to the new member email address. If member - * doesn't exists in the project it will be automatically created. + * Use this endpoint to invite a new member to join your team. An email with a + * link to join the team will be sent to the new member email address if the + * member doesn't exist in the project it will be created automatically. * - * Use the 'url' parameter to redirect the user from the invitation email back + * Use the 'URL' parameter to redirect the user from the invitation email back * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join - * the user to the team. + * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to + * accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/php/src/Appwrite/Services/Users.php b/app/sdks/php/src/Appwrite/Services/Users.php index aa3b2ecaa4..89189b0d63 100644 --- a/app/sdks/php/src/Appwrite/Services/Users.php +++ b/app/sdks/php/src/Appwrite/Services/Users.php @@ -128,11 +128,11 @@ class Users extends Service * settings you wish to update. * * @param string $userId - * @param string $prefs + * @param array $prefs * @throws Exception * @return array */ - public function updatePrefs(string $userId, string $prefs):array + public function updatePrefs(string $userId, array $prefs):array { $path = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs'); $params = []; diff --git a/app/sdks/python/README.md b/app/sdks/python/README.md index e5a3c8a652..84ad580d4d 100644 --- a/app/sdks/python/README.md +++ b/app/sdks/python/README.md @@ -1,7 +1,7 @@ # Appwrite SDK for Python ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) **This SDK is compatible with Appwrite server version . For older versions, please check previous releases.** diff --git a/app/sdks/python/docs/examples/database/create-document.md b/app/sdks/python/docs/examples/database/create-document.md index 353eece269..8e2b6a74fa 100644 --- a/app/sdks/python/docs/examples/database/create-document.md +++ b/app/sdks/python/docs/examples/database/create-document.md @@ -10,4 +10,4 @@ client = Client() database = Database(client) -result = database.create_document('[COLLECTION_ID]', '{}', {}, {}) +result = database.create_document('[COLLECTION_ID]', {}, {}, {}) diff --git a/app/sdks/python/docs/examples/database/update-document.md b/app/sdks/python/docs/examples/database/update-document.md index 9278e4a9f3..3903ff6042 100644 --- a/app/sdks/python/docs/examples/database/update-document.md +++ b/app/sdks/python/docs/examples/database/update-document.md @@ -10,4 +10,4 @@ client = Client() database = Database(client) -result = database.update_document('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', {}, {}) +result = database.update_document('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, {}, {}) diff --git a/app/sdks/python/docs/examples/storage/create.md b/app/sdks/python/docs/examples/storage/create.md deleted file mode 100644 index 39bb42e671..0000000000 --- a/app/sdks/python/docs/examples/storage/create.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.create(document.getElementById('uploader').files[0], {}, {}) diff --git a/app/sdks/python/docs/examples/storage/delete.md b/app/sdks/python/docs/examples/storage/delete.md deleted file mode 100644 index dde1f574f9..0000000000 --- a/app/sdks/python/docs/examples/storage/delete.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.delete('[FILE_ID]') diff --git a/app/sdks/python/docs/examples/storage/get-download.md b/app/sdks/python/docs/examples/storage/get-download.md deleted file mode 100644 index 1f0893590e..0000000000 --- a/app/sdks/python/docs/examples/storage/get-download.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.get_download('[FILE_ID]') diff --git a/app/sdks/python/docs/examples/storage/get-preview.md b/app/sdks/python/docs/examples/storage/get-preview.md deleted file mode 100644 index 96badbe625..0000000000 --- a/app/sdks/python/docs/examples/storage/get-preview.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.get_preview('[FILE_ID]') diff --git a/app/sdks/python/docs/examples/storage/get-view.md b/app/sdks/python/docs/examples/storage/get-view.md deleted file mode 100644 index bb5bdebb7f..0000000000 --- a/app/sdks/python/docs/examples/storage/get-view.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.get_view('[FILE_ID]') diff --git a/app/sdks/python/docs/examples/storage/get.md b/app/sdks/python/docs/examples/storage/get.md deleted file mode 100644 index 8962ea4160..0000000000 --- a/app/sdks/python/docs/examples/storage/get.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.get('[FILE_ID]') diff --git a/app/sdks/python/docs/examples/storage/list.md b/app/sdks/python/docs/examples/storage/list.md deleted file mode 100644 index e7f7924bdb..0000000000 --- a/app/sdks/python/docs/examples/storage/list.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.list() diff --git a/app/sdks/python/docs/examples/storage/update.md b/app/sdks/python/docs/examples/storage/update.md deleted file mode 100644 index c07dcb5b8b..0000000000 --- a/app/sdks/python/docs/examples/storage/update.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.storage import Storage - -client = Client() - -(client - .set_project('') - .set_key('') -) - -storage = Storage(client) - -result = storage.update('[FILE_ID]', {}, {}) diff --git a/app/sdks/python/docs/examples/users/update-prefs.md b/app/sdks/python/docs/examples/users/update-prefs.md index f7ae308d5e..684a20bdf5 100644 --- a/app/sdks/python/docs/examples/users/update-prefs.md +++ b/app/sdks/python/docs/examples/users/update-prefs.md @@ -10,4 +10,4 @@ client = Client() users = Users(client) -result = users.update_prefs('[USER_ID]', '') +result = users.update_prefs('[USER_ID]', {}) diff --git a/app/sdks/ruby/README.md b/app/sdks/ruby/README.md index dcf68a0384..67e7a0fb24 100644 --- a/app/sdks/ruby/README.md +++ b/app/sdks/ruby/README.md @@ -1,7 +1,7 @@ # Appwrite SDK for Ruby ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1) **This SDK is compatible with Appwrite server version . For older versions, please check previous releases.** diff --git a/composer.lock b/composer.lock index 0b51593ed4..1542e07727 100644 --- a/composer.lock +++ b/composer.lock @@ -1526,7 +1526,7 @@ "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator", - "reference": "aaf138e1cfa3e572338767ed2e59cad2de02027b" + "reference": "4cd052bb2f47db69e3653f20a2a706b5a7bb2565" }, "require": { "ext-curl": "*", @@ -1556,7 +1556,7 @@ } ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", - "time": "2020-02-12T15:25:53+00:00" + "time": "2020-02-14T06:25:13+00:00" }, { "name": "doctrine/instantiator", @@ -3156,12 +3156,12 @@ "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "54a87ed2473d446ca61786e2c90a9e5b12152793" + "reference": "4d62307f9899420a2027d2b963f5c9b2b5b06fbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/54a87ed2473d446ca61786e2c90a9e5b12152793", - "reference": "54a87ed2473d446ca61786e2c90a9e5b12152793", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/4d62307f9899420a2027d2b963f5c9b2b5b06fbd", + "reference": "4d62307f9899420a2027d2b963f5c9b2b5b06fbd", "shasum": "" }, "require": { @@ -3213,7 +3213,7 @@ "keywords": [ "templating" ], - "time": "2020-02-12T11:01:30+00:00" + "time": "2020-02-13T13:24:02+00:00" }, { "name": "webmozart/assert",