diff --git a/app/config/platforms.php b/app/config/platforms.php index 2eeabbcc73..a18fd1c7d7 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -15,6 +15,7 @@ $langDart = [ 'url' => 'https://github.com/appwrite/sdk-for-dart', 'enabled' => true, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => 'dart', 'source' => realpath(__DIR__ . '/../sdks/dart'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git', @@ -35,6 +36,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-js', 'enabled' => true, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => 'javascript', 'source' => realpath(__DIR__ . '/../sdks/javascript'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-js.git', @@ -47,6 +49,7 @@ return [ 'url' => '', 'enabled' => false, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => 'typescript', 'source' => false, 'gitUrl' => 'git@github.com:appwrite/sdk-for-typescript.git', @@ -67,6 +70,7 @@ return [ 'url' => '', 'enabled' => false, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => 'swift', 'source' => false, 'gitUrl' => 'git@github.com:appwrite/sdk-for-swift.git', @@ -79,6 +83,7 @@ return [ 'url' => '', 'enabled' => false, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => '', 'source' => false, 'gitUrl' => 'git@github.com:appwrite/sdk-for-objective-c.git', @@ -99,6 +104,7 @@ return [ 'url' => '', 'enabled' => false, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => 'kotlin', 'source' => false, 'gitUrl' => 'git@github.com:appwrite/sdk-for-kotlin.git', @@ -111,6 +117,7 @@ return [ 'url' => '', 'enabled' => false, 'beta' => false, + 'family' => APP_PLATFORM_CLIENT, 'prism' => 'java', 'source' => false, 'gitUrl' => 'git@github.com:appwrite/sdk-for-java.git', @@ -132,6 +139,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-node', 'enabled' => true, 'beta' => false, + 'family' => APP_PLATFORM_SERVER, 'prism' => 'javascript', 'source' => realpath(__DIR__ . '/../sdks/node'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-node.git', @@ -144,6 +152,8 @@ return [ 'version' => '1.0.16', 'url' => 'https://github.com/appwrite/sdk-for-php', 'enabled' => true, + 'beta' => false, + 'family' => APP_PLATFORM_SERVER, 'prism' => 'php', 'source' => realpath(__DIR__ . '/../sdks/php'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-php.git', @@ -157,6 +167,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-python', 'enabled' => true, 'beta' => true, + 'family' => APP_PLATFORM_SERVER, 'prism' => 'python', 'source' => realpath(__DIR__ . '/../sdks/python'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-python.git', @@ -170,6 +181,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-go', 'enabled' => true, 'beta' => true, + 'family' => APP_PLATFORM_SERVER, 'prism' => 'go', 'source' => realpath(__DIR__ . '/../sdks/go'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-go.git', @@ -183,6 +195,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'enabled' => true, 'beta' => true, + 'family' => APP_PLATFORM_SERVER, 'prism' => 'ruby', 'source' => realpath(__DIR__ . '/../sdks/ruby'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-ruby.git', diff --git a/app/sdks/dart/.packages b/app/sdks/dart/.packages deleted file mode 100644 index 8b327e4ec1..0000000000 --- a/app/sdks/dart/.packages +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by pub on 2019-12-05 18:55:11.878585. -charcode:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/ -collection:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12/lib/ -cookie_jar:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1/lib/ -dio:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio-3.0.3/lib/ -dio_cookie_manager:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio_cookie_manager-1.0.0/lib/ -http_parser:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/ -meta:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/meta-1.1.7/lib/ -path:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/path-1.6.4/lib/ -source_span:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/source_span-1.5.5/lib/ -string_scanner:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5/lib/ -term_glyph:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0/lib/ -typed_data:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/ -appwrite:lib/ diff --git a/app/sdks/dart/LICENSE b/app/sdks/dart/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/dart/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/dart/README.md b/app/sdks/dart/README.md deleted file mode 100644 index db1082d9e7..0000000000 --- a/app/sdks/dart/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# 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) - -**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).** - -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) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -Add this to your package's pubspec.yaml file: - -```yml -dependencies: - appwrite: ^0.0.6 -``` - -You can install packages from the command line: - -```bash -pub get -``` - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/dart/lib/appwrite.dart b/app/sdks/dart/lib/appwrite.dart deleted file mode 100644 index 01930e9b60..0000000000 --- a/app/sdks/dart/lib/appwrite.dart +++ /dev/null @@ -1,11 +0,0 @@ -export 'package:appwrite/services/account.dart'; -export 'package:appwrite/services/auth.dart'; -export 'package:appwrite/services/avatars.dart'; -export 'package:appwrite/services/database.dart'; -export 'package:appwrite/services/locale.dart'; -export 'package:appwrite/services/projects.dart'; -export 'package:appwrite/services/storage.dart'; -export 'package:appwrite/services/teams.dart'; -export 'package:appwrite/services/users.dart'; -export 'package:appwrite/client.dart'; -export 'package:dio/dio.dart' show Response; \ No newline at end of file diff --git a/app/sdks/dart/lib/client.dart b/app/sdks/dart/lib/client.dart deleted file mode 100644 index 05a5370651..0000000000 --- a/app/sdks/dart/lib/client.dart +++ /dev/null @@ -1,100 +0,0 @@ -import 'package:dio/dio.dart'; -import 'package:dio_cookie_manager/dio_cookie_manager.dart'; -import 'package:cookie_jar/cookie_jar.dart'; - -class Client { - String endPoint; - Map headers; - bool selfSigned; - Dio http; - - Client() { - this.endPoint = 'https://appwrite.io/v1'; - this.headers = { - 'content-type': 'application/json', - 'x-sdk-version': 'appwrite:dart:0.0.6', - }; - this.selfSigned = false; - - this.http = Dio(); - this.http.options.baseUrl = this.endPoint; - this.http.options.validateStatus = (status) => status != 404; - this.http.interceptors.add(CookieManager(CookieJar())); - } - - - /// Your Appwrite project ID - Client setProject(value) { - this.addHeader('X-Appwrite-Project', value); - - return this; - } - - - /// Your Appwrite project secret key - Client setKey(value) { - this.addHeader('X-Appwrite-Key', value); - - return this; - } - - - Client setLocale(value) { - this.addHeader('X-Appwrite-Locale', value); - - return this; - } - - - Client setMode(value) { - this.addHeader('X-Appwrite-Mode', value); - - return this; - } - - Client setSelfSigned({bool status = true}) { - this.selfSigned = status; - - return this; - } - - Client setEndpoint(String endPoint) - { - this.endPoint = endPoint; - this.http.options.baseUrl = this.endPoint; - return this; - } - - Client addHeader(String key, String value) { - this.headers[key.toLowerCase()] = value.toLowerCase(); - - return this; - } - - Future call(String method, {String path = '', Map headers = const {}, Map params = const {}}) { - if(this.selfSigned) { - // Allow self signed requests - } - - String reqPath = path; - bool isGet = method.toUpperCase() == "GET"; - - // Origin is hardcoded for testing - Options options = Options( - headers: {...this.headers, ...headers, "Origin": "http://localhost"}, - method: method.toUpperCase(), - ); - - if (isGet) { - path += "?"; - params.forEach((k, v) { - path += "${k}=${v}&"; - }); - } - - if (!isGet) - return http.request(reqPath, data: params, options: options); - else - return http.request(reqPath, options: options); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/service.dart b/app/sdks/dart/lib/service.dart deleted file mode 100644 index 81107c7803..0000000000 --- a/app/sdks/dart/lib/service.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:appwrite/client.dart'; - -class Service { - Client client; - - Service(Client client) { - this.client = client; - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/account.dart b/app/sdks/dart/lib/services/account.dart deleted file mode 100644 index 4d191232d2..0000000000 --- a/app/sdks/dart/lib/services/account.dart +++ /dev/null @@ -1,107 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Account extends Service { - - Account(Client client): super(client); - - /// Get currently logged in user data as JSON object. - Future get() async { - String path = '/account'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Delete a currently logged in user account. Behind the scene, the user - /// record is not deleted but permanently blocked from any access. This is done - /// to avoid deleted accounts being overtaken by new users with the same email - /// address. Any user-related resources like documents or storage files should - /// be deleted separately. - Future delete() async { - String path = '/account'; - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Update currently logged in user account email address. After changing user - /// address, user confirmation status is being reset and a new confirmation - /// mail is sent. For security measures, user password is required to complete - /// this request. - Future updateEmail({email, password}) async { - String path = '/account/email'; - - Map params = { - 'email': email, - 'password': password, - }; - - return await this.client.call('patch', path: path, params: params); - } - /// Update currently logged in user account name. - Future updateName({name}) async { - String path = '/account/name'; - - Map params = { - 'name': name, - }; - - return await this.client.call('patch', path: path, params: params); - } - /// Update currently logged in user password. For validation, user is required - /// to pass the password twice. - Future updatePassword({password, oldPassword}) async { - String path = '/account/password'; - - Map params = { - 'password': password, - 'old-password': oldPassword, - }; - - return await this.client.call('patch', path: path, params: params); - } - /// Get currently logged in user preferences key-value object. - Future getPrefs() async { - String path = '/account/prefs'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Update currently logged in user account preferences. You can pass only the - /// specific settings you wish to update. - Future updatePrefs({prefs}) async { - String path = '/account/prefs'; - - Map params = { - 'prefs': prefs, - }; - - return await this.client.call('patch', path: path, params: params); - } - /// Get currently logged in user list of latest security activity logs. Each - /// log returns user IP address, location and date and time of log. - Future getSecurity() async { - String path = '/account/security'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Get currently logged in user list of active sessions across different - /// devices. - Future getSessions() async { - String path = '/account/sessions'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/auth.dart b/app/sdks/dart/lib/services/auth.dart deleted file mode 100644 index 1fdb5aa134..0000000000 --- a/app/sdks/dart/lib/services/auth.dart +++ /dev/null @@ -1,173 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Auth extends Service { - - Auth(Client client): super(client); - - /// 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 notice 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. - Future login({email, password, success = null, failure = null}) async { - String path = '/auth/login'; - - Map params = { - 'email': email, - 'password': password, - 'success': success, - 'failure': failure, - }; - - return await this.client.call('post', 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 - /// back to your app when login is completed. - Future oauth({provider, success, failure}) async { - String path = '/auth/login/oauth/{provider}'.replaceAll(RegExp('{provider}'), provider); - - Map params = { - 'success': success, - 'failure': failure, - }; - - return await this.client.call('get', 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 logout() async { - String path = '/auth/logout'; - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// 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 logoutBySession({id}) async { - String path = '/auth/logout/{id}'.replaceAll(RegExp('{id}'), id); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Sends the user an email with a temporary secret token for password reset. - /// When the user clicks the confirmation link he is redirected back to your - /// app password reset redirect URL with a secret token 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. - Future recovery({email, reset}) async { - String path = '/auth/recovery'; - - Map params = { - 'email': email, - 'reset': reset, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Use this endpoint to complete the user account password reset. Both the - /// **userId** and **token** arguments will be passed as query parameters to - /// the redirect URL you have provided when sending your request to the - /// /auth/recovery endpoint. - /// - /// Please notice 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 recoveryReset({userId, token, passwordA, passwordB}) async { - String path = '/auth/recovery/reset'; - - Map params = { - 'userId': userId, - 'token': token, - 'password-a': passwordA, - 'password-b': passwordB, - }; - - return await this.client.call('put', 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 notice 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. - Future register({email, password, confirm, success = null, failure = null, name = null}) async { - String path = '/auth/register'; - - Map params = { - 'email': email, - 'password': password, - 'confirm': confirm, - 'success': success, - 'failure': failure, - 'name': name, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Use this endpoint to complete the confirmation of the user account email - /// address. Both the **userId** and **token** arguments will be passed as - /// query parameters to the redirect URL you have provided when sending your - /// request to the /auth/register endpoint. - Future confirm({userId, token}) async { - String path = '/auth/register/confirm'; - - Map params = { - 'userId': userId, - 'token': token, - }; - - return await this.client.call('post', path: path, params: params); - } - /// This endpoint allows the user to request your app to resend him his email - /// confirmation message. The redirect arguments act the same way as in - /// /auth/register endpoint. - /// - /// Please notice 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 confirmResend({confirm}) async { - String path = '/auth/register/confirm/resend'; - - Map params = { - 'confirm': confirm, - }; - - return await this.client.call('post', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/avatars.dart b/app/sdks/dart/lib/services/avatars.dart deleted file mode 100644 index 4ffcc6aa15..0000000000 --- a/app/sdks/dart/lib/services/avatars.dart +++ /dev/null @@ -1,93 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Avatars extends Service { - - Avatars(Client client): super(client); - - /// You can use this endpoint to show different browser icons to your users. - /// The code argument receives the browser code as it appears in your user - /// /account/sessions endpoint. Use width, height and quality arguments to - /// change the output settings. - Future getBrowser({code, width = 100, height = 100, quality = 100}) async { - String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code); - - Map params = { - 'width': width, - 'height': height, - 'quality': quality, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Need to display your users with your billing method or their payment - /// methods? The credit card endpoint will return you the icon of the credit - /// card provider you need. Use width, height and quality arguments to change - /// the output settings. - Future getCreditCard({code, width = 100, height = 100, quality = 100}) async { - String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code); - - Map params = { - 'width': width, - 'height': height, - 'quality': quality, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - /// website URL. - Future getFavicon({url}) async { - String path = '/avatars/favicon'; - - Map params = { - 'url': url, - }; - - return await this.client.call('get', path: path, params: params); - } - /// You can use this endpoint to show different country flags icons to your - /// users. The code argument receives the 2 letter country code. Use width, - /// height and quality arguments to change the output settings. - Future getFlag({code, width = 100, height = 100, quality = 100}) async { - String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code); - - Map params = { - 'width': width, - 'height': height, - 'quality': quality, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Use this endpoint to fetch a remote image URL and crop it to any image size - /// you want. This endpoint is very useful if you need to crop and display - /// remote images in your app or in case you want to make sure a 3rd party - /// image is properly served using a TLS protocol. - Future getImage({url, width = 400, height = 400}) async { - String path = '/avatars/image'; - - Map params = { - 'url': url, - 'width': width, - 'height': height, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Converts a given plain text to a QR code image. You can use the query - /// parameters to change the size and style of the resulting image. - Future getQR({text, size = 400, margin = 1, download = null}) async { - String path = '/avatars/qr'; - - Map params = { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download, - }; - - return await this.client.call('get', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/database.dart b/app/sdks/dart/lib/services/database.dart deleted file mode 100644 index 1c9a2a743a..0000000000 --- a/app/sdks/dart/lib/services/database.dart +++ /dev/null @@ -1,139 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -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'; - - 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'; - - 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/{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/{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/{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 - /// modes](/docs/admin). - Future listDocuments({collectionId, filters = const [], offset = null, limit = 50, orderField = '\$uid', orderType = 'ASC', orderCast = 'string', search = null, first = null, last = null}) async { - String path = '/database/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); - - Map params = { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'order-field': orderField, - 'order-type': orderType, - 'order-cast': orderCast, - 'search': search, - 'first': first, - 'last': last, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Create a new Document. - Future createDocument({collectionId, data, read, write, parentDocument = null, parentProperty = null, parentPropertyType = 'assign'}) async { - String path = '/database/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); - - Map params = { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parentDocument, - 'parentProperty': parentProperty, - 'parentPropertyType': parentPropertyType, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Get document by its unique ID. This endpoint response returns a JSON object - /// with the document data. - Future getDocument({collectionId, documentId}) async { - String path = '/database/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future updateDocument({collectionId, documentId, data, read, write}) async { - String path = '/database/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - Map params = { - 'data': data, - 'read': read, - 'write': write, - }; - - return await this.client.call('patch', path: path, params: params); - } - /// Delete document by its unique ID. This endpoint deletes only the parent - /// documents, his attributes and relations to other documents. Child documents - /// **will not** be deleted. - Future deleteDocument({collectionId, documentId}) async { - String path = '/database/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/locale.dart b/app/sdks/dart/lib/services/locale.dart deleted file mode 100644 index 6112ada3e3..0000000000 --- a/app/sdks/dart/lib/services/locale.dart +++ /dev/null @@ -1,73 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Locale extends Service { - - Locale(Client client): super(client); - - /// Get the current user location based on IP. Returns an object with user - /// country code, country name, continent name, continent code, ip address and - /// suggested currency. You can use the locale header to get the data in a - /// supported language. - Future getLocale() async { - String path = '/locale'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// List of all continents. You can use the locale header to get the data in a - /// supported language. - Future getContinents() async { - String path = '/locale/continents'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// List of all countries. You can use the locale header to get the data in a - /// supported language. - Future getCountries() async { - String path = '/locale/countries'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// List of all countries that are currently members of the EU. You can use the - /// locale header to get the data in a supported language. UK brexit date is - /// currently set to 2019-10-31 and will be updated if and when needed. - Future getCountriesEU() async { - String path = '/locale/countries/eu'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// List of all countries phone codes. You can use the locale header to get the - /// data in a supported language. - Future getCountriesPhones() async { - String path = '/locale/countries/phones'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// List of all currencies, including currency symol, name, plural, and decimal - /// digits for all major and minor currencies. You can use the locale header to - /// get the data in a supported language. - Future getCurrencies() async { - String path = '/locale/currencies'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/projects.dart b/app/sdks/dart/lib/services/projects.dart deleted file mode 100644 index d4f9df3639..0000000000 --- a/app/sdks/dart/lib/services/projects.dart +++ /dev/null @@ -1,292 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Projects extends Service { - - Projects(Client client): super(client); - - Future listProjects() async { - String path = '/projects'; - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future createProject({name, teamId, description = null, logo = null, url = null, legalName = null, legalCountry = null, legalState = null, legalCity = null, legalAddress = null, legalTaxId = null}) async { - String path = '/projects'; - - Map params = { - 'name': name, - 'teamId': teamId, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legalName, - 'legalCountry': legalCountry, - 'legalState': legalState, - 'legalCity': legalCity, - 'legalAddress': legalAddress, - 'legalTaxId': legalTaxId, - }; - - return await this.client.call('post', path: path, params: params); - } - Future getProject({projectId}) async { - String path = '/projects/{projectId}'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future updateProject({projectId, name, description = null, logo = null, url = null, legalName = null, legalCountry = null, legalState = null, legalCity = null, legalAddress = null, legalTaxId = null}) async { - String path = '/projects/{projectId}'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - 'name': name, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legalName, - 'legalCountry': legalCountry, - 'legalState': legalState, - 'legalCity': legalCity, - 'legalAddress': legalAddress, - 'legalTaxId': legalTaxId, - }; - - return await this.client.call('patch', path: path, params: params); - } - Future deleteProject({projectId}) async { - String path = '/projects/{projectId}'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - Future listKeys({projectId}) async { - String path = '/projects/{projectId}/keys'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future createKey({projectId, name, scopes}) async { - String path = '/projects/{projectId}/keys'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - 'name': name, - 'scopes': scopes, - }; - - return await this.client.call('post', path: path, params: params); - } - Future getKey({projectId, keyId}) async { - String path = '/projects/{projectId}/keys/{keyId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{keyId}'), keyId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future updateKey({projectId, keyId, name, scopes}) async { - String path = '/projects/{projectId}/keys/{keyId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{keyId}'), keyId); - - Map params = { - 'name': name, - 'scopes': scopes, - }; - - return await this.client.call('put', path: path, params: params); - } - Future deleteKey({projectId, keyId}) async { - String path = '/projects/{projectId}/keys/{keyId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{keyId}'), keyId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - Future updateProjectOAuth({projectId, provider, appId = null, secret = null}) async { - String path = '/projects/{projectId}/oauth'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - 'provider': provider, - 'appId': appId, - 'secret': secret, - }; - - return await this.client.call('patch', path: path, params: params); - } - Future listPlatforms({projectId}) async { - String path = '/projects/{projectId}/platforms'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future createPlatform({projectId, type, name, key = null, store = null, url = null}) async { - String path = '/projects/{projectId}/platforms'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - 'type': type, - 'name': name, - 'key': key, - 'store': store, - 'url': url, - }; - - return await this.client.call('post', path: path, params: params); - } - Future getPlatform({projectId, platformId}) async { - String path = '/projects/{projectId}/platforms/{platformId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{platformId}'), platformId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future updatePlatform({projectId, platformId, name, key = null, store = null, url = null}) async { - String path = '/projects/{projectId}/platforms/{platformId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{platformId}'), platformId); - - Map params = { - 'name': name, - 'key': key, - 'store': store, - 'url': url, - }; - - return await this.client.call('put', path: path, params: params); - } - Future deletePlatform({projectId, platformId}) async { - String path = '/projects/{projectId}/platforms/{platformId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{platformId}'), platformId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - Future listTasks({projectId}) async { - String path = '/projects/{projectId}/tasks'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future createTask({projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = null, httpUser = null, httpPass = null}) async { - String path = '/projects/{projectId}/tasks'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': httpMethod, - 'httpUrl': httpUrl, - 'httpHeaders': httpHeaders, - 'httpUser': httpUser, - 'httpPass': httpPass, - }; - - return await this.client.call('post', path: path, params: params); - } - Future getTask({projectId, taskId}) async { - String path = '/projects/{projectId}/tasks/{taskId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{taskId}'), taskId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future updateTask({projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = null, httpUser = null, httpPass = null}) async { - String path = '/projects/{projectId}/tasks/{taskId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{taskId}'), taskId); - - Map params = { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': httpMethod, - 'httpUrl': httpUrl, - 'httpHeaders': httpHeaders, - 'httpUser': httpUser, - 'httpPass': httpPass, - }; - - return await this.client.call('put', path: path, params: params); - } - Future deleteTask({projectId, taskId}) async { - String path = '/projects/{projectId}/tasks/{taskId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{taskId}'), taskId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - Future getProjectUsage({projectId}) async { - String path = '/projects/{projectId}/usage'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future listWebhooks({projectId}) async { - String path = '/projects/{projectId}/webhooks'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future createWebhook({projectId, name, events, url, security, httpUser = null, httpPass = null}) async { - String path = '/projects/{projectId}/webhooks'.replaceAll(RegExp('{projectId}'), projectId); - - Map params = { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': httpUser, - 'httpPass': httpPass, - }; - - return await this.client.call('post', path: path, params: params); - } - Future getWebhook({projectId, webhookId}) async { - String path = '/projects/{projectId}/webhooks/{webhookId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{webhookId}'), webhookId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - Future updateWebhook({projectId, webhookId, name, events, url, security, httpUser = null, httpPass = null}) async { - String path = '/projects/{projectId}/webhooks/{webhookId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{webhookId}'), webhookId); - - Map params = { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': httpUser, - 'httpPass': httpPass, - }; - - return await this.client.call('put', path: path, params: params); - } - Future deleteWebhook({projectId, webhookId}) async { - String path = '/projects/{projectId}/webhooks/{webhookId}'.replaceAll(RegExp('{projectId}'), projectId).replaceAll(RegExp('{webhookId}'), webhookId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/storage.dart b/app/sdks/dart/lib/services/storage.dart deleted file mode 100644 index c46dba5af6..0000000000 --- a/app/sdks/dart/lib/services/storage.dart +++ /dev/null @@ -1,109 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Storage extends Service { - - Storage(Client client): super(client); - - /// Get a list of all the user files. You can use the query params to filter - /// your results. On admin mode, this endpoint will return a list of all of the - /// project files. [Learn more about different API modes](/docs/admin). - Future listFiles({search = null, limit = 25, offset = null, orderType = 'ASC'}) async { - String path = '/storage/files'; - - Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Create a new file. The user who creates the file will automatically be - /// assigned to read and write access unless he has passed custom values for - /// read and write arguments. - Future createFile({files, read, write}) async { - String path = '/storage/files'; - - Map params = { - 'files': files, - 'read': read, - 'write': write, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Get file by its unique ID. This endpoint response returns a JSON object - /// with the file metadata. - Future getFile({fileId}) async { - String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Update file by its unique ID. Only users with write permissions have access - /// to update this resource. - Future updateFile({fileId, read, write}) async { - String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - Map params = { - 'read': read, - 'write': write, - }; - - return await this.client.call('put', path: path, params: params); - } - /// Delete a file by its unique ID. Only users with write permissions have - /// access to delete this resource. - Future deleteFile({fileId}) async { - String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Get file content by its unique ID. The endpoint response return with a - /// 'Content-Disposition: attachment' header that tells the browser to start - /// downloading the file to user downloads directory. - Future getFileDownload({fileId}) async { - String path = '/storage/files/{fileId}/download'.replaceAll(RegExp('{fileId}'), fileId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Get file preview image. Currently, this method supports preview for image - /// files (jpg, png, and gif), other supported formats, like pdf, docs, slides, - /// and spreadsheets will return file icon image. You can also pass query - /// string arguments for cutting and resizing your preview image. - Future getFilePreview({fileId, width = null, height = null, quality = 100, background = null, output = null}) async { - String path = '/storage/files/{fileId}/preview'.replaceAll(RegExp('{fileId}'), fileId); - - Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Get file content by its unique ID. This endpoint is similar to the download - /// method but returns with no 'Content-Disposition: attachment' header. - Future getFileView({fileId, as = null}) async { - String path = '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId); - - Map params = { - 'as': as, - }; - - return await this.client.call('get', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/teams.dart b/app/sdks/dart/lib/services/teams.dart deleted file mode 100644 index ab91cc70d2..0000000000 --- a/app/sdks/dart/lib/services/teams.dart +++ /dev/null @@ -1,152 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Teams extends Service { - - Teams(Client client): super(client); - - /// Get a list of all the current user teams. You can use the query params to - /// filter your results. On admin mode, this endpoint will return a list of all - /// of the project teams. [Learn more about different API modes](/docs/admin). - Future listTeams({search = null, limit = 25, offset = null, orderType = 'ASC'}) async { - String path = '/teams'; - - Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Create a new team. The user who creates the team will automatically be - /// assigned as the owner of the team. The team owner can invite new members, - /// who will be able add new owners and update or delete the team from your - /// project. - Future createTeam({name, roles = const ["owner"]}) async { - String path = '/teams'; - - Map params = { - 'name': name, - 'roles': roles, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Get team by its unique ID. All team members have read access for this - /// resource. - Future getTeam({teamId}) async { - String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Update team by its unique ID. Only team owners have write access for this - /// resource. - Future updateTeam({teamId, name}) async { - String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - Map params = { - 'name': name, - }; - - return await this.client.call('put', path: path, params: params); - } - /// Delete team by its unique ID. Only team owners have write access for this - /// resource. - Future deleteTeam({teamId}) async { - String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Get team members by the team unique ID. All team members have read access - /// for this list of resources. - Future getTeamMembers({teamId}) async { - String path = '/teams/{teamId}/members'.replaceAll(RegExp('{teamId}'), teamId); - - Map params = { - }; - - 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 the redirect parameter to redirect the user from the invitation email - /// back to your app. When the user is redirected, use the - /// /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the - /// user to the team. - /// - /// Please notice 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. - Future createTeamMembership({teamId, email, roles, redirect, name = null}) async { - String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId); - - Map params = { - 'email': email, - 'name': name, - 'roles': roles, - 'redirect': redirect, - }; - - return await this.client.call('post', path: path, params: params); - } - /// This endpoint allows a user to leave a team or for a team owner to delete - /// the membership of any other team member. - Future deleteTeamMembership({teamId, inviteId}) async { - String path = '/teams/{teamId}/memberships/{inviteId}'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Use this endpoint to resend your invitation email for a user to join a - /// team. - Future createTeamMembershipResend({teamId, inviteId, redirect}) async { - String path = '/teams/{teamId}/memberships/{inviteId}/resend'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - Map params = { - 'redirect': redirect, - }; - - return await this.client.call('post', 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 notice 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 token. - Future updateTeamMembershipStatus({teamId, inviteId, userId, secret, success = null, failure = null}) async { - String path = '/teams/{teamId}/memberships/{inviteId}/status'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - Map params = { - 'userId': userId, - 'secret': secret, - 'success': success, - 'failure': failure, - }; - - return await this.client.call('patch', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/lib/services/users.dart b/app/sdks/dart/lib/services/users.dart deleted file mode 100644 index 3e84ddd287..0000000000 --- a/app/sdks/dart/lib/services/users.dart +++ /dev/null @@ -1,111 +0,0 @@ -import "package:appwrite/service.dart"; -import "package:appwrite/client.dart"; -import 'package:dio/dio.dart'; - -class Users extends Service { - - Users(Client client): super(client); - - /// Get a list of all the project users. You can use the query params to filter - /// your results. - Future listUsers({search = null, limit = 25, offset = null, orderType = 'ASC'}) async { - String path = '/users'; - - Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType, - }; - - return await this.client.call('get', path: path, params: params); - } - /// Create a new user. - Future createUser({email, password, name = null}) async { - String path = '/users'; - - Map params = { - 'email': email, - 'password': password, - 'name': name, - }; - - return await this.client.call('post', path: path, params: params); - } - /// Get user by its unique ID. - Future getUser({userId}) async { - String path = '/users/{userId}'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Get user activity logs list by its unique ID. - Future getUserLogs({userId}) async { - String path = '/users/{userId}/logs'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Get user preferences by its unique ID. - Future getUserPrefs({userId}) async { - String path = '/users/{userId}/prefs'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Update user preferences by its unique ID. You can pass only the specific - /// settings you wish to update. - Future updateUserPrefs({userId, prefs}) async { - String path = '/users/{userId}/prefs'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - 'prefs': prefs, - }; - - return await this.client.call('patch', path: path, params: params); - } - /// Get user sessions list by its unique ID. - Future getUserSessions({userId}) async { - String path = '/users/{userId}/sessions'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - }; - - return await this.client.call('get', path: path, params: params); - } - /// Delete all user sessions by its unique ID. - Future deleteUserSessions({userId}) async { - String path = '/users/{userId}/sessions'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Delete user sessions by its unique ID. - Future deleteUserSession({userId, sessionId}) async { - String path = '/users/{userId}/sessions/:session'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - 'sessionId': sessionId, - }; - - return await this.client.call('delete', path: path, params: params); - } - /// Update user status by its unique ID. - Future updateUserStatus({userId, status}) async { - String path = '/users/{userId}/status'.replaceAll(RegExp('{userId}'), userId); - - Map params = { - 'status': status, - }; - - return await this.client.call('patch', path: path, params: params); - } -} \ No newline at end of file diff --git a/app/sdks/dart/pubspec.lock b/app/sdks/dart/pubspec.lock deleted file mode 100644 index 98d3035608..0000000000 --- a/app/sdks/dart/pubspec.lock +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.14.12" - cookie_jar: - dependency: "direct main" - description: - name: cookie_jar - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - dio: - dependency: "direct main" - description: - name: dio - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.3" - dio_cookie_manager: - dependency: "direct main" - description: - name: dio_cookie_manager - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.3" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.7" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.4" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.5" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" -sdks: - dart: ">2.4.0 <3.0.0" diff --git a/app/sdks/dart/pubspec.yaml b/app/sdks/dart/pubspec.yaml deleted file mode 100644 index 95225dfda5..0000000000 --- a/app/sdks/dart/pubspec.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: appwrite -version: 0.0.6 -description: 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) -author: Appwrite Team -homepage: https://github.com/appwrite/sdk-for-dart -environment: - sdk: '>=2.2.2 <3.0.0' -dependencies: - dio: ^3.0.0 - cookie_jar: ^1.0.0 - dio_cookie_manager: ^1.0.0 \ No newline at end of file diff --git a/app/sdks/go/account.go b/app/sdks/go/account.go deleted file mode 100644 index 90582ae0d8..0000000000 --- a/app/sdks/go/account.go +++ /dev/null @@ -1,307 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Account service -type Account struct { - client *Client -} - -// GetAccount get currently logged in user data as JSON object. -func (srv *Account) GetAccount() (map[string]interface{}, error) { - path := "/account" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateAccount 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. -func (srv *Account) CreateAccount(Email string, Password string, Name string) (map[string]interface{}, error) { - path := "/account" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - "name": Name, - } - - return srv.client.Call("POST", path, nil, params) -} - -// Delete delete a currently logged in user account. Behind the scene, the -// user record is not deleted but permanently blocked from any access. This is -// done to avoid deleted accounts being overtaken by new users with the same -// email address. Any user-related resources like documents or storage files -// should be deleted separately. -func (srv *Account) Delete() (map[string]interface{}, error) { - path := "/account" - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// UpdateEmail update currently logged in user account email address. After -// changing user address, user confirmation status is being reset and a new -// confirmation mail is sent. For security measures, user password is required -// to complete this request. -func (srv *Account) UpdateEmail(Email string, Password string) (map[string]interface{}, error) { - path := "/account/email" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// GetAccountLogs get currently logged in user list of latest security -// activity logs. Each log returns user IP address, location and date and time -// of log. -func (srv *Account) GetAccountLogs() (map[string]interface{}, error) { - path := "/account/logs" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateAccountName update currently logged in user account name. -func (srv *Account) UpdateAccountName(Name string) (map[string]interface{}, error) { - path := "/account/name" - - params := map[string]interface{}{ - "name": Name, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// UpdateAccountPassword update currently logged in user password. For -// validation, user is required to pass the password twice. -func (srv *Account) UpdateAccountPassword(Password string, OldPassword string) (map[string]interface{}, error) { - path := "/account/password" - - params := map[string]interface{}{ - "password": Password, - "old-password": OldPassword, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// GetAccountPrefs get currently logged in user preferences key-value object. -func (srv *Account) GetAccountPrefs() (map[string]interface{}, error) { - path := "/account/prefs" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdatePrefs update currently logged in user account preferences. You can -// pass only the specific settings you wish to update. -func (srv *Account) UpdatePrefs(Prefs string) (map[string]interface{}, error) { - path := "/account/prefs" - - params := map[string]interface{}{ - "prefs": Prefs, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// CreateAccountRecovery 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. -func (srv *Account) CreateAccountRecovery(Email string, Url string) (map[string]interface{}, error) { - path := "/account/recovery" - - params := map[string]interface{}{ - "email": Email, - "url": Url, - } - - return srv.client.Call("POST", path, nil, params) -} - -// UpdateAccountRecovery 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. -// -// 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. -func (srv *Account) UpdateAccountRecovery(UserId string, Secret string, PasswordA string, PasswordB string) (map[string]interface{}, error) { - path := "/account/recovery" - - params := map[string]interface{}{ - "userId": UserId, - "secret": Secret, - "password-a": PasswordA, - "password-b": PasswordB, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// GetAccountSessions get currently logged in user list of active sessions -// across different devices. -func (srv *Account) GetAccountSessions() (map[string]interface{}, error) { - path := "/account/sessions" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateAccountSession 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. -func (srv *Account) CreateAccountSession(Email string, Password string) (map[string]interface{}, error) { - path := "/account/sessions" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - } - - return srv.client.Call("POST", path, nil, params) -} - -// DeleteAccountSessions delete all sessions from the user account and remove -// any sessions cookies from the end client. -func (srv *Account) DeleteAccountSessions() (map[string]interface{}, error) { - path := "/account/sessions" - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// DeleteAccountCurrentSession 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. -func (srv *Account) DeleteAccountCurrentSession() (map[string]interface{}, error) { - path := "/account/sessions/current" - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// CreateAccountSessionOAuth 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 back to your app when login is completed. -func (srv *Account) CreateAccountSessionOAuth(Provider string, Success string, Failure string) (map[string]interface{}, error) { - r := strings.NewReplacer("{provider}", Provider) - path := r.Replace("/account/sessions/oauth/{provider}") - - params := map[string]interface{}{ - "success": Success, - "failure": Failure, - } - - return srv.client.Call("GET", path, nil, params) -} - -// DeleteAccountSession 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. -func (srv *Account) DeleteAccountSession(Id string) (map[string]interface{}, error) { - r := strings.NewReplacer("{id}", Id) - path := r.Replace("/account/sessions/{id}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// CreateAccountVerification 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. -func (srv *Account) CreateAccountVerification(Url string) (map[string]interface{}, error) { - path := "/account/verification" - - params := map[string]interface{}{ - "url": Url, - } - - return srv.client.Call("POST", path, nil, params) -} - -// UpdateAccountVerification 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. -func (srv *Account) UpdateAccountVerification(UserId string, Secret string, PasswordB string) (map[string]interface{}, error) { - path := "/account/verification" - - params := map[string]interface{}{ - "userId": UserId, - "secret": Secret, - "password-b": PasswordB, - } - - return srv.client.Call("PUT", path, nil, params) -} diff --git a/app/sdks/go/auth.go b/app/sdks/go/auth.go deleted file mode 100644 index b869140bb8..0000000000 --- a/app/sdks/go/auth.go +++ /dev/null @@ -1,186 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Auth service -type Auth struct { - client *Client -} - -// Login 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 notice 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. -func (srv *Auth) Login(Email string, Password string, Success string, Failure string) (map[string]interface{}, error) { - path := "/auth/login" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - "success": Success, - "failure": Failure, - } - - return srv.client.Call("POST", path, nil, params) -} - -// Oauth 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 -// back to your app when login is completed. -func (srv *Auth) Oauth(Provider string, Success string, Failure string) (map[string]interface{}, error) { - r := strings.NewReplacer("{provider}", Provider) - path := r.Replace("/auth/login/oauth/{provider}") - - params := map[string]interface{}{ - "success": Success, - "failure": Failure, - } - - return srv.client.Call("GET", path, nil, params) -} - -// Logout 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. -func (srv *Auth) Logout() (map[string]interface{}, error) { - path := "/auth/logout" - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// LogoutBySession 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. -func (srv *Auth) LogoutBySession(Id string) (map[string]interface{}, error) { - r := strings.NewReplacer("{id}", Id) - path := r.Replace("/auth/logout/{id}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// Recovery sends the user an email with a temporary secret token for password -// reset. When the user clicks the confirmation link he is redirected back to -// your app password reset redirect URL with a secret token 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. -func (srv *Auth) Recovery(Email string, Reset string) (map[string]interface{}, error) { - path := "/auth/recovery" - - params := map[string]interface{}{ - "email": Email, - "reset": Reset, - } - - return srv.client.Call("POST", path, nil, params) -} - -// RecoveryReset use this endpoint to complete the user account password -// reset. Both the **userId** and **token** arguments will be passed as query -// parameters to the redirect URL you have provided when sending your request -// to the /auth/recovery endpoint. -// -// Please notice 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. -func (srv *Auth) RecoveryReset(UserId string, Token string, PasswordA string, PasswordB string) (map[string]interface{}, error) { - path := "/auth/recovery/reset" - - params := map[string]interface{}{ - "userId": UserId, - "token": Token, - "password-a": PasswordA, - "password-b": PasswordB, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// Register 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 notice 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. -func (srv *Auth) Register(Email string, Password string, Confirm string, Success string, Failure string, Name string) (map[string]interface{}, error) { - path := "/auth/register" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - "confirm": Confirm, - "success": Success, - "failure": Failure, - "name": Name, - } - - return srv.client.Call("POST", path, nil, params) -} - -// Confirm use this endpoint to complete the confirmation of the user account -// email address. Both the **userId** and **token** arguments will be passed -// as query parameters to the redirect URL you have provided when sending your -// request to the /auth/register endpoint. -func (srv *Auth) Confirm(UserId string, Token string) (map[string]interface{}, error) { - path := "/auth/register/confirm" - - params := map[string]interface{}{ - "userId": UserId, - "token": Token, - } - - return srv.client.Call("POST", path, nil, params) -} - -// ConfirmResend this endpoint allows the user to request your app to resend -// him his email confirmation message. The redirect arguments act the same way -// as in /auth/register endpoint. -// -// Please notice 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. -func (srv *Auth) ConfirmResend(Confirm string) (map[string]interface{}, error) { - path := "/auth/register/confirm/resend" - - params := map[string]interface{}{ - "confirm": Confirm, - } - - return srv.client.Call("POST", path, nil, params) -} diff --git a/app/sdks/go/docs/examples/Account/Delete.md b/app/sdks/go/docs/examples/Account/Delete.md deleted file mode 100644 index 67ace9a461..0000000000 --- a/app/sdks/go/docs/examples/Account/Delete.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## Delete - -```go - package appwrite-delete - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call Delete method and handle results - var res, err := srv.Delete() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/Get.md b/app/sdks/go/docs/examples/Account/Get.md deleted file mode 100644 index a6dd237a5d..0000000000 --- a/app/sdks/go/docs/examples/Account/Get.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## Get - -```go - package appwrite-get - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call Get method and handle results - var res, err := srv.Get() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/GetPrefs.md b/app/sdks/go/docs/examples/Account/GetPrefs.md deleted file mode 100644 index 0e4cfea354..0000000000 --- a/app/sdks/go/docs/examples/Account/GetPrefs.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## GetPrefs - -```go - package appwrite-getprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetPrefs method and handle results - var res, err := srv.GetPrefs() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/GetSecurity.md b/app/sdks/go/docs/examples/Account/GetSecurity.md deleted file mode 100644 index 113eb16ae5..0000000000 --- a/app/sdks/go/docs/examples/Account/GetSecurity.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## GetSecurity - -```go - package appwrite-getsecurity - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetSecurity method and handle results - var res, err := srv.GetSecurity() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/GetSessions.md b/app/sdks/go/docs/examples/Account/GetSessions.md deleted file mode 100644 index 153b8e3fe9..0000000000 --- a/app/sdks/go/docs/examples/Account/GetSessions.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## GetSessions - -```go - package appwrite-getsessions - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetSessions method and handle results - var res, err := srv.GetSessions() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/UpdateEmail.md b/app/sdks/go/docs/examples/Account/UpdateEmail.md deleted file mode 100644 index 6f9895257e..0000000000 --- a/app/sdks/go/docs/examples/Account/UpdateEmail.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## UpdateEmail - -```go - package appwrite-updateemail - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateEmail method and handle results - var res, err := srv.UpdateEmail("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/UpdateName.md b/app/sdks/go/docs/examples/Account/UpdateName.md deleted file mode 100644 index 3172a94fa6..0000000000 --- a/app/sdks/go/docs/examples/Account/UpdateName.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## UpdateName - -```go - package appwrite-updatename - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateName method and handle results - var res, err := srv.UpdateName("[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/UpdatePassword.md b/app/sdks/go/docs/examples/Account/UpdatePassword.md deleted file mode 100644 index 2aa8543fcd..0000000000 --- a/app/sdks/go/docs/examples/Account/UpdatePassword.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## UpdatePassword - -```go - package appwrite-updatepassword - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdatePassword method and handle results - var res, err := srv.UpdatePassword("password", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/UpdatePrefs.md b/app/sdks/go/docs/examples/Account/UpdatePrefs.md deleted file mode 100644 index 869e12572d..0000000000 --- a/app/sdks/go/docs/examples/Account/UpdatePrefs.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## UpdatePrefs - -```go - package appwrite-updateprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdatePrefs method and handle results - var res, err := srv.UpdatePrefs("{}") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/create-account-recovery.md b/app/sdks/go/docs/examples/Account/create-account-recovery.md deleted file mode 100644 index 9dfef57968..0000000000 --- a/app/sdks/go/docs/examples/Account/create-account-recovery.md +++ /dev/null @@ -1,33 +0,0 @@ -# Account Examples - -## CreateAccountRecovery - -```go - package appwrite-createaccountrecovery - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call CreateAccountRecovery method and handle results - var res, err := srv.CreateAccountRecovery("email@example.com", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/create-account-session-o-auth.md b/app/sdks/go/docs/examples/Account/create-account-session-o-auth.md deleted file mode 100644 index 7bcf83b527..0000000000 --- a/app/sdks/go/docs/examples/Account/create-account-session-o-auth.md +++ /dev/null @@ -1,33 +0,0 @@ -# Account Examples - -## CreateAccountSessionOAuth - -```go - package appwrite-createaccountsessionoauth - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call CreateAccountSessionOAuth method and handle results - var res, err := srv.CreateAccountSessionOAuth("bitbucket", "https://example.com", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/create-account-session.md b/app/sdks/go/docs/examples/Account/create-account-session.md deleted file mode 100644 index 979313a4bb..0000000000 --- a/app/sdks/go/docs/examples/Account/create-account-session.md +++ /dev/null @@ -1,33 +0,0 @@ -# Account Examples - -## CreateAccountSession - -```go - package appwrite-createaccountsession - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call CreateAccountSession method and handle results - var res, err := srv.CreateAccountSession("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/create-account-verification.md b/app/sdks/go/docs/examples/Account/create-account-verification.md deleted file mode 100644 index ceda5fc3c8..0000000000 --- a/app/sdks/go/docs/examples/Account/create-account-verification.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## CreateAccountVerification - -```go - package appwrite-createaccountverification - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call CreateAccountVerification method and handle results - var res, err := srv.CreateAccountVerification("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/create-account.md b/app/sdks/go/docs/examples/Account/create-account.md deleted file mode 100644 index f942eed4bc..0000000000 --- a/app/sdks/go/docs/examples/Account/create-account.md +++ /dev/null @@ -1,33 +0,0 @@ -# Account Examples - -## CreateAccount - -```go - package appwrite-createaccount - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call CreateAccount method and handle results - var res, err := srv.CreateAccount("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/delete-account-current-session.md b/app/sdks/go/docs/examples/Account/delete-account-current-session.md deleted file mode 100644 index 4ba93be456..0000000000 --- a/app/sdks/go/docs/examples/Account/delete-account-current-session.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## DeleteAccountCurrentSession - -```go - package appwrite-deleteaccountcurrentsession - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call DeleteAccountCurrentSession method and handle results - var res, err := srv.DeleteAccountCurrentSession() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/delete-account-session.md b/app/sdks/go/docs/examples/Account/delete-account-session.md deleted file mode 100644 index 2ef9751568..0000000000 --- a/app/sdks/go/docs/examples/Account/delete-account-session.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## DeleteAccountSession - -```go - package appwrite-deleteaccountsession - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call DeleteAccountSession method and handle results - var res, err := srv.DeleteAccountSession("[ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/delete-account-sessions.md b/app/sdks/go/docs/examples/Account/delete-account-sessions.md deleted file mode 100644 index b1934ba852..0000000000 --- a/app/sdks/go/docs/examples/Account/delete-account-sessions.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## DeleteAccountSessions - -```go - package appwrite-deleteaccountsessions - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call DeleteAccountSessions method and handle results - var res, err := srv.DeleteAccountSessions() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-account-logs.md b/app/sdks/go/docs/examples/Account/get-account-logs.md deleted file mode 100644 index fe8a036959..0000000000 --- a/app/sdks/go/docs/examples/Account/get-account-logs.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## GetAccountLogs - -```go - package appwrite-getaccountlogs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetAccountLogs method and handle results - var res, err := srv.GetAccountLogs() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-account-prefs.md b/app/sdks/go/docs/examples/Account/get-account-prefs.md deleted file mode 100644 index a1483646f8..0000000000 --- a/app/sdks/go/docs/examples/Account/get-account-prefs.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## GetAccountPrefs - -```go - package appwrite-getaccountprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetAccountPrefs method and handle results - var res, err := srv.GetAccountPrefs() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-account-sessions.md b/app/sdks/go/docs/examples/Account/get-account-sessions.md deleted file mode 100644 index b6f9dd92ba..0000000000 --- a/app/sdks/go/docs/examples/Account/get-account-sessions.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## GetAccountSessions - -```go - package appwrite-getaccountsessions - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetAccountSessions method and handle results - var res, err := srv.GetAccountSessions() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-account.md b/app/sdks/go/docs/examples/Account/get-account.md deleted file mode 100644 index 5ece106aed..0000000000 --- a/app/sdks/go/docs/examples/Account/get-account.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## GetAccount - -```go - package appwrite-getaccount - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetAccount method and handle results - var res, err := srv.GetAccount() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-prefs.md b/app/sdks/go/docs/examples/Account/get-prefs.md deleted file mode 100644 index 0e4cfea354..0000000000 --- a/app/sdks/go/docs/examples/Account/get-prefs.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## GetPrefs - -```go - package appwrite-getprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetPrefs method and handle results - var res, err := srv.GetPrefs() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-security.md b/app/sdks/go/docs/examples/Account/get-security.md deleted file mode 100644 index 113eb16ae5..0000000000 --- a/app/sdks/go/docs/examples/Account/get-security.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## GetSecurity - -```go - package appwrite-getsecurity - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetSecurity method and handle results - var res, err := srv.GetSecurity() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/get-sessions.md b/app/sdks/go/docs/examples/Account/get-sessions.md deleted file mode 100644 index 153b8e3fe9..0000000000 --- a/app/sdks/go/docs/examples/Account/get-sessions.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## GetSessions - -```go - package appwrite-getsessions - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call GetSessions method and handle results - var res, err := srv.GetSessions() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-account-name.md b/app/sdks/go/docs/examples/Account/update-account-name.md deleted file mode 100644 index c5f47a0592..0000000000 --- a/app/sdks/go/docs/examples/Account/update-account-name.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## UpdateAccountName - -```go - package appwrite-updateaccountname - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateAccountName method and handle results - var res, err := srv.UpdateAccountName("[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-account-password.md b/app/sdks/go/docs/examples/Account/update-account-password.md deleted file mode 100644 index 2025742290..0000000000 --- a/app/sdks/go/docs/examples/Account/update-account-password.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## UpdateAccountPassword - -```go - package appwrite-updateaccountpassword - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateAccountPassword method and handle results - var res, err := srv.UpdateAccountPassword("password", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-account-recovery.md b/app/sdks/go/docs/examples/Account/update-account-recovery.md deleted file mode 100644 index 4463522761..0000000000 --- a/app/sdks/go/docs/examples/Account/update-account-recovery.md +++ /dev/null @@ -1,33 +0,0 @@ -# Account Examples - -## UpdateAccountRecovery - -```go - package appwrite-updateaccountrecovery - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateAccountRecovery method and handle results - var res, err := srv.UpdateAccountRecovery("[USER_ID]", "[SECRET]", "password", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-account-verification.md b/app/sdks/go/docs/examples/Account/update-account-verification.md deleted file mode 100644 index 494db24089..0000000000 --- a/app/sdks/go/docs/examples/Account/update-account-verification.md +++ /dev/null @@ -1,33 +0,0 @@ -# Account Examples - -## UpdateAccountVerification - -```go - package appwrite-updateaccountverification - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateAccountVerification method and handle results - var res, err := srv.UpdateAccountVerification("[USER_ID]", "[SECRET]", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-email.md b/app/sdks/go/docs/examples/Account/update-email.md deleted file mode 100644 index 5866aac613..0000000000 --- a/app/sdks/go/docs/examples/Account/update-email.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## UpdateEmail - -```go - package appwrite-updateemail - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateEmail method and handle results - var res, err := srv.UpdateEmail("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-name.md b/app/sdks/go/docs/examples/Account/update-name.md deleted file mode 100644 index 3172a94fa6..0000000000 --- a/app/sdks/go/docs/examples/Account/update-name.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## UpdateName - -```go - package appwrite-updatename - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdateName method and handle results - var res, err := srv.UpdateName("[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-password.md b/app/sdks/go/docs/examples/Account/update-password.md deleted file mode 100644 index 2aa8543fcd..0000000000 --- a/app/sdks/go/docs/examples/Account/update-password.md +++ /dev/null @@ -1,35 +0,0 @@ -# Account Examples - -## UpdatePassword - -```go - package appwrite-updatepassword - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdatePassword method and handle results - var res, err := srv.UpdatePassword("password", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Account/update-prefs.md b/app/sdks/go/docs/examples/Account/update-prefs.md deleted file mode 100644 index 44cd77c898..0000000000 --- a/app/sdks/go/docs/examples/Account/update-prefs.md +++ /dev/null @@ -1,34 +0,0 @@ -# Account Examples - -## UpdatePrefs - -```go - package appwrite-updateprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Account service passing Client - var srv := appwrite.Account{ - client: &clt - } - - // Call UpdatePrefs method and handle results - var res, err := srv.UpdatePrefs("") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/Confirm.md b/app/sdks/go/docs/examples/Auth/Confirm.md deleted file mode 100644 index c7305d378a..0000000000 --- a/app/sdks/go/docs/examples/Auth/Confirm.md +++ /dev/null @@ -1,33 +0,0 @@ -# Auth Examples - -## Confirm - -```go - package appwrite-confirm - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call Confirm method and handle results - var res, err := srv.Confirm("[USER_ID]", "[TOKEN]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/ConfirmResend.md b/app/sdks/go/docs/examples/Auth/ConfirmResend.md deleted file mode 100644 index 42750db217..0000000000 --- a/app/sdks/go/docs/examples/Auth/ConfirmResend.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## ConfirmResend - -```go - package appwrite-confirmresend - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call ConfirmResend method and handle results - var res, err := srv.ConfirmResend("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/Login.md b/app/sdks/go/docs/examples/Auth/Login.md deleted file mode 100644 index 2f60a9ffd3..0000000000 --- a/app/sdks/go/docs/examples/Auth/Login.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## Login - -```go - package appwrite-login - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call Login method and handle results - var res, err := srv.Login("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/Logout.md b/app/sdks/go/docs/examples/Auth/Logout.md deleted file mode 100644 index 4a3d126e7e..0000000000 --- a/app/sdks/go/docs/examples/Auth/Logout.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## Logout - -```go - package appwrite-logout - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call Logout method and handle results - var res, err := srv.Logout() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/LogoutBySession.md b/app/sdks/go/docs/examples/Auth/LogoutBySession.md deleted file mode 100644 index 239e764b16..0000000000 --- a/app/sdks/go/docs/examples/Auth/LogoutBySession.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## LogoutBySession - -```go - package appwrite-logoutbysession - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call LogoutBySession method and handle results - var res, err := srv.LogoutBySession("[ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/Oauth.md b/app/sdks/go/docs/examples/Auth/Oauth.md deleted file mode 100644 index 0cfb46726d..0000000000 --- a/app/sdks/go/docs/examples/Auth/Oauth.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## Oauth - -```go - package appwrite-oauth - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call Oauth method and handle results - var res, err := srv.Oauth("bitbucket", "https://example.com", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/Recovery.md b/app/sdks/go/docs/examples/Auth/Recovery.md deleted file mode 100644 index 4e4e88093c..0000000000 --- a/app/sdks/go/docs/examples/Auth/Recovery.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## Recovery - -```go - package appwrite-recovery - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call Recovery method and handle results - var res, err := srv.Recovery("email@example.com", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/RecoveryReset.md b/app/sdks/go/docs/examples/Auth/RecoveryReset.md deleted file mode 100644 index d5922708aa..0000000000 --- a/app/sdks/go/docs/examples/Auth/RecoveryReset.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## RecoveryReset - -```go - package appwrite-recoveryreset - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call RecoveryReset method and handle results - var res, err := srv.RecoveryReset("[USER_ID]", "[TOKEN]", "password", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/Register.md b/app/sdks/go/docs/examples/Auth/Register.md deleted file mode 100644 index 8e64c96fcb..0000000000 --- a/app/sdks/go/docs/examples/Auth/Register.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## Register - -```go - package appwrite-register - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call Register method and handle results - var res, err := srv.Register("email@example.com", "password", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/confirm-resend.md b/app/sdks/go/docs/examples/Auth/confirm-resend.md deleted file mode 100644 index 42750db217..0000000000 --- a/app/sdks/go/docs/examples/Auth/confirm-resend.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## ConfirmResend - -```go - package appwrite-confirmresend - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call ConfirmResend method and handle results - var res, err := srv.ConfirmResend("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/logout-by-session.md b/app/sdks/go/docs/examples/Auth/logout-by-session.md deleted file mode 100644 index 239e764b16..0000000000 --- a/app/sdks/go/docs/examples/Auth/logout-by-session.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## LogoutBySession - -```go - package appwrite-logoutbysession - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call LogoutBySession method and handle results - var res, err := srv.LogoutBySession("[ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Auth/recovery-reset.md b/app/sdks/go/docs/examples/Auth/recovery-reset.md deleted file mode 100644 index d5922708aa..0000000000 --- a/app/sdks/go/docs/examples/Auth/recovery-reset.md +++ /dev/null @@ -1,35 +0,0 @@ -# Auth Examples - -## RecoveryReset - -```go - package appwrite-recoveryreset - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Auth service passing Client - var srv := appwrite.Auth{ - client: &clt - } - - // Call RecoveryReset method and handle results - var res, err := srv.RecoveryReset("[USER_ID]", "[TOKEN]", "password", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/GetBrowser.md b/app/sdks/go/docs/examples/Avatars/GetBrowser.md deleted file mode 100644 index 9628da910b..0000000000 --- a/app/sdks/go/docs/examples/Avatars/GetBrowser.md +++ /dev/null @@ -1,35 +0,0 @@ -# Avatars Examples - -## GetBrowser - -```go - package appwrite-getbrowser - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &clt - } - - // Call GetBrowser method and handle results - var res, err := srv.GetBrowser("aa") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/GetCreditCard.md b/app/sdks/go/docs/examples/Avatars/GetCreditCard.md deleted file mode 100644 index 488077cfc3..0000000000 --- a/app/sdks/go/docs/examples/Avatars/GetCreditCard.md +++ /dev/null @@ -1,35 +0,0 @@ -# Avatars Examples - -## GetCreditCard - -```go - package appwrite-getcreditcard - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &clt - } - - // Call GetCreditCard method and handle results - var res, err := srv.GetCreditCard("amex") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/GetFavicon.md b/app/sdks/go/docs/examples/Avatars/GetFavicon.md deleted file mode 100644 index c235967d6b..0000000000 --- a/app/sdks/go/docs/examples/Avatars/GetFavicon.md +++ /dev/null @@ -1,35 +0,0 @@ -# Avatars Examples - -## GetFavicon - -```go - package appwrite-getfavicon - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &clt - } - - // Call GetFavicon method and handle results - var res, err := srv.GetFavicon("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/GetFlag.md b/app/sdks/go/docs/examples/Avatars/GetFlag.md deleted file mode 100644 index 955c96c530..0000000000 --- a/app/sdks/go/docs/examples/Avatars/GetFlag.md +++ /dev/null @@ -1,35 +0,0 @@ -# Avatars Examples - -## GetFlag - -```go - package appwrite-getflag - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &clt - } - - // Call GetFlag method and handle results - var res, err := srv.GetFlag("af") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/GetImage.md b/app/sdks/go/docs/examples/Avatars/GetImage.md deleted file mode 100644 index 11d1c6523d..0000000000 --- a/app/sdks/go/docs/examples/Avatars/GetImage.md +++ /dev/null @@ -1,35 +0,0 @@ -# Avatars Examples - -## GetImage - -```go - package appwrite-getimage - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &clt - } - - // Call GetImage method and handle results - var res, err := srv.GetImage("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/GetQR.md b/app/sdks/go/docs/examples/Avatars/GetQR.md deleted file mode 100644 index 0874c0e6be..0000000000 --- a/app/sdks/go/docs/examples/Avatars/GetQR.md +++ /dev/null @@ -1,35 +0,0 @@ -# Avatars Examples - -## GetQR - -```go - package appwrite-getqr - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &clt - } - - // Call GetQR method and handle results - var res, err := srv.GetQR("[TEXT]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/get-browser.md b/app/sdks/go/docs/examples/Avatars/get-browser.md index f94c34aab4..9628da910b 100644 --- a/app/sdks/go/docs/examples/Avatars/get-browser.md +++ b/app/sdks/go/docs/examples/Avatars/get-browser.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Avatars service passing Client var srv := appwrite.Avatars{ diff --git a/app/sdks/go/docs/examples/Avatars/get-credit-card.md b/app/sdks/go/docs/examples/Avatars/get-credit-card.md index 4d3c60600a..488077cfc3 100644 --- a/app/sdks/go/docs/examples/Avatars/get-credit-card.md +++ b/app/sdks/go/docs/examples/Avatars/get-credit-card.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Avatars service passing Client var srv := appwrite.Avatars{ diff --git a/app/sdks/go/docs/examples/Avatars/get-favicon.md b/app/sdks/go/docs/examples/Avatars/get-favicon.md index 4cb5a5c5e3..c235967d6b 100644 --- a/app/sdks/go/docs/examples/Avatars/get-favicon.md +++ b/app/sdks/go/docs/examples/Avatars/get-favicon.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Avatars service passing Client var srv := appwrite.Avatars{ diff --git a/app/sdks/go/docs/examples/Avatars/get-flag.md b/app/sdks/go/docs/examples/Avatars/get-flag.md index 0428944e12..955c96c530 100644 --- a/app/sdks/go/docs/examples/Avatars/get-flag.md +++ b/app/sdks/go/docs/examples/Avatars/get-flag.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Avatars service passing Client var srv := appwrite.Avatars{ diff --git a/app/sdks/go/docs/examples/Avatars/get-image.md b/app/sdks/go/docs/examples/Avatars/get-image.md index 9fc5892c68..11d1c6523d 100644 --- a/app/sdks/go/docs/examples/Avatars/get-image.md +++ b/app/sdks/go/docs/examples/Avatars/get-image.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Avatars service passing Client var srv := appwrite.Avatars{ diff --git a/app/sdks/go/docs/examples/Avatars/get-q-r.md b/app/sdks/go/docs/examples/Avatars/get-q-r.md index 4d5b93ebdc..0874c0e6be 100644 --- a/app/sdks/go/docs/examples/Avatars/get-q-r.md +++ b/app/sdks/go/docs/examples/Avatars/get-q-r.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Avatars service passing Client var srv := appwrite.Avatars{ diff --git a/app/sdks/go/docs/examples/Database/CreateCollection.md b/app/sdks/go/docs/examples/Database/CreateCollection.md deleted file mode 100644 index f4f2ab1fc3..0000000000 --- a/app/sdks/go/docs/examples/Database/CreateCollection.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## CreateCollection - -```go - package appwrite-createcollection - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call CreateCollection method and handle results - var res, err := srv.CreateCollection("[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/CreateDocument.md b/app/sdks/go/docs/examples/Database/CreateDocument.md deleted file mode 100644 index ab9aa9e602..0000000000 --- a/app/sdks/go/docs/examples/Database/CreateDocument.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## CreateDocument - -```go - package appwrite-createdocument - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call CreateDocument method and handle results - var res, err := srv.CreateDocument("[COLLECTION_ID]", "{}") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/DeleteCollection.md b/app/sdks/go/docs/examples/Database/DeleteCollection.md deleted file mode 100644 index 85928bde3b..0000000000 --- a/app/sdks/go/docs/examples/Database/DeleteCollection.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## DeleteCollection - -```go - package appwrite-deletecollection - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call DeleteCollection method and handle results - var res, err := srv.DeleteCollection("[COLLECTION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/DeleteDocument.md b/app/sdks/go/docs/examples/Database/DeleteDocument.md deleted file mode 100644 index 256a0abccb..0000000000 --- a/app/sdks/go/docs/examples/Database/DeleteDocument.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## DeleteDocument - -```go - package appwrite-deletedocument - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call DeleteDocument method and handle results - var res, err := srv.DeleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/GetCollection.md b/app/sdks/go/docs/examples/Database/GetCollection.md deleted file mode 100644 index 120ad0a19e..0000000000 --- a/app/sdks/go/docs/examples/Database/GetCollection.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## GetCollection - -```go - package appwrite-getcollection - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call GetCollection method and handle results - var res, err := srv.GetCollection("[COLLECTION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/GetDocument.md b/app/sdks/go/docs/examples/Database/GetDocument.md deleted file mode 100644 index 8866442b6b..0000000000 --- a/app/sdks/go/docs/examples/Database/GetDocument.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## GetDocument - -```go - package appwrite-getdocument - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call GetDocument method and handle results - var res, err := srv.GetDocument("[COLLECTION_ID]", "[DOCUMENT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/ListCollections.md b/app/sdks/go/docs/examples/Database/ListCollections.md deleted file mode 100644 index 1db6530df7..0000000000 --- a/app/sdks/go/docs/examples/Database/ListCollections.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## ListCollections - -```go - package appwrite-listcollections - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call ListCollections method and handle results - var res, err := srv.ListCollections() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/ListDocuments.md b/app/sdks/go/docs/examples/Database/ListDocuments.md deleted file mode 100644 index 6c46ead8db..0000000000 --- a/app/sdks/go/docs/examples/Database/ListDocuments.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## ListDocuments - -```go - package appwrite-listdocuments - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call ListDocuments method and handle results - var res, err := srv.ListDocuments("[COLLECTION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/UpdateCollection.md b/app/sdks/go/docs/examples/Database/UpdateCollection.md deleted file mode 100644 index f6ab2b17e1..0000000000 --- a/app/sdks/go/docs/examples/Database/UpdateCollection.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## UpdateCollection - -```go - package appwrite-updatecollection - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call UpdateCollection method and handle results - var res, err := srv.UpdateCollection("[COLLECTION_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/UpdateDocument.md b/app/sdks/go/docs/examples/Database/UpdateDocument.md deleted file mode 100644 index 6a2775e71a..0000000000 --- a/app/sdks/go/docs/examples/Database/UpdateDocument.md +++ /dev/null @@ -1,35 +0,0 @@ -# Database Examples - -## UpdateDocument - -```go - package appwrite-updatedocument - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &clt - } - - // Call UpdateDocument method and handle results - var res, err := srv.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", "{}") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/create-collection.md b/app/sdks/go/docs/examples/Database/create-collection.md index 3c940b0f8f..48e5977c60 100644 --- a/app/sdks/go/docs/examples/Database/create-collection.md +++ b/app/sdks/go/docs/examples/Database/create-collection.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/create-document.md b/app/sdks/go/docs/examples/Database/create-document.md index b6411c0638..ccaa02f578 100644 --- a/app/sdks/go/docs/examples/Database/create-document.md +++ b/app/sdks/go/docs/examples/Database/create-document.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/delete-collection.md b/app/sdks/go/docs/examples/Database/delete-collection.md index 574fc498d1..85928bde3b 100644 --- a/app/sdks/go/docs/examples/Database/delete-collection.md +++ b/app/sdks/go/docs/examples/Database/delete-collection.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/delete-document.md b/app/sdks/go/docs/examples/Database/delete-document.md index 4a8442861e..256a0abccb 100644 --- a/app/sdks/go/docs/examples/Database/delete-document.md +++ b/app/sdks/go/docs/examples/Database/delete-document.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/get-collection.md b/app/sdks/go/docs/examples/Database/get-collection.md index 46b70412e7..120ad0a19e 100644 --- a/app/sdks/go/docs/examples/Database/get-collection.md +++ b/app/sdks/go/docs/examples/Database/get-collection.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/get-document.md b/app/sdks/go/docs/examples/Database/get-document.md index 2c7a6fdb60..8866442b6b 100644 --- a/app/sdks/go/docs/examples/Database/get-document.md +++ b/app/sdks/go/docs/examples/Database/get-document.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/list-collections.md b/app/sdks/go/docs/examples/Database/list-collections.md index f4fe864615..1db6530df7 100644 --- a/app/sdks/go/docs/examples/Database/list-collections.md +++ b/app/sdks/go/docs/examples/Database/list-collections.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/list-documents.md b/app/sdks/go/docs/examples/Database/list-documents.md index 5542d89b9a..6c46ead8db 100644 --- a/app/sdks/go/docs/examples/Database/list-documents.md +++ b/app/sdks/go/docs/examples/Database/list-documents.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/update-collection.md b/app/sdks/go/docs/examples/Database/update-collection.md index 1fd860d466..7cf07ac2c0 100644 --- a/app/sdks/go/docs/examples/Database/update-collection.md +++ b/app/sdks/go/docs/examples/Database/update-collection.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Database/update-document.md b/app/sdks/go/docs/examples/Database/update-document.md index 5b225d62f3..88f57eefa9 100644 --- a/app/sdks/go/docs/examples/Database/update-document.md +++ b/app/sdks/go/docs/examples/Database/update-document.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Database service passing Client var srv := appwrite.Database{ diff --git a/app/sdks/go/docs/examples/Locale/GetCountries.md b/app/sdks/go/docs/examples/Locale/GetCountries.md deleted file mode 100644 index be286c1979..0000000000 --- a/app/sdks/go/docs/examples/Locale/GetCountries.md +++ /dev/null @@ -1,35 +0,0 @@ -# Locale Examples - -## GetCountries - -```go - package appwrite-getcountries - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &clt - } - - // Call GetCountries method and handle results - var res, err := srv.GetCountries() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/GetCountriesEU.md b/app/sdks/go/docs/examples/Locale/GetCountriesEU.md deleted file mode 100644 index ca8ed7ca48..0000000000 --- a/app/sdks/go/docs/examples/Locale/GetCountriesEU.md +++ /dev/null @@ -1,35 +0,0 @@ -# Locale Examples - -## GetCountriesEU - -```go - package appwrite-getcountrieseu - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &clt - } - - // Call GetCountriesEU method and handle results - var res, err := srv.GetCountriesEU() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/GetCountriesPhones.md b/app/sdks/go/docs/examples/Locale/GetCountriesPhones.md deleted file mode 100644 index 8847258258..0000000000 --- a/app/sdks/go/docs/examples/Locale/GetCountriesPhones.md +++ /dev/null @@ -1,35 +0,0 @@ -# Locale Examples - -## GetCountriesPhones - -```go - package appwrite-getcountriesphones - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &clt - } - - // Call GetCountriesPhones method and handle results - var res, err := srv.GetCountriesPhones() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/GetCurrencies.md b/app/sdks/go/docs/examples/Locale/GetCurrencies.md deleted file mode 100644 index fcbb679fd3..0000000000 --- a/app/sdks/go/docs/examples/Locale/GetCurrencies.md +++ /dev/null @@ -1,35 +0,0 @@ -# Locale Examples - -## GetCurrencies - -```go - package appwrite-getcurrencies - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &clt - } - - // Call GetCurrencies method and handle results - var res, err := srv.GetCurrencies() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/GetLocale.md b/app/sdks/go/docs/examples/Locale/GetLocale.md deleted file mode 100644 index 67cfcdccc9..0000000000 --- a/app/sdks/go/docs/examples/Locale/GetLocale.md +++ /dev/null @@ -1,35 +0,0 @@ -# Locale Examples - -## GetLocale - -```go - package appwrite-getlocale - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &clt - } - - // Call GetLocale method and handle results - var res, err := srv.GetLocale() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-continents.md b/app/sdks/go/docs/examples/Locale/get-continents.md index ee76b8f574..faeab3a977 100644 --- a/app/sdks/go/docs/examples/Locale/get-continents.md +++ b/app/sdks/go/docs/examples/Locale/get-continents.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Locale service passing Client var srv := appwrite.Locale{ diff --git a/app/sdks/go/docs/examples/Locale/get-countries-e-u.md b/app/sdks/go/docs/examples/Locale/get-countries-e-u.md index b79057d7e7..ca8ed7ca48 100644 --- a/app/sdks/go/docs/examples/Locale/get-countries-e-u.md +++ b/app/sdks/go/docs/examples/Locale/get-countries-e-u.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Locale service passing Client var srv := appwrite.Locale{ diff --git a/app/sdks/go/docs/examples/Locale/get-countries-phones.md b/app/sdks/go/docs/examples/Locale/get-countries-phones.md index aaa02a6585..8847258258 100644 --- a/app/sdks/go/docs/examples/Locale/get-countries-phones.md +++ b/app/sdks/go/docs/examples/Locale/get-countries-phones.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Locale service passing Client var srv := appwrite.Locale{ diff --git a/app/sdks/go/docs/examples/Locale/get-countries.md b/app/sdks/go/docs/examples/Locale/get-countries.md index f206e66ea6..be286c1979 100644 --- a/app/sdks/go/docs/examples/Locale/get-countries.md +++ b/app/sdks/go/docs/examples/Locale/get-countries.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Locale service passing Client var srv := appwrite.Locale{ diff --git a/app/sdks/go/docs/examples/Locale/get-currencies.md b/app/sdks/go/docs/examples/Locale/get-currencies.md index 69fba7c7bd..fcbb679fd3 100644 --- a/app/sdks/go/docs/examples/Locale/get-currencies.md +++ b/app/sdks/go/docs/examples/Locale/get-currencies.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Locale service passing Client var srv := appwrite.Locale{ diff --git a/app/sdks/go/docs/examples/Locale/get-locale.md b/app/sdks/go/docs/examples/Locale/get-locale.md index 002b841f2a..67cfcdccc9 100644 --- a/app/sdks/go/docs/examples/Locale/get-locale.md +++ b/app/sdks/go/docs/examples/Locale/get-locale.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Locale service passing Client var srv := appwrite.Locale{ diff --git a/app/sdks/go/docs/examples/Projects/CreateKey.md b/app/sdks/go/docs/examples/Projects/CreateKey.md deleted file mode 100644 index 7fa69e4b67..0000000000 --- a/app/sdks/go/docs/examples/Projects/CreateKey.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## CreateKey - -```go - package appwrite-createkey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateKey method and handle results - var res, err := srv.CreateKey("[PROJECT_ID]", "[NAME]", []) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/CreatePlatform.md b/app/sdks/go/docs/examples/Projects/CreatePlatform.md deleted file mode 100644 index 7f2d247741..0000000000 --- a/app/sdks/go/docs/examples/Projects/CreatePlatform.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## CreatePlatform - -```go - package appwrite-createplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreatePlatform method and handle results - var res, err := srv.CreatePlatform("[PROJECT_ID]", "web", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/CreateProject.md b/app/sdks/go/docs/examples/Projects/CreateProject.md deleted file mode 100644 index 44525bdcd2..0000000000 --- a/app/sdks/go/docs/examples/Projects/CreateProject.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## CreateProject - -```go - package appwrite-createproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateProject method and handle results - var res, err := srv.CreateProject("[NAME]", "[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/CreateTask.md b/app/sdks/go/docs/examples/Projects/CreateTask.md deleted file mode 100644 index 25c617ec9b..0000000000 --- a/app/sdks/go/docs/examples/Projects/CreateTask.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## CreateTask - -```go - package appwrite-createtask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateTask method and handle results - var res, err := srv.CreateTask("[PROJECT_ID]", "[NAME]", "play", "", 0, "GET", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/CreateWebhook.md b/app/sdks/go/docs/examples/Projects/CreateWebhook.md deleted file mode 100644 index 58e5dc548f..0000000000 --- a/app/sdks/go/docs/examples/Projects/CreateWebhook.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## CreateWebhook - -```go - package appwrite-createwebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateWebhook method and handle results - var res, err := srv.CreateWebhook("[PROJECT_ID]", "[NAME]", [], "[URL]", 0) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/DeleteKey.md b/app/sdks/go/docs/examples/Projects/DeleteKey.md deleted file mode 100644 index 3160b37d1c..0000000000 --- a/app/sdks/go/docs/examples/Projects/DeleteKey.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## DeleteKey - -```go - package appwrite-deletekey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteKey method and handle results - var res, err := srv.DeleteKey("[PROJECT_ID]", "[KEY_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/DeletePlatform.md b/app/sdks/go/docs/examples/Projects/DeletePlatform.md deleted file mode 100644 index a9e3f0d3b9..0000000000 --- a/app/sdks/go/docs/examples/Projects/DeletePlatform.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## DeletePlatform - -```go - package appwrite-deleteplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeletePlatform method and handle results - var res, err := srv.DeletePlatform("[PROJECT_ID]", "[PLATFORM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/DeleteProject.md b/app/sdks/go/docs/examples/Projects/DeleteProject.md deleted file mode 100644 index 446f640c0d..0000000000 --- a/app/sdks/go/docs/examples/Projects/DeleteProject.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## DeleteProject - -```go - package appwrite-deleteproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteProject method and handle results - var res, err := srv.DeleteProject("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/DeleteTask.md b/app/sdks/go/docs/examples/Projects/DeleteTask.md deleted file mode 100644 index a5275e3b04..0000000000 --- a/app/sdks/go/docs/examples/Projects/DeleteTask.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## DeleteTask - -```go - package appwrite-deletetask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteTask method and handle results - var res, err := srv.DeleteTask("[PROJECT_ID]", "[TASK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/DeleteWebhook.md b/app/sdks/go/docs/examples/Projects/DeleteWebhook.md deleted file mode 100644 index 377708f6a3..0000000000 --- a/app/sdks/go/docs/examples/Projects/DeleteWebhook.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## DeleteWebhook - -```go - package appwrite-deletewebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteWebhook method and handle results - var res, err := srv.DeleteWebhook("[PROJECT_ID]", "[WEBHOOK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/GetKey.md b/app/sdks/go/docs/examples/Projects/GetKey.md deleted file mode 100644 index abe636ba31..0000000000 --- a/app/sdks/go/docs/examples/Projects/GetKey.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## GetKey - -```go - package appwrite-getkey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetKey method and handle results - var res, err := srv.GetKey("[PROJECT_ID]", "[KEY_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/GetPlatform.md b/app/sdks/go/docs/examples/Projects/GetPlatform.md deleted file mode 100644 index 14a9d3bda5..0000000000 --- a/app/sdks/go/docs/examples/Projects/GetPlatform.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## GetPlatform - -```go - package appwrite-getplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetPlatform method and handle results - var res, err := srv.GetPlatform("[PROJECT_ID]", "[PLATFORM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/GetProject.md b/app/sdks/go/docs/examples/Projects/GetProject.md deleted file mode 100644 index 8e0986f592..0000000000 --- a/app/sdks/go/docs/examples/Projects/GetProject.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## GetProject - -```go - package appwrite-getproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetProject method and handle results - var res, err := srv.GetProject("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/GetProjectUsage.md b/app/sdks/go/docs/examples/Projects/GetProjectUsage.md deleted file mode 100644 index 2bb6bc4dc5..0000000000 --- a/app/sdks/go/docs/examples/Projects/GetProjectUsage.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## GetProjectUsage - -```go - package appwrite-getprojectusage - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetProjectUsage method and handle results - var res, err := srv.GetProjectUsage("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/GetTask.md b/app/sdks/go/docs/examples/Projects/GetTask.md deleted file mode 100644 index c6efdf553b..0000000000 --- a/app/sdks/go/docs/examples/Projects/GetTask.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## GetTask - -```go - package appwrite-gettask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetTask method and handle results - var res, err := srv.GetTask("[PROJECT_ID]", "[TASK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/GetWebhook.md b/app/sdks/go/docs/examples/Projects/GetWebhook.md deleted file mode 100644 index b46bf392b5..0000000000 --- a/app/sdks/go/docs/examples/Projects/GetWebhook.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## GetWebhook - -```go - package appwrite-getwebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetWebhook method and handle results - var res, err := srv.GetWebhook("[PROJECT_ID]", "[WEBHOOK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/ListKeys.md b/app/sdks/go/docs/examples/Projects/ListKeys.md deleted file mode 100644 index e084035bb5..0000000000 --- a/app/sdks/go/docs/examples/Projects/ListKeys.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## ListKeys - -```go - package appwrite-listkeys - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListKeys method and handle results - var res, err := srv.ListKeys("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/ListPlatforms.md b/app/sdks/go/docs/examples/Projects/ListPlatforms.md deleted file mode 100644 index ecce7449e1..0000000000 --- a/app/sdks/go/docs/examples/Projects/ListPlatforms.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## ListPlatforms - -```go - package appwrite-listplatforms - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListPlatforms method and handle results - var res, err := srv.ListPlatforms("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/ListProjects.md b/app/sdks/go/docs/examples/Projects/ListProjects.md deleted file mode 100644 index f17ea76beb..0000000000 --- a/app/sdks/go/docs/examples/Projects/ListProjects.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## ListProjects - -```go - package appwrite-listprojects - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListProjects method and handle results - var res, err := srv.ListProjects() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/ListTasks.md b/app/sdks/go/docs/examples/Projects/ListTasks.md deleted file mode 100644 index 84f5356c34..0000000000 --- a/app/sdks/go/docs/examples/Projects/ListTasks.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## ListTasks - -```go - package appwrite-listtasks - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListTasks method and handle results - var res, err := srv.ListTasks("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/ListWebhooks.md b/app/sdks/go/docs/examples/Projects/ListWebhooks.md deleted file mode 100644 index aee6b8da62..0000000000 --- a/app/sdks/go/docs/examples/Projects/ListWebhooks.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## ListWebhooks - -```go - package appwrite-listwebhooks - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListWebhooks method and handle results - var res, err := srv.ListWebhooks("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/UpdateKey.md b/app/sdks/go/docs/examples/Projects/UpdateKey.md deleted file mode 100644 index 205caef8c8..0000000000 --- a/app/sdks/go/docs/examples/Projects/UpdateKey.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## UpdateKey - -```go - package appwrite-updatekey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateKey method and handle results - var res, err := srv.UpdateKey("[PROJECT_ID]", "[KEY_ID]", "[NAME]", []) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/UpdatePlatform.md b/app/sdks/go/docs/examples/Projects/UpdatePlatform.md deleted file mode 100644 index bc966f73a8..0000000000 --- a/app/sdks/go/docs/examples/Projects/UpdatePlatform.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## UpdatePlatform - -```go - package appwrite-updateplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdatePlatform method and handle results - var res, err := srv.UpdatePlatform("[PROJECT_ID]", "[PLATFORM_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/UpdateProject.md b/app/sdks/go/docs/examples/Projects/UpdateProject.md deleted file mode 100644 index 7663ec4c4e..0000000000 --- a/app/sdks/go/docs/examples/Projects/UpdateProject.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## UpdateProject - -```go - package appwrite-updateproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateProject method and handle results - var res, err := srv.UpdateProject("[PROJECT_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/UpdateProjectOAuth.md b/app/sdks/go/docs/examples/Projects/UpdateProjectOAuth.md deleted file mode 100644 index 58f23b698b..0000000000 --- a/app/sdks/go/docs/examples/Projects/UpdateProjectOAuth.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## UpdateProjectOAuth - -```go - package appwrite-updateprojectoauth - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateProjectOAuth method and handle results - var res, err := srv.UpdateProjectOAuth("[PROJECT_ID]", "bitbucket") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/UpdateTask.md b/app/sdks/go/docs/examples/Projects/UpdateTask.md deleted file mode 100644 index f977fd5540..0000000000 --- a/app/sdks/go/docs/examples/Projects/UpdateTask.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## UpdateTask - -```go - package appwrite-updatetask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateTask method and handle results - var res, err := srv.UpdateTask("[PROJECT_ID]", "[TASK_ID]", "[NAME]", "play", "", 0, "GET", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/UpdateWebhook.md b/app/sdks/go/docs/examples/Projects/UpdateWebhook.md deleted file mode 100644 index 0120707ad5..0000000000 --- a/app/sdks/go/docs/examples/Projects/UpdateWebhook.md +++ /dev/null @@ -1,35 +0,0 @@ -# Projects Examples - -## UpdateWebhook - -```go - package appwrite-updatewebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateWebhook method and handle results - var res, err := srv.UpdateWebhook("[PROJECT_ID]", "[WEBHOOK_ID]", "[NAME]", [], "[URL]", 0) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/create-key.md b/app/sdks/go/docs/examples/Projects/create-key.md deleted file mode 100644 index d5197d2a1e..0000000000 --- a/app/sdks/go/docs/examples/Projects/create-key.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## CreateKey - -```go - package appwrite-createkey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateKey method and handle results - var res, err := srv.CreateKey("[PROJECT_ID]", "[NAME]", []) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/create-platform.md b/app/sdks/go/docs/examples/Projects/create-platform.md deleted file mode 100644 index fd4a61884d..0000000000 --- a/app/sdks/go/docs/examples/Projects/create-platform.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## CreatePlatform - -```go - package appwrite-createplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreatePlatform method and handle results - var res, err := srv.CreatePlatform("[PROJECT_ID]", "web", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/create-project.md b/app/sdks/go/docs/examples/Projects/create-project.md deleted file mode 100644 index 74ffc04444..0000000000 --- a/app/sdks/go/docs/examples/Projects/create-project.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## CreateProject - -```go - package appwrite-createproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateProject method and handle results - var res, err := srv.CreateProject("[NAME]", "[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/create-task.md b/app/sdks/go/docs/examples/Projects/create-task.md deleted file mode 100644 index aa642b536a..0000000000 --- a/app/sdks/go/docs/examples/Projects/create-task.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## CreateTask - -```go - package appwrite-createtask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateTask method and handle results - var res, err := srv.CreateTask("[PROJECT_ID]", "[NAME]", "play", "", 0, "GET", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/create-webhook.md b/app/sdks/go/docs/examples/Projects/create-webhook.md deleted file mode 100644 index 60b62ed828..0000000000 --- a/app/sdks/go/docs/examples/Projects/create-webhook.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## CreateWebhook - -```go - package appwrite-createwebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call CreateWebhook method and handle results - var res, err := srv.CreateWebhook("[PROJECT_ID]", "[NAME]", [], "[URL]", 0) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/delete-key.md b/app/sdks/go/docs/examples/Projects/delete-key.md deleted file mode 100644 index b4929842f0..0000000000 --- a/app/sdks/go/docs/examples/Projects/delete-key.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## DeleteKey - -```go - package appwrite-deletekey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteKey method and handle results - var res, err := srv.DeleteKey("[PROJECT_ID]", "[KEY_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/delete-platform.md b/app/sdks/go/docs/examples/Projects/delete-platform.md deleted file mode 100644 index 1f04f26bd2..0000000000 --- a/app/sdks/go/docs/examples/Projects/delete-platform.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## DeletePlatform - -```go - package appwrite-deleteplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeletePlatform method and handle results - var res, err := srv.DeletePlatform("[PROJECT_ID]", "[PLATFORM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/delete-project.md b/app/sdks/go/docs/examples/Projects/delete-project.md deleted file mode 100644 index b8b7f2d60d..0000000000 --- a/app/sdks/go/docs/examples/Projects/delete-project.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## DeleteProject - -```go - package appwrite-deleteproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteProject method and handle results - var res, err := srv.DeleteProject("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/delete-task.md b/app/sdks/go/docs/examples/Projects/delete-task.md deleted file mode 100644 index 934a80f405..0000000000 --- a/app/sdks/go/docs/examples/Projects/delete-task.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## DeleteTask - -```go - package appwrite-deletetask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteTask method and handle results - var res, err := srv.DeleteTask("[PROJECT_ID]", "[TASK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/delete-webhook.md b/app/sdks/go/docs/examples/Projects/delete-webhook.md deleted file mode 100644 index f30e3906e6..0000000000 --- a/app/sdks/go/docs/examples/Projects/delete-webhook.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## DeleteWebhook - -```go - package appwrite-deletewebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call DeleteWebhook method and handle results - var res, err := srv.DeleteWebhook("[PROJECT_ID]", "[WEBHOOK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/get-key.md b/app/sdks/go/docs/examples/Projects/get-key.md deleted file mode 100644 index d58e13d211..0000000000 --- a/app/sdks/go/docs/examples/Projects/get-key.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## GetKey - -```go - package appwrite-getkey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetKey method and handle results - var res, err := srv.GetKey("[PROJECT_ID]", "[KEY_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/get-platform.md b/app/sdks/go/docs/examples/Projects/get-platform.md deleted file mode 100644 index 1a0d3fc29f..0000000000 --- a/app/sdks/go/docs/examples/Projects/get-platform.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## GetPlatform - -```go - package appwrite-getplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetPlatform method and handle results - var res, err := srv.GetPlatform("[PROJECT_ID]", "[PLATFORM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/get-project-usage.md b/app/sdks/go/docs/examples/Projects/get-project-usage.md deleted file mode 100644 index 89f87f3345..0000000000 --- a/app/sdks/go/docs/examples/Projects/get-project-usage.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## GetProjectUsage - -```go - package appwrite-getprojectusage - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetProjectUsage method and handle results - var res, err := srv.GetProjectUsage("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/get-project.md b/app/sdks/go/docs/examples/Projects/get-project.md deleted file mode 100644 index b942ba7249..0000000000 --- a/app/sdks/go/docs/examples/Projects/get-project.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## GetProject - -```go - package appwrite-getproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetProject method and handle results - var res, err := srv.GetProject("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/get-task.md b/app/sdks/go/docs/examples/Projects/get-task.md deleted file mode 100644 index 1168f7ab6f..0000000000 --- a/app/sdks/go/docs/examples/Projects/get-task.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## GetTask - -```go - package appwrite-gettask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetTask method and handle results - var res, err := srv.GetTask("[PROJECT_ID]", "[TASK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/get-webhook.md b/app/sdks/go/docs/examples/Projects/get-webhook.md deleted file mode 100644 index 349f0fea47..0000000000 --- a/app/sdks/go/docs/examples/Projects/get-webhook.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## GetWebhook - -```go - package appwrite-getwebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call GetWebhook method and handle results - var res, err := srv.GetWebhook("[PROJECT_ID]", "[WEBHOOK_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/list-keys.md b/app/sdks/go/docs/examples/Projects/list-keys.md deleted file mode 100644 index cd405846b3..0000000000 --- a/app/sdks/go/docs/examples/Projects/list-keys.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## ListKeys - -```go - package appwrite-listkeys - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListKeys method and handle results - var res, err := srv.ListKeys("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/list-platforms.md b/app/sdks/go/docs/examples/Projects/list-platforms.md deleted file mode 100644 index c0aa3adda9..0000000000 --- a/app/sdks/go/docs/examples/Projects/list-platforms.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## ListPlatforms - -```go - package appwrite-listplatforms - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListPlatforms method and handle results - var res, err := srv.ListPlatforms("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/list-projects.md b/app/sdks/go/docs/examples/Projects/list-projects.md deleted file mode 100644 index 14c283306d..0000000000 --- a/app/sdks/go/docs/examples/Projects/list-projects.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## ListProjects - -```go - package appwrite-listprojects - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListProjects method and handle results - var res, err := srv.ListProjects() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/list-tasks.md b/app/sdks/go/docs/examples/Projects/list-tasks.md deleted file mode 100644 index 37dd64fa1a..0000000000 --- a/app/sdks/go/docs/examples/Projects/list-tasks.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## ListTasks - -```go - package appwrite-listtasks - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListTasks method and handle results - var res, err := srv.ListTasks("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/list-webhooks.md b/app/sdks/go/docs/examples/Projects/list-webhooks.md deleted file mode 100644 index 2e277cc6d6..0000000000 --- a/app/sdks/go/docs/examples/Projects/list-webhooks.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## ListWebhooks - -```go - package appwrite-listwebhooks - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call ListWebhooks method and handle results - var res, err := srv.ListWebhooks("[PROJECT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/update-key.md b/app/sdks/go/docs/examples/Projects/update-key.md deleted file mode 100644 index 7a34cfd090..0000000000 --- a/app/sdks/go/docs/examples/Projects/update-key.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## UpdateKey - -```go - package appwrite-updatekey - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateKey method and handle results - var res, err := srv.UpdateKey("[PROJECT_ID]", "[KEY_ID]", "[NAME]", []) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/update-platform.md b/app/sdks/go/docs/examples/Projects/update-platform.md deleted file mode 100644 index d85b5b04d6..0000000000 --- a/app/sdks/go/docs/examples/Projects/update-platform.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## UpdatePlatform - -```go - package appwrite-updateplatform - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdatePlatform method and handle results - var res, err := srv.UpdatePlatform("[PROJECT_ID]", "[PLATFORM_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/update-project-o-auth.md b/app/sdks/go/docs/examples/Projects/update-project-o-auth.md deleted file mode 100644 index a402bed516..0000000000 --- a/app/sdks/go/docs/examples/Projects/update-project-o-auth.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## UpdateProjectOAuth - -```go - package appwrite-updateprojectoauth - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateProjectOAuth method and handle results - var res, err := srv.UpdateProjectOAuth("[PROJECT_ID]", "bitbucket") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/update-project.md b/app/sdks/go/docs/examples/Projects/update-project.md deleted file mode 100644 index b4f8e90090..0000000000 --- a/app/sdks/go/docs/examples/Projects/update-project.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## UpdateProject - -```go - package appwrite-updateproject - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateProject method and handle results - var res, err := srv.UpdateProject("[PROJECT_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/update-task.md b/app/sdks/go/docs/examples/Projects/update-task.md deleted file mode 100644 index 31ca901e94..0000000000 --- a/app/sdks/go/docs/examples/Projects/update-task.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## UpdateTask - -```go - package appwrite-updatetask - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateTask method and handle results - var res, err := srv.UpdateTask("[PROJECT_ID]", "[TASK_ID]", "[NAME]", "play", "", 0, "GET", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Projects/update-webhook.md b/app/sdks/go/docs/examples/Projects/update-webhook.md deleted file mode 100644 index fde81679cc..0000000000 --- a/app/sdks/go/docs/examples/Projects/update-webhook.md +++ /dev/null @@ -1,34 +0,0 @@ -# Projects Examples - -## UpdateWebhook - -```go - package appwrite-updatewebhook - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - - // Create a new Projects service passing Client - var srv := appwrite.Projects{ - client: &clt - } - - // Call UpdateWebhook method and handle results - var res, err := srv.UpdateWebhook("[PROJECT_ID]", "[WEBHOOK_ID]", "[NAME]", [], "[URL]", 0) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/CreateFile.md b/app/sdks/go/docs/examples/Storage/CreateFile.md deleted file mode 100644 index 2b33879f54..0000000000 --- a/app/sdks/go/docs/examples/Storage/CreateFile.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## CreateFile - -```go - package appwrite-createfile - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call CreateFile method and handle results - var res, err := srv.CreateFile(file) - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/DeleteFile.md b/app/sdks/go/docs/examples/Storage/DeleteFile.md deleted file mode 100644 index c6ecabdf99..0000000000 --- a/app/sdks/go/docs/examples/Storage/DeleteFile.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## DeleteFile - -```go - package appwrite-deletefile - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call DeleteFile method and handle results - var res, err := srv.DeleteFile("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/GetFile.md b/app/sdks/go/docs/examples/Storage/GetFile.md deleted file mode 100644 index 0e7bff0952..0000000000 --- a/app/sdks/go/docs/examples/Storage/GetFile.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## GetFile - -```go - package appwrite-getfile - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call GetFile method and handle results - var res, err := srv.GetFile("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/GetFileDownload.md b/app/sdks/go/docs/examples/Storage/GetFileDownload.md deleted file mode 100644 index 4513337425..0000000000 --- a/app/sdks/go/docs/examples/Storage/GetFileDownload.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## GetFileDownload - -```go - package appwrite-getfiledownload - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call GetFileDownload method and handle results - var res, err := srv.GetFileDownload("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/GetFilePreview.md b/app/sdks/go/docs/examples/Storage/GetFilePreview.md deleted file mode 100644 index a30a271d93..0000000000 --- a/app/sdks/go/docs/examples/Storage/GetFilePreview.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## GetFilePreview - -```go - package appwrite-getfilepreview - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call GetFilePreview method and handle results - var res, err := srv.GetFilePreview("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/GetFileView.md b/app/sdks/go/docs/examples/Storage/GetFileView.md deleted file mode 100644 index 7782cb3b1e..0000000000 --- a/app/sdks/go/docs/examples/Storage/GetFileView.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## GetFileView - -```go - package appwrite-getfileview - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call GetFileView method and handle results - var res, err := srv.GetFileView("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/ListFiles.md b/app/sdks/go/docs/examples/Storage/ListFiles.md deleted file mode 100644 index 7c5d800f6e..0000000000 --- a/app/sdks/go/docs/examples/Storage/ListFiles.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## ListFiles - -```go - package appwrite-listfiles - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call ListFiles method and handle results - var res, err := srv.ListFiles() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/UpdateFile.md b/app/sdks/go/docs/examples/Storage/UpdateFile.md deleted file mode 100644 index 157d44b7a4..0000000000 --- a/app/sdks/go/docs/examples/Storage/UpdateFile.md +++ /dev/null @@ -1,35 +0,0 @@ -# Storage Examples - -## UpdateFile - -```go - package appwrite-updatefile - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &clt - } - - // Call UpdateFile method and handle results - var res, err := srv.UpdateFile("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/create-file.md b/app/sdks/go/docs/examples/Storage/create-file.md index 72f5ca8da9..1d0bf35af8 100644 --- a/app/sdks/go/docs/examples/Storage/create-file.md +++ b/app/sdks/go/docs/examples/Storage/create-file.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/delete-file.md b/app/sdks/go/docs/examples/Storage/delete-file.md index 420814abb0..c6ecabdf99 100644 --- a/app/sdks/go/docs/examples/Storage/delete-file.md +++ b/app/sdks/go/docs/examples/Storage/delete-file.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/get-file-download.md b/app/sdks/go/docs/examples/Storage/get-file-download.md index 8c90942705..4513337425 100644 --- a/app/sdks/go/docs/examples/Storage/get-file-download.md +++ b/app/sdks/go/docs/examples/Storage/get-file-download.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/get-file-preview.md b/app/sdks/go/docs/examples/Storage/get-file-preview.md index 4c24617095..a30a271d93 100644 --- a/app/sdks/go/docs/examples/Storage/get-file-preview.md +++ b/app/sdks/go/docs/examples/Storage/get-file-preview.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/get-file-view.md b/app/sdks/go/docs/examples/Storage/get-file-view.md index 712ab69ab3..7782cb3b1e 100644 --- a/app/sdks/go/docs/examples/Storage/get-file-view.md +++ b/app/sdks/go/docs/examples/Storage/get-file-view.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/get-file.md b/app/sdks/go/docs/examples/Storage/get-file.md index fccfbbc793..0e7bff0952 100644 --- a/app/sdks/go/docs/examples/Storage/get-file.md +++ b/app/sdks/go/docs/examples/Storage/get-file.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/list-files.md b/app/sdks/go/docs/examples/Storage/list-files.md index e8058befc5..7c5d800f6e 100644 --- a/app/sdks/go/docs/examples/Storage/list-files.md +++ b/app/sdks/go/docs/examples/Storage/list-files.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Storage/update-file.md b/app/sdks/go/docs/examples/Storage/update-file.md index bf73435ca6..01b44bc620 100644 --- a/app/sdks/go/docs/examples/Storage/update-file.md +++ b/app/sdks/go/docs/examples/Storage/update-file.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Storage service passing Client var srv := appwrite.Storage{ diff --git a/app/sdks/go/docs/examples/Teams/CreateTeam.md b/app/sdks/go/docs/examples/Teams/CreateTeam.md deleted file mode 100644 index 7922f904f8..0000000000 --- a/app/sdks/go/docs/examples/Teams/CreateTeam.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## CreateTeam - -```go - package appwrite-createteam - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call CreateTeam method and handle results - var res, err := srv.CreateTeam("[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/CreateTeamMembership.md b/app/sdks/go/docs/examples/Teams/CreateTeamMembership.md deleted file mode 100644 index 9d74105ec5..0000000000 --- a/app/sdks/go/docs/examples/Teams/CreateTeamMembership.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## CreateTeamMembership - -```go - package appwrite-createteammembership - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call CreateTeamMembership method and handle results - var res, err := srv.CreateTeamMembership("[TEAM_ID]", "email@example.com", [], "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/CreateTeamMembershipResend.md b/app/sdks/go/docs/examples/Teams/CreateTeamMembershipResend.md deleted file mode 100644 index 9925df6e95..0000000000 --- a/app/sdks/go/docs/examples/Teams/CreateTeamMembershipResend.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## CreateTeamMembershipResend - -```go - package appwrite-createteammembershipresend - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call CreateTeamMembershipResend method and handle results - var res, err := srv.CreateTeamMembershipResend("[TEAM_ID]", "[INVITE_ID]", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/DeleteTeam.md b/app/sdks/go/docs/examples/Teams/DeleteTeam.md deleted file mode 100644 index fa15cce6d6..0000000000 --- a/app/sdks/go/docs/examples/Teams/DeleteTeam.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## DeleteTeam - -```go - package appwrite-deleteteam - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call DeleteTeam method and handle results - var res, err := srv.DeleteTeam("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/DeleteTeamMembership.md b/app/sdks/go/docs/examples/Teams/DeleteTeamMembership.md deleted file mode 100644 index 80cdc936b0..0000000000 --- a/app/sdks/go/docs/examples/Teams/DeleteTeamMembership.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## DeleteTeamMembership - -```go - package appwrite-deleteteammembership - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call DeleteTeamMembership method and handle results - var res, err := srv.DeleteTeamMembership("[TEAM_ID]", "[INVITE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/GetTeam.md b/app/sdks/go/docs/examples/Teams/GetTeam.md deleted file mode 100644 index 8418da4d14..0000000000 --- a/app/sdks/go/docs/examples/Teams/GetTeam.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## GetTeam - -```go - package appwrite-getteam - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call GetTeam method and handle results - var res, err := srv.GetTeam("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/GetTeamMembers.md b/app/sdks/go/docs/examples/Teams/GetTeamMembers.md deleted file mode 100644 index 35dd4aa047..0000000000 --- a/app/sdks/go/docs/examples/Teams/GetTeamMembers.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## GetTeamMembers - -```go - package appwrite-getteammembers - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call GetTeamMembers method and handle results - var res, err := srv.GetTeamMembers("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/ListTeams.md b/app/sdks/go/docs/examples/Teams/ListTeams.md deleted file mode 100644 index 089daf4697..0000000000 --- a/app/sdks/go/docs/examples/Teams/ListTeams.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## ListTeams - -```go - package appwrite-listteams - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call ListTeams method and handle results - var res, err := srv.ListTeams() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/UpdateTeam.md b/app/sdks/go/docs/examples/Teams/UpdateTeam.md deleted file mode 100644 index d32a67800a..0000000000 --- a/app/sdks/go/docs/examples/Teams/UpdateTeam.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## UpdateTeam - -```go - package appwrite-updateteam - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call UpdateTeam method and handle results - var res, err := srv.UpdateTeam("[TEAM_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/UpdateTeamMembershipStatus.md b/app/sdks/go/docs/examples/Teams/UpdateTeamMembershipStatus.md deleted file mode 100644 index 7d4346d2a3..0000000000 --- a/app/sdks/go/docs/examples/Teams/UpdateTeamMembershipStatus.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## UpdateTeamMembershipStatus - -```go - package appwrite-updateteammembershipstatus - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call UpdateTeamMembershipStatus method and handle results - var res, err := srv.UpdateTeamMembershipStatus("[TEAM_ID]", "[INVITE_ID]", "[USER_ID]", "[SECRET]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/create-team-membership-resend.md b/app/sdks/go/docs/examples/Teams/create-team-membership-resend.md deleted file mode 100644 index 9925df6e95..0000000000 --- a/app/sdks/go/docs/examples/Teams/create-team-membership-resend.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## CreateTeamMembershipResend - -```go - package appwrite-createteammembershipresend - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call CreateTeamMembershipResend method and handle results - var res, err := srv.CreateTeamMembershipResend("[TEAM_ID]", "[INVITE_ID]", "https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/create-team-membership.md b/app/sdks/go/docs/examples/Teams/create-team-membership.md index 5b9b53494a..9d74105ec5 100644 --- a/app/sdks/go/docs/examples/Teams/create-team-membership.md +++ b/app/sdks/go/docs/examples/Teams/create-team-membership.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/create-team.md b/app/sdks/go/docs/examples/Teams/create-team.md index 79c8fa0daf..7922f904f8 100644 --- a/app/sdks/go/docs/examples/Teams/create-team.md +++ b/app/sdks/go/docs/examples/Teams/create-team.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/delete-team-membership.md b/app/sdks/go/docs/examples/Teams/delete-team-membership.md index 5f545111dd..80cdc936b0 100644 --- a/app/sdks/go/docs/examples/Teams/delete-team-membership.md +++ b/app/sdks/go/docs/examples/Teams/delete-team-membership.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/delete-team.md b/app/sdks/go/docs/examples/Teams/delete-team.md index 34f5dac131..fa15cce6d6 100644 --- a/app/sdks/go/docs/examples/Teams/delete-team.md +++ b/app/sdks/go/docs/examples/Teams/delete-team.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/get-team-members.md b/app/sdks/go/docs/examples/Teams/get-team-members.md deleted file mode 100644 index 35dd4aa047..0000000000 --- a/app/sdks/go/docs/examples/Teams/get-team-members.md +++ /dev/null @@ -1,35 +0,0 @@ -# Teams Examples - -## GetTeamMembers - -```go - package appwrite-getteammembers - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call GetTeamMembers method and handle results - var res, err := srv.GetTeamMembers("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/get-team-memberships.md b/app/sdks/go/docs/examples/Teams/get-team-memberships.md index ab17cdcd08..b945ec493e 100644 --- a/app/sdks/go/docs/examples/Teams/get-team-memberships.md +++ b/app/sdks/go/docs/examples/Teams/get-team-memberships.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/get-team.md b/app/sdks/go/docs/examples/Teams/get-team.md index ed75792881..8418da4d14 100644 --- a/app/sdks/go/docs/examples/Teams/get-team.md +++ b/app/sdks/go/docs/examples/Teams/get-team.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/list-teams.md b/app/sdks/go/docs/examples/Teams/list-teams.md index 8a132ef97e..089daf4697 100644 --- a/app/sdks/go/docs/examples/Teams/list-teams.md +++ b/app/sdks/go/docs/examples/Teams/list-teams.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Teams/update-team-membership-status.md b/app/sdks/go/docs/examples/Teams/update-team-membership-status.md deleted file mode 100644 index effb5eed67..0000000000 --- a/app/sdks/go/docs/examples/Teams/update-team-membership-status.md +++ /dev/null @@ -1,33 +0,0 @@ -# Teams Examples - -## UpdateTeamMembershipStatus - -```go - package appwrite-updateteammembershipstatus - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &clt - } - - // Call UpdateTeamMembershipStatus method and handle results - var res, err := srv.UpdateTeamMembershipStatus("[TEAM_ID]", "[INVITE_ID]", "[USER_ID]", "[SECRET]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/update-team.md b/app/sdks/go/docs/examples/Teams/update-team.md index 4635d3068e..d32a67800a 100644 --- a/app/sdks/go/docs/examples/Teams/update-team.md +++ b/app/sdks/go/docs/examples/Teams/update-team.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Teams service passing Client var srv := appwrite.Teams{ diff --git a/app/sdks/go/docs/examples/Users/CreateUser.md b/app/sdks/go/docs/examples/Users/CreateUser.md deleted file mode 100644 index b790840277..0000000000 --- a/app/sdks/go/docs/examples/Users/CreateUser.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## CreateUser - -```go - package appwrite-createuser - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call CreateUser method and handle results - var res, err := srv.CreateUser("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/DeleteUserSession.md b/app/sdks/go/docs/examples/Users/DeleteUserSession.md deleted file mode 100644 index 6bc880b88a..0000000000 --- a/app/sdks/go/docs/examples/Users/DeleteUserSession.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## DeleteUserSession - -```go - package appwrite-deleteusersession - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call DeleteUserSession method and handle results - var res, err := srv.DeleteUserSession("[USER_ID]", "[SESSION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/DeleteUserSessions.md b/app/sdks/go/docs/examples/Users/DeleteUserSessions.md deleted file mode 100644 index 8d36d951d5..0000000000 --- a/app/sdks/go/docs/examples/Users/DeleteUserSessions.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## DeleteUserSessions - -```go - package appwrite-deleteusersessions - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call DeleteUserSessions method and handle results - var res, err := srv.DeleteUserSessions("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/GetUser.md b/app/sdks/go/docs/examples/Users/GetUser.md deleted file mode 100644 index d61430718b..0000000000 --- a/app/sdks/go/docs/examples/Users/GetUser.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## GetUser - -```go - package appwrite-getuser - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call GetUser method and handle results - var res, err := srv.GetUser("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/GetUserLogs.md b/app/sdks/go/docs/examples/Users/GetUserLogs.md deleted file mode 100644 index 227d123413..0000000000 --- a/app/sdks/go/docs/examples/Users/GetUserLogs.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## GetUserLogs - -```go - package appwrite-getuserlogs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call GetUserLogs method and handle results - var res, err := srv.GetUserLogs("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/GetUserPrefs.md b/app/sdks/go/docs/examples/Users/GetUserPrefs.md deleted file mode 100644 index fc9515a4af..0000000000 --- a/app/sdks/go/docs/examples/Users/GetUserPrefs.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## GetUserPrefs - -```go - package appwrite-getuserprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call GetUserPrefs method and handle results - var res, err := srv.GetUserPrefs("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/GetUserSessions.md b/app/sdks/go/docs/examples/Users/GetUserSessions.md deleted file mode 100644 index 99dd8b3fff..0000000000 --- a/app/sdks/go/docs/examples/Users/GetUserSessions.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## GetUserSessions - -```go - package appwrite-getusersessions - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call GetUserSessions method and handle results - var res, err := srv.GetUserSessions("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/ListUsers.md b/app/sdks/go/docs/examples/Users/ListUsers.md deleted file mode 100644 index 8332347ba8..0000000000 --- a/app/sdks/go/docs/examples/Users/ListUsers.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## ListUsers - -```go - package appwrite-listusers - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call ListUsers method and handle results - var res, err := srv.ListUsers() - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/UpdateUserPrefs.md b/app/sdks/go/docs/examples/Users/UpdateUserPrefs.md deleted file mode 100644 index 50614f238e..0000000000 --- a/app/sdks/go/docs/examples/Users/UpdateUserPrefs.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## UpdateUserPrefs - -```go - package appwrite-updateuserprefs - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call UpdateUserPrefs method and handle results - var res, err := srv.UpdateUserPrefs("[USER_ID]", "{}") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/UpdateUserStatus.md b/app/sdks/go/docs/examples/Users/UpdateUserStatus.md deleted file mode 100644 index d5570ca041..0000000000 --- a/app/sdks/go/docs/examples/Users/UpdateUserStatus.md +++ /dev/null @@ -1,35 +0,0 @@ -# Users Examples - -## UpdateUserStatus - -```go - package appwrite-updateuserstatus - - import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" - ) - - func main() { - // Create a Client - var clt := appwrite.Client{} - - // Set Client required headers - clt.SetProject("") - clt.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &clt - } - - // Call UpdateUserStatus method and handle results - var res, err := srv.UpdateUserStatus("[USER_ID]", "1") - if err != nil { - panic(err) - } - - fmt.Println(res) - } -``` \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/create-user.md b/app/sdks/go/docs/examples/Users/create-user.md index 17b770577f..b790840277 100644 --- a/app/sdks/go/docs/examples/Users/create-user.md +++ b/app/sdks/go/docs/examples/Users/create-user.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/delete-user-session.md b/app/sdks/go/docs/examples/Users/delete-user-session.md index c583cf1ea1..6bc880b88a 100644 --- a/app/sdks/go/docs/examples/Users/delete-user-session.md +++ b/app/sdks/go/docs/examples/Users/delete-user-session.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/delete-user-sessions.md b/app/sdks/go/docs/examples/Users/delete-user-sessions.md index 61e0d255b2..8d36d951d5 100644 --- a/app/sdks/go/docs/examples/Users/delete-user-sessions.md +++ b/app/sdks/go/docs/examples/Users/delete-user-sessions.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/get-user-logs.md b/app/sdks/go/docs/examples/Users/get-user-logs.md index 02c484f58f..227d123413 100644 --- a/app/sdks/go/docs/examples/Users/get-user-logs.md +++ b/app/sdks/go/docs/examples/Users/get-user-logs.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/get-user-prefs.md b/app/sdks/go/docs/examples/Users/get-user-prefs.md index fb94dc1f1c..fc9515a4af 100644 --- a/app/sdks/go/docs/examples/Users/get-user-prefs.md +++ b/app/sdks/go/docs/examples/Users/get-user-prefs.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/get-user-sessions.md b/app/sdks/go/docs/examples/Users/get-user-sessions.md index c5c6deb9c8..99dd8b3fff 100644 --- a/app/sdks/go/docs/examples/Users/get-user-sessions.md +++ b/app/sdks/go/docs/examples/Users/get-user-sessions.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/get-user.md b/app/sdks/go/docs/examples/Users/get-user.md index 0d3fbc760c..d61430718b 100644 --- a/app/sdks/go/docs/examples/Users/get-user.md +++ b/app/sdks/go/docs/examples/Users/get-user.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/list-users.md b/app/sdks/go/docs/examples/Users/list-users.md index 71fc3c0bfc..8332347ba8 100644 --- a/app/sdks/go/docs/examples/Users/list-users.md +++ b/app/sdks/go/docs/examples/Users/list-users.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/update-user-prefs.md b/app/sdks/go/docs/examples/Users/update-user-prefs.md index 2315287fbb..e48384abbf 100644 --- a/app/sdks/go/docs/examples/Users/update-user-prefs.md +++ b/app/sdks/go/docs/examples/Users/update-user-prefs.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/docs/examples/Users/update-user-status.md b/app/sdks/go/docs/examples/Users/update-user-status.md index 23ea9afc1c..d5570ca041 100644 --- a/app/sdks/go/docs/examples/Users/update-user-status.md +++ b/app/sdks/go/docs/examples/Users/update-user-status.md @@ -17,6 +17,7 @@ // Set Client required headers clt.SetProject("") + clt.SetKey("") // Create a new Users service passing Client var srv := appwrite.Users{ diff --git a/app/sdks/go/projects.go b/app/sdks/go/projects.go deleted file mode 100644 index d3a425a52c..0000000000 --- a/app/sdks/go/projects.go +++ /dev/null @@ -1,372 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Projects service -type Projects struct { - client *Client -} - -// ListProjects -func (srv *Projects) ListProjects() (map[string]interface{}, error) { - path := "/projects" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateProject -func (srv *Projects) CreateProject(Name string, TeamId string, Description string, Logo string, Url string, LegalName string, LegalCountry string, LegalState string, LegalCity string, LegalAddress string, LegalTaxId string) (map[string]interface{}, error) { - path := "/projects" - - params := map[string]interface{}{ - "name": Name, - "teamId": TeamId, - "description": Description, - "logo": Logo, - "url": Url, - "legalName": LegalName, - "legalCountry": LegalCountry, - "legalState": LegalState, - "legalCity": LegalCity, - "legalAddress": LegalAddress, - "legalTaxId": LegalTaxId, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetProject -func (srv *Projects) GetProject(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateProject -func (srv *Projects) UpdateProject(ProjectId string, Name string, Description string, Logo string, Url string, LegalName string, LegalCountry string, LegalState string, LegalCity string, LegalAddress string, LegalTaxId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}") - - params := map[string]interface{}{ - "name": Name, - "description": Description, - "logo": Logo, - "url": Url, - "legalName": LegalName, - "legalCountry": LegalCountry, - "legalState": LegalState, - "legalCity": LegalCity, - "legalAddress": LegalAddress, - "legalTaxId": LegalTaxId, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// DeleteProject -func (srv *Projects) DeleteProject(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// ListKeys -func (srv *Projects) ListKeys(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/keys") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateKey -func (srv *Projects) CreateKey(ProjectId string, Name string, Scopes []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/keys") - - params := map[string]interface{}{ - "name": Name, - "scopes": Scopes, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetKey -func (srv *Projects) GetKey(ProjectId string, KeyId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{keyId}", KeyId) - path := r.Replace("/projects/{projectId}/keys/{keyId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateKey -func (srv *Projects) UpdateKey(ProjectId string, KeyId string, Name string, Scopes []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{keyId}", KeyId) - path := r.Replace("/projects/{projectId}/keys/{keyId}") - - params := map[string]interface{}{ - "name": Name, - "scopes": Scopes, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteKey -func (srv *Projects) DeleteKey(ProjectId string, KeyId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{keyId}", KeyId) - path := r.Replace("/projects/{projectId}/keys/{keyId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// UpdateProjectOAuth -func (srv *Projects) UpdateProjectOAuth(ProjectId string, Provider string, AppId string, Secret string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/oauth") - - params := map[string]interface{}{ - "provider": Provider, - "appId": AppId, - "secret": Secret, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// ListPlatforms -func (srv *Projects) ListPlatforms(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/platforms") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreatePlatform -func (srv *Projects) CreatePlatform(ProjectId string, Type string, Name string, Key string, Store string, Url string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/platforms") - - params := map[string]interface{}{ - "type": Type, - "name": Name, - "key": Key, - "store": Store, - "url": Url, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetPlatform -func (srv *Projects) GetPlatform(ProjectId string, PlatformId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{platformId}", PlatformId) - path := r.Replace("/projects/{projectId}/platforms/{platformId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdatePlatform -func (srv *Projects) UpdatePlatform(ProjectId string, PlatformId string, Name string, Key string, Store string, Url string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{platformId}", PlatformId) - path := r.Replace("/projects/{projectId}/platforms/{platformId}") - - params := map[string]interface{}{ - "name": Name, - "key": Key, - "store": Store, - "url": Url, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeletePlatform -func (srv *Projects) DeletePlatform(ProjectId string, PlatformId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{platformId}", PlatformId) - path := r.Replace("/projects/{projectId}/platforms/{platformId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// ListTasks -func (srv *Projects) ListTasks(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/tasks") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateTask -func (srv *Projects) CreateTask(ProjectId string, Name string, Status string, Schedule string, Security int, HttpMethod string, HttpUrl string, HttpHeaders []interface{}, HttpUser string, HttpPass string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/tasks") - - params := map[string]interface{}{ - "name": Name, - "status": Status, - "schedule": Schedule, - "security": Security, - "httpMethod": HttpMethod, - "httpUrl": HttpUrl, - "httpHeaders": HttpHeaders, - "httpUser": HttpUser, - "httpPass": HttpPass, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetTask -func (srv *Projects) GetTask(ProjectId string, TaskId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{taskId}", TaskId) - path := r.Replace("/projects/{projectId}/tasks/{taskId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateTask -func (srv *Projects) UpdateTask(ProjectId string, TaskId string, Name string, Status string, Schedule string, Security int, HttpMethod string, HttpUrl string, HttpHeaders []interface{}, HttpUser string, HttpPass string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{taskId}", TaskId) - path := r.Replace("/projects/{projectId}/tasks/{taskId}") - - params := map[string]interface{}{ - "name": Name, - "status": Status, - "schedule": Schedule, - "security": Security, - "httpMethod": HttpMethod, - "httpUrl": HttpUrl, - "httpHeaders": HttpHeaders, - "httpUser": HttpUser, - "httpPass": HttpPass, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteTask -func (srv *Projects) DeleteTask(ProjectId string, TaskId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{taskId}", TaskId) - path := r.Replace("/projects/{projectId}/tasks/{taskId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// GetProjectUsage -func (srv *Projects) GetProjectUsage(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/usage") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// ListWebhooks -func (srv *Projects) ListWebhooks(ProjectId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/webhooks") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateWebhook -func (srv *Projects) CreateWebhook(ProjectId string, Name string, Events []interface{}, Url string, Security int, HttpUser string, HttpPass string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId) - path := r.Replace("/projects/{projectId}/webhooks") - - params := map[string]interface{}{ - "name": Name, - "events": Events, - "url": Url, - "security": Security, - "httpUser": HttpUser, - "httpPass": HttpPass, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetWebhook -func (srv *Projects) GetWebhook(ProjectId string, WebhookId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{webhookId}", WebhookId) - path := r.Replace("/projects/{projectId}/webhooks/{webhookId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateWebhook -func (srv *Projects) UpdateWebhook(ProjectId string, WebhookId string, Name string, Events []interface{}, Url string, Security int, HttpUser string, HttpPass string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{webhookId}", WebhookId) - path := r.Replace("/projects/{projectId}/webhooks/{webhookId}") - - params := map[string]interface{}{ - "name": Name, - "events": Events, - "url": Url, - "security": Security, - "httpUser": HttpUser, - "httpPass": HttpPass, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteWebhook -func (srv *Projects) DeleteWebhook(ProjectId string, WebhookId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{projectId}", ProjectId, "{webhookId}", WebhookId) - path := r.Replace("/projects/{projectId}/webhooks/{webhookId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} diff --git a/app/sdks/go/teams.go b/app/sdks/go/teams.go index 996d9ed4bc..925275f733 100644 --- a/app/sdks/go/teams.go +++ b/app/sdks/go/teams.go @@ -130,30 +130,3 @@ func (srv *Teams) DeleteTeamMembership(TeamId string, InviteId string) (map[stri return srv.client.Call("DELETE", path, nil, params) } - -// UpdateTeamMembershipStatus 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. -func (srv *Teams) UpdateTeamMembershipStatus(TeamId string, InviteId string, UserId string, Secret string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId, "{inviteId}", InviteId) - path := r.Replace("/teams/{teamId}/memberships/{inviteId}/status") - - params := map[string]interface{}{ - "userId": UserId, - "secret": Secret, - } - - return srv.client.Call("PATCH", path, nil, params) -} diff --git a/app/sdks/javascript/docs/examples/account/create-account-verification.md b/app/sdks/javascript/docs/examples/account/create-account-verification.md deleted file mode 100644 index 1f3191732e..0000000000 --- a/app/sdks/javascript/docs/examples/account/create-account-verification.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.createAccountVerification('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-key.md b/app/sdks/javascript/docs/examples/projects/create-key.md deleted file mode 100644 index 3c12c8a8c2..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 b67b84ba56..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-project.md b/app/sdks/javascript/docs/examples/projects/create-project.md deleted file mode 100644 index a1b6922fed..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.createProject('[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/create-task.md b/app/sdks/javascript/docs/examples/projects/create-task.md deleted file mode 100644 index 3262b4d9fe..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 66a76c26c2..0000000000 --- a/app/sdks/javascript/docs/examples/projects/create-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/delete-key.md b/app/sdks/javascript/docs/examples/projects/delete-key.md deleted file mode 100644 index e5ae8e426c..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 450f9cd0a6..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-project.md b/app/sdks/javascript/docs/examples/projects/delete-project.md deleted file mode 100644 index b60d4de3c9..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.deleteProject('[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/delete-task.md b/app/sdks/javascript/docs/examples/projects/delete-task.md deleted file mode 100644 index 3208d38bf8..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 030a3b77f1..0000000000 --- a/app/sdks/javascript/docs/examples/projects/delete-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/get-key.md b/app/sdks/javascript/docs/examples/projects/get-key.md deleted file mode 100644 index 7207b33bf7..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 6f353f3aca..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-project-usage.md b/app/sdks/javascript/docs/examples/projects/get-project-usage.md deleted file mode 100644 index 87a2e3148a..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-project-usage.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.getProjectUsage('[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-project.md b/app/sdks/javascript/docs/examples/projects/get-project.md deleted file mode 100644 index 084e48c253..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.getProject('[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-task.md b/app/sdks/javascript/docs/examples/projects/get-task.md deleted file mode 100644 index e5195bce8c..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-webhook.md b/app/sdks/javascript/docs/examples/projects/get-webhook.md deleted file mode 100644 index a2b6089c3e..0000000000 --- a/app/sdks/javascript/docs/examples/projects/get-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/list-keys.md b/app/sdks/javascript/docs/examples/projects/list-keys.md deleted file mode 100644 index 14ef64fb6f..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-keys.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 7cfd9341a7..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-platforms.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-projects.md b/app/sdks/javascript/docs/examples/projects/list-projects.md deleted file mode 100644 index 3ba3afc41e..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-projects.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.listProjects(); - -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 fd8ab61ffa..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-tasks.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 b19851c8b1..0000000000 --- a/app/sdks/javascript/docs/examples/projects/list-webhooks.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/update-key.md b/app/sdks/javascript/docs/examples/projects/update-key.md deleted file mode 100644 index 063f4daea4..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-platform.md b/app/sdks/javascript/docs/examples/projects/update-platform.md deleted file mode 100644 index e28846f050..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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-project-o-auth.md b/app/sdks/javascript/docs/examples/projects/update-project-o-auth.md deleted file mode 100644 index 9ab78a4ea9..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-project-o-auth.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.updateProjectOAuth('[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-project.md b/app/sdks/javascript/docs/examples/projects/update-project.md deleted file mode 100644 index 6fcaa49f37..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.updateProject('[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/update-task.md b/app/sdks/javascript/docs/examples/projects/update-task.md deleted file mode 100644 index 54116a41d0..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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 ce876d5a64..0000000000 --- a/app/sdks/javascript/docs/examples/projects/update-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/users/create-user.md b/app/sdks/javascript/docs/examples/users/create-user.md deleted file mode 100644 index 1242fe70c2..0000000000 --- a/app/sdks/javascript/docs/examples/users/create-user.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.createUser('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-user-session.md b/app/sdks/javascript/docs/examples/users/delete-user-session.md deleted file mode 100644 index 4b5df53439..0000000000 --- a/app/sdks/javascript/docs/examples/users/delete-user-session.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.deleteUserSession('[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-user-sessions.md b/app/sdks/javascript/docs/examples/users/delete-user-sessions.md deleted file mode 100644 index 1a6851ce15..0000000000 --- a/app/sdks/javascript/docs/examples/users/delete-user-sessions.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.deleteUserSessions('[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-user-logs.md b/app/sdks/javascript/docs/examples/users/get-user-logs.md deleted file mode 100644 index 85175b0e1e..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-user-logs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUserLogs('[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-user-prefs.md b/app/sdks/javascript/docs/examples/users/get-user-prefs.md deleted file mode 100644 index 0d9c8dbb22..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-user-prefs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUserPrefs('[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-user-sessions.md b/app/sdks/javascript/docs/examples/users/get-user-sessions.md deleted file mode 100644 index 8cc7b1f85b..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-user-sessions.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUserSessions('[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-user.md b/app/sdks/javascript/docs/examples/users/get-user.md deleted file mode 100644 index feb40dff2d..0000000000 --- a/app/sdks/javascript/docs/examples/users/get-user.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUser('[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-users.md b/app/sdks/javascript/docs/examples/users/list-users.md deleted file mode 100644 index 561826cbd1..0000000000 --- a/app/sdks/javascript/docs/examples/users/list-users.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.listUsers(); - -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-user-prefs.md b/app/sdks/javascript/docs/examples/users/update-user-prefs.md deleted file mode 100644 index 7c9918cc07..0000000000 --- a/app/sdks/javascript/docs/examples/users/update-user-prefs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.updateUserPrefs('[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-user-status.md b/app/sdks/javascript/docs/examples/users/update-user-status.md deleted file mode 100644 index 15b7376ca7..0000000000 --- a/app/sdks/javascript/docs/examples/users/update-user-status.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.updateUserStatus('[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 de45c183cc..cd3fe716c4 100644 --- a/app/sdks/javascript/src/sdk.js +++ b/app/sdks/javascript/src/sdk.js @@ -862,46 +862,6 @@ }, payload); }, - /** - * Create 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} - */ - createAccountVerification: 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); - }, - /** * Updated Verification * @@ -1782,1139 +1742,6 @@ } }; - let projects = { - - /** - * List Projects - * - * - * @throws {Error} - * @return {Promise} - */ - listProjects: function() { - let path = '/projects'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Project - * - * - * @param {string} name - * @param {string} teamId - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - createProject: function(name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/projects'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(teamId) { - payload['teamId'] = teamId; - } - - if(description) { - payload['description'] = description; - } - - if(logo) { - payload['logo'] = logo; - } - - if(url) { - payload['url'] = url; - } - - if(legalName) { - payload['legalName'] = legalName; - } - - if(legalCountry) { - payload['legalCountry'] = legalCountry; - } - - if(legalState) { - payload['legalState'] = legalState; - } - - if(legalCity) { - payload['legalCity'] = legalCity; - } - - if(legalAddress) { - payload['legalAddress'] = legalAddress; - } - - if(legalTaxId) { - payload['legalTaxId'] = legalTaxId; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - getProject: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project - * - * - * @param {string} projectId - * @param {string} name - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - updateProject: function(projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(description) { - payload['description'] = description; - } - - if(logo) { - payload['logo'] = logo; - } - - if(url) { - payload['url'] = url; - } - - if(legalName) { - payload['legalName'] = legalName; - } - - if(legalCountry) { - payload['legalCountry'] = legalCountry; - } - - if(legalState) { - payload['legalState'] = legalState; - } - - if(legalCity) { - payload['legalCity'] = legalCity; - } - - if(legalAddress) { - payload['legalAddress'] = legalAddress; - } - - if(legalTaxId) { - payload['legalTaxId'] = legalTaxId; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - deleteProject: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Keys - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listKeys: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Key - * - * - * @param {string} projectId - * @param {string} name - * @param {array} scopes - * @throws {Error} - * @return {Promise} - */ - createKey: function(projectId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - getKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Key - * - * - * @param {string} projectId - * @param {string} keyId - * @param {string} name - * @param {array} scopes - * @throws {Error} - * @return {Promise} - */ - updateKey: function(projectId, keyId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - deleteKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project OAuth - * - * - * @param {string} projectId - * @param {string} provider - * @param {string} appId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateProjectOAuth: function(projectId, provider, appId = '', secret = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/projects/{projectId}/oauth'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(provider) { - payload['provider'] = provider; - } - - if(appId) { - payload['appId'] = appId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Platforms - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listPlatforms: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Platform - * - * - * @param {string} projectId - * @param {string} type - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createPlatform: function(projectId, type, name, key = '', store = '', url = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(type === undefined) { - throw new Error('Missing required parameter: "type"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(type) { - payload['type'] = type; - } - - if(name) { - payload['name'] = name; - } - - if(key) { - payload['key'] = key; - } - - if(store) { - payload['store'] = store; - } - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - getPlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - updatePlatform: function(projectId, platformId, name, key = '', store = '', url = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(key) { - payload['key'] = key; - } - - if(store) { - payload['store'] = store; - } - - if(url) { - payload['url'] = url; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - deletePlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Tasks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listTasks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Task - * - * - * @param {string} projectId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {number} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {array} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createTask: function(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(status) { - payload['status'] = status; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(security) { - payload['security'] = security; - } - - if(httpMethod) { - payload['httpMethod'] = httpMethod; - } - - if(httpUrl) { - payload['httpUrl'] = httpUrl; - } - - if(httpHeaders) { - payload['httpHeaders'] = httpHeaders; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - getTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Task - * - * - * @param {string} projectId - * @param {string} taskId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {number} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {array} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateTask: function(projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(status) { - payload['status'] = status; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(security) { - payload['security'] = security; - } - - if(httpMethod) { - payload['httpMethod'] = httpMethod; - } - - if(httpUrl) { - payload['httpUrl'] = httpUrl; - } - - if(httpHeaders) { - payload['httpHeaders'] = httpHeaders; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - deleteTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - getProjectUsage: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Webhooks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listWebhooks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Webhook - * - * - * @param {string} projectId - * @param {string} name - * @param {array} events - * @param {string} url - * @param {number} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createWebhook: function(projectId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(events) { - payload['events'] = events; - } - - if(url) { - payload['url'] = url; - } - - if(security) { - payload['security'] = security; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - getWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @param {string} name - * @param {array} events - * @param {string} url - * @param {number} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateWebhook: function(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(events) { - payload['events'] = events; - } - - if(url) { - payload['url'] = url; - } - - if(security) { - payload['security'] = security; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - deleteWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - let storage = { /** @@ -3556,311 +2383,6 @@ } }; - let users = { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listUsers: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/users'; - - 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 User - * - * Create a new user. - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createUser: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/users'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(name) { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User - * - * Get user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUser: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUserLogs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Preferences - * - * Get user preferences by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUserPrefs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Preferences - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param {string} userId - * @param {string} prefs - * @throws {Error} - * @return {Promise} - */ - updateUserPrefs: function(userId, prefs) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(prefs) { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUserSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteUserSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param {string} userId - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteUserSession: function(userId, sessionId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); - } - - let path = '/users/{userId}/sessions/:session'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(sessionId) { - payload['sessionId'] = sessionId; - } - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param {string} userId - * @param {string} status - * @throws {Error} - * @return {Promise} - */ - updateUserStatus: function(userId, status) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(status) { - payload['status'] = status; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - return { setEndpoint: setEndpoint, setProject: setProject, @@ -3871,10 +2393,8 @@ avatars: avatars, database: database, locale: locale, - projects: projects, storage: storage, - teams: teams, - users: users + teams: teams }; }; diff --git a/app/sdks/javascript/src/sdk.min.js b/app/sdks/javascript/src/sdk.min.js index 493765dd7c..223eb1fcd2 100644 --- a/app/sdks/javascript/src/sdk.min.js +++ b/app/sdks/javascript/src/sdk.min.js @@ -50,9 +50,7 @@ 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)},deleteAccountSession: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)},createAccountVerification: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)},updateAccountVerification:function(userId,secret,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} +let path='/account/sessions/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateAccountVerification:function(userId,secret,passwordB){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} @@ -135,142 +133,7 @@ if(read){payload.read=read} if(write){payload.write=write} return http.patch(path,{'content-type':'application/json',},payload)},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')} -let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={getLocale:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let projects={listProjects:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/projects';let payload={};if(name){payload.name=name} -if(teamId){payload.teamId=teamId} -if(description){payload.description=description} -if(logo){payload.logo=logo} -if(url){payload.url=url} -if(legalName){payload.legalName=legalName} -if(legalCountry){payload.legalCountry=legalCountry} -if(legalState){payload.legalState=legalState} -if(legalCity){payload.legalCity=legalCity} -if(legalAddress){payload.legalAddress=legalAddress} -if(legalTaxId){payload.legalTaxId=legalTaxId} -return http.post(path,{'content-type':'application/json',},payload)},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(description){payload.description=description} -if(logo){payload.logo=logo} -if(url){payload.url=url} -if(legalName){payload.legalName=legalName} -if(legalCountry){payload.legalCountry=legalCountry} -if(legalState){payload.legalState=legalState} -if(legalCity){payload.legalCity=legalCity} -if(legalAddress){payload.legalAddress=legalAddress} -if(legalTaxId){payload.legalTaxId=legalTaxId} -return http.patch(path,{'content-type':'application/json',},payload)},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(scopes){payload.scopes=scopes} -return http.post(path,{'content-type':'application/json',},payload)},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload.name=name} -if(scopes){payload.scopes=scopes} -return http.put(path,{'content-type':'application/json',},payload)},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(provider===undefined){throw new Error('Missing required parameter: "provider"')} -let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload.provider=provider} -if(appId){payload.appId=appId} -if(secret){payload.secret=secret} -return http.patch(path,{'content-type':'application/json',},payload)},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(type===undefined){throw new Error('Missing required parameter: "type"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload.type=type} -if(name){payload.name=name} -if(key){payload.key=key} -if(store){payload.store=store} -if(url){payload.url=url} -return http.post(path,{'content-type':'application/json',},payload)},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload.name=name} -if(key){payload.key=key} -if(store){payload.store=store} -if(url){payload.url=url} -return http.put(path,{'content-type':'application/json',},payload)},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(status===undefined){throw new Error('Missing required parameter: "status"')} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(status){payload.status=status} -if(schedule){payload.schedule=schedule} -if(security){payload.security=security} -if(httpMethod){payload.httpMethod=httpMethod} -if(httpUrl){payload.httpUrl=httpUrl} -if(httpHeaders){payload.httpHeaders=httpHeaders} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.post(path,{'content-type':'application/json',},payload)},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(status===undefined){throw new Error('Missing required parameter: "status"')} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload.name=name} -if(status){payload.status=status} -if(schedule){payload.schedule=schedule} -if(security){payload.security=security} -if(httpMethod){payload.httpMethod=httpMethod} -if(httpUrl){payload.httpUrl=httpUrl} -if(httpHeaders){payload.httpHeaders=httpHeaders} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.put(path,{'content-type':'application/json',},payload)},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(events===undefined){throw new Error('Missing required parameter: "events"')} -if(url===undefined){throw new Error('Missing required parameter: "url"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(events){payload.events=events} -if(url){payload.url=url} -if(security){payload.security=security} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.post(path,{'content-type':'application/json',},payload)},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(events===undefined){throw new Error('Missing required parameter: "events"')} -if(url===undefined){throw new Error('Missing required parameter: "url"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload.name=name} -if(events){payload.events=events} -if(url){payload.url=url} -if(security){payload.security=security} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.put(path,{'content-type':'application/json',},payload)},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search} +let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={getLocale:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search} if(limit){payload.limit=limit} if(offset){payload.offset=offset} if(orderType){payload.orderType=orderType} @@ -325,27 +188,4 @@ if(userId===undefined){throw new Error('Missing required parameter: "userId"')} if(secret===undefined){throw new Error('Missing required parameter: "secret"')} let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload.userId=userId} if(secret){payload.secret=secret} -payload.project=config.project;return iframe('patch',path,payload)}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';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)},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/users';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -if(name){payload.name=name} -return http.post(path,{'content-type':'application/json',},payload)},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateUserPrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload.prefs=prefs} -return http.patch(path,{'content-type':'application/json',},payload)},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},deleteUserSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"')} -let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);let payload={};if(sessionId){payload.sessionId=sessionId} -return http.delete(path,{'content-type':'application/json',},payload)},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(status===undefined){throw new Error('Missing required parameter: "status"')} -let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload.status=status} -return http.patch(path,{'content-type':'application/json',},payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{}) \ No newline at end of file +payload.project=config.project;return iframe('patch',path,payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,locale:locale,storage:storage,teams:teams}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{}) \ No newline at end of file diff --git a/app/sdks/js/LICENSE b/app/sdks/js/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/js/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/js/README.md b/app/sdks/js/README.md deleted file mode 100644 index f104da6caa..0000000000 --- a/app/sdks/js/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 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) - -**This SDK is compatible with Appwrite server version 0.4.0. 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) - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -### NPM - -To install via [NPM](https://www.npmjs.com/): - -```bash -npm install appwrite --save -``` - -If you're using a bundler (like [Browserify](http://browserify.org/) or [webpack](https://webpack.js.org/)), you can import the Appwrite module when you need it: - -```js -import * as Appwrite from "appwrite"; -``` - -### CDN - -To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: - -```html - -``` - -## Getting Started - -Initialise the Appwrite SDK in your code, and setup your API credentials: - -```js - -// Init your JS SDK -var appwrite = new Appwrite(); - -appwrite - .setEndpoint('http://localhost/v1') // Set only when using self-hosted solution - .setProject('455x34dfkj') // Your Appwrite Project UID -; - -``` - - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/delete.md b/app/sdks/js/docs/examples/account/delete.md deleted file mode 100644 index c199f0f719..0000000000 --- a/app/sdks/js/docs/examples/account/delete.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.delete(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/get-prefs.md b/app/sdks/js/docs/examples/account/get-prefs.md deleted file mode 100644 index 39f8950138..0000000000 --- a/app/sdks/js/docs/examples/account/get-prefs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.getPrefs(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/get-security.md b/app/sdks/js/docs/examples/account/get-security.md deleted file mode 100644 index ab0671da8a..0000000000 --- a/app/sdks/js/docs/examples/account/get-security.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.getSecurity(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/get-sessions.md b/app/sdks/js/docs/examples/account/get-sessions.md deleted file mode 100644 index 963400deeb..0000000000 --- a/app/sdks/js/docs/examples/account/get-sessions.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.getSessions(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/get.md b/app/sdks/js/docs/examples/account/get.md deleted file mode 100644 index 682e09fbd8..0000000000 --- a/app/sdks/js/docs/examples/account/get.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.get(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/update-email.md b/app/sdks/js/docs/examples/account/update-email.md deleted file mode 100644 index e9fb9c9ed2..0000000000 --- a/app/sdks/js/docs/examples/account/update-email.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.updateEmail('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/js/docs/examples/account/update-name.md b/app/sdks/js/docs/examples/account/update-name.md deleted file mode 100644 index 2e5531e4c3..0000000000 --- a/app/sdks/js/docs/examples/account/update-name.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.updateName('[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/update-password.md b/app/sdks/js/docs/examples/account/update-password.md deleted file mode 100644 index e4ddc7fc49..0000000000 --- a/app/sdks/js/docs/examples/account/update-password.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.updatePassword('password', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/account/update-prefs.md b/app/sdks/js/docs/examples/account/update-prefs.md deleted file mode 100644 index da37ceff8e..0000000000 --- a/app/sdks/js/docs/examples/account/update-prefs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.account.updatePrefs('{}'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/auth/confirm-resend.md b/app/sdks/js/docs/examples/auth/confirm-resend.md deleted file mode 100644 index 4c66e71d93..0000000000 --- a/app/sdks/js/docs/examples/auth/confirm-resend.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.confirmResend('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/js/docs/examples/auth/confirm.md b/app/sdks/js/docs/examples/auth/confirm.md deleted file mode 100644 index 4313e94f23..0000000000 --- a/app/sdks/js/docs/examples/auth/confirm.md +++ /dev/null @@ -1,12 +0,0 @@ -let sdk = new Appwrite(); - -sdk -; - -let promise = sdk.auth.confirm('[USER_ID]', '[TOKEN]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/auth/login.md b/app/sdks/js/docs/examples/auth/login.md deleted file mode 100644 index 99ffaa8df7..0000000000 --- a/app/sdks/js/docs/examples/auth/login.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.login('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/js/docs/examples/auth/logout-by-session.md b/app/sdks/js/docs/examples/auth/logout-by-session.md deleted file mode 100644 index ba03feff4a..0000000000 --- a/app/sdks/js/docs/examples/auth/logout-by-session.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.logoutBySession('[ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/auth/logout.md b/app/sdks/js/docs/examples/auth/logout.md deleted file mode 100644 index 90f5ff4b18..0000000000 --- a/app/sdks/js/docs/examples/auth/logout.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.logout(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/auth/oauth-callback.md b/app/sdks/js/docs/examples/auth/oauth-callback.md deleted file mode 100644 index f5412deea6..0000000000 --- a/app/sdks/js/docs/examples/auth/oauth-callback.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - setProject('') -; - -let promise = sdk.auth.oauthCallback('[PROJECT_ID]', 'bitbucket', '[CODE]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/auth/oauth.md b/app/sdks/js/docs/examples/auth/oauth.md deleted file mode 100644 index eeffd40b57..0000000000 --- a/app/sdks/js/docs/examples/auth/oauth.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.oauth('bitbucket', 'https://example.com', '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/js/docs/examples/auth/recovery-reset.md b/app/sdks/js/docs/examples/auth/recovery-reset.md deleted file mode 100644 index 7830eba1d6..0000000000 --- a/app/sdks/js/docs/examples/auth/recovery-reset.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.recoveryReset('[USER_ID]', '[TOKEN]', 'password', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/auth/recovery.md b/app/sdks/js/docs/examples/auth/recovery.md deleted file mode 100644 index a313e192f8..0000000000 --- a/app/sdks/js/docs/examples/auth/recovery.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.recovery('email@example.com', '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/js/docs/examples/auth/register.md b/app/sdks/js/docs/examples/auth/register.md deleted file mode 100644 index c5205f90cd..0000000000 --- a/app/sdks/js/docs/examples/auth/register.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.auth.register('email@example.com', 'password', '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/js/docs/examples/avatars/get-browser.md b/app/sdks/js/docs/examples/avatars/get-browser.md deleted file mode 100644 index 84c992621e..0000000000 --- a/app/sdks/js/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.avatars.getBrowser('aa'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/avatars/get-credit-card.md b/app/sdks/js/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index c9fb87edc7..0000000000 --- a/app/sdks/js/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.avatars.getCreditCard('amex'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/avatars/get-favicon.md b/app/sdks/js/docs/examples/avatars/get-favicon.md deleted file mode 100644 index 5876eb2b5a..0000000000 --- a/app/sdks/js/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.avatars.getFavicon('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/js/docs/examples/avatars/get-flag.md b/app/sdks/js/docs/examples/avatars/get-flag.md deleted file mode 100644 index 694c6b399e..0000000000 --- a/app/sdks/js/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.avatars.getFlag('af'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/avatars/get-image.md b/app/sdks/js/docs/examples/avatars/get-image.md deleted file mode 100644 index b807ff734e..0000000000 --- a/app/sdks/js/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.avatars.getImage('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/js/docs/examples/avatars/get-q-r.md b/app/sdks/js/docs/examples/avatars/get-q-r.md deleted file mode 100644 index e64d83a5c4..0000000000 --- a/app/sdks/js/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.avatars.getQR('[TEXT]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/database/create-collection.md b/app/sdks/js/docs/examples/database/create-collection.md deleted file mode 100644 index a93fe45778..0000000000 --- a/app/sdks/js/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/js/docs/examples/database/create-document.md b/app/sdks/js/docs/examples/database/create-document.md deleted file mode 100644 index aa251ae2b2..0000000000 --- a/app/sdks/js/docs/examples/database/create-document.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.createDocument('[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/js/docs/examples/database/delete-collection.md b/app/sdks/js/docs/examples/database/delete-collection.md deleted file mode 100644 index 1a116c58b9..0000000000 --- a/app/sdks/js/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/js/docs/examples/database/delete-document.md b/app/sdks/js/docs/examples/database/delete-document.md deleted file mode 100644 index 7dd7fc4db4..0000000000 --- a/app/sdks/js/docs/examples/database/delete-document.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/database/get-collection.md b/app/sdks/js/docs/examples/database/get-collection.md deleted file mode 100644 index abe8d482d4..0000000000 --- a/app/sdks/js/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/js/docs/examples/database/get-document.md b/app/sdks/js/docs/examples/database/get-document.md deleted file mode 100644 index 1bcb5b00ac..0000000000 --- a/app/sdks/js/docs/examples/database/get-document.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/database/list-collections.md b/app/sdks/js/docs/examples/database/list-collections.md deleted file mode 100644 index 3160903309..0000000000 --- a/app/sdks/js/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/js/docs/examples/database/list-documents.md b/app/sdks/js/docs/examples/database/list-documents.md deleted file mode 100644 index 68ce8d6c23..0000000000 --- a/app/sdks/js/docs/examples/database/list-documents.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.listDocuments('[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/js/docs/examples/database/update-collection.md b/app/sdks/js/docs/examples/database/update-collection.md deleted file mode 100644 index 726c244c79..0000000000 --- a/app/sdks/js/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/js/docs/examples/database/update-document.md b/app/sdks/js/docs/examples/database/update-document.md deleted file mode 100644 index 7809b97bfd..0000000000 --- a/app/sdks/js/docs/examples/database/update-document.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/locale/get-continents.md b/app/sdks/js/docs/examples/locale/get-continents.md deleted file mode 100644 index a8de63eb91..0000000000 --- a/app/sdks/js/docs/examples/locale/get-continents.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.locale.getContinents(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/locale/get-countries-e-u.md b/app/sdks/js/docs/examples/locale/get-countries-e-u.md deleted file mode 100644 index 44ceffd7e7..0000000000 --- a/app/sdks/js/docs/examples/locale/get-countries-e-u.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.locale.getCountriesEU(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/locale/get-countries-phones.md b/app/sdks/js/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index afd084f5d4..0000000000 --- a/app/sdks/js/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.locale.getCountriesPhones(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/locale/get-countries.md b/app/sdks/js/docs/examples/locale/get-countries.md deleted file mode 100644 index 521195bfaa..0000000000 --- a/app/sdks/js/docs/examples/locale/get-countries.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.locale.getCountries(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/locale/get-currencies.md b/app/sdks/js/docs/examples/locale/get-currencies.md deleted file mode 100644 index 8032307f86..0000000000 --- a/app/sdks/js/docs/examples/locale/get-currencies.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.locale.getCurrencies(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/locale/get-locale.md b/app/sdks/js/docs/examples/locale/get-locale.md deleted file mode 100644 index 4cc5a3f3b2..0000000000 --- a/app/sdks/js/docs/examples/locale/get-locale.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.locale.getLocale(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/projects/create-key.md b/app/sdks/js/docs/examples/projects/create-key.md deleted file mode 100644 index 3c12c8a8c2..0000000000 --- a/app/sdks/js/docs/examples/projects/create-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/create-platform.md b/app/sdks/js/docs/examples/projects/create-platform.md deleted file mode 100644 index b67b84ba56..0000000000 --- a/app/sdks/js/docs/examples/projects/create-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/create-project.md b/app/sdks/js/docs/examples/projects/create-project.md deleted file mode 100644 index a1b6922fed..0000000000 --- a/app/sdks/js/docs/examples/projects/create-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.createProject('[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/js/docs/examples/projects/create-task.md b/app/sdks/js/docs/examples/projects/create-task.md deleted file mode 100644 index 3262b4d9fe..0000000000 --- a/app/sdks/js/docs/examples/projects/create-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/create-webhook.md b/app/sdks/js/docs/examples/projects/create-webhook.md deleted file mode 100644 index 66a76c26c2..0000000000 --- a/app/sdks/js/docs/examples/projects/create-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/delete-key.md b/app/sdks/js/docs/examples/projects/delete-key.md deleted file mode 100644 index e5ae8e426c..0000000000 --- a/app/sdks/js/docs/examples/projects/delete-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/delete-platform.md b/app/sdks/js/docs/examples/projects/delete-platform.md deleted file mode 100644 index 450f9cd0a6..0000000000 --- a/app/sdks/js/docs/examples/projects/delete-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/delete-project.md b/app/sdks/js/docs/examples/projects/delete-project.md deleted file mode 100644 index b60d4de3c9..0000000000 --- a/app/sdks/js/docs/examples/projects/delete-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.deleteProject('[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/js/docs/examples/projects/delete-task.md b/app/sdks/js/docs/examples/projects/delete-task.md deleted file mode 100644 index 3208d38bf8..0000000000 --- a/app/sdks/js/docs/examples/projects/delete-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/delete-webhook.md b/app/sdks/js/docs/examples/projects/delete-webhook.md deleted file mode 100644 index 030a3b77f1..0000000000 --- a/app/sdks/js/docs/examples/projects/delete-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/get-key.md b/app/sdks/js/docs/examples/projects/get-key.md deleted file mode 100644 index 7207b33bf7..0000000000 --- a/app/sdks/js/docs/examples/projects/get-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/get-platform.md b/app/sdks/js/docs/examples/projects/get-platform.md deleted file mode 100644 index 6f353f3aca..0000000000 --- a/app/sdks/js/docs/examples/projects/get-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/get-project-usage.md b/app/sdks/js/docs/examples/projects/get-project-usage.md deleted file mode 100644 index 87a2e3148a..0000000000 --- a/app/sdks/js/docs/examples/projects/get-project-usage.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.getProjectUsage('[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/js/docs/examples/projects/get-project.md b/app/sdks/js/docs/examples/projects/get-project.md deleted file mode 100644 index 084e48c253..0000000000 --- a/app/sdks/js/docs/examples/projects/get-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.getProject('[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/js/docs/examples/projects/get-task.md b/app/sdks/js/docs/examples/projects/get-task.md deleted file mode 100644 index e5195bce8c..0000000000 --- a/app/sdks/js/docs/examples/projects/get-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/get-webhook.md b/app/sdks/js/docs/examples/projects/get-webhook.md deleted file mode 100644 index a2b6089c3e..0000000000 --- a/app/sdks/js/docs/examples/projects/get-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/list-keys.md b/app/sdks/js/docs/examples/projects/list-keys.md deleted file mode 100644 index 14ef64fb6f..0000000000 --- a/app/sdks/js/docs/examples/projects/list-keys.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/list-platforms.md b/app/sdks/js/docs/examples/projects/list-platforms.md deleted file mode 100644 index 7cfd9341a7..0000000000 --- a/app/sdks/js/docs/examples/projects/list-platforms.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/list-projects.md b/app/sdks/js/docs/examples/projects/list-projects.md deleted file mode 100644 index 3ba3afc41e..0000000000 --- a/app/sdks/js/docs/examples/projects/list-projects.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.listProjects(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/projects/list-tasks.md b/app/sdks/js/docs/examples/projects/list-tasks.md deleted file mode 100644 index fd8ab61ffa..0000000000 --- a/app/sdks/js/docs/examples/projects/list-tasks.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/list-webhooks.md b/app/sdks/js/docs/examples/projects/list-webhooks.md deleted file mode 100644 index b19851c8b1..0000000000 --- a/app/sdks/js/docs/examples/projects/list-webhooks.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/update-key.md b/app/sdks/js/docs/examples/projects/update-key.md deleted file mode 100644 index 063f4daea4..0000000000 --- a/app/sdks/js/docs/examples/projects/update-key.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/update-platform.md b/app/sdks/js/docs/examples/projects/update-platform.md deleted file mode 100644 index e28846f050..0000000000 --- a/app/sdks/js/docs/examples/projects/update-platform.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/update-project-o-auth.md b/app/sdks/js/docs/examples/projects/update-project-o-auth.md deleted file mode 100644 index 9ab78a4ea9..0000000000 --- a/app/sdks/js/docs/examples/projects/update-project-o-auth.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.updateProjectOAuth('[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/js/docs/examples/projects/update-project.md b/app/sdks/js/docs/examples/projects/update-project.md deleted file mode 100644 index 6fcaa49f37..0000000000 --- a/app/sdks/js/docs/examples/projects/update-project.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.projects.updateProject('[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/js/docs/examples/projects/update-task.md b/app/sdks/js/docs/examples/projects/update-task.md deleted file mode 100644 index 54116a41d0..0000000000 --- a/app/sdks/js/docs/examples/projects/update-task.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/projects/update-webhook.md b/app/sdks/js/docs/examples/projects/update-webhook.md deleted file mode 100644 index ce876d5a64..0000000000 --- a/app/sdks/js/docs/examples/projects/update-webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -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/js/docs/examples/storage/create-file.md b/app/sdks/js/docs/examples/storage/create-file.md deleted file mode 100644 index 53157d19a3..0000000000 --- a/app/sdks/js/docs/examples/storage/create-file.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.createFile(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/js/docs/examples/storage/delete-file.md b/app/sdks/js/docs/examples/storage/delete-file.md deleted file mode 100644 index 4e39bd9811..0000000000 --- a/app/sdks/js/docs/examples/storage/delete-file.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.deleteFile('[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/js/docs/examples/storage/get-file-download.md b/app/sdks/js/docs/examples/storage/get-file-download.md deleted file mode 100644 index a53142184c..0000000000 --- a/app/sdks/js/docs/examples/storage/get-file-download.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getFileDownload('[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/js/docs/examples/storage/get-file-preview.md b/app/sdks/js/docs/examples/storage/get-file-preview.md deleted file mode 100644 index 1cce3acd24..0000000000 --- a/app/sdks/js/docs/examples/storage/get-file-preview.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getFilePreview('[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/js/docs/examples/storage/get-file-view.md b/app/sdks/js/docs/examples/storage/get-file-view.md deleted file mode 100644 index 4844b22ce3..0000000000 --- a/app/sdks/js/docs/examples/storage/get-file-view.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getFileView('[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/js/docs/examples/storage/get-file.md b/app/sdks/js/docs/examples/storage/get-file.md deleted file mode 100644 index 32b11a2175..0000000000 --- a/app/sdks/js/docs/examples/storage/get-file.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.getFile('[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/js/docs/examples/storage/list-files.md b/app/sdks/js/docs/examples/storage/list-files.md deleted file mode 100644 index 0033bb254d..0000000000 --- a/app/sdks/js/docs/examples/storage/list-files.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.listFiles(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/storage/update-file.md b/app/sdks/js/docs/examples/storage/update-file.md deleted file mode 100644 index 72d6ee3166..0000000000 --- a/app/sdks/js/docs/examples/storage/update-file.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.storage.updateFile('[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/js/docs/examples/teams/create-team-membership-resend.md b/app/sdks/js/docs/examples/teams/create-team-membership-resend.md deleted file mode 100644 index 03ac8240a9..0000000000 --- a/app/sdks/js/docs/examples/teams/create-team-membership-resend.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.createTeamMembershipResend('[TEAM_ID]', '[INVITE_ID]', '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/js/docs/examples/teams/create-team-membership.md b/app/sdks/js/docs/examples/teams/create-team-membership.md deleted file mode 100644 index 60f996c209..0000000000 --- a/app/sdks/js/docs/examples/teams/create-team-membership.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.createTeamMembership('[TEAM_ID]', 'email@example.com', [], '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/js/docs/examples/teams/create-team.md b/app/sdks/js/docs/examples/teams/create-team.md deleted file mode 100644 index 2dafeac2ab..0000000000 --- a/app/sdks/js/docs/examples/teams/create-team.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.createTeam('[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/teams/delete-team-membership.md b/app/sdks/js/docs/examples/teams/delete-team-membership.md deleted file mode 100644 index 551dfd7dbb..0000000000 --- a/app/sdks/js/docs/examples/teams/delete-team-membership.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.deleteTeamMembership('[TEAM_ID]', '[INVITE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/teams/delete-team.md b/app/sdks/js/docs/examples/teams/delete-team.md deleted file mode 100644 index 3f9cd8b6f5..0000000000 --- a/app/sdks/js/docs/examples/teams/delete-team.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.deleteTeam('[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/js/docs/examples/teams/get-team-members.md b/app/sdks/js/docs/examples/teams/get-team-members.md deleted file mode 100644 index f1ba5d9f4a..0000000000 --- a/app/sdks/js/docs/examples/teams/get-team-members.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.getTeamMembers('[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/js/docs/examples/teams/get-team.md b/app/sdks/js/docs/examples/teams/get-team.md deleted file mode 100644 index 7e1f8254fe..0000000000 --- a/app/sdks/js/docs/examples/teams/get-team.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.getTeam('[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/js/docs/examples/teams/list-teams.md b/app/sdks/js/docs/examples/teams/list-teams.md deleted file mode 100644 index abd4fa420b..0000000000 --- a/app/sdks/js/docs/examples/teams/list-teams.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.listTeams(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/teams/update-team-membership-status.md b/app/sdks/js/docs/examples/teams/update-team-membership-status.md deleted file mode 100644 index 15eb72524b..0000000000 --- a/app/sdks/js/docs/examples/teams/update-team-membership-status.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.updateTeamMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/teams/update-team.md b/app/sdks/js/docs/examples/teams/update-team.md deleted file mode 100644 index 2ec35ec906..0000000000 --- a/app/sdks/js/docs/examples/teams/update-team.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.teams.updateTeam('[TEAM_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/js/docs/examples/users/create-user.md b/app/sdks/js/docs/examples/users/create-user.md deleted file mode 100644 index 1242fe70c2..0000000000 --- a/app/sdks/js/docs/examples/users/create-user.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.createUser('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/js/docs/examples/users/delete-user-session.md b/app/sdks/js/docs/examples/users/delete-user-session.md deleted file mode 100644 index 4b5df53439..0000000000 --- a/app/sdks/js/docs/examples/users/delete-user-session.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.deleteUserSession('[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/js/docs/examples/users/delete-user-sessions.md b/app/sdks/js/docs/examples/users/delete-user-sessions.md deleted file mode 100644 index 1a6851ce15..0000000000 --- a/app/sdks/js/docs/examples/users/delete-user-sessions.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.deleteUserSessions('[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/js/docs/examples/users/delete-users-session.md b/app/sdks/js/docs/examples/users/delete-users-session.md deleted file mode 100644 index 5eac7e2236..0000000000 --- a/app/sdks/js/docs/examples/users/delete-users-session.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.deleteUsersSession('[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/js/docs/examples/users/get-user-logs.md b/app/sdks/js/docs/examples/users/get-user-logs.md deleted file mode 100644 index 85175b0e1e..0000000000 --- a/app/sdks/js/docs/examples/users/get-user-logs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUserLogs('[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/js/docs/examples/users/get-user-prefs.md b/app/sdks/js/docs/examples/users/get-user-prefs.md deleted file mode 100644 index 0d9c8dbb22..0000000000 --- a/app/sdks/js/docs/examples/users/get-user-prefs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUserPrefs('[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/js/docs/examples/users/get-user-sessions.md b/app/sdks/js/docs/examples/users/get-user-sessions.md deleted file mode 100644 index 8cc7b1f85b..0000000000 --- a/app/sdks/js/docs/examples/users/get-user-sessions.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUserSessions('[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/js/docs/examples/users/get-user.md b/app/sdks/js/docs/examples/users/get-user.md deleted file mode 100644 index feb40dff2d..0000000000 --- a/app/sdks/js/docs/examples/users/get-user.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.getUser('[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/js/docs/examples/users/list-users.md b/app/sdks/js/docs/examples/users/list-users.md deleted file mode 100644 index 561826cbd1..0000000000 --- a/app/sdks/js/docs/examples/users/list-users.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.listUsers(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/js/docs/examples/users/update-user-prefs.md b/app/sdks/js/docs/examples/users/update-user-prefs.md deleted file mode 100644 index 54208f5f96..0000000000 --- a/app/sdks/js/docs/examples/users/update-user-prefs.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.updateUserPrefs('[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/js/docs/examples/users/update-user-status.md b/app/sdks/js/docs/examples/users/update-user-status.md deleted file mode 100644 index 15b7376ca7..0000000000 --- a/app/sdks/js/docs/examples/users/update-user-status.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('') -; - -let promise = sdk.users.updateUserStatus('[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/js/package.json b/app/sdks/js/package.json deleted file mode 100644 index 0c3d5e7b03..0000000000 --- a/app/sdks/js/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "appwrite", - "homepage": "https://appwrite.io/support", - "description": "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)", - "version": "1.0.28", - "license": "BSD-3-Clause", - "main": "src/sdk.js", - "repository": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-js.git" - }, - "devDependencies": {}, - "dependencies": {} -} \ No newline at end of file diff --git a/app/sdks/js/src/sdk.js b/app/sdks/js/src/sdk.js deleted file mode 100644 index b64f08c92b..0000000000 --- a/app/sdks/js/src/sdk.js +++ /dev/null @@ -1,3929 +0,0 @@ -(function (window) { - - 'use strict'; - - window.Appwrite = function () { - - let config = { - endpoint: 'https://appwrite.io/v1', - project: '', - key: '', - locale: '', - mode: '', - }; - - /** - * @param {string} endpoint - * @returns {this} - */ - let setEndpoint = function(endpoint) { - config.endpoint = endpoint; - - return this; - }; - - /** - * Set Project - * - * Your Appwrite project ID - * - * @param value string - * - * @return this - */ - let setProject = function (value) - { - http.addGlobalHeader('X-Appwrite-Project', value); - - config.project = value; - - return this; - }; - - /** - * Set Key - * - * Your Appwrite project secret key - * - * @param value string - * - * @return this - */ - let setKey = function (value) - { - http.addGlobalHeader('X-Appwrite-Key', value); - - config.key = value; - - return this; - }; - - /** - * Set Locale - * - * @param value string - * - * @return this - */ - let setLocale = function (value) - { - http.addGlobalHeader('X-Appwrite-Locale', value); - - config.locale = value; - - return this; - }; - - /** - * Set Mode - * - * @param value string - * - * @return this - */ - let setMode = function (value) - { - http.addGlobalHeader('X-Appwrite-Mode', value); - - config.mode = value; - - return this; - }; - - let http = function(document) { - let globalParams = [], - globalHeaders = []; - - let addParam = function (url, param, value) { - let a = document.createElement('a'), regex = /(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g; - let match, str = []; - a.href = url; - param = encodeURIComponent(param); - - while (match = regex.exec(a.search)) if (param !== match[1]) str.push(match[1] + (match[2] ? "=" + match[2] : "")); - - str.push(param + (value ? "=" + encodeURIComponent(value) : "")); - - a.search = str.join("&"); - - return a.href; - }; - - /** - * @param {Object} params - * @returns {string} - */ - let buildQuery = function(params) { - let str = []; - - for (let p in params) { - if(Array.isArray(params[p])) { - for (let index = 0; index < params[p].length; index++) { - let param = params[p][index]; - str.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(params[p])); - } - } - - return str.join("&"); - }; - - let addGlobalHeader = function(key, value) { - globalHeaders[key] = {key: key.toLowerCase(), value: value.toLowerCase()}; - }; - - let addGlobalParam = function(key, value) { - globalParams.push({key: key, value: value}); - }; - - addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.28'); - addGlobalHeader('content-type', ''); - - /** - * @param {string} method - * @param {string} path string - * @param {Object} headers - * @param {Object} params - * @param {function} progress - * @returns {Promise} - */ - let call = function (method, path, headers = {}, params = {}, progress = null) { - let i; - - path = config.endpoint + path; - - if (-1 === ['GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'HEAD', 'OPTIONS', 'CONNECT', 'PATCH'].indexOf(method)) { - throw new Error('var method must contain a valid HTTP method name'); - } - - if (typeof path !== 'string') { - throw new Error('var path must be of type string'); - } - - if (typeof headers !== 'object') { - throw new Error('var headers must be of type object'); - } - - for (i = 0; i < globalParams.length; i++) { // Add global params to URL - path = addParam(path, globalParams[i].key, globalParams[i].value); - } - - for (let key in globalHeaders) { // Add Global Headers - if (globalHeaders.hasOwnProperty(key)) { - if (!headers[globalHeaders[key].key]) { - headers[globalHeaders[key].key] = globalHeaders[key].value; - } - } - } - - if(method === 'GET') { - for (let param in params) { - if (param.hasOwnProperty(key)) { - path = addParam(path, key + (Array.isArray(param) ? '[]' : ''), params[key]); - } - } - } - - switch (headers['content-type']) { // Parse request by content type - case 'application/json': - params = JSON.stringify(params); - break; - - case 'multipart/form-data': - let formData = new FormData(); - - Object.keys(params).forEach(function(key) { - let param = params[key]; - formData.append(key + (Array.isArray(param) ? '[]' : ''), param); - }); - - params = formData; - break; - } - - return new Promise(function (resolve, reject) { - - let request = new XMLHttpRequest(), key; - - request.withCredentials = true; - request.open(method, path, true); - - for (key in headers) { // Set Headers - if (headers.hasOwnProperty(key)) { - if (key === 'content-type' && headers[key] === 'multipart/form-data') { // Skip to avoid missing boundary - continue; - } - - request.setRequestHeader(key, headers[key]); - } - } - - request.onload = function () { - if (4 === request.readyState && 399 >= request.status) { - let data = request.response; - let contentType = this.getResponseHeader('content-type') || ''; - contentType = contentType.substring(0, contentType.indexOf(';')); - - switch (contentType) { - case 'application/json': - data = JSON.parse(data); - break; - } - - resolve(data); - - } else { - reject(new Error(request.statusText)); - } - }; - - if (progress) { - request.addEventListener('progress', progress); - request.upload.addEventListener('progress', progress, false); - } - - // Handle network errors - request.onerror = function () { - reject(new Error("Network Error")); - }; - - request.send(params); - }) - }; - - return { - 'get': function(path, headers = {}, params = {}) { - return call('GET', path + ((Object.keys(params).length > 0) ? '?' + buildQuery(params) : ''), headers, {}); - }, - 'post': function(path, headers = {}, params = {}, progress = null) { - return call('POST', path, headers, params, progress); - }, - 'put': function(path, headers = {}, params = {}, progress = null) { - return call('PUT', path, headers, params, progress); - }, - 'patch': function(path, headers = {}, params = {}, progress = null) { - return call('PATCH', path, headers, params, progress); - }, - 'delete': function(path, headers = {}, params = {}, progress = null) { - return call('DELETE', path, headers, params, progress); - }, - 'addGlobalParam': addGlobalParam, - 'addGlobalHeader': addGlobalHeader - } - }(window.document); - - let iframe = function(method, url, params) { - let form = document.createElement('form'); - - form.setAttribute('method', method); - form.setAttribute('action', config.endpoint + url); - - for(let key in params) { - if(params.hasOwnProperty(key)) { - let hiddenField = document.createElement("input"); - hiddenField.setAttribute("type", "hidden"); - hiddenField.setAttribute("name", key); - hiddenField.setAttribute("value", params[key]); - - form.appendChild(hiddenField); - } - } - - document.body.appendChild(form); - - return form.submit(); - }; - - let account = { - - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/account'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws {Error} - * @return {Promise} - */ - delete: function() { - let path = '/account'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - updateEmail: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/email'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateName: function(name) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/account/name'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param {string} password - * @param {string} oldPassword - * @throws {Error} - * @return {Promise} - */ - updatePassword: function(password, oldPassword) { - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(oldPassword === undefined) { - throw new Error('Missing required parameter: "oldPassword"'); - } - - let path = '/account/password'; - - let payload = {}; - - if(password) { - payload['password'] = password; - } - - if(oldPassword) { - payload['old-password'] = oldPassword; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Preferences - * - * Get currently logged in user preferences key-value object. - * - * @throws {Error} - * @return {Promise} - */ - getPrefs: function() { - let path = '/account/prefs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Prefs - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param {string} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs: function(prefs) { - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/account/prefs'; - - let payload = {}; - - if(prefs) { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Security Log - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws {Error} - * @return {Promise} - */ - getSecurity: function() { - let path = '/account/security'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Active Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws {Error} - * @return {Promise} - */ - getSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let auth = { - - /** - * Login - * - * 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 notice 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. - * - * @param {string} email - * @param {string} password - * @param {string} success - * @param {string} failure - * @throws {Error} - * @return {null} - */ - login: function(email, password, success = '', failure = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/auth/login'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - payload['project'] = config.project; - - return iframe('post', path, payload); - }, - - /** - * Login with OAuth - * - * 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 - * back to your app when login is completed. - * - * @param {string} provider - * @param {string} success - * @param {string} failure - * @throws {Error} - * @return {null} - */ - oauth: 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 = '/auth/login/oauth/{provider}'.replace(new RegExp('{provider}', 'g'), provider); - - let payload = {}; - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - payload['project'] = config.project; - - return iframe('get', path, payload); - }, - - /** - * Logout Current 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} - */ - logout: function() { - let path = '/auth/logout'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Logout Specific Session - * - * 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. - * - * @param {string} id - * @throws {Error} - * @return {Promise} - */ - logoutBySession: function(id) { - if(id === undefined) { - throw new Error('Missing required parameter: "id"'); - } - - let path = '/auth/logout/{id}'.replace(new RegExp('{id}', 'g'), id); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Password Recovery - * - * Sends the user an email with a temporary secret token for password reset. - * When the user clicks the confirmation link he is redirected back to your - * app password reset redirect URL with a secret token 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. - * - * @param {string} email - * @param {string} reset - * @throws {Error} - * @return {Promise} - */ - recovery: function(email, reset) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(reset === undefined) { - throw new Error('Missing required parameter: "reset"'); - } - - let path = '/auth/recovery'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(reset) { - payload['reset'] = reset; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Password Reset - * - * Use this endpoint to complete the user account password reset. Both the - * **userId** and **token** arguments will be passed as query parameters to - * the redirect URL you have provided when sending your request to the - * /auth/recovery endpoint. - * - * Please notice 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} userId - * @param {string} token - * @param {string} passwordA - * @param {string} passwordB - * @throws {Error} - * @return {Promise} - */ - recoveryReset: function(userId, token, passwordA, passwordB) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(token === undefined) { - throw new Error('Missing required parameter: "token"'); - } - - if(passwordA === undefined) { - throw new Error('Missing required parameter: "passwordA"'); - } - - if(passwordB === undefined) { - throw new Error('Missing required parameter: "passwordB"'); - } - - let path = '/auth/recovery/reset'; - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(token) { - payload['token'] = token; - } - - if(passwordA) { - payload['password-a'] = passwordA; - } - - if(passwordB) { - payload['password-b'] = passwordB; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Register - * - * 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 notice 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. - * - * @param {string} email - * @param {string} password - * @param {string} confirm - * @param {string} success - * @param {string} failure - * @param {string} name - * @throws {Error} - * @return {null} - */ - register: function(email, password, confirm, success = '', failure = '', name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(confirm === undefined) { - throw new Error('Missing required parameter: "confirm"'); - } - - let path = '/auth/register'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(confirm) { - payload['confirm'] = confirm; - } - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - if(name) { - payload['name'] = name; - } - - payload['project'] = config.project; - - return iframe('post', path, payload); - }, - - /** - * Confirmation - * - * Use this endpoint to complete the confirmation of the user account email - * address. Both the **userId** and **token** arguments will be passed as - * query parameters to the redirect URL you have provided when sending your - * request to the /auth/register endpoint. - * - * @param {string} userId - * @param {string} token - * @throws {Error} - * @return {Promise} - */ - confirm: function(userId, token) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(token === undefined) { - throw new Error('Missing required parameter: "token"'); - } - - let path = '/auth/register/confirm'; - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(token) { - payload['token'] = token; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Resend Confirmation - * - * This endpoint allows the user to request your app to resend him his email - * confirmation message. The redirect arguments act the same way as in - * /auth/register endpoint. - * - * Please notice 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} confirm - * @throws {Error} - * @return {Promise} - */ - confirmResend: function(confirm) { - if(confirm === undefined) { - throw new Error('Missing required parameter: "confirm"'); - } - - let path = '/auth/register/confirm/resend'; - - let payload = {}; - - if(confirm) { - payload['confirm'] = confirm; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let avatars = { - - /** - * Get Browser Icon - * - * You can use this endpoint to show different browser icons to your users. - * The code argument receives the browser code as it appears in your user - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {Promise} - */ - 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; - } - - if(quality) { - payload['quality'] = quality; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? The credit card endpoint will return you the icon of the credit - * card provider you need. Use width, height and quality arguments to change - * the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {Promise} - */ - getCreditCard: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - getFavicon: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/favicon'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Country Flag - * - * You can use this endpoint to show different country flags icons to your - * users. The code argument receives the 2 letter country code. Use width, - * height and quality arguments to change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {Promise} - */ - getFlag: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Image from URL - * - * Use this endpoint to fetch a remote image URL and crop it to any image size - * you want. This endpoint is very useful if you need to crop and display - * remote images in your app or in case you want to make sure a 3rd party - * image is properly served using a TLS protocol. - * - * @param {string} url - * @param {number} width - * @param {number} height - * @throws {Error} - * @return {Promise} - */ - getImage: function(url, width = 400, height = 400) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/image'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get QR Code - * - * Converts a given plain text to a QR code image. You can use the query - * parameters to change the size and style of the resulting image. - * - * @param {string} text - * @param {number} size - * @param {number} margin - * @param {number} download - * @throws {Error} - * @return {Promise} - */ - getQR: function(text, size = 400, margin = 1, download = 0) { - if(text === undefined) { - throw new Error('Missing required parameter: "text"'); - } - - 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 = { - - /** - * 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'; - - 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'; - - 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/{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/{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/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Documents - * - * 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 - * modes](/docs/admin). - * - * @param {string} collectionId - * @param {array} filters - * @param {number} offset - * @param {number} limit - * @param {string} orderField - * @param {string} orderType - * @param {string} orderCast - * @param {string} search - * @param {number} first - * @param {number} last - * @throws {Error} - * @return {Promise} - */ - 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/{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; - } - - if(orderField) { - payload['order-field'] = orderField; - } - - if(orderType) { - payload['order-type'] = orderType; - } - - if(orderCast) { - payload['order-cast'] = orderCast; - } - - if(search) { - payload['search'] = search; - } - - if(first) { - payload['first'] = first; - } - - if(last) { - payload['last'] = last; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Document - * - * Create a new Document. - * - * @param {string} collectionId - * @param {string} data - * @param {array} read - * @param {array} write - * @param {string} parentDocument - * @param {string} parentProperty - * @param {string} parentPropertyType - * @throws {Error} - * @return {Promise} - */ - createDocument: function(collectionId, data, read, write, parentDocument = '', parentProperty = '', parentPropertyType = 'assign') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(data) { - payload['data'] = data; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(parentDocument) { - payload['parentDocument'] = parentDocument; - } - - if(parentProperty) { - payload['parentProperty'] = parentProperty; - } - - if(parentPropertyType) { - payload['parentPropertyType'] = parentPropertyType; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - getDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Document - * - * - * @param {string} collectionId - * @param {string} documentId - * @param {string} data - * @param {array} read - * @param {array} write - * @throws {Error} - * @return {Promise} - */ - updateDocument: function(collectionId, documentId, data, read, write) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - if(data) { - payload['data'] = data; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - deleteDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let locale = { - - /** - * Get User Locale - * - * Get the current user location based on IP. Returns an object with user - * country code, country name, continent name, continent code, ip address and - * suggested currency. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getLocale: function() { - let path = '/locale'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getContinents: function() { - let path = '/locale/continents'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountries: function() { - let path = '/locale/countries'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List EU Countries - * - * List of all countries that are currently members of the EU. You can use the - * locale header to get the data in a supported language. UK brexit date is - * currently set to 2019-10-31 and will be updated if and when needed. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesEU: function() { - let path = '/locale/countries/eu'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesPhones: function() { - let path = '/locale/countries/phones'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Currencies - * - * List of all currencies, including currency symol, name, plural, and decimal - * digits for all major and minor currencies. You can use the locale header to - * get the data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCurrencies: function() { - let path = '/locale/currencies'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let projects = { - - /** - * List Projects - * - * - * @throws {Error} - * @return {Promise} - */ - listProjects: function() { - let path = '/projects'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Project - * - * - * @param {string} name - * @param {string} teamId - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - createProject: function(name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/projects'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(teamId) { - payload['teamId'] = teamId; - } - - if(description) { - payload['description'] = description; - } - - if(logo) { - payload['logo'] = logo; - } - - if(url) { - payload['url'] = url; - } - - if(legalName) { - payload['legalName'] = legalName; - } - - if(legalCountry) { - payload['legalCountry'] = legalCountry; - } - - if(legalState) { - payload['legalState'] = legalState; - } - - if(legalCity) { - payload['legalCity'] = legalCity; - } - - if(legalAddress) { - payload['legalAddress'] = legalAddress; - } - - if(legalTaxId) { - payload['legalTaxId'] = legalTaxId; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - getProject: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project - * - * - * @param {string} projectId - * @param {string} name - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - updateProject: function(projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(description) { - payload['description'] = description; - } - - if(logo) { - payload['logo'] = logo; - } - - if(url) { - payload['url'] = url; - } - - if(legalName) { - payload['legalName'] = legalName; - } - - if(legalCountry) { - payload['legalCountry'] = legalCountry; - } - - if(legalState) { - payload['legalState'] = legalState; - } - - if(legalCity) { - payload['legalCity'] = legalCity; - } - - if(legalAddress) { - payload['legalAddress'] = legalAddress; - } - - if(legalTaxId) { - payload['legalTaxId'] = legalTaxId; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - deleteProject: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Keys - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listKeys: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Key - * - * - * @param {string} projectId - * @param {string} name - * @param {array} scopes - * @throws {Error} - * @return {Promise} - */ - createKey: function(projectId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - getKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Key - * - * - * @param {string} projectId - * @param {string} keyId - * @param {string} name - * @param {array} scopes - * @throws {Error} - * @return {Promise} - */ - updateKey: function(projectId, keyId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - deleteKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project OAuth - * - * - * @param {string} projectId - * @param {string} provider - * @param {string} appId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateProjectOAuth: function(projectId, provider, appId = '', secret = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/projects/{projectId}/oauth'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(provider) { - payload['provider'] = provider; - } - - if(appId) { - payload['appId'] = appId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Platforms - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listPlatforms: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Platform - * - * - * @param {string} projectId - * @param {string} type - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createPlatform: function(projectId, type, name, key = '', store = '', url = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(type === undefined) { - throw new Error('Missing required parameter: "type"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(type) { - payload['type'] = type; - } - - if(name) { - payload['name'] = name; - } - - if(key) { - payload['key'] = key; - } - - if(store) { - payload['store'] = store; - } - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - getPlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - updatePlatform: function(projectId, platformId, name, key = '', store = '', url = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(key) { - payload['key'] = key; - } - - if(store) { - payload['store'] = store; - } - - if(url) { - payload['url'] = url; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - deletePlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Tasks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listTasks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Task - * - * - * @param {string} projectId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {number} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {array} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createTask: function(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(status) { - payload['status'] = status; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(security) { - payload['security'] = security; - } - - if(httpMethod) { - payload['httpMethod'] = httpMethod; - } - - if(httpUrl) { - payload['httpUrl'] = httpUrl; - } - - if(httpHeaders) { - payload['httpHeaders'] = httpHeaders; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - getTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Task - * - * - * @param {string} projectId - * @param {string} taskId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {number} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {array} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateTask: function(projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(status) { - payload['status'] = status; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(security) { - payload['security'] = security; - } - - if(httpMethod) { - payload['httpMethod'] = httpMethod; - } - - if(httpUrl) { - payload['httpUrl'] = httpUrl; - } - - if(httpHeaders) { - payload['httpHeaders'] = httpHeaders; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - deleteTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - getProjectUsage: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Webhooks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listWebhooks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Webhook - * - * - * @param {string} projectId - * @param {string} name - * @param {array} events - * @param {string} url - * @param {number} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createWebhook: function(projectId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(events) { - payload['events'] = events; - } - - if(url) { - payload['url'] = url; - } - - if(security) { - payload['security'] = security; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - getWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @param {string} name - * @param {array} events - * @param {string} url - * @param {number} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateWebhook: function(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(events) { - payload['events'] = events; - } - - if(url) { - payload['url'] = url; - } - - if(security) { - payload['security'] = security; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - deleteWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let storage = { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listFiles: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/storage/files'; - - 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 File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param {File} files - * @param {array} read - * @param {array} write - * @throws {Error} - * @return {Promise} - */ - createFile: function(files, read, write) { - if(files === undefined) { - throw new Error('Missing required parameter: "files"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files'; - - let payload = {}; - - if(files) { - payload['files'] = files; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .post(path, { - 'content-type': 'multipart/form-data', - }, payload); - }, - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param {string} fileId - * @param {array} read - * @param {array} write - * @throws {Error} - * @return {Promise} - */ - updateFile: function(fileId, read, write) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - deleteFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get File for Download - * - * Get file content by its unique ID. The endpoint response return with a - * 'Content-Disposition: attachment' header that tells the browser to start - * downloading the file to user downloads directory. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFileDownload: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get File Preview - * - * Get file preview image. Currently, this method supports preview for image - * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, - * and spreadsheets will return file icon image. You can also pass query - * string arguments for cutting and resizing your preview image. - * - * @param {string} fileId - * @param {number} width - * @param {number} height - * @param {number} quality - * @param {string} background - * @param {string} output - * @throws {Error} - * @return {Promise} - */ - getFilePreview: function(fileId, width = 0, height = 0, quality = 100, background = '', output = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - if(background) { - payload['background'] = background; - } - - if(output) { - payload['output'] = output; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param {string} fileId - * @param {string} as - * @throws {Error} - * @return {Promise} - */ - getFileView: function(fileId, as = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(as) { - payload['as'] = as; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let teams = { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listTeams: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/teams'; - - 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 Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param {string} name - * @param {array} roles - * @throws {Error} - * @return {Promise} - */ - createTeam: function(name, roles = ["owner"]) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(roles) { - payload['roles'] = roles; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - getTeam: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateTeam: function(teamId, name) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - deleteTeam: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team Members - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - getTeamMembers: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}/members'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * 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 the redirect parameter to redirect the user from the invitation email - * back to your app. When the user is redirected, use the - * /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the - * user to the team. - * - * Please notice 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. - * - * @param {string} teamId - * @param {string} email - * @param {array} roles - * @param {string} redirect - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createTeamMembership: function(teamId, email, roles, redirect, name = '') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(roles === undefined) { - throw new Error('Missing required parameter: "roles"'); - } - - if(redirect === undefined) { - throw new Error('Missing required parameter: "redirect"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(name) { - payload['name'] = name; - } - - if(roles) { - payload['roles'] = roles; - } - - if(redirect) { - payload['redirect'] = redirect; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team Membership - * - * This endpoint allows a user to leave a team or for a team owner to delete - * the membership of any other team member. - * - * @param {string} teamId - * @param {string} inviteId - * @throws {Error} - * @return {Promise} - */ - deleteTeamMembership: function(teamId, inviteId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team Membership (Resend) - * - * Use this endpoint to resend your invitation email for a user to join a - * team. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} redirect - * @throws {Error} - * @return {Promise} - */ - createTeamMembershipResend: function(teamId, inviteId, redirect) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - if(redirect === undefined) { - throw new Error('Missing required parameter: "redirect"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - if(redirect) { - payload['redirect'] = redirect; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * 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 notice 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 token. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} userId - * @param {string} secret - * @param {string} success - * @param {string} failure - * @throws {Error} - * @return {null} - */ - updateTeamMembershipStatus: function(teamId, inviteId, userId, secret, success = '', failure = '') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - payload['project'] = config.project; - - return iframe('patch', path, payload); - } - }; - - let users = { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listUsers: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/users'; - - 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 User - * - * Create a new user. - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createUser: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/users'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(name) { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User - * - * Get user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUser: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUserLogs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Prefs - * - * Get user preferences by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUserPrefs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Prefs - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param {string} userId - * @param {string} prefs - * @throws {Error} - * @return {Promise} - */ - updateUserPrefs: function(userId, prefs) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(prefs) { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getUserSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteUserSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param {string} userId - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteUserSession: function(userId, sessionId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); - } - - let path = '/users/{userId}/sessions/:session'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(sessionId) { - payload['sessionId'] = sessionId; - } - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param {string} userId - * @param {string} status - * @throws {Error} - * @return {Promise} - */ - updateUserStatus: function(userId, status) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(status) { - payload['status'] = status; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - return { - setEndpoint: setEndpoint, - setProject: setProject, - setKey: setKey, - setLocale: setLocale, - setMode: setMode, - account: account, - auth: auth, - avatars: avatars, - database: database, - locale: locale, - projects: projects, - storage: storage, - teams: teams, - users: users - }; - }; - - if(typeof module !== "undefined") { - module.exports = window.Appwrite; - } - -})((typeof window !== "undefined") ? window : {}); \ No newline at end of file diff --git a/app/sdks/js/src/sdk.min.js b/app/sdks/js/src/sdk.min.js deleted file mode 100644 index f921d5801a..0000000000 --- a/app/sdks/js/src/sdk.min.js +++ /dev/null @@ -1,361 +0,0 @@ -(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} -resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} -request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField)}} -document.body.appendChild(form);return form.submit()};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload)},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account/email';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -return http.patch(path,{'content-type':'application/json',},payload)},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/account/name';let payload={};if(name){payload.name=name} -return http.patch(path,{'content-type':'application/json',},payload)},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"')} -let path='/account/password';let payload={};if(password){payload.password=password} -if(oldPassword){payload['old-password']=oldPassword} -return http.patch(path,{'content-type':'application/json',},payload)},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')} -let path='/account/prefs';let payload={};if(prefs){payload.prefs=prefs} -return http.patch(path,{'content-type':'application/json',},payload)},getSecurity:function(){let path='/account/security';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let auth={login:function(email,password,success='',failure=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/auth/login';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -if(success){payload.success=success} -if(failure){payload.failure=failure} -payload.project=config.project;return iframe('post',path,payload)},oauth: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='/auth/login/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success} -if(failure){payload.failure=failure} -payload.project=config.project;return iframe('get',path,payload)},logout:function(){let path='/auth/logout';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')} -let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(reset===undefined){throw new Error('Missing required parameter: "reset"')} -let path='/auth/recovery';let payload={};if(email){payload.email=email} -if(reset){payload.reset=reset} -return http.post(path,{'content-type':'application/json',},payload)},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(token===undefined){throw new Error('Missing required parameter: "token"')} -if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')} -if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')} -let path='/auth/recovery/reset';let payload={};if(userId){payload.userId=userId} -if(token){payload.token=token} -if(passwordA){payload['password-a']=passwordA} -if(passwordB){payload['password-b']=passwordB} -return http.put(path,{'content-type':'application/json',},payload)},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')} -let path='/auth/register';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -if(confirm){payload.confirm=confirm} -if(success){payload.success=success} -if(failure){payload.failure=failure} -if(name){payload.name=name} -payload.project=config.project;return iframe('post',path,payload)},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(token===undefined){throw new Error('Missing required parameter: "token"')} -let path='/auth/register/confirm';let payload={};if(userId){payload.userId=userId} -if(token){payload.token=token} -return http.post(path,{'content-type':'application/json',},payload)},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')} -let path='/auth/register/confirm/resend';let payload={};if(confirm){payload.confirm=confirm} -return http.post(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} -if(quality){payload.quality=quality} -return http.get(path,{'content-type':'application/json',},payload)},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} -let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width} -if(height){payload.height=height} -if(quality){payload.quality=quality} -return http.get(path,{'content-type':'application/json',},payload)},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} -let path='/avatars/favicon';let payload={};if(url){payload.url=url} -return http.get(path,{'content-type':'application/json',},payload)},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} -let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width} -if(height){payload.height=height} -if(quality){payload.quality=quality} -return http.get(path,{'content-type':'application/json',},payload)},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')} -let path='/avatars/image';let payload={};if(url){payload.url=url} -if(width){payload.width=width} -if(height){payload.height=height} -return http.get(path,{'content-type':'application/json',},payload)},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')} -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';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';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/{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/{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/{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"')} -let path='/database/{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} -if(orderField){payload['order-field']=orderField} -if(orderType){payload['order-type']=orderType} -if(orderCast){payload['order-cast']=orderCast} -if(search){payload.search=search} -if(first){payload.first=first} -if(last){payload.last=last} -return http.get(path,{'content-type':'application/json',},payload)},createDocument:function(collectionId,data,read,write,parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -if(data===undefined){throw new Error('Missing required parameter: "data"')} -if(read===undefined){throw new Error('Missing required parameter: "read"')} -if(write===undefined){throw new Error('Missing required parameter: "write"')} -let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(data){payload.data=data} -if(read){payload.read=read} -if(write){payload.write=write} -if(parentDocument){payload.parentDocument=parentDocument} -if(parentProperty){payload.parentProperty=parentProperty} -if(parentPropertyType){payload.parentPropertyType=parentPropertyType} -return http.post(path,{'content-type':'application/json',},payload)},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')} -let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateDocument:function(collectionId,documentId,data,read,write){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')} -if(data===undefined){throw new Error('Missing required parameter: "data"')} -if(read===undefined){throw new Error('Missing required parameter: "read"')} -if(write===undefined){throw new Error('Missing required parameter: "write"')} -let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};if(data){payload.data=data} -if(read){payload.read=read} -if(write){payload.write=write} -return http.patch(path,{'content-type':'application/json',},payload)},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')} -let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={getLocale:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let projects={listProjects:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/projects';let payload={};if(name){payload.name=name} -if(teamId){payload.teamId=teamId} -if(description){payload.description=description} -if(logo){payload.logo=logo} -if(url){payload.url=url} -if(legalName){payload.legalName=legalName} -if(legalCountry){payload.legalCountry=legalCountry} -if(legalState){payload.legalState=legalState} -if(legalCity){payload.legalCity=legalCity} -if(legalAddress){payload.legalAddress=legalAddress} -if(legalTaxId){payload.legalTaxId=legalTaxId} -return http.post(path,{'content-type':'application/json',},payload)},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(description){payload.description=description} -if(logo){payload.logo=logo} -if(url){payload.url=url} -if(legalName){payload.legalName=legalName} -if(legalCountry){payload.legalCountry=legalCountry} -if(legalState){payload.legalState=legalState} -if(legalCity){payload.legalCity=legalCity} -if(legalAddress){payload.legalAddress=legalAddress} -if(legalTaxId){payload.legalTaxId=legalTaxId} -return http.patch(path,{'content-type':'application/json',},payload)},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(scopes){payload.scopes=scopes} -return http.post(path,{'content-type':'application/json',},payload)},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload.name=name} -if(scopes){payload.scopes=scopes} -return http.put(path,{'content-type':'application/json',},payload)},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(provider===undefined){throw new Error('Missing required parameter: "provider"')} -let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload.provider=provider} -if(appId){payload.appId=appId} -if(secret){payload.secret=secret} -return http.patch(path,{'content-type':'application/json',},payload)},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(type===undefined){throw new Error('Missing required parameter: "type"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload.type=type} -if(name){payload.name=name} -if(key){payload.key=key} -if(store){payload.store=store} -if(url){payload.url=url} -return http.post(path,{'content-type':'application/json',},payload)},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload.name=name} -if(key){payload.key=key} -if(store){payload.store=store} -if(url){payload.url=url} -return http.put(path,{'content-type':'application/json',},payload)},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(status===undefined){throw new Error('Missing required parameter: "status"')} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(status){payload.status=status} -if(schedule){payload.schedule=schedule} -if(security){payload.security=security} -if(httpMethod){payload.httpMethod=httpMethod} -if(httpUrl){payload.httpUrl=httpUrl} -if(httpHeaders){payload.httpHeaders=httpHeaders} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.post(path,{'content-type':'application/json',},payload)},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(status===undefined){throw new Error('Missing required parameter: "status"')} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload.name=name} -if(status){payload.status=status} -if(schedule){payload.schedule=schedule} -if(security){payload.security=security} -if(httpMethod){payload.httpMethod=httpMethod} -if(httpUrl){payload.httpUrl=httpUrl} -if(httpHeaders){payload.httpHeaders=httpHeaders} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.put(path,{'content-type':'application/json',},payload)},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(events===undefined){throw new Error('Missing required parameter: "events"')} -if(url===undefined){throw new Error('Missing required parameter: "url"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name} -if(events){payload.events=events} -if(url){payload.url=url} -if(security){payload.security=security} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.post(path,{'content-type':'application/json',},payload)},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -if(events===undefined){throw new Error('Missing required parameter: "events"')} -if(url===undefined){throw new Error('Missing required parameter: "url"')} -if(security===undefined){throw new Error('Missing required parameter: "security"')} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload.name=name} -if(events){payload.events=events} -if(url){payload.url=url} -if(security){payload.security=security} -if(httpUser){payload.httpUser=httpUser} -if(httpPass){payload.httpPass=httpPass} -return http.put(path,{'content-type':'application/json',},payload)},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';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)},createFile:function(files,read,write){if(files===undefined){throw new Error('Missing required parameter: "files"')} -if(read===undefined){throw new Error('Missing required parameter: "read"')} -if(write===undefined){throw new Error('Missing required parameter: "write"')} -let path='/storage/files';let payload={};if(files){payload.files=files} -if(read){payload.read=read} -if(write){payload.write=write} -return http.post(path,{'content-type':'multipart/form-data',},payload)},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateFile:function(fileId,read,write){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')} -if(read===undefined){throw new Error('Missing required parameter: "read"')} -if(write===undefined){throw new Error('Missing required parameter: "write"')} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload.read=read} -if(write){payload.write=write} -return http.put(path,{'content-type':'application/json',},payload)},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')} -let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')} -let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(width){payload.width=width} -if(height){payload.height=height} -if(quality){payload.quality=quality} -if(background){payload.background=background} -if(output){payload.output=output} -return http.get(path,{'content-type':'application/json',},payload)},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')} -let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(as){payload.as=as} -return http.get(path,{'content-type':'application/json',},payload)}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';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)},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/teams';let payload={};if(name){payload.name=name} -if(roles){payload.roles=roles} -return http.post(path,{'content-type':'application/json',},payload)},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name} -return http.put(path,{'content-type':'application/json',},payload)},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(roles===undefined){throw new Error('Missing required parameter: "roles"')} -if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload.email=email} -if(name){payload.name=name} -if(roles){payload.roles=roles} -if(redirect){payload.redirect=redirect} -return http.post(path,{'content-type':'application/json',},payload)},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')} -let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')} -if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} -let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(redirect){payload.redirect=redirect} -return http.post(path,{'content-type':'application/json',},payload)},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')} -if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(secret===undefined){throw new Error('Missing required parameter: "secret"')} -let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload.userId=userId} -if(secret){payload.secret=secret} -if(success){payload.success=success} -if(failure){payload.failure=failure} -payload.project=config.project;return iframe('patch',path,payload)}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';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)},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/users';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -if(name){payload.name=name} -return http.post(path,{'content-type':'application/json',},payload)},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateUserPrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload.prefs=prefs} -return http.patch(path,{'content-type':'application/json',},payload)},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},deleteUserSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"')} -let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);let payload={};if(sessionId){payload.sessionId=sessionId} -return http.delete(path,{'content-type':'application/json',},payload)},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(status===undefined){throw new Error('Missing required parameter: "status"')} -let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload.status=status} -return http.patch(path,{'content-type':'application/json',},payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{}) \ No newline at end of file diff --git a/app/sdks/node/LICENSE b/app/sdks/node/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/node/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/node/README.md b/app/sdks/node/README.md deleted file mode 100644 index 51a4ba0454..0000000000 --- a/app/sdks/node/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# 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) - -**This SDK is compatible with Appwrite server version 0.4.0. 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) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install via [NPM](https://www.npmjs.com/): - -```bash -npm install node-appwrite --save -``` - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/delete.md b/app/sdks/node/docs/examples/account/delete.md deleted file mode 100644 index 0710fd6dfc..0000000000 --- a/app/sdks/node/docs/examples/account/delete.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.delete(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/get-prefs.md b/app/sdks/node/docs/examples/account/get-prefs.md deleted file mode 100644 index bdff57e923..0000000000 --- a/app/sdks/node/docs/examples/account/get-prefs.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.getPrefs(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/get-security.md b/app/sdks/node/docs/examples/account/get-security.md deleted file mode 100644 index 03a6561fff..0000000000 --- a/app/sdks/node/docs/examples/account/get-security.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.getSecurity(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/get-sessions.md b/app/sdks/node/docs/examples/account/get-sessions.md deleted file mode 100644 index 02b464a497..0000000000 --- a/app/sdks/node/docs/examples/account/get-sessions.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.getSessions(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/get.md b/app/sdks/node/docs/examples/account/get.md deleted file mode 100644 index b2e078d061..0000000000 --- a/app/sdks/node/docs/examples/account/get.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.get(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/update-email.md b/app/sdks/node/docs/examples/account/update-email.md deleted file mode 100644 index 29b50314f2..0000000000 --- a/app/sdks/node/docs/examples/account/update-email.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.updateEmail('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/node/docs/examples/account/update-name.md b/app/sdks/node/docs/examples/account/update-name.md deleted file mode 100644 index d8b4734cbb..0000000000 --- a/app/sdks/node/docs/examples/account/update-name.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.updateName('[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/update-password.md b/app/sdks/node/docs/examples/account/update-password.md deleted file mode 100644 index 5aa6622ffa..0000000000 --- a/app/sdks/node/docs/examples/account/update-password.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.updatePassword('password', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/account/update-prefs.md b/app/sdks/node/docs/examples/account/update-prefs.md deleted file mode 100644 index c76e735e18..0000000000 --- a/app/sdks/node/docs/examples/account/update-prefs.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') - .setKey('') -; - -let promise = account.updatePrefs('{}'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/auth/confirm-resend.md b/app/sdks/node/docs/examples/auth/confirm-resend.md deleted file mode 100644 index 443870394b..0000000000 --- a/app/sdks/node/docs/examples/auth/confirm-resend.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.confirmResend('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/node/docs/examples/auth/confirm.md b/app/sdks/node/docs/examples/auth/confirm.md deleted file mode 100644 index 527df2d6ff..0000000000 --- a/app/sdks/node/docs/examples/auth/confirm.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client -; - -let promise = auth.confirm('[USER_ID]', '[TOKEN]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/auth/login.md b/app/sdks/node/docs/examples/auth/login.md deleted file mode 100644 index 1033b6f30f..0000000000 --- a/app/sdks/node/docs/examples/auth/login.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.login('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/node/docs/examples/auth/logout-by-session.md b/app/sdks/node/docs/examples/auth/logout-by-session.md deleted file mode 100644 index df964c0caf..0000000000 --- a/app/sdks/node/docs/examples/auth/logout-by-session.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.logoutBySession('[ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/auth/logout.md b/app/sdks/node/docs/examples/auth/logout.md deleted file mode 100644 index d34102cbd7..0000000000 --- a/app/sdks/node/docs/examples/auth/logout.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.logout(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/auth/oauth-callback.md b/app/sdks/node/docs/examples/auth/oauth-callback.md deleted file mode 100644 index 2588802fed..0000000000 --- a/app/sdks/node/docs/examples/auth/oauth-callback.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new Auth.Client(); - -let auth = new sdk.Auth(client); - -client - setProject('') - setKey('') -; - -let promise = auth.oauthCallback('[PROJECT_ID]', 'bitbucket', '[CODE]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/auth/oauth.md b/app/sdks/node/docs/examples/auth/oauth.md deleted file mode 100644 index 4a2230c686..0000000000 --- a/app/sdks/node/docs/examples/auth/oauth.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.oauth('bitbucket', 'https://example.com', '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/node/docs/examples/auth/recovery-reset.md b/app/sdks/node/docs/examples/auth/recovery-reset.md deleted file mode 100644 index f43a8b3305..0000000000 --- a/app/sdks/node/docs/examples/auth/recovery-reset.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.recoveryReset('[USER_ID]', '[TOKEN]', 'password', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/auth/recovery.md b/app/sdks/node/docs/examples/auth/recovery.md deleted file mode 100644 index 9e340a7f32..0000000000 --- a/app/sdks/node/docs/examples/auth/recovery.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.recovery('email@example.com', '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/node/docs/examples/auth/register.md b/app/sdks/node/docs/examples/auth/register.md deleted file mode 100644 index 708719a56f..0000000000 --- a/app/sdks/node/docs/examples/auth/register.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let auth = new sdk.Auth(client); - -client - .setProject('') - .setKey('') -; - -let promise = auth.register('email@example.com', 'password', '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/node/docs/examples/avatars/get-browser.md b/app/sdks/node/docs/examples/avatars/get-browser.md deleted file mode 100644 index 50d3fefcf1..0000000000 --- a/app/sdks/node/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let avatars = new sdk.Avatars(client); - -client - .setProject('') - .setKey('') -; - -let promise = avatars.getBrowser('aa'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/avatars/get-credit-card.md b/app/sdks/node/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index f64488cc12..0000000000 --- a/app/sdks/node/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let avatars = new sdk.Avatars(client); - -client - .setProject('') - .setKey('') -; - -let promise = avatars.getCreditCard('amex'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/avatars/get-favicon.md b/app/sdks/node/docs/examples/avatars/get-favicon.md deleted file mode 100644 index ac449e9f1a..0000000000 --- a/app/sdks/node/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let avatars = new sdk.Avatars(client); - -client - .setProject('') - .setKey('') -; - -let promise = avatars.getFavicon('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/node/docs/examples/avatars/get-flag.md b/app/sdks/node/docs/examples/avatars/get-flag.md deleted file mode 100644 index d53f2aa555..0000000000 --- a/app/sdks/node/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let avatars = new sdk.Avatars(client); - -client - .setProject('') - .setKey('') -; - -let promise = avatars.getFlag('af'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/avatars/get-image.md b/app/sdks/node/docs/examples/avatars/get-image.md deleted file mode 100644 index e541b90e61..0000000000 --- a/app/sdks/node/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let avatars = new sdk.Avatars(client); - -client - .setProject('') - .setKey('') -; - -let promise = avatars.getImage('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/node/docs/examples/avatars/get-q-r.md b/app/sdks/node/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 9611a617ef..0000000000 --- a/app/sdks/node/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let avatars = new sdk.Avatars(client); - -client - .setProject('') - .setKey('') -; - -let promise = avatars.getQR('[TEXT]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/database/create-collection.md b/app/sdks/node/docs/examples/database/create-collection.md deleted file mode 100644 index c7ea8d43e1..0000000000 --- a/app/sdks/node/docs/examples/database/create-collection.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/database/create-document.md b/app/sdks/node/docs/examples/database/create-document.md deleted file mode 100644 index 9a15f133d5..0000000000 --- a/app/sdks/node/docs/examples/database/create-document.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = database.createDocument('[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/node/docs/examples/database/delete-collection.md b/app/sdks/node/docs/examples/database/delete-collection.md deleted file mode 100644 index 7be40b41bf..0000000000 --- a/app/sdks/node/docs/examples/database/delete-collection.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/database/delete-document.md b/app/sdks/node/docs/examples/database/delete-document.md deleted file mode 100644 index d74f2dd16c..0000000000 --- a/app/sdks/node/docs/examples/database/delete-document.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/database/get-collection.md b/app/sdks/node/docs/examples/database/get-collection.md deleted file mode 100644 index 69a39382bf..0000000000 --- a/app/sdks/node/docs/examples/database/get-collection.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/database/get-document.md b/app/sdks/node/docs/examples/database/get-document.md deleted file mode 100644 index 5a676580bd..0000000000 --- a/app/sdks/node/docs/examples/database/get-document.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/database/list-collections.md b/app/sdks/node/docs/examples/database/list-collections.md deleted file mode 100644 index 2f746de896..0000000000 --- a/app/sdks/node/docs/examples/database/list-collections.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/database/list-documents.md b/app/sdks/node/docs/examples/database/list-documents.md deleted file mode 100644 index 641a572420..0000000000 --- a/app/sdks/node/docs/examples/database/list-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = database.listDocuments('[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/node/docs/examples/database/update-collection.md b/app/sdks/node/docs/examples/database/update-collection.md deleted file mode 100644 index d393606e8f..0000000000 --- a/app/sdks/node/docs/examples/database/update-collection.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/database/update-document.md b/app/sdks/node/docs/examples/database/update-document.md deleted file mode 100644 index b281187da4..0000000000 --- a/app/sdks/node/docs/examples/database/update-document.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setProject('') - .setKey('') -; - -let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', [], []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/locale/get-continents.md b/app/sdks/node/docs/examples/locale/get-continents.md deleted file mode 100644 index 3c2143cf06..0000000000 --- a/app/sdks/node/docs/examples/locale/get-continents.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let locale = new sdk.Locale(client); - -client - .setProject('') - .setKey('') -; - -let promise = locale.getContinents(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/locale/get-countries-e-u.md b/app/sdks/node/docs/examples/locale/get-countries-e-u.md deleted file mode 100644 index 3aabf5713b..0000000000 --- a/app/sdks/node/docs/examples/locale/get-countries-e-u.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let locale = new sdk.Locale(client); - -client - .setProject('') - .setKey('') -; - -let promise = locale.getCountriesEU(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/locale/get-countries-phones.md b/app/sdks/node/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index 79cc6f5b6b..0000000000 --- a/app/sdks/node/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let locale = new sdk.Locale(client); - -client - .setProject('') - .setKey('') -; - -let promise = locale.getCountriesPhones(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/locale/get-countries.md b/app/sdks/node/docs/examples/locale/get-countries.md deleted file mode 100644 index a4e878bc6a..0000000000 --- a/app/sdks/node/docs/examples/locale/get-countries.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let locale = new sdk.Locale(client); - -client - .setProject('') - .setKey('') -; - -let promise = locale.getCountries(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/locale/get-currencies.md b/app/sdks/node/docs/examples/locale/get-currencies.md deleted file mode 100644 index 59d8137dee..0000000000 --- a/app/sdks/node/docs/examples/locale/get-currencies.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let locale = new sdk.Locale(client); - -client - .setProject('') - .setKey('') -; - -let promise = locale.getCurrencies(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/locale/get-locale.md b/app/sdks/node/docs/examples/locale/get-locale.md deleted file mode 100644 index 57e5d69e78..0000000000 --- a/app/sdks/node/docs/examples/locale/get-locale.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let locale = new sdk.Locale(client); - -client - .setProject('') - .setKey('') -; - -let promise = locale.getLocale(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/projects/create-key.md b/app/sdks/node/docs/examples/projects/create-key.md deleted file mode 100644 index 227e8fc5ba..0000000000 --- a/app/sdks/node/docs/examples/projects/create-key.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/create-platform.md b/app/sdks/node/docs/examples/projects/create-platform.md deleted file mode 100644 index ce9c7e01e1..0000000000 --- a/app/sdks/node/docs/examples/projects/create-platform.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/create-project.md b/app/sdks/node/docs/examples/projects/create-project.md deleted file mode 100644 index 8f0d8b47ef..0000000000 --- a/app/sdks/node/docs/examples/projects/create-project.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.createProject('[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/node/docs/examples/projects/create-task.md b/app/sdks/node/docs/examples/projects/create-task.md deleted file mode 100644 index 8923742294..0000000000 --- a/app/sdks/node/docs/examples/projects/create-task.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/create-webhook.md b/app/sdks/node/docs/examples/projects/create-webhook.md deleted file mode 100644 index 8135e8d66e..0000000000 --- a/app/sdks/node/docs/examples/projects/create-webhook.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/delete-key.md b/app/sdks/node/docs/examples/projects/delete-key.md deleted file mode 100644 index 3ca5caba8a..0000000000 --- a/app/sdks/node/docs/examples/projects/delete-key.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/delete-platform.md b/app/sdks/node/docs/examples/projects/delete-platform.md deleted file mode 100644 index 8c01703dd0..0000000000 --- a/app/sdks/node/docs/examples/projects/delete-platform.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/delete-project.md b/app/sdks/node/docs/examples/projects/delete-project.md deleted file mode 100644 index 7755f35c1f..0000000000 --- a/app/sdks/node/docs/examples/projects/delete-project.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.deleteProject('[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/node/docs/examples/projects/delete-task.md b/app/sdks/node/docs/examples/projects/delete-task.md deleted file mode 100644 index a3b985b784..0000000000 --- a/app/sdks/node/docs/examples/projects/delete-task.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/delete-webhook.md b/app/sdks/node/docs/examples/projects/delete-webhook.md deleted file mode 100644 index 3b41b8c433..0000000000 --- a/app/sdks/node/docs/examples/projects/delete-webhook.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/get-key.md b/app/sdks/node/docs/examples/projects/get-key.md deleted file mode 100644 index e0b2a85856..0000000000 --- a/app/sdks/node/docs/examples/projects/get-key.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/get-platform.md b/app/sdks/node/docs/examples/projects/get-platform.md deleted file mode 100644 index c035141e0c..0000000000 --- a/app/sdks/node/docs/examples/projects/get-platform.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/get-project-usage.md b/app/sdks/node/docs/examples/projects/get-project-usage.md deleted file mode 100644 index 32c13c13a3..0000000000 --- a/app/sdks/node/docs/examples/projects/get-project-usage.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.getProjectUsage('[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/node/docs/examples/projects/get-project.md b/app/sdks/node/docs/examples/projects/get-project.md deleted file mode 100644 index 15b685a554..0000000000 --- a/app/sdks/node/docs/examples/projects/get-project.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.getProject('[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/node/docs/examples/projects/get-task.md b/app/sdks/node/docs/examples/projects/get-task.md deleted file mode 100644 index 83040a39f1..0000000000 --- a/app/sdks/node/docs/examples/projects/get-task.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/get-webhook.md b/app/sdks/node/docs/examples/projects/get-webhook.md deleted file mode 100644 index cb98367d6f..0000000000 --- a/app/sdks/node/docs/examples/projects/get-webhook.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/list-keys.md b/app/sdks/node/docs/examples/projects/list-keys.md deleted file mode 100644 index a0a894a68e..0000000000 --- a/app/sdks/node/docs/examples/projects/list-keys.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/list-platforms.md b/app/sdks/node/docs/examples/projects/list-platforms.md deleted file mode 100644 index bb7f1370cb..0000000000 --- a/app/sdks/node/docs/examples/projects/list-platforms.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/list-projects.md b/app/sdks/node/docs/examples/projects/list-projects.md deleted file mode 100644 index e4651ef686..0000000000 --- a/app/sdks/node/docs/examples/projects/list-projects.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.listProjects(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/projects/list-tasks.md b/app/sdks/node/docs/examples/projects/list-tasks.md deleted file mode 100644 index 98e381116f..0000000000 --- a/app/sdks/node/docs/examples/projects/list-tasks.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/list-webhooks.md b/app/sdks/node/docs/examples/projects/list-webhooks.md deleted file mode 100644 index 35da55721b..0000000000 --- a/app/sdks/node/docs/examples/projects/list-webhooks.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/update-key.md b/app/sdks/node/docs/examples/projects/update-key.md deleted file mode 100644 index cd445aef25..0000000000 --- a/app/sdks/node/docs/examples/projects/update-key.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/update-platform.md b/app/sdks/node/docs/examples/projects/update-platform.md deleted file mode 100644 index 6adcad9ed9..0000000000 --- a/app/sdks/node/docs/examples/projects/update-platform.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/update-project-o-auth.md b/app/sdks/node/docs/examples/projects/update-project-o-auth.md deleted file mode 100644 index 229f7e9c3b..0000000000 --- a/app/sdks/node/docs/examples/projects/update-project-o-auth.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.updateProjectOAuth('[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/node/docs/examples/projects/update-project.md b/app/sdks/node/docs/examples/projects/update-project.md deleted file mode 100644 index 486cef2a4d..0000000000 --- a/app/sdks/node/docs/examples/projects/update-project.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = projects.updateProject('[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/node/docs/examples/projects/update-task.md b/app/sdks/node/docs/examples/projects/update-task.md deleted file mode 100644 index 06f0dd21e4..0000000000 --- a/app/sdks/node/docs/examples/projects/update-task.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/projects/update-webhook.md b/app/sdks/node/docs/examples/projects/update-webhook.md deleted file mode 100644 index 4a74848fca..0000000000 --- a/app/sdks/node/docs/examples/projects/update-webhook.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') - .setKey('') -; - -let promise = 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/node/docs/examples/storage/create-file.md b/app/sdks/node/docs/examples/storage/create-file.md deleted file mode 100644 index f0c9d4c5a8..0000000000 --- a/app/sdks/node/docs/examples/storage/create-file.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.createFile(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/node/docs/examples/storage/delete-file.md b/app/sdks/node/docs/examples/storage/delete-file.md deleted file mode 100644 index 9e8d13880f..0000000000 --- a/app/sdks/node/docs/examples/storage/delete-file.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.deleteFile('[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/node/docs/examples/storage/get-file-download.md b/app/sdks/node/docs/examples/storage/get-file-download.md deleted file mode 100644 index 2967170695..0000000000 --- a/app/sdks/node/docs/examples/storage/get-file-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.getFileDownload('[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/node/docs/examples/storage/get-file-preview.md b/app/sdks/node/docs/examples/storage/get-file-preview.md deleted file mode 100644 index 0c09e8ca8d..0000000000 --- a/app/sdks/node/docs/examples/storage/get-file-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.getFilePreview('[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/node/docs/examples/storage/get-file-view.md b/app/sdks/node/docs/examples/storage/get-file-view.md deleted file mode 100644 index a3074fbed1..0000000000 --- a/app/sdks/node/docs/examples/storage/get-file-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.getFileView('[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/node/docs/examples/storage/get-file.md b/app/sdks/node/docs/examples/storage/get-file.md deleted file mode 100644 index a1a3baf009..0000000000 --- a/app/sdks/node/docs/examples/storage/get-file.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.getFile('[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/node/docs/examples/storage/list-files.md b/app/sdks/node/docs/examples/storage/list-files.md deleted file mode 100644 index 59a331a2b5..0000000000 --- a/app/sdks/node/docs/examples/storage/list-files.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.listFiles(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/storage/update-file.md b/app/sdks/node/docs/examples/storage/update-file.md deleted file mode 100644 index 3741785996..0000000000 --- a/app/sdks/node/docs/examples/storage/update-file.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.updateFile('[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/node/docs/examples/teams/create-team-membership-resend.md b/app/sdks/node/docs/examples/teams/create-team-membership-resend.md deleted file mode 100644 index 1f387d0b3b..0000000000 --- a/app/sdks/node/docs/examples/teams/create-team-membership-resend.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.createTeamMembershipResend('[TEAM_ID]', '[INVITE_ID]', '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/node/docs/examples/teams/create-team-membership.md b/app/sdks/node/docs/examples/teams/create-team-membership.md deleted file mode 100644 index 7a2c9be298..0000000000 --- a/app/sdks/node/docs/examples/teams/create-team-membership.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.createTeamMembership('[TEAM_ID]', 'email@example.com', [], '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/node/docs/examples/teams/create-team.md b/app/sdks/node/docs/examples/teams/create-team.md deleted file mode 100644 index 73dd77ecc5..0000000000 --- a/app/sdks/node/docs/examples/teams/create-team.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.createTeam('[NAME]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/teams/delete-team-membership.md b/app/sdks/node/docs/examples/teams/delete-team-membership.md deleted file mode 100644 index 435a65026f..0000000000 --- a/app/sdks/node/docs/examples/teams/delete-team-membership.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.deleteTeamMembership('[TEAM_ID]', '[INVITE_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/teams/delete-team.md b/app/sdks/node/docs/examples/teams/delete-team.md deleted file mode 100644 index 0204d40c98..0000000000 --- a/app/sdks/node/docs/examples/teams/delete-team.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.deleteTeam('[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/node/docs/examples/teams/get-team-members.md b/app/sdks/node/docs/examples/teams/get-team-members.md deleted file mode 100644 index 35fd3062fe..0000000000 --- a/app/sdks/node/docs/examples/teams/get-team-members.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.getTeamMembers('[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/node/docs/examples/teams/get-team.md b/app/sdks/node/docs/examples/teams/get-team.md deleted file mode 100644 index b716b7ea01..0000000000 --- a/app/sdks/node/docs/examples/teams/get-team.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.getTeam('[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/node/docs/examples/teams/list-teams.md b/app/sdks/node/docs/examples/teams/list-teams.md deleted file mode 100644 index 609c708753..0000000000 --- a/app/sdks/node/docs/examples/teams/list-teams.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.listTeams(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/teams/update-team-membership-status.md b/app/sdks/node/docs/examples/teams/update-team-membership-status.md deleted file mode 100644 index 8d65bf33b0..0000000000 --- a/app/sdks/node/docs/examples/teams/update-team-membership-status.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.updateTeamMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/teams/update-team.md b/app/sdks/node/docs/examples/teams/update-team.md deleted file mode 100644 index 6afb377091..0000000000 --- a/app/sdks/node/docs/examples/teams/update-team.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client - .setProject('') - .setKey('') -; - -let promise = teams.updateTeam('[TEAM_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/node/docs/examples/users/create-user.md b/app/sdks/node/docs/examples/users/create-user.md deleted file mode 100644 index d07ab1eabf..0000000000 --- a/app/sdks/node/docs/examples/users/create-user.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.createUser('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/node/docs/examples/users/delete-user-session.md b/app/sdks/node/docs/examples/users/delete-user-session.md deleted file mode 100644 index dab704e2d4..0000000000 --- a/app/sdks/node/docs/examples/users/delete-user-session.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.deleteUserSession('[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/node/docs/examples/users/delete-user-sessions.md b/app/sdks/node/docs/examples/users/delete-user-sessions.md deleted file mode 100644 index 33f803298d..0000000000 --- a/app/sdks/node/docs/examples/users/delete-user-sessions.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.deleteUserSessions('[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/node/docs/examples/users/delete-users-session.md b/app/sdks/node/docs/examples/users/delete-users-session.md deleted file mode 100644 index 530503da4b..0000000000 --- a/app/sdks/node/docs/examples/users/delete-users-session.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.deleteUsersSession('[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/node/docs/examples/users/get-user-logs.md b/app/sdks/node/docs/examples/users/get-user-logs.md deleted file mode 100644 index 85d0a125a0..0000000000 --- a/app/sdks/node/docs/examples/users/get-user-logs.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.getUserLogs('[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/node/docs/examples/users/get-user-prefs.md b/app/sdks/node/docs/examples/users/get-user-prefs.md deleted file mode 100644 index 46d959e1cb..0000000000 --- a/app/sdks/node/docs/examples/users/get-user-prefs.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.getUserPrefs('[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/node/docs/examples/users/get-user-sessions.md b/app/sdks/node/docs/examples/users/get-user-sessions.md deleted file mode 100644 index b3dfe28405..0000000000 --- a/app/sdks/node/docs/examples/users/get-user-sessions.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.getUserSessions('[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/node/docs/examples/users/get-user.md b/app/sdks/node/docs/examples/users/get-user.md deleted file mode 100644 index 96676c0196..0000000000 --- a/app/sdks/node/docs/examples/users/get-user.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.getUser('[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/node/docs/examples/users/list-users.md b/app/sdks/node/docs/examples/users/list-users.md deleted file mode 100644 index 455e42db4d..0000000000 --- a/app/sdks/node/docs/examples/users/list-users.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.listUsers(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/node/docs/examples/users/update-user-prefs.md b/app/sdks/node/docs/examples/users/update-user-prefs.md deleted file mode 100644 index beacba0b0a..0000000000 --- a/app/sdks/node/docs/examples/users/update-user-prefs.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.updateUserPrefs('[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/node/docs/examples/users/update-user-status.md b/app/sdks/node/docs/examples/users/update-user-status.md deleted file mode 100644 index 858833a50c..0000000000 --- a/app/sdks/node/docs/examples/users/update-user-status.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let users = new sdk.Users(client); - -client - .setProject('') - .setKey('') -; - -let promise = users.updateUserStatus('[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/node/index.js b/app/sdks/node/index.js deleted file mode 100644 index f4b28948ae..0000000000 --- a/app/sdks/node/index.js +++ /dev/null @@ -1,23 +0,0 @@ -const Client = require('./lib/client.js'); -const Account = require('./lib/services/account.js'); -const Auth = require('./lib/services/auth.js'); -const Avatars = require('./lib/services/avatars.js'); -const Database = require('./lib/services/database.js'); -const Locale = require('./lib/services/locale.js'); -const Projects = require('./lib/services/projects.js'); -const Storage = require('./lib/services/storage.js'); -const Teams = require('./lib/services/teams.js'); -const Users = require('./lib/services/users.js'); - -module.exports = { - Client, - Account, - Auth, - Avatars, - Database, - Locale, - Projects, - Storage, - Teams, - Users, -}; \ No newline at end of file diff --git a/app/sdks/node/lib/client.js b/app/sdks/node/lib/client.js deleted file mode 100644 index 253bf95f02..0000000000 --- a/app/sdks/node/lib/client.js +++ /dev/null @@ -1,122 +0,0 @@ -const URL = require('url').URL; -const request = require('request-promise-native'); - -class Client { - - constructor() { - this.endpoint = 'https://appwrite.io/v1'; - this.headers = { - 'content-type': '', - 'x-sdk-version': 'appwrite:nodejs:1.0.31', - }; - this.selfSigned = false; - } - - /** - * Set Project - * - * Your Appwrite project ID - * - * @param string value - * - * @return self - */ - setProject(value) { - this.addHeader('X-Appwrite-Project', value); - - return this; - } - - /** - * Set Key - * - * Your Appwrite project secret key - * - * @param string value - * - * @return self - */ - setKey(value) { - this.addHeader('X-Appwrite-Key', value); - - return this; - } - - /** - * Set Locale - * - * @param string value - * - * @return self - */ - setLocale(value) { - this.addHeader('X-Appwrite-Locale', value); - - return this; - } - - /** - * Set Mode - * - * @param string value - * - * @return self - */ - setMode(value) { - this.addHeader('X-Appwrite-Mode', value); - - return this; - } - - /*** - * @param bool status - * @return this - */ - setSelfSigned(status = true) { - this.selfSigned = status; - - return this; - } - - /*** - * @param endpoint - * @return this - */ - setEndpoint(endpoint) - { - this.endpoint = endpoint; - - return this; - } - - /** - * @param key string - * @param value string - */ - addHeader(key, value) { - this.headers[key.toLowerCase()] = value.toLowerCase(); - - return this; - } - - 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 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')), - }; - - return request(options); - } -} - -module.exports = Client; \ No newline at end of file diff --git a/app/sdks/node/lib/service.js b/app/sdks/node/lib/service.js deleted file mode 100644 index e799c064be..0000000000 --- a/app/sdks/node/lib/service.js +++ /dev/null @@ -1,10 +0,0 @@ -class Service { - /** - * @param client - */ - constructor(client) { - this.client = client; - } -} - -module.exports = Service; \ No newline at end of file diff --git a/app/sdks/node/lib/services/account.js b/app/sdks/node/lib/services/account.js deleted file mode 100644 index 327c1c80fd..0000000000 --- a/app/sdks/node/lib/services/account.js +++ /dev/null @@ -1,191 +0,0 @@ -const Service = require('../service.js'); - -class Account extends Service { - - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws Exception - * @return {} - */ - async get() { - let path = '/account'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws Exception - * @return {} - */ - async delete() { - let path = '/account'; - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param string email - * @param string password - * @throws Exception - * @return {} - */ - async updateEmail(email, password) { - let path = '/account/email'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password - }); - } - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param string name - * @throws Exception - * @return {} - */ - async updateName(name) { - let path = '/account/name'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'name': name - }); - } - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param string password - * @param string oldPassword - * @throws Exception - * @return {} - */ - async updatePassword(password, oldPassword) { - let path = '/account/password'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'password': password, - 'old-password': oldPassword - }); - } - - /** - * Get Account Preferences - * - * Get currently logged in user preferences key-value object. - * - * @throws Exception - * @return {} - */ - async getPrefs() { - let path = '/account/prefs'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Account Prefs - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param string prefs - * @throws Exception - * @return {} - */ - async updatePrefs(prefs) { - let path = '/account/prefs'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'prefs': prefs - }); - } - - /** - * Get Account Security Log - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws Exception - * @return {} - */ - async getSecurity() { - let path = '/account/security'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Account Active Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws Exception - * @return {} - */ - async getSessions() { - let path = '/account/sessions'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Account; \ No newline at end of file diff --git a/app/sdks/node/lib/services/auth.js b/app/sdks/node/lib/services/auth.js deleted file mode 100644 index c88bb9bdf5..0000000000 --- a/app/sdks/node/lib/services/auth.js +++ /dev/null @@ -1,274 +0,0 @@ -const Service = require('../service.js'); - -class Auth extends Service { - - /** - * Login - * - * 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 notice 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. - * - * @param string email - * @param string password - * @param string success - * @param string failure - * @throws Exception - * @return {} - */ - async login(email, password, success = '', failure = '') { - let path = '/auth/login'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password, - 'success': success, - 'failure': failure - }); - } - - /** - * Login with OAuth - * - * 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 - * back to your app when login is completed. - * - * @param string provider - * @param string success - * @param string failure - * @throws Exception - * @return {} - */ - async oauth(provider, success, failure) { - let path = '/auth/login/oauth/{provider}'.replace(new RegExp('{provider}', 'g'), provider); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'success': success, - 'failure': failure - }); - } - - /** - * Logout Current 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 Exception - * @return {} - */ - async logout() { - let path = '/auth/logout'; - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Logout Specific Session - * - * 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. - * - * @param string id - * @throws Exception - * @return {} - */ - async logoutBySession(id) { - let path = '/auth/logout/{id}'.replace(new RegExp('{id}', 'g'), id); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Password Recovery - * - * Sends the user an email with a temporary secret token for password reset. - * When the user clicks the confirmation link he is redirected back to your - * app password reset redirect URL with a secret token 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. - * - * @param string email - * @param string reset - * @throws Exception - * @return {} - */ - async recovery(email, reset) { - let path = '/auth/recovery'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'reset': reset - }); - } - - /** - * Password Reset - * - * Use this endpoint to complete the user account password reset. Both the - * **userId** and **token** arguments will be passed as query parameters to - * the redirect URL you have provided when sending your request to the - * /auth/recovery endpoint. - * - * Please notice 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 userId - * @param string token - * @param string passwordA - * @param string passwordB - * @throws Exception - * @return {} - */ - async recoveryReset(userId, token, passwordA, passwordB) { - let path = '/auth/recovery/reset'; - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'userId': userId, - 'token': token, - 'password-a': passwordA, - 'password-b': passwordB - }); - } - - /** - * Register - * - * 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 notice 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. - * - * @param string email - * @param string password - * @param string confirm - * @param string success - * @param string failure - * @param string name - * @throws Exception - * @return {} - */ - async register(email, password, confirm, success = '', failure = '', name = '') { - let path = '/auth/register'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password, - 'confirm': confirm, - 'success': success, - 'failure': failure, - 'name': name - }); - } - - /** - * Confirmation - * - * Use this endpoint to complete the confirmation of the user account email - * address. Both the **userId** and **token** arguments will be passed as - * query parameters to the redirect URL you have provided when sending your - * request to the /auth/register endpoint. - * - * @param string userId - * @param string token - * @throws Exception - * @return {} - */ - async confirm(userId, token) { - let path = '/auth/register/confirm'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'userId': userId, - 'token': token - }); - } - - /** - * Resend Confirmation - * - * This endpoint allows the user to request your app to resend him his email - * confirmation message. The redirect arguments act the same way as in - * /auth/register endpoint. - * - * Please notice 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 confirm - * @throws Exception - * @return {} - */ - async confirmResend(confirm) { - let path = '/auth/register/confirm/resend'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'confirm': confirm - }); - } -} - -module.exports = Auth; \ No newline at end of file diff --git a/app/sdks/node/lib/services/avatars.js b/app/sdks/node/lib/services/avatars.js deleted file mode 100644 index c34bdde966..0000000000 --- a/app/sdks/node/lib/services/avatars.js +++ /dev/null @@ -1,164 +0,0 @@ -const Service = require('../service.js'); - -class Avatars extends Service { - - /** - * Get Browser Icon - * - * You can use this endpoint to show different browser icons to your users. - * The code argument receives the browser code as it appears in your user - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return {} - */ - async getBrowser(code, width = 100, height = 100, quality = 100) { - let path = '/avatars/browsers/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? The credit card endpoint will return you the icon of the credit - * card provider you need. Use width, height and quality arguments to change - * the output settings. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return {} - */ - async getCreditCard(code, width = 100, height = 100, quality = 100) { - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param string url - * @throws Exception - * @return {} - */ - async getFavicon(url) { - let path = '/avatars/favicon'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'url': url - }); - } - - /** - * Get Country Flag - * - * You can use this endpoint to show different country flags icons to your - * users. The code argument receives the 2 letter country code. Use width, - * height and quality arguments to change the output settings. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return {} - */ - async getFlag(code, width = 100, height = 100, quality = 100) { - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Image from URL - * - * Use this endpoint to fetch a remote image URL and crop it to any image size - * you want. This endpoint is very useful if you need to crop and display - * remote images in your app or in case you want to make sure a 3rd party - * image is properly served using a TLS protocol. - * - * @param string url - * @param number width - * @param number height - * @throws Exception - * @return {} - */ - async getImage(url, width = 400, height = 400) { - let path = '/avatars/image'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'url': url, - 'width': width, - 'height': height - }); - } - - /** - * Get QR Code - * - * Converts a given plain text to a QR code image. You can use the query - * parameters to change the size and style of the resulting image. - * - * @param string text - * @param number size - * @param number margin - * @param number download - * @throws Exception - * @return {} - */ - async getQR(text, size = 400, margin = 1, download = 0) { - let path = '/avatars/qr'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download - }); - } -} - -module.exports = Avatars; \ No newline at end of file diff --git a/app/sdks/node/lib/services/database.js b/app/sdks/node/lib/services/database.js deleted file mode 100644 index 4287484038..0000000000 --- a/app/sdks/node/lib/services/database.js +++ /dev/null @@ -1,266 +0,0 @@ -const Service = require('../service.js'); - -class Database extends Service { - - /** - * 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 Exception - * @return {} - */ - async listCollections(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/database'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Collection - * - * Create a new Collection. - * - * @param string name - * @param array read - * @param array write - * @param array rules - * @throws Exception - * @return {} - */ - async createCollection(name, read, write, rules) { - let path = '/database'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - }); - } - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param string collectionId - * @throws Exception - * @return {} - */ - async getCollection(collectionId) { - let path = '/database/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param string collectionId - * @param string name - * @param array read - * @param array write - * @param array rules - * @throws Exception - * @return {} - */ - async updateCollection(collectionId, name, read, write, rules = []) { - let path = '/database/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - }); - } - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param string collectionId - * @throws Exception - * @return {} - */ - async deleteCollection(collectionId) { - let path = '/database/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Documents - * - * 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 - * modes](/docs/admin). - * - * @param string collectionId - * @param array filters - * @param number offset - * @param number limit - * @param string orderField - * @param string orderType - * @param string orderCast - * @param string search - * @param number first - * @param number last - * @throws Exception - * @return {} - */ - async listDocuments(collectionId, filters = [], offset = 0, limit = 50, orderField = '$uid', orderType = 'ASC', orderCast = 'string', search = '', first = 0, last = 0) { - let path = '/database/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'order-field': orderField, - 'order-type': orderType, - 'order-cast': orderCast, - 'search': search, - 'first': first, - 'last': last - }); - } - - /** - * Create Document - * - * Create a new Document. - * - * @param string collectionId - * @param string data - * @param array read - * @param array write - * @param string parentDocument - * @param string parentProperty - * @param string parentPropertyType - * @throws Exception - * @return {} - */ - async createDocument(collectionId, data, read, write, parentDocument = '', parentProperty = '', parentPropertyType = 'assign') { - let path = '/database/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parentDocument, - 'parentProperty': parentProperty, - 'parentPropertyType': parentPropertyType - }); - } - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param string collectionId - * @param string documentId - * @throws Exception - * @return {} - */ - async getDocument(collectionId, documentId) { - let path = '/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Document - * - * @param string collectionId - * @param string documentId - * @param string data - * @param array read - * @param array write - * @throws Exception - * @return {} - */ - async updateDocument(collectionId, documentId, data, read, write) { - let path = '/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'data': data, - 'read': read, - 'write': write - }); - } - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param string collectionId - * @param string documentId - * @throws Exception - * @return {} - */ - async deleteDocument(collectionId, documentId) { - let path = '/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Database; \ No newline at end of file diff --git a/app/sdks/node/lib/services/locale.js b/app/sdks/node/lib/services/locale.js deleted file mode 100644 index 8233259394..0000000000 --- a/app/sdks/node/lib/services/locale.js +++ /dev/null @@ -1,124 +0,0 @@ -const Service = require('../service.js'); - -class Locale extends Service { - - /** - * Get User Locale - * - * Get the current user location based on IP. Returns an object with user - * country code, country name, continent name, continent code, ip address and - * suggested currency. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return {} - */ - async getLocale() { - let path = '/locale'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return {} - */ - async getContinents() { - let path = '/locale/continents'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return {} - */ - async getCountries() { - let path = '/locale/countries'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List EU Countries - * - * List of all countries that are currently members of the EU. You can use the - * locale header to get the data in a supported language. UK brexit date is - * currently set to 2019-10-31 and will be updated if and when needed. - * - * @throws Exception - * @return {} - */ - async getCountriesEU() { - let path = '/locale/countries/eu'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws Exception - * @return {} - */ - async getCountriesPhones() { - let path = '/locale/countries/phones'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Currencies - * - * List of all currencies, including currency symol, name, plural, and decimal - * digits for all major and minor currencies. You can use the locale header to - * get the data in a supported language. - * - * @throws Exception - * @return {} - */ - async getCurrencies() { - let path = '/locale/currencies'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Locale; \ No newline at end of file diff --git a/app/sdks/node/lib/services/projects.js b/app/sdks/node/lib/services/projects.js deleted file mode 100644 index 58a03980a2..0000000000 --- a/app/sdks/node/lib/services/projects.js +++ /dev/null @@ -1,609 +0,0 @@ -const Service = require('../service.js'); - -class Projects extends Service { - - /** - * List Projects - * - * @throws Exception - * @return {} - */ - async listProjects() { - let path = '/projects'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Project - * - * @param string name - * @param string teamId - * @param string description - * @param string logo - * @param string url - * @param string legalName - * @param string legalCountry - * @param string legalState - * @param string legalCity - * @param string legalAddress - * @param string legalTaxId - * @throws Exception - * @return {} - */ - async createProject(name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - let path = '/projects'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'teamId': teamId, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legalName, - 'legalCountry': legalCountry, - 'legalState': legalState, - 'legalCity': legalCity, - 'legalAddress': legalAddress, - 'legalTaxId': legalTaxId - }); - } - - /** - * Get Project - * - * @param string projectId - * @throws Exception - * @return {} - */ - async getProject(projectId) { - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Project - * - * @param string projectId - * @param string name - * @param string description - * @param string logo - * @param string url - * @param string legalName - * @param string legalCountry - * @param string legalState - * @param string legalCity - * @param string legalAddress - * @param string legalTaxId - * @throws Exception - * @return {} - */ - async updateProject(projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legalName, - 'legalCountry': legalCountry, - 'legalState': legalState, - 'legalCity': legalCity, - 'legalAddress': legalAddress, - 'legalTaxId': legalTaxId - }); - } - - /** - * Delete Project - * - * @param string projectId - * @throws Exception - * @return {} - */ - async deleteProject(projectId) { - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Keys - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listKeys(projectId) { - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Key - * - * @param string projectId - * @param string name - * @param array scopes - * @throws Exception - * @return {} - */ - async createKey(projectId, name, scopes) { - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'scopes': scopes - }); - } - - /** - * Get Key - * - * @param string projectId - * @param string keyId - * @throws Exception - * @return {} - */ - async getKey(projectId, keyId) { - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Key - * - * @param string projectId - * @param string keyId - * @param string name - * @param array scopes - * @throws Exception - * @return {} - */ - async updateKey(projectId, keyId, name, scopes) { - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'scopes': scopes - }); - } - - /** - * Delete Key - * - * @param string projectId - * @param string keyId - * @throws Exception - * @return {} - */ - async deleteKey(projectId, keyId) { - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Project OAuth - * - * @param string projectId - * @param string provider - * @param string appId - * @param string secret - * @throws Exception - * @return {} - */ - async updateProjectOAuth(projectId, provider, appId = '', secret = '') { - let path = '/projects/{projectId}/oauth'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'provider': provider, - 'appId': appId, - 'secret': secret - }); - } - - /** - * List Platforms - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listPlatforms(projectId) { - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Platform - * - * @param string projectId - * @param string type - * @param string name - * @param string key - * @param string store - * @param string url - * @throws Exception - * @return {} - */ - async createPlatform(projectId, type, name, key = '', store = '', url = '') { - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'type': type, - 'name': name, - 'key': key, - 'store': store, - 'url': url - }); - } - - /** - * Get Platform - * - * @param string projectId - * @param string platformId - * @throws Exception - * @return {} - */ - async getPlatform(projectId, platformId) { - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Platform - * - * @param string projectId - * @param string platformId - * @param string name - * @param string key - * @param string store - * @param string url - * @throws Exception - * @return {} - */ - async updatePlatform(projectId, platformId, name, key = '', store = '', url = '') { - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'key': key, - 'store': store, - 'url': url - }); - } - - /** - * Delete Platform - * - * @param string projectId - * @param string platformId - * @throws Exception - * @return {} - */ - async deletePlatform(projectId, platformId) { - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Tasks - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listTasks(projectId) { - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Task - * - * @param string projectId - * @param string name - * @param string status - * @param string schedule - * @param number security - * @param string httpMethod - * @param string httpUrl - * @param array httpHeaders - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async createTask(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': httpMethod, - 'httpUrl': httpUrl, - 'httpHeaders': httpHeaders, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Get Task - * - * @param string projectId - * @param string taskId - * @throws Exception - * @return {} - */ - async getTask(projectId, taskId) { - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Task - * - * @param string projectId - * @param string taskId - * @param string name - * @param string status - * @param string schedule - * @param number security - * @param string httpMethod - * @param string httpUrl - * @param array httpHeaders - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async updateTask(projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': httpMethod, - 'httpUrl': httpUrl, - 'httpHeaders': httpHeaders, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Delete Task - * - * @param string projectId - * @param string taskId - * @throws Exception - * @return {} - */ - async deleteTask(projectId, taskId) { - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Project - * - * @param string projectId - * @throws Exception - * @return {} - */ - async getProjectUsage(projectId) { - let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Webhooks - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listWebhooks(projectId) { - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Webhook - * - * @param string projectId - * @param string name - * @param array events - * @param string url - * @param number security - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async createWebhook(projectId, name, events, url, security, httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Get Webhook - * - * @param string projectId - * @param string webhookId - * @throws Exception - * @return {} - */ - async getWebhook(projectId, webhookId) { - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Webhook - * - * @param string projectId - * @param string webhookId - * @param string name - * @param array events - * @param string url - * @param number security - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async updateWebhook(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Delete Webhook - * - * @param string projectId - * @param string webhookId - * @throws Exception - * @return {} - */ - async deleteWebhook(projectId, webhookId) { - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Projects; \ No newline at end of file diff --git a/app/sdks/node/lib/services/storage.js b/app/sdks/node/lib/services/storage.js deleted file mode 100644 index fb9f8632c9..0000000000 --- a/app/sdks/node/lib/services/storage.js +++ /dev/null @@ -1,199 +0,0 @@ -const Service = require('../service.js'); - -class Storage extends Service { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listFiles(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/storage/files'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param File files - * @param array read - * @param array write - * @throws Exception - * @return {} - */ - async createFile(files, read, write) { - let path = '/storage/files'; - - return await this.client.call('post', path, { - 'content-type': 'multipart/form-data', - }, - { - 'files': files, - 'read': read, - 'write': write - }); - } - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param string fileId - * @throws Exception - * @return {} - */ - async getFile(fileId) { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param string fileId - * @param array read - * @param array write - * @throws Exception - * @return {} - */ - async updateFile(fileId, read, write) { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'read': read, - 'write': write - }); - } - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param string fileId - * @throws Exception - * @return {} - */ - async deleteFile(fileId) { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get File for Download - * - * Get file content by its unique ID. The endpoint response return with a - * 'Content-Disposition: attachment' header that tells the browser to start - * downloading the file to user downloads directory. - * - * @param string fileId - * @throws Exception - * @return {} - */ - async getFileDownload(fileId) { - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get File Preview - * - * Get file preview image. Currently, this method supports preview for image - * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, - * and spreadsheets will return file icon image. You can also pass query - * string arguments for cutting and resizing your preview image. - * - * @param string fileId - * @param number width - * @param number height - * @param number quality - * @param string background - * @param string output - * @throws Exception - * @return {} - */ - async getFilePreview(fileId, width = 0, height = 0, quality = 100, background = '', output = '') { - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output - }); - } - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param string fileId - * @param string as - * @throws Exception - * @return {} - */ - async getFileView(fileId, as = '') { - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'as': as - }); - } -} - -module.exports = Storage; \ No newline at end of file diff --git a/app/sdks/node/lib/services/teams.js b/app/sdks/node/lib/services/teams.js deleted file mode 100644 index 9ed1def550..0000000000 --- a/app/sdks/node/lib/services/teams.js +++ /dev/null @@ -1,266 +0,0 @@ -const Service = require('../service.js'); - -class Teams extends Service { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listTeams(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/teams'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param string name - * @param array roles - * @throws Exception - * @return {} - */ - async createTeam(name, roles = ["owner"]) { - let path = '/teams'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'roles': roles - }); - } - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param string teamId - * @throws Exception - * @return {} - */ - async getTeam(teamId) { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string teamId - * @param string name - * @throws Exception - * @return {} - */ - async updateTeam(teamId, name) { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name - }); - } - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string teamId - * @throws Exception - * @return {} - */ - async deleteTeam(teamId) { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Team Members - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param string teamId - * @throws Exception - * @return {} - */ - async getTeamMembers(teamId) { - let path = '/teams/{teamId}/members'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * 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 the redirect parameter to redirect the user from the invitation email - * back to your app. When the user is redirected, use the - * /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the - * user to the team. - * - * Please notice 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. - * - * @param string teamId - * @param string email - * @param array roles - * @param string redirect - * @param string name - * @throws Exception - * @return {} - */ - async createTeamMembership(teamId, email, roles, redirect, name = '') { - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'name': name, - 'roles': roles, - 'redirect': redirect - }); - } - - /** - * Delete Team Membership - * - * This endpoint allows a user to leave a team or for a team owner to delete - * the membership of any other team member. - * - * @param string teamId - * @param string inviteId - * @throws Exception - * @return {} - */ - async deleteTeamMembership(teamId, inviteId) { - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Team Membership (Resend) - * - * Use this endpoint to resend your invitation email for a user to join a - * team. - * - * @param string teamId - * @param string inviteId - * @param string redirect - * @throws Exception - * @return {} - */ - async createTeamMembershipResend(teamId, inviteId, redirect) { - let path = '/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'redirect': redirect - }); - } - - /** - * 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 notice 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 token. - * - * @param string teamId - * @param string inviteId - * @param string userId - * @param string secret - * @param string success - * @param string failure - * @throws Exception - * @return {} - */ - async updateTeamMembershipStatus(teamId, inviteId, userId, secret, success = '', failure = '') { - let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'userId': userId, - 'secret': secret, - 'success': success, - 'failure': failure - }); - } -} - -module.exports = Teams; \ No newline at end of file diff --git a/app/sdks/node/lib/services/users.js b/app/sdks/node/lib/services/users.js deleted file mode 100644 index 85da0ae9b8..0000000000 --- a/app/sdks/node/lib/services/users.js +++ /dev/null @@ -1,216 +0,0 @@ -const Service = require('../service.js'); - -class Users extends Service { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listUsers(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/users'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create User - * - * Create a new user. - * - * @param string email - * @param string password - * @param string name - * @throws Exception - * @return {} - */ - async createUser(email, password, name = '') { - let path = '/users'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password, - 'name': name - }); - } - - /** - * Get User - * - * Get user by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getUser(userId) { - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getUserLogs(userId) { - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get User Prefs - * - * Get user preferences by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getUserPrefs(userId) { - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update User Prefs - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param string userId - * @param string prefs - * @throws Exception - * @return {} - */ - async updateUserPrefs(userId, prefs) { - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'prefs': prefs - }); - } - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getUserSessions(userId) { - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async deleteUserSessions(userId) { - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param string userId - * @param string sessionId - * @throws Exception - * @return {} - */ - async deleteUserSession(userId, sessionId) { - let path = '/users/{userId}/sessions/:session'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - 'sessionId': sessionId - }); - } - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param string userId - * @param string status - * @throws Exception - * @return {} - */ - async updateUserStatus(userId, status) { - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'status': status - }); - } -} - -module.exports = Users; \ No newline at end of file diff --git a/app/sdks/node/package.json b/app/sdks/node/package.json deleted file mode 100644 index 88159d963a..0000000000 --- a/app/sdks/node/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "node-appwrite", - "homepage": "https://appwrite.io/support", - "description": "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)", - "version": "1.0.31", - "license": "BSD-3-Clause", - "main": "index.js", - "repository": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-node.git" - }, - "devDependencies": {}, - "dependencies": { - "request": "^2.88.0", - "request-promise-native": "^1.0.7" - } -} \ No newline at end of file diff --git a/app/sdks/nodejs/docs/examples/account/create-account-recovery.md b/app/sdks/nodejs/docs/examples/account/create-account-recovery.md deleted file mode 100644 index 192870a20f..0000000000 --- a/app/sdks/nodejs/docs/examples/account/create-account-recovery.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client -; - -let promise = account.createAccountRecovery('email@example.com', '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/nodejs/docs/examples/account/create-account-session-o-auth.md b/app/sdks/nodejs/docs/examples/account/create-account-session-o-auth.md deleted file mode 100644 index 7e401a4161..0000000000 --- a/app/sdks/nodejs/docs/examples/account/create-account-session-o-auth.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client -; - -let promise = account.createAccountSessionOAuth('bitbucket', 'https://example.com', '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/nodejs/docs/examples/account/create-account-session.md b/app/sdks/nodejs/docs/examples/account/create-account-session.md deleted file mode 100644 index 755f4bd3e5..0000000000 --- a/app/sdks/nodejs/docs/examples/account/create-account-session.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client -; - -let promise = account.createAccountSession('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/nodejs/docs/examples/account/create-account-verification.md b/app/sdks/nodejs/docs/examples/account/create-account-verification.md deleted file mode 100644 index 3e2082273f..0000000000 --- a/app/sdks/nodejs/docs/examples/account/create-account-verification.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.createAccountVerification('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/nodejs/docs/examples/account/create-account.md b/app/sdks/nodejs/docs/examples/account/create-account.md deleted file mode 100644 index ea36651887..0000000000 --- a/app/sdks/nodejs/docs/examples/account/create-account.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client -; - -let promise = account.createAccount('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/nodejs/docs/examples/account/delete-account-current-session.md b/app/sdks/nodejs/docs/examples/account/delete-account-current-session.md deleted file mode 100644 index 1d617e20e6..0000000000 --- a/app/sdks/nodejs/docs/examples/account/delete-account-current-session.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.deleteAccountCurrentSession(); - -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/account/delete-account-session.md b/app/sdks/nodejs/docs/examples/account/delete-account-session.md deleted file mode 100644 index 23388767ce..0000000000 --- a/app/sdks/nodejs/docs/examples/account/delete-account-session.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.deleteAccountSession('[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/account/delete-account-sessions.md b/app/sdks/nodejs/docs/examples/account/delete-account-sessions.md deleted file mode 100644 index 5571d7af4e..0000000000 --- a/app/sdks/nodejs/docs/examples/account/delete-account-sessions.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.deleteAccountSessions(); - -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/account/delete.md b/app/sdks/nodejs/docs/examples/account/delete.md deleted file mode 100644 index a2294e7a2b..0000000000 --- a/app/sdks/nodejs/docs/examples/account/delete.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.delete(); - -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/account/get-account-logs.md b/app/sdks/nodejs/docs/examples/account/get-account-logs.md deleted file mode 100644 index 7c241510dd..0000000000 --- a/app/sdks/nodejs/docs/examples/account/get-account-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.getAccountLogs(); - -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/account/get-account-prefs.md b/app/sdks/nodejs/docs/examples/account/get-account-prefs.md deleted file mode 100644 index f6c6ce0ab7..0000000000 --- a/app/sdks/nodejs/docs/examples/account/get-account-prefs.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.getAccountPrefs(); - -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/account/get-account-sessions.md b/app/sdks/nodejs/docs/examples/account/get-account-sessions.md deleted file mode 100644 index 60adb274c7..0000000000 --- a/app/sdks/nodejs/docs/examples/account/get-account-sessions.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.getAccountSessions(); - -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/account/get-account.md b/app/sdks/nodejs/docs/examples/account/get-account.md deleted file mode 100644 index 5b27263b55..0000000000 --- a/app/sdks/nodejs/docs/examples/account/get-account.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.getAccount(); - -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/account/update-account-name.md b/app/sdks/nodejs/docs/examples/account/update-account-name.md deleted file mode 100644 index 8c819ac65b..0000000000 --- a/app/sdks/nodejs/docs/examples/account/update-account-name.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.updateAccountName('[NAME]'); - -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/account/update-account-password.md b/app/sdks/nodejs/docs/examples/account/update-account-password.md deleted file mode 100644 index d58273c139..0000000000 --- a/app/sdks/nodejs/docs/examples/account/update-account-password.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.updateAccountPassword('password', 'password'); - -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/account/update-account-recovery.md b/app/sdks/nodejs/docs/examples/account/update-account-recovery.md deleted file mode 100644 index a161f077f6..0000000000 --- a/app/sdks/nodejs/docs/examples/account/update-account-recovery.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client -; - -let promise = account.updateAccountRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); - -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/account/update-account-verification.md b/app/sdks/nodejs/docs/examples/account/update-account-verification.md deleted file mode 100644 index d935d0d635..0000000000 --- a/app/sdks/nodejs/docs/examples/account/update-account-verification.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client -; - -let promise = account.updateAccountVerification('[USER_ID]', '[SECRET]', 'password'); - -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/account/update-email.md b/app/sdks/nodejs/docs/examples/account/update-email.md deleted file mode 100644 index e1937eb31a..0000000000 --- a/app/sdks/nodejs/docs/examples/account/update-email.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.updateEmail('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/nodejs/docs/examples/account/update-prefs.md b/app/sdks/nodejs/docs/examples/account/update-prefs.md deleted file mode 100644 index c52e3a560a..0000000000 --- a/app/sdks/nodejs/docs/examples/account/update-prefs.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let account = new sdk.Account(client); - -client - .setProject('') -; - -let promise = account.updatePrefs(''); - -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/avatars/get-browser.md b/app/sdks/nodejs/docs/examples/avatars/get-browser.md index ae650dae9b..50d3fefcf1 100644 --- a/app/sdks/nodejs/docs/examples/avatars/get-browser.md +++ b/app/sdks/nodejs/docs/examples/avatars/get-browser.md @@ -7,6 +7,7 @@ let avatars = new sdk.Avatars(client); client .setProject('') + .setKey('') ; let promise = avatars.getBrowser('aa'); diff --git a/app/sdks/nodejs/docs/examples/avatars/get-credit-card.md b/app/sdks/nodejs/docs/examples/avatars/get-credit-card.md index 567ff2c81f..f64488cc12 100644 --- a/app/sdks/nodejs/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/nodejs/docs/examples/avatars/get-credit-card.md @@ -7,6 +7,7 @@ let avatars = new sdk.Avatars(client); client .setProject('') + .setKey('') ; let promise = avatars.getCreditCard('amex'); diff --git a/app/sdks/nodejs/docs/examples/avatars/get-favicon.md b/app/sdks/nodejs/docs/examples/avatars/get-favicon.md index 10e05eef00..ac449e9f1a 100644 --- a/app/sdks/nodejs/docs/examples/avatars/get-favicon.md +++ b/app/sdks/nodejs/docs/examples/avatars/get-favicon.md @@ -7,6 +7,7 @@ let avatars = new sdk.Avatars(client); client .setProject('') + .setKey('') ; let promise = avatars.getFavicon('https://example.com'); diff --git a/app/sdks/nodejs/docs/examples/avatars/get-flag.md b/app/sdks/nodejs/docs/examples/avatars/get-flag.md index 4793f320af..d53f2aa555 100644 --- a/app/sdks/nodejs/docs/examples/avatars/get-flag.md +++ b/app/sdks/nodejs/docs/examples/avatars/get-flag.md @@ -7,6 +7,7 @@ let avatars = new sdk.Avatars(client); client .setProject('') + .setKey('') ; let promise = avatars.getFlag('af'); diff --git a/app/sdks/nodejs/docs/examples/avatars/get-image.md b/app/sdks/nodejs/docs/examples/avatars/get-image.md index 5329174988..e541b90e61 100644 --- a/app/sdks/nodejs/docs/examples/avatars/get-image.md +++ b/app/sdks/nodejs/docs/examples/avatars/get-image.md @@ -7,6 +7,7 @@ let avatars = new sdk.Avatars(client); client .setProject('') + .setKey('') ; let promise = avatars.getImage('https://example.com'); diff --git a/app/sdks/nodejs/docs/examples/avatars/get-q-r.md b/app/sdks/nodejs/docs/examples/avatars/get-q-r.md index adb6ea9ca1..9611a617ef 100644 --- a/app/sdks/nodejs/docs/examples/avatars/get-q-r.md +++ b/app/sdks/nodejs/docs/examples/avatars/get-q-r.md @@ -7,6 +7,7 @@ let avatars = new sdk.Avatars(client); client .setProject('') + .setKey('') ; let promise = avatars.getQR('[TEXT]'); diff --git a/app/sdks/nodejs/docs/examples/database/create-collection.md b/app/sdks/nodejs/docs/examples/database/create-collection.md index cdd31c2c40..c7ea8d43e1 100644 --- a/app/sdks/nodejs/docs/examples/database/create-collection.md +++ b/app/sdks/nodejs/docs/examples/database/create-collection.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.createCollection('[NAME]', [], [], []); diff --git a/app/sdks/nodejs/docs/examples/database/create-document.md b/app/sdks/nodejs/docs/examples/database/create-document.md index b1d3745d3c..9a15f133d5 100644 --- a/app/sdks/nodejs/docs/examples/database/create-document.md +++ b/app/sdks/nodejs/docs/examples/database/create-document.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.createDocument('[COLLECTION_ID]', '{}', [], []); diff --git a/app/sdks/nodejs/docs/examples/database/delete-collection.md b/app/sdks/nodejs/docs/examples/database/delete-collection.md index 4fe87892ef..7be40b41bf 100644 --- a/app/sdks/nodejs/docs/examples/database/delete-collection.md +++ b/app/sdks/nodejs/docs/examples/database/delete-collection.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.deleteCollection('[COLLECTION_ID]'); diff --git a/app/sdks/nodejs/docs/examples/database/delete-document.md b/app/sdks/nodejs/docs/examples/database/delete-document.md index 1dba553a31..d74f2dd16c 100644 --- a/app/sdks/nodejs/docs/examples/database/delete-document.md +++ b/app/sdks/nodejs/docs/examples/database/delete-document.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); diff --git a/app/sdks/nodejs/docs/examples/database/get-collection.md b/app/sdks/nodejs/docs/examples/database/get-collection.md index a634fcb9e8..69a39382bf 100644 --- a/app/sdks/nodejs/docs/examples/database/get-collection.md +++ b/app/sdks/nodejs/docs/examples/database/get-collection.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.getCollection('[COLLECTION_ID]'); diff --git a/app/sdks/nodejs/docs/examples/database/get-document.md b/app/sdks/nodejs/docs/examples/database/get-document.md index 034ab82c37..5a676580bd 100644 --- a/app/sdks/nodejs/docs/examples/database/get-document.md +++ b/app/sdks/nodejs/docs/examples/database/get-document.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); diff --git a/app/sdks/nodejs/docs/examples/database/list-collections.md b/app/sdks/nodejs/docs/examples/database/list-collections.md index 27e960111f..2f746de896 100644 --- a/app/sdks/nodejs/docs/examples/database/list-collections.md +++ b/app/sdks/nodejs/docs/examples/database/list-collections.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.listCollections(); diff --git a/app/sdks/nodejs/docs/examples/database/list-documents.md b/app/sdks/nodejs/docs/examples/database/list-documents.md index 4dd99052af..641a572420 100644 --- a/app/sdks/nodejs/docs/examples/database/list-documents.md +++ b/app/sdks/nodejs/docs/examples/database/list-documents.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.listDocuments('[COLLECTION_ID]'); diff --git a/app/sdks/nodejs/docs/examples/database/update-collection.md b/app/sdks/nodejs/docs/examples/database/update-collection.md index 37e4ef9fa1..d393606e8f 100644 --- a/app/sdks/nodejs/docs/examples/database/update-collection.md +++ b/app/sdks/nodejs/docs/examples/database/update-collection.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.updateCollection('[COLLECTION_ID]', '[NAME]', [], []); diff --git a/app/sdks/nodejs/docs/examples/database/update-document.md b/app/sdks/nodejs/docs/examples/database/update-document.md index 1be1d9672a..b281187da4 100644 --- a/app/sdks/nodejs/docs/examples/database/update-document.md +++ b/app/sdks/nodejs/docs/examples/database/update-document.md @@ -7,6 +7,7 @@ let database = new sdk.Database(client); client .setProject('') + .setKey('') ; let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', '{}', [], []); diff --git a/app/sdks/nodejs/docs/examples/locale/get-continents.md b/app/sdks/nodejs/docs/examples/locale/get-continents.md index 84ea74f1b5..3c2143cf06 100644 --- a/app/sdks/nodejs/docs/examples/locale/get-continents.md +++ b/app/sdks/nodejs/docs/examples/locale/get-continents.md @@ -7,6 +7,7 @@ let locale = new sdk.Locale(client); client .setProject('') + .setKey('') ; let promise = locale.getContinents(); diff --git a/app/sdks/nodejs/docs/examples/locale/get-countries-e-u.md b/app/sdks/nodejs/docs/examples/locale/get-countries-e-u.md index a022ddee34..3aabf5713b 100644 --- a/app/sdks/nodejs/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/nodejs/docs/examples/locale/get-countries-e-u.md @@ -7,6 +7,7 @@ let locale = new sdk.Locale(client); client .setProject('') + .setKey('') ; let promise = locale.getCountriesEU(); diff --git a/app/sdks/nodejs/docs/examples/locale/get-countries-phones.md b/app/sdks/nodejs/docs/examples/locale/get-countries-phones.md index b7d870f7df..79cc6f5b6b 100644 --- a/app/sdks/nodejs/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/nodejs/docs/examples/locale/get-countries-phones.md @@ -7,6 +7,7 @@ let locale = new sdk.Locale(client); client .setProject('') + .setKey('') ; let promise = locale.getCountriesPhones(); diff --git a/app/sdks/nodejs/docs/examples/locale/get-countries.md b/app/sdks/nodejs/docs/examples/locale/get-countries.md index 610d679dfb..a4e878bc6a 100644 --- a/app/sdks/nodejs/docs/examples/locale/get-countries.md +++ b/app/sdks/nodejs/docs/examples/locale/get-countries.md @@ -7,6 +7,7 @@ let locale = new sdk.Locale(client); client .setProject('') + .setKey('') ; let promise = locale.getCountries(); diff --git a/app/sdks/nodejs/docs/examples/locale/get-currencies.md b/app/sdks/nodejs/docs/examples/locale/get-currencies.md index 0bfb6b1951..59d8137dee 100644 --- a/app/sdks/nodejs/docs/examples/locale/get-currencies.md +++ b/app/sdks/nodejs/docs/examples/locale/get-currencies.md @@ -7,6 +7,7 @@ let locale = new sdk.Locale(client); client .setProject('') + .setKey('') ; let promise = locale.getCurrencies(); diff --git a/app/sdks/nodejs/docs/examples/locale/get-locale.md b/app/sdks/nodejs/docs/examples/locale/get-locale.md index f07554e149..57e5d69e78 100644 --- a/app/sdks/nodejs/docs/examples/locale/get-locale.md +++ b/app/sdks/nodejs/docs/examples/locale/get-locale.md @@ -7,6 +7,7 @@ let locale = new sdk.Locale(client); client .setProject('') + .setKey('') ; let promise = locale.getLocale(); diff --git a/app/sdks/nodejs/docs/examples/projects/create-key.md b/app/sdks/nodejs/docs/examples/projects/create-key.md deleted file mode 100644 index 2328b381a4..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/create-key.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/create-platform.md b/app/sdks/nodejs/docs/examples/projects/create-platform.md deleted file mode 100644 index 7ca5744429..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/create-platform.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/create-project.md b/app/sdks/nodejs/docs/examples/projects/create-project.md deleted file mode 100644 index 787cba3cdb..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/create-project.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.createProject('[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/nodejs/docs/examples/projects/create-task.md b/app/sdks/nodejs/docs/examples/projects/create-task.md deleted file mode 100644 index 6aeab88830..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/create-task.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/create-webhook.md b/app/sdks/nodejs/docs/examples/projects/create-webhook.md deleted file mode 100644 index 3998c671e2..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/create-webhook.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/delete-key.md b/app/sdks/nodejs/docs/examples/projects/delete-key.md deleted file mode 100644 index 7aaa57ea15..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/delete-key.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/delete-platform.md b/app/sdks/nodejs/docs/examples/projects/delete-platform.md deleted file mode 100644 index 96a539a160..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/delete-platform.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/delete-project.md b/app/sdks/nodejs/docs/examples/projects/delete-project.md deleted file mode 100644 index 755733f80b..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/delete-project.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.deleteProject('[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/nodejs/docs/examples/projects/delete-task.md b/app/sdks/nodejs/docs/examples/projects/delete-task.md deleted file mode 100644 index 944f31cc1c..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/delete-task.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/delete-webhook.md b/app/sdks/nodejs/docs/examples/projects/delete-webhook.md deleted file mode 100644 index faa5b59b6a..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/delete-webhook.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/get-key.md b/app/sdks/nodejs/docs/examples/projects/get-key.md deleted file mode 100644 index fa0c34f520..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/get-key.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/get-platform.md b/app/sdks/nodejs/docs/examples/projects/get-platform.md deleted file mode 100644 index a54b7e6788..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/get-platform.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/get-project-usage.md b/app/sdks/nodejs/docs/examples/projects/get-project-usage.md deleted file mode 100644 index b97c7b6366..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/get-project-usage.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.getProjectUsage('[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/nodejs/docs/examples/projects/get-project.md b/app/sdks/nodejs/docs/examples/projects/get-project.md deleted file mode 100644 index d548b12ffd..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/get-project.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.getProject('[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/nodejs/docs/examples/projects/get-task.md b/app/sdks/nodejs/docs/examples/projects/get-task.md deleted file mode 100644 index f6b6c6b558..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/get-task.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/get-webhook.md b/app/sdks/nodejs/docs/examples/projects/get-webhook.md deleted file mode 100644 index dbfa0f508f..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/get-webhook.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/list-keys.md b/app/sdks/nodejs/docs/examples/projects/list-keys.md deleted file mode 100644 index c66aee9905..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/list-keys.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/list-platforms.md b/app/sdks/nodejs/docs/examples/projects/list-platforms.md deleted file mode 100644 index f92efcd1ce..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/list-platforms.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/list-projects.md b/app/sdks/nodejs/docs/examples/projects/list-projects.md deleted file mode 100644 index a8f40d3bd7..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/list-projects.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.listProjects(); - -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/projects/list-tasks.md b/app/sdks/nodejs/docs/examples/projects/list-tasks.md deleted file mode 100644 index fe8176abe9..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/list-tasks.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/list-webhooks.md b/app/sdks/nodejs/docs/examples/projects/list-webhooks.md deleted file mode 100644 index b878f71618..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/list-webhooks.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/update-key.md b/app/sdks/nodejs/docs/examples/projects/update-key.md deleted file mode 100644 index 72f13ea361..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/update-key.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/update-platform.md b/app/sdks/nodejs/docs/examples/projects/update-platform.md deleted file mode 100644 index 44fad61cfb..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/update-platform.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/update-project-o-auth.md b/app/sdks/nodejs/docs/examples/projects/update-project-o-auth.md deleted file mode 100644 index 29a3c6359f..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/update-project-o-auth.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.updateProjectOAuth('[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/nodejs/docs/examples/projects/update-project.md b/app/sdks/nodejs/docs/examples/projects/update-project.md deleted file mode 100644 index ced5f47fb3..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/update-project.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = projects.updateProject('[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/nodejs/docs/examples/projects/update-task.md b/app/sdks/nodejs/docs/examples/projects/update-task.md deleted file mode 100644 index eaa54d89a5..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/update-task.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/projects/update-webhook.md b/app/sdks/nodejs/docs/examples/projects/update-webhook.md deleted file mode 100644 index 26f47557be..0000000000 --- a/app/sdks/nodejs/docs/examples/projects/update-webhook.md +++ /dev/null @@ -1,18 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let projects = new sdk.Projects(client); - -client - .setProject('') -; - -let promise = 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/nodejs/docs/examples/storage/create-file.md b/app/sdks/nodejs/docs/examples/storage/create-file.md index d8d108017d..f0c9d4c5a8 100644 --- a/app/sdks/nodejs/docs/examples/storage/create-file.md +++ b/app/sdks/nodejs/docs/examples/storage/create-file.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.createFile(document.getElementById('uploader').files[0], [], []); diff --git a/app/sdks/nodejs/docs/examples/storage/delete-file.md b/app/sdks/nodejs/docs/examples/storage/delete-file.md index fae85d0b1d..9e8d13880f 100644 --- a/app/sdks/nodejs/docs/examples/storage/delete-file.md +++ b/app/sdks/nodejs/docs/examples/storage/delete-file.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.deleteFile('[FILE_ID]'); diff --git a/app/sdks/nodejs/docs/examples/storage/get-file-download.md b/app/sdks/nodejs/docs/examples/storage/get-file-download.md index 10ca0322a3..2967170695 100644 --- a/app/sdks/nodejs/docs/examples/storage/get-file-download.md +++ b/app/sdks/nodejs/docs/examples/storage/get-file-download.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.getFileDownload('[FILE_ID]'); diff --git a/app/sdks/nodejs/docs/examples/storage/get-file-preview.md b/app/sdks/nodejs/docs/examples/storage/get-file-preview.md index f8a4b1ea02..0c09e8ca8d 100644 --- a/app/sdks/nodejs/docs/examples/storage/get-file-preview.md +++ b/app/sdks/nodejs/docs/examples/storage/get-file-preview.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.getFilePreview('[FILE_ID]'); diff --git a/app/sdks/nodejs/docs/examples/storage/get-file-view.md b/app/sdks/nodejs/docs/examples/storage/get-file-view.md index 34260abe30..a3074fbed1 100644 --- a/app/sdks/nodejs/docs/examples/storage/get-file-view.md +++ b/app/sdks/nodejs/docs/examples/storage/get-file-view.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.getFileView('[FILE_ID]'); diff --git a/app/sdks/nodejs/docs/examples/storage/get-file.md b/app/sdks/nodejs/docs/examples/storage/get-file.md index 16e109f2ef..a1a3baf009 100644 --- a/app/sdks/nodejs/docs/examples/storage/get-file.md +++ b/app/sdks/nodejs/docs/examples/storage/get-file.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.getFile('[FILE_ID]'); diff --git a/app/sdks/nodejs/docs/examples/storage/list-files.md b/app/sdks/nodejs/docs/examples/storage/list-files.md index 61fcc799b0..59a331a2b5 100644 --- a/app/sdks/nodejs/docs/examples/storage/list-files.md +++ b/app/sdks/nodejs/docs/examples/storage/list-files.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.listFiles(); diff --git a/app/sdks/nodejs/docs/examples/storage/update-file.md b/app/sdks/nodejs/docs/examples/storage/update-file.md index fbe5d588fb..3741785996 100644 --- a/app/sdks/nodejs/docs/examples/storage/update-file.md +++ b/app/sdks/nodejs/docs/examples/storage/update-file.md @@ -7,6 +7,7 @@ let storage = new sdk.Storage(client); client .setProject('') + .setKey('') ; let promise = storage.updateFile('[FILE_ID]', [], []); diff --git a/app/sdks/nodejs/docs/examples/teams/create-team-membership.md b/app/sdks/nodejs/docs/examples/teams/create-team-membership.md index 4106ac2a11..7a2c9be298 100644 --- a/app/sdks/nodejs/docs/examples/teams/create-team-membership.md +++ b/app/sdks/nodejs/docs/examples/teams/create-team-membership.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.createTeamMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); diff --git a/app/sdks/nodejs/docs/examples/teams/create-team.md b/app/sdks/nodejs/docs/examples/teams/create-team.md index c0bf9b7d59..73dd77ecc5 100644 --- a/app/sdks/nodejs/docs/examples/teams/create-team.md +++ b/app/sdks/nodejs/docs/examples/teams/create-team.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.createTeam('[NAME]'); diff --git a/app/sdks/nodejs/docs/examples/teams/delete-team-membership.md b/app/sdks/nodejs/docs/examples/teams/delete-team-membership.md index 859a9ca8a9..435a65026f 100644 --- a/app/sdks/nodejs/docs/examples/teams/delete-team-membership.md +++ b/app/sdks/nodejs/docs/examples/teams/delete-team-membership.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.deleteTeamMembership('[TEAM_ID]', '[INVITE_ID]'); diff --git a/app/sdks/nodejs/docs/examples/teams/delete-team.md b/app/sdks/nodejs/docs/examples/teams/delete-team.md index 7c87cc9260..0204d40c98 100644 --- a/app/sdks/nodejs/docs/examples/teams/delete-team.md +++ b/app/sdks/nodejs/docs/examples/teams/delete-team.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.deleteTeam('[TEAM_ID]'); diff --git a/app/sdks/nodejs/docs/examples/teams/get-team-memberships.md b/app/sdks/nodejs/docs/examples/teams/get-team-memberships.md index 4dd49446fa..038fd4e2a0 100644 --- a/app/sdks/nodejs/docs/examples/teams/get-team-memberships.md +++ b/app/sdks/nodejs/docs/examples/teams/get-team-memberships.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.getTeamMemberships('[TEAM_ID]'); diff --git a/app/sdks/nodejs/docs/examples/teams/get-team.md b/app/sdks/nodejs/docs/examples/teams/get-team.md index 0e65a57e7e..b716b7ea01 100644 --- a/app/sdks/nodejs/docs/examples/teams/get-team.md +++ b/app/sdks/nodejs/docs/examples/teams/get-team.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.getTeam('[TEAM_ID]'); diff --git a/app/sdks/nodejs/docs/examples/teams/list-teams.md b/app/sdks/nodejs/docs/examples/teams/list-teams.md index d8d3ca7010..609c708753 100644 --- a/app/sdks/nodejs/docs/examples/teams/list-teams.md +++ b/app/sdks/nodejs/docs/examples/teams/list-teams.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.listTeams(); diff --git a/app/sdks/nodejs/docs/examples/teams/update-team-membership-status.md b/app/sdks/nodejs/docs/examples/teams/update-team-membership-status.md deleted file mode 100644 index daeaf47fa0..0000000000 --- a/app/sdks/nodejs/docs/examples/teams/update-team-membership-status.md +++ /dev/null @@ -1,17 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let teams = new sdk.Teams(client); - -client -; - -let promise = teams.updateTeamMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); - -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/teams/update-team.md b/app/sdks/nodejs/docs/examples/teams/update-team.md index d527ca95ab..6afb377091 100644 --- a/app/sdks/nodejs/docs/examples/teams/update-team.md +++ b/app/sdks/nodejs/docs/examples/teams/update-team.md @@ -7,6 +7,7 @@ let teams = new sdk.Teams(client); client .setProject('') + .setKey('') ; let promise = teams.updateTeam('[TEAM_ID]', '[NAME]'); diff --git a/app/sdks/nodejs/docs/examples/users/create-user.md b/app/sdks/nodejs/docs/examples/users/create-user.md index a5c637c383..d07ab1eabf 100644 --- a/app/sdks/nodejs/docs/examples/users/create-user.md +++ b/app/sdks/nodejs/docs/examples/users/create-user.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.createUser('email@example.com', 'password'); diff --git a/app/sdks/nodejs/docs/examples/users/delete-user-session.md b/app/sdks/nodejs/docs/examples/users/delete-user-session.md index a3cbeb522c..dab704e2d4 100644 --- a/app/sdks/nodejs/docs/examples/users/delete-user-session.md +++ b/app/sdks/nodejs/docs/examples/users/delete-user-session.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.deleteUserSession('[USER_ID]', '[SESSION_ID]'); diff --git a/app/sdks/nodejs/docs/examples/users/delete-user-sessions.md b/app/sdks/nodejs/docs/examples/users/delete-user-sessions.md index 0b972bd21c..33f803298d 100644 --- a/app/sdks/nodejs/docs/examples/users/delete-user-sessions.md +++ b/app/sdks/nodejs/docs/examples/users/delete-user-sessions.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.deleteUserSessions('[USER_ID]'); diff --git a/app/sdks/nodejs/docs/examples/users/get-user-logs.md b/app/sdks/nodejs/docs/examples/users/get-user-logs.md index 1ff249ea31..85d0a125a0 100644 --- a/app/sdks/nodejs/docs/examples/users/get-user-logs.md +++ b/app/sdks/nodejs/docs/examples/users/get-user-logs.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.getUserLogs('[USER_ID]'); diff --git a/app/sdks/nodejs/docs/examples/users/get-user-prefs.md b/app/sdks/nodejs/docs/examples/users/get-user-prefs.md index 33e26ebda8..46d959e1cb 100644 --- a/app/sdks/nodejs/docs/examples/users/get-user-prefs.md +++ b/app/sdks/nodejs/docs/examples/users/get-user-prefs.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.getUserPrefs('[USER_ID]'); diff --git a/app/sdks/nodejs/docs/examples/users/get-user-sessions.md b/app/sdks/nodejs/docs/examples/users/get-user-sessions.md index 09e7e4bbdb..b3dfe28405 100644 --- a/app/sdks/nodejs/docs/examples/users/get-user-sessions.md +++ b/app/sdks/nodejs/docs/examples/users/get-user-sessions.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.getUserSessions('[USER_ID]'); diff --git a/app/sdks/nodejs/docs/examples/users/get-user.md b/app/sdks/nodejs/docs/examples/users/get-user.md index 1a9b1b5463..96676c0196 100644 --- a/app/sdks/nodejs/docs/examples/users/get-user.md +++ b/app/sdks/nodejs/docs/examples/users/get-user.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.getUser('[USER_ID]'); diff --git a/app/sdks/nodejs/docs/examples/users/list-users.md b/app/sdks/nodejs/docs/examples/users/list-users.md index 0e609113a8..455e42db4d 100644 --- a/app/sdks/nodejs/docs/examples/users/list-users.md +++ b/app/sdks/nodejs/docs/examples/users/list-users.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.listUsers(); diff --git a/app/sdks/nodejs/docs/examples/users/update-user-prefs.md b/app/sdks/nodejs/docs/examples/users/update-user-prefs.md index 58009109f8..8788ac7dba 100644 --- a/app/sdks/nodejs/docs/examples/users/update-user-prefs.md +++ b/app/sdks/nodejs/docs/examples/users/update-user-prefs.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.updateUserPrefs('[USER_ID]', ''); diff --git a/app/sdks/nodejs/docs/examples/users/update-user-status.md b/app/sdks/nodejs/docs/examples/users/update-user-status.md index 99227df81b..858833a50c 100644 --- a/app/sdks/nodejs/docs/examples/users/update-user-status.md +++ b/app/sdks/nodejs/docs/examples/users/update-user-status.md @@ -7,6 +7,7 @@ let users = new sdk.Users(client); client .setProject('') + .setKey('') ; let promise = users.updateUserStatus('[USER_ID]', '1'); diff --git a/app/sdks/nodejs/index.js b/app/sdks/nodejs/index.js index 89e82ef555..d9e8b5a391 100644 --- a/app/sdks/nodejs/index.js +++ b/app/sdks/nodejs/index.js @@ -1,20 +1,16 @@ const Client = require('./lib/client.js'); -const Account = require('./lib/services/account.js'); const Avatars = require('./lib/services/avatars.js'); const Database = require('./lib/services/database.js'); const Locale = require('./lib/services/locale.js'); -const Projects = require('./lib/services/projects.js'); const Storage = require('./lib/services/storage.js'); const Teams = require('./lib/services/teams.js'); const Users = require('./lib/services/users.js'); module.exports = { Client, - Account, Avatars, Database, Locale, - Projects, Storage, Teams, Users, diff --git a/app/sdks/nodejs/lib/services/account.js b/app/sdks/nodejs/lib/services/account.js deleted file mode 100644 index 27f6d1f709..0000000000 --- a/app/sdks/nodejs/lib/services/account.js +++ /dev/null @@ -1,474 +0,0 @@ -const Service = require('../service.js'); - -class Account extends Service { - - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws Exception - * @return {} - */ - async getAccount() { - let path = '/account'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * 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. - * - * @param string email - * @param string password - * @param string name - * @throws Exception - * @return {} - */ - async createAccount(email, password, name = '') { - let path = '/account'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password, - 'name': name - }); - } - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws Exception - * @return {} - */ - async delete() { - let path = '/account'; - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param string email - * @param string password - * @throws Exception - * @return {} - */ - async updateEmail(email, password) { - let path = '/account/email'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password - }); - } - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws Exception - * @return {} - */ - async getAccountLogs() { - let path = '/account/logs'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param string name - * @throws Exception - * @return {} - */ - async updateAccountName(name) { - let path = '/account/name'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'name': name - }); - } - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param string password - * @param string oldPassword - * @throws Exception - * @return {} - */ - async updateAccountPassword(password, oldPassword) { - let path = '/account/password'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'password': password, - 'old-password': oldPassword - }); - } - - /** - * Get Account Preferences - * - * Get currently logged in user preferences key-value object. - * - * @throws Exception - * @return {} - */ - async getAccountPrefs() { - let path = '/account/prefs'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param string prefs - * @throws Exception - * @return {} - */ - async updatePrefs(prefs) { - let path = '/account/prefs'; - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'prefs': prefs - }); - } - - /** - * 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. - * - * @param string email - * @param string url - * @throws Exception - * @return {} - */ - async createAccountRecovery(email, url) { - let path = '/account/recovery'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'url': url - }); - } - - /** - * Password Reset - * - * 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. - * - * 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 userId - * @param string secret - * @param string passwordA - * @param string passwordB - * @throws Exception - * @return {} - */ - async updateAccountRecovery(userId, secret, passwordA, passwordB) { - let path = '/account/recovery'; - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'userId': userId, - 'secret': secret, - 'password-a': passwordA, - 'password-b': passwordB - }); - } - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws Exception - * @return {} - */ - async getAccountSessions() { - let path = '/account/sessions'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * 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. - * - * @param string email - * @param string password - * @throws Exception - * @return {} - */ - async createAccountSession(email, password) { - let path = '/account/sessions'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password - }); - } - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws Exception - * @return {} - */ - async deleteAccountSessions() { - let path = '/account/sessions'; - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * 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 Exception - * @return {} - */ - async deleteAccountCurrentSession() { - let path = '/account/sessions/current'; - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Account Session with OAuth - * - * 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 - * back to your app when login is completed. - * - * @param string provider - * @param string success - * @param string failure - * @throws Exception - * @return {} - */ - async createAccountSessionOAuth(provider, success, failure) { - let path = '/account/sessions/oauth/{provider}'.replace(new RegExp('{provider}', 'g'), provider); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'success': success, - 'failure': failure - }); - } - - /** - * Delete Account Session - * - * 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. - * - * @param string id - * @throws Exception - * @return {} - */ - async deleteAccountSession(id) { - let path = '/account/sessions/{id}'.replace(new RegExp('{id}', 'g'), id); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create 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 Exception - * @return {} - */ - async createAccountVerification(url) { - let path = '/account/verification'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'url': url - }); - } - - /** - * Updated 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 - * to verify the user email ownership. If confirmed this route will return a - * 200 status code. - * - * @param string userId - * @param string secret - * @param string passwordB - * @throws Exception - * @return {} - */ - async updateAccountVerification(userId, secret, passwordB) { - let path = '/account/verification'; - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'userId': userId, - 'secret': secret, - 'password-b': passwordB - }); - } -} - -module.exports = Account; \ No newline at end of file diff --git a/app/sdks/nodejs/lib/services/projects.js b/app/sdks/nodejs/lib/services/projects.js deleted file mode 100644 index 58a03980a2..0000000000 --- a/app/sdks/nodejs/lib/services/projects.js +++ /dev/null @@ -1,609 +0,0 @@ -const Service = require('../service.js'); - -class Projects extends Service { - - /** - * List Projects - * - * @throws Exception - * @return {} - */ - async listProjects() { - let path = '/projects'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Project - * - * @param string name - * @param string teamId - * @param string description - * @param string logo - * @param string url - * @param string legalName - * @param string legalCountry - * @param string legalState - * @param string legalCity - * @param string legalAddress - * @param string legalTaxId - * @throws Exception - * @return {} - */ - async createProject(name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - let path = '/projects'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'teamId': teamId, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legalName, - 'legalCountry': legalCountry, - 'legalState': legalState, - 'legalCity': legalCity, - 'legalAddress': legalAddress, - 'legalTaxId': legalTaxId - }); - } - - /** - * Get Project - * - * @param string projectId - * @throws Exception - * @return {} - */ - async getProject(projectId) { - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Project - * - * @param string projectId - * @param string name - * @param string description - * @param string logo - * @param string url - * @param string legalName - * @param string legalCountry - * @param string legalState - * @param string legalCity - * @param string legalAddress - * @param string legalTaxId - * @throws Exception - * @return {} - */ - async updateProject(projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legalName, - 'legalCountry': legalCountry, - 'legalState': legalState, - 'legalCity': legalCity, - 'legalAddress': legalAddress, - 'legalTaxId': legalTaxId - }); - } - - /** - * Delete Project - * - * @param string projectId - * @throws Exception - * @return {} - */ - async deleteProject(projectId) { - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Keys - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listKeys(projectId) { - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Key - * - * @param string projectId - * @param string name - * @param array scopes - * @throws Exception - * @return {} - */ - async createKey(projectId, name, scopes) { - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'scopes': scopes - }); - } - - /** - * Get Key - * - * @param string projectId - * @param string keyId - * @throws Exception - * @return {} - */ - async getKey(projectId, keyId) { - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Key - * - * @param string projectId - * @param string keyId - * @param string name - * @param array scopes - * @throws Exception - * @return {} - */ - async updateKey(projectId, keyId, name, scopes) { - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'scopes': scopes - }); - } - - /** - * Delete Key - * - * @param string projectId - * @param string keyId - * @throws Exception - * @return {} - */ - async deleteKey(projectId, keyId) { - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Project OAuth - * - * @param string projectId - * @param string provider - * @param string appId - * @param string secret - * @throws Exception - * @return {} - */ - async updateProjectOAuth(projectId, provider, appId = '', secret = '') { - let path = '/projects/{projectId}/oauth'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'provider': provider, - 'appId': appId, - 'secret': secret - }); - } - - /** - * List Platforms - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listPlatforms(projectId) { - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Platform - * - * @param string projectId - * @param string type - * @param string name - * @param string key - * @param string store - * @param string url - * @throws Exception - * @return {} - */ - async createPlatform(projectId, type, name, key = '', store = '', url = '') { - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'type': type, - 'name': name, - 'key': key, - 'store': store, - 'url': url - }); - } - - /** - * Get Platform - * - * @param string projectId - * @param string platformId - * @throws Exception - * @return {} - */ - async getPlatform(projectId, platformId) { - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Platform - * - * @param string projectId - * @param string platformId - * @param string name - * @param string key - * @param string store - * @param string url - * @throws Exception - * @return {} - */ - async updatePlatform(projectId, platformId, name, key = '', store = '', url = '') { - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'key': key, - 'store': store, - 'url': url - }); - } - - /** - * Delete Platform - * - * @param string projectId - * @param string platformId - * @throws Exception - * @return {} - */ - async deletePlatform(projectId, platformId) { - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Tasks - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listTasks(projectId) { - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Task - * - * @param string projectId - * @param string name - * @param string status - * @param string schedule - * @param number security - * @param string httpMethod - * @param string httpUrl - * @param array httpHeaders - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async createTask(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': httpMethod, - 'httpUrl': httpUrl, - 'httpHeaders': httpHeaders, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Get Task - * - * @param string projectId - * @param string taskId - * @throws Exception - * @return {} - */ - async getTask(projectId, taskId) { - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Task - * - * @param string projectId - * @param string taskId - * @param string name - * @param string status - * @param string schedule - * @param number security - * @param string httpMethod - * @param string httpUrl - * @param array httpHeaders - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async updateTask(projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': httpMethod, - 'httpUrl': httpUrl, - 'httpHeaders': httpHeaders, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Delete Task - * - * @param string projectId - * @param string taskId - * @throws Exception - * @return {} - */ - async deleteTask(projectId, taskId) { - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Project - * - * @param string projectId - * @throws Exception - * @return {} - */ - async getProjectUsage(projectId) { - let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Webhooks - * - * @param string projectId - * @throws Exception - * @return {} - */ - async listWebhooks(projectId) { - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Webhook - * - * @param string projectId - * @param string name - * @param array events - * @param string url - * @param number security - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async createWebhook(projectId, name, events, url, security, httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Get Webhook - * - * @param string projectId - * @param string webhookId - * @throws Exception - * @return {} - */ - async getWebhook(projectId, webhookId) { - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Webhook - * - * @param string projectId - * @param string webhookId - * @param string name - * @param array events - * @param string url - * @param number security - * @param string httpUser - * @param string httpPass - * @throws Exception - * @return {} - */ - async updateWebhook(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') { - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': httpUser, - 'httpPass': httpPass - }); - } - - /** - * Delete Webhook - * - * @param string projectId - * @param string webhookId - * @throws Exception - * @return {} - */ - async deleteWebhook(projectId, webhookId) { - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Projects; \ No newline at end of file diff --git a/app/sdks/nodejs/lib/services/teams.js b/app/sdks/nodejs/lib/services/teams.js index 5da060f2b9..b54ca076db 100644 --- a/app/sdks/nodejs/lib/services/teams.js +++ b/app/sdks/nodejs/lib/services/teams.js @@ -197,44 +197,6 @@ class Teams extends Service { { }); } - - /** - * 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. - * - * @param string teamId - * @param string inviteId - * @param string userId - * @param string secret - * @throws Exception - * @return {} - */ - async updateTeamMembershipStatus(teamId, inviteId, userId, secret) { - let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'userId': userId, - 'secret': secret - }); - } } module.exports = Teams; \ No newline at end of file diff --git a/app/sdks/php/docs/account.md b/app/sdks/php/docs/account.md deleted file mode 100644 index 26e195d673..0000000000 --- a/app/sdks/php/docs/account.md +++ /dev/null @@ -1,253 +0,0 @@ -# Account Service - -## Get Account - -```http request -GET https://appwrite.io/v1/account -``` - -** Get currently logged in user data as JSON object. ** - -## Create Account - -```http request -POST https://appwrite.io/v1/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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | Account email | | -| password | string | User password | | -| name | string | User name | | - -## Delete Account - -```http request -DELETE https://appwrite.io/v1/account -``` - -** Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately. ** - -## Update Account Email - -```http request -PATCH https://appwrite.io/v1/account/email -``` - -** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | Email address | | -| password | string | User password | | - -## Get Account Logs - -```http request -GET https://appwrite.io/v1/account/logs -``` - -** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. ** - -## Update Account Name - -```http request -PATCH https://appwrite.io/v1/account/name -``` - -** Update currently logged in user account name. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | User name | | - -## Update Account Password - -```http request -PATCH https://appwrite.io/v1/account/password -``` - -** Update currently logged in user password. For validation, user is required to pass the password twice. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| password | string | New password | | -| old-password | string | Old password | | - -## Get Account Preferences - -```http request -GET https://appwrite.io/v1/account/prefs -``` - -** Get currently logged in user preferences key-value object. ** - -## Update Account Preferences - -```http request -PATCH https://appwrite.io/v1/account/prefs -``` - -** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| prefs | string | Prefs key-value JSON object. | | - -## Password Recovery - -```http request -POST https://appwrite.io/v1/account/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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User account email address. | | -| url | string | URL to redirect the user back to your app from the recovery email. | | - -## Password Reset - -```http request -PUT https://appwrite.io/v1/account/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. - -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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | User account UID address. | | -| secret | string | Valid reset token. | | -| password-a | string | New password. | | -| password-b | string | New password again. | | - -## Get Account Sessions - -```http request -GET https://appwrite.io/v1/account/sessions -``` - -** Get currently logged in user list of active sessions across different devices. ** - -## Create Account Session - -```http request -POST https://appwrite.io/v1/account/sessions -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User account email address | | -| password | string | User account password | | - -## Delete All Account Sessions - -```http request -DELETE https://appwrite.io/v1/account/sessions -``` - -** Delete all sessions from the user account and remove any sessions cookies from the end client. ** - -## Delete Current Account Session - -```http request -DELETE https://appwrite.io/v1/account/sessions/current -``` - -** 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. ** - -## Create Account Session with OAuth - -```http request -GET https://appwrite.io/v1/account/sessions/oauth/{provider} -``` - -** 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 back to your app when login is completed. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| provider | string | **Required** OAuth Provider. Currently, supported providers are: bitbucket, facebook, github, gitlab, google, microsoft, linkedin, slack, dropbox, salesforce, amazon, vk, discord, twitch, spotify, yahoo, yandex, twitter, paypal, bitly, mock | | -| success | string | **Required** URL to redirect back to your app after a successful login attempt. | | -| failure | string | **Required** URL to redirect back to your app after a failed login attempt. | | - -## Delete Account Session - -```http request -DELETE https://appwrite.io/v1/account/sessions/{id} -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| id | string | **Required** Session unique ID. | | - -## Create Verification - -```http request -POST https://appwrite.io/v1/account/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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| url | string | URL to redirect the user back to your app from the verification email. | | - -## Updated Verification - -```http request -PUT https://appwrite.io/v1/account/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 to verify the user email ownership. If confirmed this route will return a 200 status code. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | User account UID address. | | -| secret | string | Valid reset token. | | -| password-b | string | New password again. | | - diff --git a/app/sdks/php/docs/auth.md b/app/sdks/php/docs/auth.md deleted file mode 100644 index 2af37f5239..0000000000 --- a/app/sdks/php/docs/auth.md +++ /dev/null @@ -1,151 +0,0 @@ -# Auth Service - -## Login - -```http request -POST https://appwrite.io/v1/auth/login -``` - -** 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 notice 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User account email address | | -| password | string | User account password | | -| success | string | URL to redirect back to your app after a successful login attempt. | | -| failure | string | URL to redirect back to your app after a failed login attempt. | | - -## Login with OAuth - -```http request -GET https://appwrite.io/v1/auth/login/oauth/{provider} -``` - -** 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 back to your app when login is completed. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| provider | string | **Required** OAuth Provider. Currently, supported providers are: bitbucket, facebook, github, gitlab, google, microsoft, linkedin, slack, dropbox, amazon, vk | | -| success | string | **Required** URL to redirect back to your app after a successful login attempt. | | -| failure | string | **Required** URL to redirect back to your app after a failed login attempt. | | - -## Logout Current Session - -```http request -DELETE https://appwrite.io/v1/auth/logout -``` - -** 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. ** - -## Logout Specific Session - -```http request -DELETE https://appwrite.io/v1/auth/logout/{id} -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| id | string | **Required** User specific session unique ID number. if 0 delete all sessions. | | - -## Password Recovery - -```http request -POST https://appwrite.io/v1/auth/recovery -``` - -** Sends the user an email with a temporary secret token for password reset. When the user clicks the confirmation link he is redirected back to your app password reset redirect URL with a secret token 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User account email address. | | -| reset | string | Reset URL in your app to redirect the user after the reset token has been sent to the user email. | | - -## Password Reset - -```http request -PUT https://appwrite.io/v1/auth/recovery/reset -``` - -** Use this endpoint to complete the user account password reset. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/recovery endpoint. - -Please notice 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | User account email address. | | -| token | string | Valid reset token. | | -| password-a | string | New password. | | -| password-b | string | New password again. | | - -## Register - -```http request -POST https://appwrite.io/v1/auth/register -``` - -** 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 notice 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | Account email | | -| password | string | User password | | -| confirm | string | Confirmation URL to redirect user after confirm token has been sent to user email | | -| success | string | Redirect when registration succeed | | -| failure | string | Redirect when registration failed | | -| name | string | User name | | - -## Confirmation - -```http request -POST https://appwrite.io/v1/auth/register/confirm -``` - -** Use this endpoint to complete the confirmation of the user account email address. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/register endpoint. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | User unique ID | | -| token | string | Confirmation secret token | | - -## Resend Confirmation - -```http request -POST https://appwrite.io/v1/auth/register/confirm/resend -``` - -** This endpoint allows the user to request your app to resend him his email confirmation message. The redirect arguments act the same way as in /auth/register endpoint. - -Please notice 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| confirm | string | Confirmation URL to redirect user to your app after confirm token has been sent to user email. | | - diff --git a/app/sdks/php/docs/examples/account/create-account-recovery.md b/app/sdks/php/docs/examples/account/create-account-recovery.md deleted file mode 100644 index 0ba77c1e1f..0000000000 --- a/app/sdks/php/docs/examples/account/create-account-recovery.md +++ /dev/null @@ -1,13 +0,0 @@ -createAccountRecovery('email@example.com', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/create-account-session-o-auth.md b/app/sdks/php/docs/examples/account/create-account-session-o-auth.md deleted file mode 100644 index 7e0e4decaf..0000000000 --- a/app/sdks/php/docs/examples/account/create-account-session-o-auth.md +++ /dev/null @@ -1,13 +0,0 @@ -createAccountSessionOAuth('bitbucket', 'https://example.com', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/create-account-session.md b/app/sdks/php/docs/examples/account/create-account-session.md deleted file mode 100644 index daa9aefab6..0000000000 --- a/app/sdks/php/docs/examples/account/create-account-session.md +++ /dev/null @@ -1,13 +0,0 @@ -createAccountSession('email@example.com', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/create-account-verification.md b/app/sdks/php/docs/examples/account/create-account-verification.md deleted file mode 100644 index a7cbb8da35..0000000000 --- a/app/sdks/php/docs/examples/account/create-account-verification.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->createAccountVerification('https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/create-account.md b/app/sdks/php/docs/examples/account/create-account.md deleted file mode 100644 index d6425fc205..0000000000 --- a/app/sdks/php/docs/examples/account/create-account.md +++ /dev/null @@ -1,13 +0,0 @@ -createAccount('email@example.com', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/delete-account-current-session.md b/app/sdks/php/docs/examples/account/delete-account-current-session.md deleted file mode 100644 index 85f7d27622..0000000000 --- a/app/sdks/php/docs/examples/account/delete-account-current-session.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->deleteAccountCurrentSession(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/delete-account-session.md b/app/sdks/php/docs/examples/account/delete-account-session.md deleted file mode 100644 index b7581763c9..0000000000 --- a/app/sdks/php/docs/examples/account/delete-account-session.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->deleteAccountSession('[ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/delete-account-sessions.md b/app/sdks/php/docs/examples/account/delete-account-sessions.md deleted file mode 100644 index 45799e649c..0000000000 --- a/app/sdks/php/docs/examples/account/delete-account-sessions.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->deleteAccountSessions(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/delete.md b/app/sdks/php/docs/examples/account/delete.md deleted file mode 100644 index 2e3b5553a5..0000000000 --- a/app/sdks/php/docs/examples/account/delete.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->delete(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-account-logs.md b/app/sdks/php/docs/examples/account/get-account-logs.md deleted file mode 100644 index 48809b17cb..0000000000 --- a/app/sdks/php/docs/examples/account/get-account-logs.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->getAccountLogs(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-account-prefs.md b/app/sdks/php/docs/examples/account/get-account-prefs.md deleted file mode 100644 index f480df1927..0000000000 --- a/app/sdks/php/docs/examples/account/get-account-prefs.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->getAccountPrefs(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-account-sessions.md b/app/sdks/php/docs/examples/account/get-account-sessions.md deleted file mode 100644 index 60b8cdc97c..0000000000 --- a/app/sdks/php/docs/examples/account/get-account-sessions.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->getAccountSessions(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-account.md b/app/sdks/php/docs/examples/account/get-account.md deleted file mode 100644 index 14226f7014..0000000000 --- a/app/sdks/php/docs/examples/account/get-account.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->getAccount(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-prefs.md b/app/sdks/php/docs/examples/account/get-prefs.md deleted file mode 100644 index f3f6d72519..0000000000 --- a/app/sdks/php/docs/examples/account/get-prefs.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$account = new Account($client); - -$result = $account->getPrefs(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-security.md b/app/sdks/php/docs/examples/account/get-security.md deleted file mode 100644 index 381d0bd755..0000000000 --- a/app/sdks/php/docs/examples/account/get-security.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$account = new Account($client); - -$result = $account->getSecurity(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get-sessions.md b/app/sdks/php/docs/examples/account/get-sessions.md deleted file mode 100644 index 8af7a7cd82..0000000000 --- a/app/sdks/php/docs/examples/account/get-sessions.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$account = new Account($client); - -$result = $account->getSessions(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/get.md b/app/sdks/php/docs/examples/account/get.md deleted file mode 100644 index c7241e576f..0000000000 --- a/app/sdks/php/docs/examples/account/get.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$account = new Account($client); - -$result = $account->get(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-account-name.md b/app/sdks/php/docs/examples/account/update-account-name.md deleted file mode 100644 index a8701822ce..0000000000 --- a/app/sdks/php/docs/examples/account/update-account-name.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->updateAccountName('[NAME]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-account-password.md b/app/sdks/php/docs/examples/account/update-account-password.md deleted file mode 100644 index 5a6135fea2..0000000000 --- a/app/sdks/php/docs/examples/account/update-account-password.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->updateAccountPassword('password', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-account-recovery.md b/app/sdks/php/docs/examples/account/update-account-recovery.md deleted file mode 100644 index dcd8dda921..0000000000 --- a/app/sdks/php/docs/examples/account/update-account-recovery.md +++ /dev/null @@ -1,13 +0,0 @@ -updateAccountRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-account-verification.md b/app/sdks/php/docs/examples/account/update-account-verification.md deleted file mode 100644 index 1a2a788984..0000000000 --- a/app/sdks/php/docs/examples/account/update-account-verification.md +++ /dev/null @@ -1,13 +0,0 @@ -updateAccountVerification('[USER_ID]', '[SECRET]', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-email.md b/app/sdks/php/docs/examples/account/update-email.md deleted file mode 100644 index 3e2ed0f62b..0000000000 --- a/app/sdks/php/docs/examples/account/update-email.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->updateEmail('email@example.com', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-name.md b/app/sdks/php/docs/examples/account/update-name.md deleted file mode 100644 index 068f824863..0000000000 --- a/app/sdks/php/docs/examples/account/update-name.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$account = new Account($client); - -$result = $account->updateName('[NAME]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-password.md b/app/sdks/php/docs/examples/account/update-password.md deleted file mode 100644 index 124bc26dab..0000000000 --- a/app/sdks/php/docs/examples/account/update-password.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$account = new Account($client); - -$result = $account->updatePassword('password', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/account/update-prefs.md b/app/sdks/php/docs/examples/account/update-prefs.md deleted file mode 100644 index 66f70fa643..0000000000 --- a/app/sdks/php/docs/examples/account/update-prefs.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$account = new Account($client); - -$result = $account->updatePrefs(''); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/confirm-resend.md b/app/sdks/php/docs/examples/auth/confirm-resend.md deleted file mode 100644 index 643e600d2f..0000000000 --- a/app/sdks/php/docs/examples/auth/confirm-resend.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->confirmResend('https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/confirm.md b/app/sdks/php/docs/examples/auth/confirm.md deleted file mode 100644 index c60b7fb01d..0000000000 --- a/app/sdks/php/docs/examples/auth/confirm.md +++ /dev/null @@ -1,13 +0,0 @@ -confirm('[USER_ID]', '[TOKEN]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/login.md b/app/sdks/php/docs/examples/auth/login.md deleted file mode 100644 index f282a88e64..0000000000 --- a/app/sdks/php/docs/examples/auth/login.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->login('email@example.com', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/logout-by-session.md b/app/sdks/php/docs/examples/auth/logout-by-session.md deleted file mode 100644 index 90a1f23fd6..0000000000 --- a/app/sdks/php/docs/examples/auth/logout-by-session.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->logoutBySession('[ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/logout.md b/app/sdks/php/docs/examples/auth/logout.md deleted file mode 100644 index 78bd0275cc..0000000000 --- a/app/sdks/php/docs/examples/auth/logout.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->logout(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/oauth-callback.md b/app/sdks/php/docs/examples/auth/oauth-callback.md deleted file mode 100644 index 437a7c427f..0000000000 --- a/app/sdks/php/docs/examples/auth/oauth-callback.md +++ /dev/null @@ -1,15 +0,0 @@ -oauthCallback('[PROJECT_ID]', 'bitbucket', '[CODE]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/oauth.md b/app/sdks/php/docs/examples/auth/oauth.md deleted file mode 100644 index 25b8d17613..0000000000 --- a/app/sdks/php/docs/examples/auth/oauth.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->oauth('bitbucket', 'https://example.com', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/recovery-reset.md b/app/sdks/php/docs/examples/auth/recovery-reset.md deleted file mode 100644 index 19a4d83cfc..0000000000 --- a/app/sdks/php/docs/examples/auth/recovery-reset.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->recoveryReset('[USER_ID]', '[TOKEN]', 'password', 'password'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/recovery.md b/app/sdks/php/docs/examples/auth/recovery.md deleted file mode 100644 index b52ddcb6ed..0000000000 --- a/app/sdks/php/docs/examples/auth/recovery.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->recovery('email@example.com', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/auth/register.md b/app/sdks/php/docs/examples/auth/register.md deleted file mode 100644 index c34b859808..0000000000 --- a/app/sdks/php/docs/examples/auth/register.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$auth = new Auth($client); - -$result = $auth->register('email@example.com', 'password', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/avatars/get-browser.md b/app/sdks/php/docs/examples/avatars/get-browser.md index 464ca10e9d..c9a6a6b6c0 100644 --- a/app/sdks/php/docs/examples/avatars/get-browser.md +++ b/app/sdks/php/docs/examples/avatars/get-browser.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $avatars = new Avatars($client); diff --git a/app/sdks/php/docs/examples/avatars/get-credit-card.md b/app/sdks/php/docs/examples/avatars/get-credit-card.md index 88fa1299b9..206b0cc8c8 100644 --- a/app/sdks/php/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/php/docs/examples/avatars/get-credit-card.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $avatars = new Avatars($client); diff --git a/app/sdks/php/docs/examples/avatars/get-favicon.md b/app/sdks/php/docs/examples/avatars/get-favicon.md index 982408e5e2..01f28add89 100644 --- a/app/sdks/php/docs/examples/avatars/get-favicon.md +++ b/app/sdks/php/docs/examples/avatars/get-favicon.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $avatars = new Avatars($client); diff --git a/app/sdks/php/docs/examples/avatars/get-flag.md b/app/sdks/php/docs/examples/avatars/get-flag.md index 9a254b5907..26740446cd 100644 --- a/app/sdks/php/docs/examples/avatars/get-flag.md +++ b/app/sdks/php/docs/examples/avatars/get-flag.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $avatars = new Avatars($client); diff --git a/app/sdks/php/docs/examples/avatars/get-image.md b/app/sdks/php/docs/examples/avatars/get-image.md index a3810f2dde..bbbe68d2d0 100644 --- a/app/sdks/php/docs/examples/avatars/get-image.md +++ b/app/sdks/php/docs/examples/avatars/get-image.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $avatars = new Avatars($client); diff --git a/app/sdks/php/docs/examples/avatars/get-q-r.md b/app/sdks/php/docs/examples/avatars/get-q-r.md index ebb4a9dc15..e10ec33d59 100644 --- a/app/sdks/php/docs/examples/avatars/get-q-r.md +++ b/app/sdks/php/docs/examples/avatars/get-q-r.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $avatars = new Avatars($client); diff --git a/app/sdks/php/docs/examples/database/create-collection.md b/app/sdks/php/docs/examples/database/create-collection.md index 8be0238d10..183d906905 100644 --- a/app/sdks/php/docs/examples/database/create-collection.md +++ b/app/sdks/php/docs/examples/database/create-collection.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/create-document.md b/app/sdks/php/docs/examples/database/create-document.md index aff513cf42..84c4d7fd06 100644 --- a/app/sdks/php/docs/examples/database/create-document.md +++ b/app/sdks/php/docs/examples/database/create-document.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/delete-collection.md b/app/sdks/php/docs/examples/database/delete-collection.md index 35594a5d95..2319d52c57 100644 --- a/app/sdks/php/docs/examples/database/delete-collection.md +++ b/app/sdks/php/docs/examples/database/delete-collection.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/delete-document.md b/app/sdks/php/docs/examples/database/delete-document.md index 4193c27d3f..b364e0bcd5 100644 --- a/app/sdks/php/docs/examples/database/delete-document.md +++ b/app/sdks/php/docs/examples/database/delete-document.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/get-collection.md b/app/sdks/php/docs/examples/database/get-collection.md index 3e967c5829..9daa61ddfc 100644 --- a/app/sdks/php/docs/examples/database/get-collection.md +++ b/app/sdks/php/docs/examples/database/get-collection.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/get-document.md b/app/sdks/php/docs/examples/database/get-document.md index 9644378337..da72bd8f1b 100644 --- a/app/sdks/php/docs/examples/database/get-document.md +++ b/app/sdks/php/docs/examples/database/get-document.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/list-collections.md b/app/sdks/php/docs/examples/database/list-collections.md index b522cfc989..c46daa2cda 100644 --- a/app/sdks/php/docs/examples/database/list-collections.md +++ b/app/sdks/php/docs/examples/database/list-collections.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/list-documents.md b/app/sdks/php/docs/examples/database/list-documents.md index 21ea55d9da..973f9c477e 100644 --- a/app/sdks/php/docs/examples/database/list-documents.md +++ b/app/sdks/php/docs/examples/database/list-documents.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/update-collection.md b/app/sdks/php/docs/examples/database/update-collection.md index f6ea3a8593..2576449e5c 100644 --- a/app/sdks/php/docs/examples/database/update-collection.md +++ b/app/sdks/php/docs/examples/database/update-collection.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/database/update-document.md b/app/sdks/php/docs/examples/database/update-document.md index eff2b554e6..2051d09772 100644 --- a/app/sdks/php/docs/examples/database/update-document.md +++ b/app/sdks/php/docs/examples/database/update-document.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $database = new Database($client); diff --git a/app/sdks/php/docs/examples/locale/get-continents.md b/app/sdks/php/docs/examples/locale/get-continents.md index 96c8b219cd..22b1528c0a 100644 --- a/app/sdks/php/docs/examples/locale/get-continents.md +++ b/app/sdks/php/docs/examples/locale/get-continents.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $locale = new Locale($client); diff --git a/app/sdks/php/docs/examples/locale/get-countries-e-u.md b/app/sdks/php/docs/examples/locale/get-countries-e-u.md index 7c3fd4d285..9f0f1973cc 100644 --- a/app/sdks/php/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/php/docs/examples/locale/get-countries-e-u.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $locale = new Locale($client); diff --git a/app/sdks/php/docs/examples/locale/get-countries-phones.md b/app/sdks/php/docs/examples/locale/get-countries-phones.md index 73726aab03..2478c7c730 100644 --- a/app/sdks/php/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/php/docs/examples/locale/get-countries-phones.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $locale = new Locale($client); diff --git a/app/sdks/php/docs/examples/locale/get-countries.md b/app/sdks/php/docs/examples/locale/get-countries.md index 0433724631..111dc52777 100644 --- a/app/sdks/php/docs/examples/locale/get-countries.md +++ b/app/sdks/php/docs/examples/locale/get-countries.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $locale = new Locale($client); diff --git a/app/sdks/php/docs/examples/locale/get-currencies.md b/app/sdks/php/docs/examples/locale/get-currencies.md index f8f3c77d3a..e01d5fd623 100644 --- a/app/sdks/php/docs/examples/locale/get-currencies.md +++ b/app/sdks/php/docs/examples/locale/get-currencies.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $locale = new Locale($client); diff --git a/app/sdks/php/docs/examples/locale/get-locale.md b/app/sdks/php/docs/examples/locale/get-locale.md index edec17a38f..ac56f068de 100644 --- a/app/sdks/php/docs/examples/locale/get-locale.md +++ b/app/sdks/php/docs/examples/locale/get-locale.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $locale = new Locale($client); diff --git a/app/sdks/php/docs/examples/projects/create-key.md b/app/sdks/php/docs/examples/projects/create-key.md deleted file mode 100644 index 5eb7f27687..0000000000 --- a/app/sdks/php/docs/examples/projects/create-key.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->createKey('[PROJECT_ID]', '[NAME]', []); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/create-platform.md b/app/sdks/php/docs/examples/projects/create-platform.md deleted file mode 100644 index cde5eddad8..0000000000 --- a/app/sdks/php/docs/examples/projects/create-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->createPlatform('[PROJECT_ID]', 'web', '[NAME]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/create-project.md b/app/sdks/php/docs/examples/projects/create-project.md deleted file mode 100644 index edb6bb6ab0..0000000000 --- a/app/sdks/php/docs/examples/projects/create-project.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->createProject('[NAME]', '[TEAM_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/create-task.md b/app/sdks/php/docs/examples/projects/create-task.md deleted file mode 100644 index aaa12d98cc..0000000000 --- a/app/sdks/php/docs/examples/projects/create-task.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/create-webhook.md b/app/sdks/php/docs/examples/projects/create-webhook.md deleted file mode 100644 index 5721c423a2..0000000000 --- a/app/sdks/php/docs/examples/projects/create-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/delete-key.md b/app/sdks/php/docs/examples/projects/delete-key.md deleted file mode 100644 index da74fa05c8..0000000000 --- a/app/sdks/php/docs/examples/projects/delete-key.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->deleteKey('[PROJECT_ID]', '[KEY_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/delete-platform.md b/app/sdks/php/docs/examples/projects/delete-platform.md deleted file mode 100644 index c21a7bb93c..0000000000 --- a/app/sdks/php/docs/examples/projects/delete-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->deletePlatform('[PROJECT_ID]', '[PLATFORM_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/delete-project.md b/app/sdks/php/docs/examples/projects/delete-project.md deleted file mode 100644 index 10158026d8..0000000000 --- a/app/sdks/php/docs/examples/projects/delete-project.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->deleteProject('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/delete-task.md b/app/sdks/php/docs/examples/projects/delete-task.md deleted file mode 100644 index 1e62f3401a..0000000000 --- a/app/sdks/php/docs/examples/projects/delete-task.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->deleteTask('[PROJECT_ID]', '[TASK_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/delete-webhook.md b/app/sdks/php/docs/examples/projects/delete-webhook.md deleted file mode 100644 index 7ec160d048..0000000000 --- a/app/sdks/php/docs/examples/projects/delete-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->deleteWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/get-key.md b/app/sdks/php/docs/examples/projects/get-key.md deleted file mode 100644 index d5b5ed742f..0000000000 --- a/app/sdks/php/docs/examples/projects/get-key.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->getKey('[PROJECT_ID]', '[KEY_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/get-platform.md b/app/sdks/php/docs/examples/projects/get-platform.md deleted file mode 100644 index 13777df0f4..0000000000 --- a/app/sdks/php/docs/examples/projects/get-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->getPlatform('[PROJECT_ID]', '[PLATFORM_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/get-project-usage.md b/app/sdks/php/docs/examples/projects/get-project-usage.md deleted file mode 100644 index f4ebfa5d2e..0000000000 --- a/app/sdks/php/docs/examples/projects/get-project-usage.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->getProjectUsage('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/get-project.md b/app/sdks/php/docs/examples/projects/get-project.md deleted file mode 100644 index f3bbd65043..0000000000 --- a/app/sdks/php/docs/examples/projects/get-project.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->getProject('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/get-task.md b/app/sdks/php/docs/examples/projects/get-task.md deleted file mode 100644 index 3ca455c2bc..0000000000 --- a/app/sdks/php/docs/examples/projects/get-task.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->getTask('[PROJECT_ID]', '[TASK_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/get-webhook.md b/app/sdks/php/docs/examples/projects/get-webhook.md deleted file mode 100644 index bfde5a94e3..0000000000 --- a/app/sdks/php/docs/examples/projects/get-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->getWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/list-keys.md b/app/sdks/php/docs/examples/projects/list-keys.md deleted file mode 100644 index ec00ca41ad..0000000000 --- a/app/sdks/php/docs/examples/projects/list-keys.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->listKeys('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/list-platforms.md b/app/sdks/php/docs/examples/projects/list-platforms.md deleted file mode 100644 index c9272711e7..0000000000 --- a/app/sdks/php/docs/examples/projects/list-platforms.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->listPlatforms('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/list-projects.md b/app/sdks/php/docs/examples/projects/list-projects.md deleted file mode 100644 index 53b7047e57..0000000000 --- a/app/sdks/php/docs/examples/projects/list-projects.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->listProjects(); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/list-tasks.md b/app/sdks/php/docs/examples/projects/list-tasks.md deleted file mode 100644 index 175b580420..0000000000 --- a/app/sdks/php/docs/examples/projects/list-tasks.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->listTasks('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/list-webhooks.md b/app/sdks/php/docs/examples/projects/list-webhooks.md deleted file mode 100644 index 299b9e3ecc..0000000000 --- a/app/sdks/php/docs/examples/projects/list-webhooks.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->listWebhooks('[PROJECT_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-key.md b/app/sdks/php/docs/examples/projects/update-key.md deleted file mode 100644 index 960761c01c..0000000000 --- a/app/sdks/php/docs/examples/projects/update-key.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->updateKey('[PROJECT_ID]', '[KEY_ID]', '[NAME]', []); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-platform.md b/app/sdks/php/docs/examples/projects/update-platform.md deleted file mode 100644 index 0537dec85a..0000000000 --- a/app/sdks/php/docs/examples/projects/update-platform.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->updatePlatform('[PROJECT_ID]', '[PLATFORM_ID]', '[NAME]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-project-o-auth.md b/app/sdks/php/docs/examples/projects/update-project-o-auth.md deleted file mode 100644 index 283ecbddff..0000000000 --- a/app/sdks/php/docs/examples/projects/update-project-o-auth.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->updateProjectOAuth('[PROJECT_ID]', 'bitbucket'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-project.md b/app/sdks/php/docs/examples/projects/update-project.md deleted file mode 100644 index f878bc9119..0000000000 --- a/app/sdks/php/docs/examples/projects/update-project.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->updateProject('[PROJECT_ID]', '[NAME]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-task.md b/app/sdks/php/docs/examples/projects/update-task.md deleted file mode 100644 index 95f64e6188..0000000000 --- a/app/sdks/php/docs/examples/projects/update-task.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/projects/update-webhook.md b/app/sdks/php/docs/examples/projects/update-webhook.md deleted file mode 100644 index d550c0c178..0000000000 --- a/app/sdks/php/docs/examples/projects/update-webhook.md +++ /dev/null @@ -1,14 +0,0 @@ -setProject('') -; - -$projects = new Projects($client); - -$result = $projects->updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/storage/create-file.md b/app/sdks/php/docs/examples/storage/create-file.md index 1e8df67482..225b9e2bec 100644 --- a/app/sdks/php/docs/examples/storage/create-file.md +++ b/app/sdks/php/docs/examples/storage/create-file.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/delete-file.md b/app/sdks/php/docs/examples/storage/delete-file.md index 21755b6cfb..74448e5a7c 100644 --- a/app/sdks/php/docs/examples/storage/delete-file.md +++ b/app/sdks/php/docs/examples/storage/delete-file.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/get-file-download.md b/app/sdks/php/docs/examples/storage/get-file-download.md index 545cf88bbf..3a6db00081 100644 --- a/app/sdks/php/docs/examples/storage/get-file-download.md +++ b/app/sdks/php/docs/examples/storage/get-file-download.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/get-file-preview.md b/app/sdks/php/docs/examples/storage/get-file-preview.md index 6cfc61ffb0..8b02bdd2a9 100644 --- a/app/sdks/php/docs/examples/storage/get-file-preview.md +++ b/app/sdks/php/docs/examples/storage/get-file-preview.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/get-file-view.md b/app/sdks/php/docs/examples/storage/get-file-view.md index 438e18479c..59cc25bc74 100644 --- a/app/sdks/php/docs/examples/storage/get-file-view.md +++ b/app/sdks/php/docs/examples/storage/get-file-view.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/get-file.md b/app/sdks/php/docs/examples/storage/get-file.md index ae442c8924..63fa59b40a 100644 --- a/app/sdks/php/docs/examples/storage/get-file.md +++ b/app/sdks/php/docs/examples/storage/get-file.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/list-files.md b/app/sdks/php/docs/examples/storage/list-files.md index 3384a3f6fd..434e1fe70d 100644 --- a/app/sdks/php/docs/examples/storage/list-files.md +++ b/app/sdks/php/docs/examples/storage/list-files.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/storage/update-file.md b/app/sdks/php/docs/examples/storage/update-file.md index 0a9a17f9eb..637870a7a6 100644 --- a/app/sdks/php/docs/examples/storage/update-file.md +++ b/app/sdks/php/docs/examples/storage/update-file.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $storage = new Storage($client); diff --git a/app/sdks/php/docs/examples/teams/create-team-membership-resend.md b/app/sdks/php/docs/examples/teams/create-team-membership-resend.md deleted file mode 100644 index 0789412121..0000000000 --- a/app/sdks/php/docs/examples/teams/create-team-membership-resend.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$teams = new Teams($client); - -$result = $teams->createTeamMembershipResend('[TEAM_ID]', '[INVITE_ID]', 'https://example.com'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/teams/create-team-membership.md b/app/sdks/php/docs/examples/teams/create-team-membership.md index f43d527a8c..12a47b6f15 100644 --- a/app/sdks/php/docs/examples/teams/create-team-membership.md +++ b/app/sdks/php/docs/examples/teams/create-team-membership.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/create-team.md b/app/sdks/php/docs/examples/teams/create-team.md index 7f51f15152..11928b37cc 100644 --- a/app/sdks/php/docs/examples/teams/create-team.md +++ b/app/sdks/php/docs/examples/teams/create-team.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/delete-team-membership.md b/app/sdks/php/docs/examples/teams/delete-team-membership.md index 80e324d83b..d53e1ed7ce 100644 --- a/app/sdks/php/docs/examples/teams/delete-team-membership.md +++ b/app/sdks/php/docs/examples/teams/delete-team-membership.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/delete-team.md b/app/sdks/php/docs/examples/teams/delete-team.md index 4647a11e75..7fb04015be 100644 --- a/app/sdks/php/docs/examples/teams/delete-team.md +++ b/app/sdks/php/docs/examples/teams/delete-team.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/get-team-members.md b/app/sdks/php/docs/examples/teams/get-team-members.md deleted file mode 100644 index 7f7b4c88bf..0000000000 --- a/app/sdks/php/docs/examples/teams/get-team-members.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$teams = new Teams($client); - -$result = $teams->getTeamMembers('[TEAM_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/teams/get-team-memberships.md b/app/sdks/php/docs/examples/teams/get-team-memberships.md index 10c19ab59c..e7868f6a8c 100644 --- a/app/sdks/php/docs/examples/teams/get-team-memberships.md +++ b/app/sdks/php/docs/examples/teams/get-team-memberships.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/get-team.md b/app/sdks/php/docs/examples/teams/get-team.md index e9307dc934..e58a9d0dc2 100644 --- a/app/sdks/php/docs/examples/teams/get-team.md +++ b/app/sdks/php/docs/examples/teams/get-team.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/list-teams.md b/app/sdks/php/docs/examples/teams/list-teams.md index 2b8d208c7e..9b753c6d16 100644 --- a/app/sdks/php/docs/examples/teams/list-teams.md +++ b/app/sdks/php/docs/examples/teams/list-teams.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/teams/update-team-membership-status.md b/app/sdks/php/docs/examples/teams/update-team-membership-status.md deleted file mode 100644 index cd387f598e..0000000000 --- a/app/sdks/php/docs/examples/teams/update-team-membership-status.md +++ /dev/null @@ -1,13 +0,0 @@ -updateTeamMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/teams/update-team.md b/app/sdks/php/docs/examples/teams/update-team.md index 1047fd8ce3..a76fce3a83 100644 --- a/app/sdks/php/docs/examples/teams/update-team.md +++ b/app/sdks/php/docs/examples/teams/update-team.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $teams = new Teams($client); diff --git a/app/sdks/php/docs/examples/users/create-user.md b/app/sdks/php/docs/examples/users/create-user.md index e0db30a5f2..b25a479c89 100644 --- a/app/sdks/php/docs/examples/users/create-user.md +++ b/app/sdks/php/docs/examples/users/create-user.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/delete-user-session.md b/app/sdks/php/docs/examples/users/delete-user-session.md index 40db227ec1..28ad6dd165 100644 --- a/app/sdks/php/docs/examples/users/delete-user-session.md +++ b/app/sdks/php/docs/examples/users/delete-user-session.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/delete-user-sessions.md b/app/sdks/php/docs/examples/users/delete-user-sessions.md index 346eff92b0..a83c648f69 100644 --- a/app/sdks/php/docs/examples/users/delete-user-sessions.md +++ b/app/sdks/php/docs/examples/users/delete-user-sessions.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/delete-users-session.md b/app/sdks/php/docs/examples/users/delete-users-session.md deleted file mode 100644 index f5a9c6fa1b..0000000000 --- a/app/sdks/php/docs/examples/users/delete-users-session.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('') - ->setKey('') -; - -$users = new Users($client); - -$result = $users->deleteUsersSession('[USER_ID]', '[SESSION_ID]'); \ No newline at end of file diff --git a/app/sdks/php/docs/examples/users/get-user-logs.md b/app/sdks/php/docs/examples/users/get-user-logs.md index 926d83ac78..bb9a70e975 100644 --- a/app/sdks/php/docs/examples/users/get-user-logs.md +++ b/app/sdks/php/docs/examples/users/get-user-logs.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/get-user-prefs.md b/app/sdks/php/docs/examples/users/get-user-prefs.md index 68b6c7c894..949d206065 100644 --- a/app/sdks/php/docs/examples/users/get-user-prefs.md +++ b/app/sdks/php/docs/examples/users/get-user-prefs.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/get-user-sessions.md b/app/sdks/php/docs/examples/users/get-user-sessions.md index 2b7eb49666..9f29697960 100644 --- a/app/sdks/php/docs/examples/users/get-user-sessions.md +++ b/app/sdks/php/docs/examples/users/get-user-sessions.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/get-user.md b/app/sdks/php/docs/examples/users/get-user.md index abf6c1f32c..bc776d4313 100644 --- a/app/sdks/php/docs/examples/users/get-user.md +++ b/app/sdks/php/docs/examples/users/get-user.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/list-users.md b/app/sdks/php/docs/examples/users/list-users.md index c5f8d92b35..d3824540fc 100644 --- a/app/sdks/php/docs/examples/users/list-users.md +++ b/app/sdks/php/docs/examples/users/list-users.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/update-user-prefs.md b/app/sdks/php/docs/examples/users/update-user-prefs.md index a42aedb9fa..873bbc2912 100644 --- a/app/sdks/php/docs/examples/users/update-user-prefs.md +++ b/app/sdks/php/docs/examples/users/update-user-prefs.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/examples/users/update-user-status.md b/app/sdks/php/docs/examples/users/update-user-status.md index 7cc61dd05b..918d827962 100644 --- a/app/sdks/php/docs/examples/users/update-user-status.md +++ b/app/sdks/php/docs/examples/users/update-user-status.md @@ -7,6 +7,7 @@ $client = new Client(); $client ->setProject('') + ->setKey('') ; $users = new Users($client); diff --git a/app/sdks/php/docs/projects.md b/app/sdks/php/docs/projects.md deleted file mode 100644 index bc4026970d..0000000000 --- a/app/sdks/php/docs/projects.md +++ /dev/null @@ -1,398 +0,0 @@ -# Projects Service - -## List Projects - -```http request -GET https://appwrite.io/v1/projects -``` - -## Create Project - -```http request -POST https://appwrite.io/v1/projects -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Project name | | -| teamId | string | Team unique ID. | | -| description | string | Project description | | -| logo | string | Project logo | | -| url | string | Project URL | | -| legalName | string | Project Legal Name | | -| legalCountry | string | Project Legal Country | | -| legalState | string | Project Legal State | | -| legalCity | string | Project Legal City | | -| legalAddress | string | Project Legal Address | | -| legalTaxId | string | Project Legal Tax ID | | - -## Get Project - -```http request -GET https://appwrite.io/v1/projects/{projectId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## Update Project - -```http request -PATCH https://appwrite.io/v1/projects/{projectId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| name | string | Project name | | -| description | string | Project description | | -| logo | string | Project logo | | -| url | string | Project URL | | -| legalName | string | Project Legal Name | | -| legalCountry | string | Project Legal Country | | -| legalState | string | Project Legal State | | -| legalCity | string | Project Legal City | | -| legalAddress | string | Project Legal Address | | -| legalTaxId | string | Project Legal Tax ID | | - -## Delete Project - -```http request -DELETE https://appwrite.io/v1/projects/{projectId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## List Keys - -```http request -GET https://appwrite.io/v1/projects/{projectId}/keys -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## Create Key - -```http request -POST https://appwrite.io/v1/projects/{projectId}/keys -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| name | string | Key name | | -| scopes | array | Key scopes list | | - -## Get Key - -```http request -GET https://appwrite.io/v1/projects/{projectId}/keys/{keyId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| keyId | string | **Required** Key unique ID. | | - -## Update Key - -```http request -PUT https://appwrite.io/v1/projects/{projectId}/keys/{keyId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| keyId | string | **Required** Key unique ID. | | -| name | string | Key name | | -| scopes | array | Key scopes list | | - -## Delete Key - -```http request -DELETE https://appwrite.io/v1/projects/{projectId}/keys/{keyId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| keyId | string | **Required** Key unique ID. | | - -## Update Project OAuth - -```http request -PATCH https://appwrite.io/v1/projects/{projectId}/oauth -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| provider | string | Provider Name | | -| appId | string | Provider App ID | | -| secret | string | Provider Secret Key | | - -## List Platforms - -```http request -GET https://appwrite.io/v1/projects/{projectId}/platforms -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## Create Platform - -```http request -POST https://appwrite.io/v1/projects/{projectId}/platforms -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| type | string | Platform name | | -| name | string | Platform name | | -| key | string | Package name for android or bundle ID for iOS | | -| store | string | App store or Google Play store ID | | -| url | string | Platform client URL | | - -## Get Platform - -```http request -GET https://appwrite.io/v1/projects/{projectId}/platforms/{platformId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| platformId | string | **Required** Platform unique ID. | | - -## Update Platform - -```http request -PUT https://appwrite.io/v1/projects/{projectId}/platforms/{platformId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| platformId | string | **Required** Platform unique ID. | | -| name | string | Platform name | | -| key | string | Package name for android or bundle ID for iOS | | -| store | string | App store or Google Play store ID | | -| url | string | Platform client URL | | - -## Delete Platform - -```http request -DELETE https://appwrite.io/v1/projects/{projectId}/platforms/{platformId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| platformId | string | **Required** Platform unique ID. | | - -## List Tasks - -```http request -GET https://appwrite.io/v1/projects/{projectId}/tasks -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## Create Task - -```http request -POST https://appwrite.io/v1/projects/{projectId}/tasks -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| name | string | Task name | | -| status | string | Task status | | -| schedule | string | Task schedule syntax | | -| security | integer | Certificate verification, 0 for disabled or 1 for enabled | | -| httpMethod | string | Task HTTP method | | -| httpUrl | string | Task HTTP URL | | -| httpHeaders | array | Task HTTP headers list | | -| httpUser | string | Task HTTP user | | -| httpPass | string | Task HTTP password | | - -## Get Task - -```http request -GET https://appwrite.io/v1/projects/{projectId}/tasks/{taskId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| taskId | string | **Required** Task unique ID. | | - -## Update Task - -```http request -PUT https://appwrite.io/v1/projects/{projectId}/tasks/{taskId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| taskId | string | **Required** Task unique ID. | | -| name | string | Task name | | -| status | string | Task status | | -| schedule | string | Task schedule syntax | | -| security | integer | Certificate verification, 0 for disabled or 1 for enabled | | -| httpMethod | string | Task HTTP method | | -| httpUrl | string | Task HTTP URL | | -| httpHeaders | array | Task HTTP headers list | | -| httpUser | string | Task HTTP user | | -| httpPass | string | Task HTTP password | | - -## Delete Task - -```http request -DELETE https://appwrite.io/v1/projects/{projectId}/tasks/{taskId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| taskId | string | **Required** Task unique ID. | | - -## Get Project - -```http request -GET https://appwrite.io/v1/projects/{projectId}/usage -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## List Webhooks - -```http request -GET https://appwrite.io/v1/projects/{projectId}/webhooks -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | - -## Create Webhook - -```http request -POST https://appwrite.io/v1/projects/{projectId}/webhooks -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| name | string | Webhook name | | -| events | array | Webhook events list | | -| url | string | Webhook URL | | -| security | integer | Certificate verification, 0 for disabled or 1 for enabled | | -| httpUser | string | Webhook HTTP user | | -| httpPass | string | Webhook HTTP password | | - -## Get Webhook - -```http request -GET https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| webhookId | string | **Required** Webhook unique ID. | | - -## Update Webhook - -```http request -PUT https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| webhookId | string | **Required** Webhook unique ID. | | -| name | string | Webhook name | | -| events | array | Webhook events list | | -| url | string | Webhook URL | | -| security | integer | Certificate verification, 0 for disabled or 1 for enabled | | -| httpUser | string | Webhook HTTP user | | -| httpPass | string | Webhook HTTP password | | - -## Delete Webhook - -```http request -DELETE https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| projectId | string | **Required** Project unique ID. | | -| webhookId | string | **Required** Webhook unique ID. | | - diff --git a/app/sdks/php/docs/teams.md b/app/sdks/php/docs/teams.md index 499a52ee49..5f181ad21e 100644 --- a/app/sdks/php/docs/teams.md +++ b/app/sdks/php/docs/teams.md @@ -126,24 +126,3 @@ DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId} | teamId | string | **Required** Team unique ID. | | | inviteId | string | **Required** Invite unique ID | | -## Update Team Membership Status - -```http request -PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| inviteId | string | **Required** Invite unique ID | | -| userId | string | User unique ID | | -| secret | string | Secret Key | | - diff --git a/app/sdks/php/src/Appwrite/Services/Account.php b/app/sdks/php/src/Appwrite/Services/Account.php deleted file mode 100644 index b1aa6a1ad3..0000000000 --- a/app/sdks/php/src/Appwrite/Services/Account.php +++ /dev/null @@ -1,498 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * 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. - * - * @param string $email - * @param string $password - * @param string $name - * @throws Exception - * @return array - */ - public function createAccount(string $email, string $password, string $name = ''):array - { - $path = str_replace([], [], '/account'); - $params = []; - - $params['email'] = $email; - $params['password'] = $password; - $params['name'] = $name; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws Exception - * @return array - */ - public function delete():array - { - $path = str_replace([], [], '/account'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param string $email - * @param string $password - * @throws Exception - * @return array - */ - public function updateEmail(string $email, string $password):array - { - $path = str_replace([], [], '/account/email'); - $params = []; - - $params['email'] = $email; - $params['password'] = $password; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws Exception - * @return array - */ - public function getAccountLogs():array - { - $path = str_replace([], [], '/account/logs'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param string $name - * @throws Exception - * @return array - */ - public function updateAccountName(string $name):array - { - $path = str_replace([], [], '/account/name'); - $params = []; - - $params['name'] = $name; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param string $password - * @param string $oldPassword - * @throws Exception - * @return array - */ - public function updateAccountPassword(string $password, string $oldPassword):array - { - $path = str_replace([], [], '/account/password'); - $params = []; - - $params['password'] = $password; - $params['old-password'] = $oldPassword; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Account Preferences - * - * Get currently logged in user preferences key-value object. - * - * @throws Exception - * @return array - */ - public function getAccountPrefs():array - { - $path = str_replace([], [], '/account/prefs'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param string $prefs - * @throws Exception - * @return array - */ - public function updatePrefs(string $prefs):array - { - $path = str_replace([], [], '/account/prefs'); - $params = []; - - $params['prefs'] = $prefs; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * 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. - * - * @param string $email - * @param string $url - * @throws Exception - * @return array - */ - public function createAccountRecovery(string $email, string $url):array - { - $path = str_replace([], [], '/account/recovery'); - $params = []; - - $params['email'] = $email; - $params['url'] = $url; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Password Reset - * - * 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. - * - * 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 $userId - * @param string $secret - * @param string $passwordA - * @param string $passwordB - * @throws Exception - * @return array - */ - public function updateAccountRecovery(string $userId, string $secret, string $passwordA, string $passwordB):array - { - $path = str_replace([], [], '/account/recovery'); - $params = []; - - $params['userId'] = $userId; - $params['secret'] = $secret; - $params['password-a'] = $passwordA; - $params['password-b'] = $passwordB; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws Exception - * @return array - */ - public function getAccountSessions():array - { - $path = str_replace([], [], '/account/sessions'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * 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. - * - * @param string $email - * @param string $password - * @throws Exception - * @return array - */ - public function createAccountSession(string $email, string $password):array - { - $path = str_replace([], [], '/account/sessions'); - $params = []; - - $params['email'] = $email; - $params['password'] = $password; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws Exception - * @return array - */ - public function deleteAccountSessions():array - { - $path = str_replace([], [], '/account/sessions'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * 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 Exception - * @return array - */ - public function deleteAccountCurrentSession():array - { - $path = str_replace([], [], '/account/sessions/current'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Account Session with OAuth - * - * 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 - * back to your app when login is completed. - * - * @param string $provider - * @param string $success - * @param string $failure - * @throws Exception - * @return array - */ - public function createAccountSessionOAuth(string $provider, string $success, string $failure):array - { - $path = str_replace(['{provider}'], [$provider], '/account/sessions/oauth/{provider}'); - $params = []; - - $params['success'] = $success; - $params['failure'] = $failure; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Account Session - * - * 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. - * - * @param string $id - * @throws Exception - * @return array - */ - public function deleteAccountSession(string $id):array - { - $path = str_replace(['{id}'], [$id], '/account/sessions/{id}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create 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 Exception - * @return array - */ - public function createAccountVerification(string $url):array - { - $path = str_replace([], [], '/account/verification'); - $params = []; - - $params['url'] = $url; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Updated 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 - * to verify the user email ownership. If confirmed this route will return a - * 200 status code. - * - * @param string $userId - * @param string $secret - * @param string $passwordB - * @throws Exception - * @return array - */ - public function updateAccountVerification(string $userId, string $secret, string $passwordB):array - { - $path = str_replace([], [], '/account/verification'); - $params = []; - - $params['userId'] = $userId; - $params['secret'] = $secret; - $params['password-b'] = $passwordB; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/php/src/Appwrite/Services/Auth.php b/app/sdks/php/src/Appwrite/Services/Auth.php deleted file mode 100644 index 31a48ebebd..0000000000 --- a/app/sdks/php/src/Appwrite/Services/Auth.php +++ /dev/null @@ -1,288 +0,0 @@ -client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Login with OAuth - * - * 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 - * back to your app when login is completed. - * - * @param string $provider - * @param string $success - * @param string $failure - * @throws Exception - * @return array - */ - public function oauth(string $provider, string $success, string $failure):array - { - $path = str_replace(['{provider}'], [$provider], '/auth/login/oauth/{provider}'); - $params = []; - - $params['success'] = $success; - $params['failure'] = $failure; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Logout Current 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 Exception - * @return array - */ - public function logout():array - { - $path = str_replace([], [], '/auth/logout'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Logout Specific Session - * - * 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. - * - * @param string $id - * @throws Exception - * @return array - */ - public function logoutBySession(string $id):array - { - $path = str_replace(['{id}'], [$id], '/auth/logout/{id}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Password Recovery - * - * Sends the user an email with a temporary secret token for password reset. - * When the user clicks the confirmation link he is redirected back to your - * app password reset redirect URL with a secret token 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. - * - * @param string $email - * @param string $reset - * @throws Exception - * @return array - */ - public function recovery(string $email, string $reset):array - { - $path = str_replace([], [], '/auth/recovery'); - $params = []; - - $params['email'] = $email; - $params['reset'] = $reset; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Password Reset - * - * Use this endpoint to complete the user account password reset. Both the - * **userId** and **token** arguments will be passed as query parameters to - * the redirect URL you have provided when sending your request to the - * /auth/recovery endpoint. - * - * Please notice 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 $userId - * @param string $token - * @param string $passwordA - * @param string $passwordB - * @throws Exception - * @return array - */ - public function recoveryReset(string $userId, string $token, string $passwordA, string $passwordB):array - { - $path = str_replace([], [], '/auth/recovery/reset'); - $params = []; - - $params['userId'] = $userId; - $params['token'] = $token; - $params['password-a'] = $passwordA; - $params['password-b'] = $passwordB; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Register - * - * 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 notice 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. - * - * @param string $email - * @param string $password - * @param string $confirm - * @param string $success - * @param string $failure - * @param string $name - * @throws Exception - * @return array - */ - public function register(string $email, string $password, string $confirm, string $success = '', string $failure = '', string $name = ''):array - { - $path = str_replace([], [], '/auth/register'); - $params = []; - - $params['email'] = $email; - $params['password'] = $password; - $params['confirm'] = $confirm; - $params['success'] = $success; - $params['failure'] = $failure; - $params['name'] = $name; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Confirmation - * - * Use this endpoint to complete the confirmation of the user account email - * address. Both the **userId** and **token** arguments will be passed as - * query parameters to the redirect URL you have provided when sending your - * request to the /auth/register endpoint. - * - * @param string $userId - * @param string $token - * @throws Exception - * @return array - */ - public function confirm(string $userId, string $token):array - { - $path = str_replace([], [], '/auth/register/confirm'); - $params = []; - - $params['userId'] = $userId; - $params['token'] = $token; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Resend Confirmation - * - * This endpoint allows the user to request your app to resend him his email - * confirmation message. The redirect arguments act the same way as in - * /auth/register endpoint. - * - * Please notice 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 $confirm - * @throws Exception - * @return array - */ - public function confirmResend(string $confirm):array - { - $path = str_replace([], [], '/auth/register/confirm/resend'); - $params = []; - - $params['confirm'] = $confirm; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/php/src/Appwrite/Services/Projects.php b/app/sdks/php/src/Appwrite/Services/Projects.php deleted file mode 100644 index 701c3cc523..0000000000 --- a/app/sdks/php/src/Appwrite/Services/Projects.php +++ /dev/null @@ -1,641 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Project - * - * @param string $name - * @param string $teamId - * @param string $description - * @param string $logo - * @param string $url - * @param string $legalName - * @param string $legalCountry - * @param string $legalState - * @param string $legalCity - * @param string $legalAddress - * @param string $legalTaxId - * @throws Exception - * @return array - */ - public function createProject(string $name, string $teamId, string $description = '', string $logo = '', string $url = '', string $legalName = '', string $legalCountry = '', string $legalState = '', string $legalCity = '', string $legalAddress = '', string $legalTaxId = ''):array - { - $path = str_replace([], [], '/projects'); - $params = []; - - $params['name'] = $name; - $params['teamId'] = $teamId; - $params['description'] = $description; - $params['logo'] = $logo; - $params['url'] = $url; - $params['legalName'] = $legalName; - $params['legalCountry'] = $legalCountry; - $params['legalState'] = $legalState; - $params['legalCity'] = $legalCity; - $params['legalAddress'] = $legalAddress; - $params['legalTaxId'] = $legalTaxId; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Project - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function getProject(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Project - * - * @param string $projectId - * @param string $name - * @param string $description - * @param string $logo - * @param string $url - * @param string $legalName - * @param string $legalCountry - * @param string $legalState - * @param string $legalCity - * @param string $legalAddress - * @param string $legalTaxId - * @throws Exception - * @return array - */ - public function updateProject(string $projectId, string $name, string $description = '', string $logo = '', string $url = '', string $legalName = '', string $legalCountry = '', string $legalState = '', string $legalCity = '', string $legalAddress = '', string $legalTaxId = ''):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}'); - $params = []; - - $params['name'] = $name; - $params['description'] = $description; - $params['logo'] = $logo; - $params['url'] = $url; - $params['legalName'] = $legalName; - $params['legalCountry'] = $legalCountry; - $params['legalState'] = $legalState; - $params['legalCity'] = $legalCity; - $params['legalAddress'] = $legalAddress; - $params['legalTaxId'] = $legalTaxId; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Project - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function deleteProject(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Keys - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function listKeys(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/keys'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Key - * - * @param string $projectId - * @param string $name - * @param array $scopes - * @throws Exception - * @return array - */ - public function createKey(string $projectId, string $name, array $scopes):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/keys'); - $params = []; - - $params['name'] = $name; - $params['scopes'] = $scopes; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Key - * - * @param string $projectId - * @param string $keyId - * @throws Exception - * @return array - */ - public function getKey(string $projectId, string $keyId):array - { - $path = str_replace(['{projectId}', '{keyId}'], [$projectId, $keyId], '/projects/{projectId}/keys/{keyId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Key - * - * @param string $projectId - * @param string $keyId - * @param string $name - * @param array $scopes - * @throws Exception - * @return array - */ - public function updateKey(string $projectId, string $keyId, string $name, array $scopes):array - { - $path = str_replace(['{projectId}', '{keyId}'], [$projectId, $keyId], '/projects/{projectId}/keys/{keyId}'); - $params = []; - - $params['name'] = $name; - $params['scopes'] = $scopes; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Key - * - * @param string $projectId - * @param string $keyId - * @throws Exception - * @return array - */ - public function deleteKey(string $projectId, string $keyId):array - { - $path = str_replace(['{projectId}', '{keyId}'], [$projectId, $keyId], '/projects/{projectId}/keys/{keyId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Project OAuth - * - * @param string $projectId - * @param string $provider - * @param string $appId - * @param string $secret - * @throws Exception - * @return array - */ - public function updateProjectOAuth(string $projectId, string $provider, string $appId = '', string $secret = ''):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/oauth'); - $params = []; - - $params['provider'] = $provider; - $params['appId'] = $appId; - $params['secret'] = $secret; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Platforms - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function listPlatforms(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/platforms'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Platform - * - * @param string $projectId - * @param string $type - * @param string $name - * @param string $key - * @param string $store - * @param string $url - * @throws Exception - * @return array - */ - public function createPlatform(string $projectId, string $type, string $name, string $key = '', string $store = '', string $url = ''):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/platforms'); - $params = []; - - $params['type'] = $type; - $params['name'] = $name; - $params['key'] = $key; - $params['store'] = $store; - $params['url'] = $url; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Platform - * - * @param string $projectId - * @param string $platformId - * @throws Exception - * @return array - */ - public function getPlatform(string $projectId, string $platformId):array - { - $path = str_replace(['{projectId}', '{platformId}'], [$projectId, $platformId], '/projects/{projectId}/platforms/{platformId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Platform - * - * @param string $projectId - * @param string $platformId - * @param string $name - * @param string $key - * @param string $store - * @param string $url - * @throws Exception - * @return array - */ - public function updatePlatform(string $projectId, string $platformId, string $name, string $key = '', string $store = '', string $url = ''):array - { - $path = str_replace(['{projectId}', '{platformId}'], [$projectId, $platformId], '/projects/{projectId}/platforms/{platformId}'); - $params = []; - - $params['name'] = $name; - $params['key'] = $key; - $params['store'] = $store; - $params['url'] = $url; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Platform - * - * @param string $projectId - * @param string $platformId - * @throws Exception - * @return array - */ - public function deletePlatform(string $projectId, string $platformId):array - { - $path = str_replace(['{projectId}', '{platformId}'], [$projectId, $platformId], '/projects/{projectId}/platforms/{platformId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Tasks - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function listTasks(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/tasks'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Task - * - * @param string $projectId - * @param string $name - * @param string $status - * @param string $schedule - * @param int $security - * @param string $httpMethod - * @param string $httpUrl - * @param array $httpHeaders - * @param string $httpUser - * @param string $httpPass - * @throws Exception - * @return array - */ - public function createTask(string $projectId, string $name, string $status, string $schedule, int $security, string $httpMethod, string $httpUrl, array $httpHeaders = [], string $httpUser = '', string $httpPass = ''):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/tasks'); - $params = []; - - $params['name'] = $name; - $params['status'] = $status; - $params['schedule'] = $schedule; - $params['security'] = $security; - $params['httpMethod'] = $httpMethod; - $params['httpUrl'] = $httpUrl; - $params['httpHeaders'] = $httpHeaders; - $params['httpUser'] = $httpUser; - $params['httpPass'] = $httpPass; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Task - * - * @param string $projectId - * @param string $taskId - * @throws Exception - * @return array - */ - public function getTask(string $projectId, string $taskId):array - { - $path = str_replace(['{projectId}', '{taskId}'], [$projectId, $taskId], '/projects/{projectId}/tasks/{taskId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Task - * - * @param string $projectId - * @param string $taskId - * @param string $name - * @param string $status - * @param string $schedule - * @param int $security - * @param string $httpMethod - * @param string $httpUrl - * @param array $httpHeaders - * @param string $httpUser - * @param string $httpPass - * @throws Exception - * @return array - */ - public function updateTask(string $projectId, string $taskId, string $name, string $status, string $schedule, int $security, string $httpMethod, string $httpUrl, array $httpHeaders = [], string $httpUser = '', string $httpPass = ''):array - { - $path = str_replace(['{projectId}', '{taskId}'], [$projectId, $taskId], '/projects/{projectId}/tasks/{taskId}'); - $params = []; - - $params['name'] = $name; - $params['status'] = $status; - $params['schedule'] = $schedule; - $params['security'] = $security; - $params['httpMethod'] = $httpMethod; - $params['httpUrl'] = $httpUrl; - $params['httpHeaders'] = $httpHeaders; - $params['httpUser'] = $httpUser; - $params['httpPass'] = $httpPass; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Task - * - * @param string $projectId - * @param string $taskId - * @throws Exception - * @return array - */ - public function deleteTask(string $projectId, string $taskId):array - { - $path = str_replace(['{projectId}', '{taskId}'], [$projectId, $taskId], '/projects/{projectId}/tasks/{taskId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Project - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function getProjectUsage(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/usage'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Webhooks - * - * @param string $projectId - * @throws Exception - * @return array - */ - public function listWebhooks(string $projectId):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/webhooks'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Webhook - * - * @param string $projectId - * @param string $name - * @param array $events - * @param string $url - * @param int $security - * @param string $httpUser - * @param string $httpPass - * @throws Exception - * @return array - */ - public function createWebhook(string $projectId, string $name, array $events, string $url, int $security, string $httpUser = '', string $httpPass = ''):array - { - $path = str_replace(['{projectId}'], [$projectId], '/projects/{projectId}/webhooks'); - $params = []; - - $params['name'] = $name; - $params['events'] = $events; - $params['url'] = $url; - $params['security'] = $security; - $params['httpUser'] = $httpUser; - $params['httpPass'] = $httpPass; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Webhook - * - * @param string $projectId - * @param string $webhookId - * @throws Exception - * @return array - */ - public function getWebhook(string $projectId, string $webhookId):array - { - $path = str_replace(['{projectId}', '{webhookId}'], [$projectId, $webhookId], '/projects/{projectId}/webhooks/{webhookId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Webhook - * - * @param string $projectId - * @param string $webhookId - * @param string $name - * @param array $events - * @param string $url - * @param int $security - * @param string $httpUser - * @param string $httpPass - * @throws Exception - * @return array - */ - public function updateWebhook(string $projectId, string $webhookId, string $name, array $events, string $url, int $security, string $httpUser = '', string $httpPass = ''):array - { - $path = str_replace(['{projectId}', '{webhookId}'], [$projectId, $webhookId], '/projects/{projectId}/webhooks/{webhookId}'); - $params = []; - - $params['name'] = $name; - $params['events'] = $events; - $params['url'] = $url; - $params['security'] = $security; - $params['httpUser'] = $httpUser; - $params['httpPass'] = $httpPass; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Webhook - * - * @param string $projectId - * @param string $webhookId - * @throws Exception - * @return array - */ - public function deleteWebhook(string $projectId, string $webhookId):array - { - $path = str_replace(['{projectId}', '{webhookId}'], [$projectId, $webhookId], '/projects/{projectId}/webhooks/{webhookId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/php/src/Appwrite/Services/Teams.php b/app/sdks/php/src/Appwrite/Services/Teams.php index 5117caa855..4b305bf9e9 100644 --- a/app/sdks/php/src/Appwrite/Services/Teams.php +++ b/app/sdks/php/src/Appwrite/Services/Teams.php @@ -212,43 +212,4 @@ class Teams extends Service ], $params); } - /** - * 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. - * - * @param string $teamId - * @param string $inviteId - * @param string $userId - * @param string $secret - * @throws Exception - * @return array - */ - public function updateTeamMembershipStatus(string $teamId, string $inviteId, string $userId, string $secret):array - { - $path = str_replace(['{teamId}', '{inviteId}'], [$teamId, $inviteId], '/teams/{teamId}/memberships/{inviteId}/status'); - $params = []; - - $params['userId'] = $userId; - $params['secret'] = $secret; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - } \ No newline at end of file diff --git a/app/sdks/python/appwrite/services/account.py b/app/sdks/python/appwrite/services/account.py deleted file mode 100644 index ab045782da..0000000000 --- a/app/sdks/python/appwrite/services/account.py +++ /dev/null @@ -1,222 +0,0 @@ -from ..service import Service - - -class Account(Service): - - def __init__(self, client): - super(Account, self).__init__(client) - - def get_account(self): - """Get Account""" - - params = {} - path = '/account' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_account(self, email, password, name=''): - """Create Account""" - - params = {} - path = '/account' - params['email'] = email - params['password'] = password - params['name'] = name - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def delete(self): - """Delete Account""" - - params = {} - path = '/account' - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def update_email(self, email, password): - """Update Account Email""" - - params = {} - path = '/account/email' - params['email'] = email - params['password'] = password - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def get_account_logs(self): - """Get Account Logs""" - - params = {} - path = '/account/logs' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_account_name(self, name): - """Update Account Name""" - - params = {} - path = '/account/name' - params['name'] = name - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def update_account_password(self, password, old_password): - """Update Account Password""" - - params = {} - path = '/account/password' - params['password'] = password - params['old-password'] = old_password - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def get_account_prefs(self): - """Get Account Preferences""" - - params = {} - path = '/account/prefs' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_prefs(self, prefs): - """Update Account Preferences""" - - params = {} - path = '/account/prefs' - params['prefs'] = prefs - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def create_account_recovery(self, email, url): - """Password Recovery""" - - params = {} - path = '/account/recovery' - params['email'] = email - params['url'] = url - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def update_account_recovery(self, user_id, secret, password_a, password_b): - """Password Reset""" - - params = {} - path = '/account/recovery' - params['userId'] = user_id - params['secret'] = secret - params['password-a'] = password_a - params['password-b'] = password_b - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def get_account_sessions(self): - """Get Account Sessions""" - - params = {} - path = '/account/sessions' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_account_session(self, email, password): - """Create Account Session""" - - params = {} - path = '/account/sessions' - params['email'] = email - params['password'] = password - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def delete_account_sessions(self): - """Delete All Account Sessions""" - - params = {} - path = '/account/sessions' - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def delete_account_current_session(self): - """Delete Current Account Session""" - - params = {} - path = '/account/sessions/current' - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def create_account_session_o_auth(self, provider, success, failure): - """Create Account Session with OAuth""" - - params = {} - path = '/account/sessions/oauth/{provider}' - path = path.replace('{provider}', provider) - params['success'] = success - params['failure'] = failure - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def delete_account_session(self, id): - """Delete Account Session""" - - params = {} - path = '/account/sessions/{id}' - path = path.replace('{id}', id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def create_account_verification(self, url): - """Create Verification""" - - params = {} - path = '/account/verification' - params['url'] = url - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def update_account_verification(self, user_id, secret, password_b): - """Updated Verification""" - - params = {} - path = '/account/verification' - params['userId'] = user_id - params['secret'] = secret - params['password-b'] = password_b - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/python/appwrite/services/auth.py b/app/sdks/python/appwrite/services/auth.py deleted file mode 100644 index ff0a894428..0000000000 --- a/app/sdks/python/appwrite/services/auth.py +++ /dev/null @@ -1,120 +0,0 @@ -from ..service import Service - - -class Auth(Service): - - def __init__(self, client): - super(Auth, self).__init__(client) - - def login(self, email, password, success='', failure=''): - """Login""" - - params = {} - path = '/auth/login' - params['email'] = email - params['password'] = password - params['success'] = success - params['failure'] = failure - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def oauth(self, provider, success, failure): - """Login with OAuth""" - - params = {} - path = '/auth/login/oauth/{provider}' - path = path.replace('{provider}', provider) - params['success'] = success - params['failure'] = failure - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def logout(self): - """Logout Current Session""" - - params = {} - path = '/auth/logout' - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def logout_by_session(self, id): - """Logout Specific Session""" - - params = {} - path = '/auth/logout/{id}' - path = path.replace('{id}', id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def recovery(self, email, reset): - """Password Recovery""" - - params = {} - path = '/auth/recovery' - params['email'] = email - params['reset'] = reset - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def recovery_reset(self, user_id, token, password_a, password_b): - """Password Reset""" - - params = {} - path = '/auth/recovery/reset' - params['userId'] = user_id - params['token'] = token - params['password-a'] = password_a - params['password-b'] = password_b - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def register(self, email, password, confirm, success='', failure='', name=''): - """Register""" - - params = {} - path = '/auth/register' - params['email'] = email - params['password'] = password - params['confirm'] = confirm - params['success'] = success - params['failure'] = failure - params['name'] = name - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def confirm(self, user_id, token): - """Confirmation""" - - params = {} - path = '/auth/register/confirm' - params['userId'] = user_id - params['token'] = token - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def confirm_resend(self, confirm): - """Resend Confirmation""" - - params = {} - path = '/auth/register/confirm/resend' - params['confirm'] = confirm - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/python/appwrite/services/projects.py b/app/sdks/python/appwrite/services/projects.py deleted file mode 100644 index 3dea4fbd9b..0000000000 --- a/app/sdks/python/appwrite/services/projects.py +++ /dev/null @@ -1,381 +0,0 @@ -from ..service import Service - - -class Projects(Service): - - def __init__(self, client): - super(Projects, self).__init__(client) - - def list_projects(self): - """List Projects""" - - params = {} - path = '/projects' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_project(self, name, team_id, description='', logo='', url='', legal_name='', legal_country='', legal_state='', legal_city='', legal_address='', legal_tax_id=''): - """Create Project""" - - params = {} - path = '/projects' - params['name'] = name - params['teamId'] = team_id - params['description'] = description - params['logo'] = logo - params['url'] = url - params['legalName'] = legal_name - params['legalCountry'] = legal_country - params['legalState'] = legal_state - params['legalCity'] = legal_city - params['legalAddress'] = legal_address - params['legalTaxId'] = legal_tax_id - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_project(self, project_id): - """Get Project""" - - params = {} - path = '/projects/{projectId}' - path = path.replace('{projectId}', project_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_project(self, project_id, name, description='', logo='', url='', legal_name='', legal_country='', legal_state='', legal_city='', legal_address='', legal_tax_id=''): - """Update Project""" - - params = {} - path = '/projects/{projectId}' - path = path.replace('{projectId}', project_id) - params['name'] = name - params['description'] = description - params['logo'] = logo - params['url'] = url - params['legalName'] = legal_name - params['legalCountry'] = legal_country - params['legalState'] = legal_state - params['legalCity'] = legal_city - params['legalAddress'] = legal_address - params['legalTaxId'] = legal_tax_id - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def delete_project(self, project_id): - """Delete Project""" - - params = {} - path = '/projects/{projectId}' - path = path.replace('{projectId}', project_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def list_keys(self, project_id): - """List Keys""" - - params = {} - path = '/projects/{projectId}/keys' - path = path.replace('{projectId}', project_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_key(self, project_id, name, scopes): - """Create Key""" - - params = {} - path = '/projects/{projectId}/keys' - path = path.replace('{projectId}', project_id) - params['name'] = name - params['scopes'] = scopes - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_key(self, project_id, key_id): - """Get Key""" - - params = {} - path = '/projects/{projectId}/keys/{keyId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{keyId}', key_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_key(self, project_id, key_id, name, scopes): - """Update Key""" - - params = {} - path = '/projects/{projectId}/keys/{keyId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{keyId}', key_id) - params['name'] = name - params['scopes'] = scopes - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete_key(self, project_id, key_id): - """Delete Key""" - - params = {} - path = '/projects/{projectId}/keys/{keyId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{keyId}', key_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def update_project_o_auth(self, project_id, provider, app_id='', secret=''): - """Update Project OAuth""" - - params = {} - path = '/projects/{projectId}/oauth' - path = path.replace('{projectId}', project_id) - params['provider'] = provider - params['appId'] = app_id - params['secret'] = secret - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def list_platforms(self, project_id): - """List Platforms""" - - params = {} - path = '/projects/{projectId}/platforms' - path = path.replace('{projectId}', project_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_platform(self, project_id, type, name, key='', store='', url=''): - """Create Platform""" - - params = {} - path = '/projects/{projectId}/platforms' - path = path.replace('{projectId}', project_id) - params['type'] = type - params['name'] = name - params['key'] = key - params['store'] = store - params['url'] = url - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_platform(self, project_id, platform_id): - """Get Platform""" - - params = {} - path = '/projects/{projectId}/platforms/{platformId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{platformId}', platform_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_platform(self, project_id, platform_id, name, key='', store='', url=''): - """Update Platform""" - - params = {} - path = '/projects/{projectId}/platforms/{platformId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{platformId}', platform_id) - params['name'] = name - params['key'] = key - params['store'] = store - params['url'] = url - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete_platform(self, project_id, platform_id): - """Delete Platform""" - - params = {} - path = '/projects/{projectId}/platforms/{platformId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{platformId}', platform_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def list_tasks(self, project_id): - """List Tasks""" - - params = {} - path = '/projects/{projectId}/tasks' - path = path.replace('{projectId}', project_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_task(self, project_id, name, status, schedule, security, http_method, http_url, http_headers={}, http_user='', http_pass=''): - """Create Task""" - - params = {} - path = '/projects/{projectId}/tasks' - path = path.replace('{projectId}', project_id) - params['name'] = name - params['status'] = status - params['schedule'] = schedule - params['security'] = security - params['httpMethod'] = http_method - params['httpUrl'] = http_url - params['httpHeaders'] = http_headers - params['httpUser'] = http_user - params['httpPass'] = http_pass - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_task(self, project_id, task_id): - """Get Task""" - - params = {} - path = '/projects/{projectId}/tasks/{taskId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{taskId}', task_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_task(self, project_id, task_id, name, status, schedule, security, http_method, http_url, http_headers={}, http_user='', http_pass=''): - """Update Task""" - - params = {} - path = '/projects/{projectId}/tasks/{taskId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{taskId}', task_id) - params['name'] = name - params['status'] = status - params['schedule'] = schedule - params['security'] = security - params['httpMethod'] = http_method - params['httpUrl'] = http_url - params['httpHeaders'] = http_headers - params['httpUser'] = http_user - params['httpPass'] = http_pass - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete_task(self, project_id, task_id): - """Delete Task""" - - params = {} - path = '/projects/{projectId}/tasks/{taskId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{taskId}', task_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def get_project_usage(self, project_id): - """Get Project""" - - params = {} - path = '/projects/{projectId}/usage' - path = path.replace('{projectId}', project_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def list_webhooks(self, project_id): - """List Webhooks""" - - params = {} - path = '/projects/{projectId}/webhooks' - path = path.replace('{projectId}', project_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_webhook(self, project_id, name, events, url, security, http_user='', http_pass=''): - """Create Webhook""" - - params = {} - path = '/projects/{projectId}/webhooks' - path = path.replace('{projectId}', project_id) - params['name'] = name - params['events'] = events - params['url'] = url - params['security'] = security - params['httpUser'] = http_user - params['httpPass'] = http_pass - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_webhook(self, project_id, webhook_id): - """Get Webhook""" - - params = {} - path = '/projects/{projectId}/webhooks/{webhookId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{webhookId}', webhook_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_webhook(self, project_id, webhook_id, name, events, url, security, http_user='', http_pass=''): - """Update Webhook""" - - params = {} - path = '/projects/{projectId}/webhooks/{webhookId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{webhookId}', webhook_id) - params['name'] = name - params['events'] = events - params['url'] = url - params['security'] = security - params['httpUser'] = http_user - params['httpPass'] = http_pass - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete_webhook(self, project_id, webhook_id): - """Delete Webhook""" - - params = {} - path = '/projects/{projectId}/webhooks/{webhookId}' - path = path.replace('{projectId}', project_id) - path = path.replace('{webhookId}', webhook_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/python/appwrite/services/teams.py b/app/sdks/python/appwrite/services/teams.py index 7112e45a87..bcf995929f 100644 --- a/app/sdks/python/appwrite/services/teams.py +++ b/app/sdks/python/appwrite/services/teams.py @@ -103,17 +103,3 @@ class Teams(Service): return self.client.call('delete', path, { 'content-type': 'application/json', }, params) - - def update_team_membership_status(self, team_id, invite_id, user_id, secret): - """Update Team Membership Status""" - - params = {} - path = '/teams/{teamId}/memberships/{inviteId}/status' - path = path.replace('{teamId}', team_id) - path = path.replace('{inviteId}', invite_id) - params['userId'] = user_id - params['secret'] = secret - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/ruby/lib/appwrite.rb b/app/sdks/ruby/lib/appwrite.rb index c93a767938..0d0dcd156e 100644 --- a/app/sdks/ruby/lib/appwrite.rb +++ b/app/sdks/ruby/lib/appwrite.rb @@ -3,11 +3,9 @@ require 'uri' require 'json' require_relative 'appwrite/client' require_relative 'appwrite/service' -require_relative 'appwrite/services/account' require_relative 'appwrite/services/avatars' require_relative 'appwrite/services/database' require_relative 'appwrite/services/locale' -require_relative 'appwrite/services/projects' require_relative 'appwrite/services/storage' require_relative 'appwrite/services/teams' require_relative 'appwrite/services/users' diff --git a/app/sdks/ruby/lib/appwrite/services/account.rb b/app/sdks/ruby/lib/appwrite/services/account.rb deleted file mode 100644 index 51c4a614f4..0000000000 --- a/app/sdks/ruby/lib/appwrite/services/account.rb +++ /dev/null @@ -1,243 +0,0 @@ -module Appwrite - class Account < Service - - def get_account() - path = '/account' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_account(email:, password:, name: '') - path = '/account' - - params = { - 'email': email, - 'password': password, - 'name': name - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete() - path = '/account' - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_email(email:, password:) - path = '/account/email' - - params = { - 'email': email, - 'password': password - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_account_logs() - path = '/account/logs' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_account_name(name:) - path = '/account/name' - - params = { - 'name': name - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_account_password(password:, old_password:) - path = '/account/password' - - params = { - 'password': password, - 'old-password': old_password - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_account_prefs() - path = '/account/prefs' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_prefs(prefs:) - path = '/account/prefs' - - params = { - 'prefs': prefs - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_account_recovery(email:, url:) - path = '/account/recovery' - - params = { - 'email': email, - 'url': url - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_account_recovery(user_id:, secret:, password_a:, password_b:) - path = '/account/recovery' - - params = { - 'userId': user_id, - 'secret': secret, - 'password-a': password_a, - 'password-b': password_b - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_account_sessions() - path = '/account/sessions' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_account_session(email:, password:) - path = '/account/sessions' - - params = { - 'email': email, - 'password': password - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_account_sessions() - path = '/account/sessions' - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_account_current_session() - path = '/account/sessions/current' - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_account_session_o_auth(provider:, success:, failure:) - path = '/account/sessions/oauth/{provider}' - .gsub('{provider}', provider) - - params = { - 'success': success, - 'failure': failure - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_account_session(id:) - path = '/account/sessions/{id}' - .gsub('{id}', id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_account_verification(url:) - path = '/account/verification' - - params = { - 'url': url - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_account_verification(user_id:, secret:, password_b:) - path = '/account/verification' - - params = { - 'userId': user_id, - 'secret': secret, - 'password-b': password_b - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/ruby/lib/appwrite/services/auth.rb b/app/sdks/ruby/lib/appwrite/services/auth.rb deleted file mode 100644 index bcf5e8906b..0000000000 --- a/app/sdks/ruby/lib/appwrite/services/auth.rb +++ /dev/null @@ -1,131 +0,0 @@ -module Appwrite - class Auth < Service - - def login(email:, password:, success: '', failure: '') - path = '/auth/login' - - params = { - 'email': email, - 'password': password, - 'success': success, - 'failure': failure - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def oauth(provider:, success:, failure:) - path = '/auth/login/oauth/{provider}' - .gsub('{provider}', provider) - - params = { - 'success': success, - 'failure': failure - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def logout() - path = '/auth/logout' - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def logout_by_session(id:) - path = '/auth/logout/{id}' - .gsub('{id}', id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def recovery(email:, reset:) - path = '/auth/recovery' - - params = { - 'email': email, - 'reset': reset - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def recovery_reset(user_id:, token:, password_a:, password_b:) - path = '/auth/recovery/reset' - - params = { - 'userId': user_id, - 'token': token, - 'password-a': password_a, - 'password-b': password_b - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def register(email:, password:, confirm:, success: '', failure: '', name: '') - path = '/auth/register' - - params = { - 'email': email, - 'password': password, - 'confirm': confirm, - 'success': success, - 'failure': failure, - 'name': name - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def confirm(user_id:, token:) - path = '/auth/register/confirm' - - params = { - 'userId': user_id, - 'token': token - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def confirm_resend(confirm:) - path = '/auth/register/confirm/resend' - - params = { - 'confirm': confirm - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/ruby/lib/appwrite/services/projects.rb b/app/sdks/ruby/lib/appwrite/services/projects.rb deleted file mode 100644 index 9988708e92..0000000000 --- a/app/sdks/ruby/lib/appwrite/services/projects.rb +++ /dev/null @@ -1,410 +0,0 @@ -module Appwrite - class Projects < Service - - def list_projects() - path = '/projects' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_project(name:, team_id:, description: '', logo: '', url: '', legal_name: '', legal_country: '', legal_state: '', legal_city: '', legal_address: '', legal_tax_id: '') - path = '/projects' - - params = { - 'name': name, - 'teamId': team_id, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legal_name, - 'legalCountry': legal_country, - 'legalState': legal_state, - 'legalCity': legal_city, - 'legalAddress': legal_address, - 'legalTaxId': legal_tax_id - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_project(project_id:) - path = '/projects/{projectId}' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_project(project_id:, name:, description: '', logo: '', url: '', legal_name: '', legal_country: '', legal_state: '', legal_city: '', legal_address: '', legal_tax_id: '') - path = '/projects/{projectId}' - .gsub('{project_id}', project_id) - - params = { - 'name': name, - 'description': description, - 'logo': logo, - 'url': url, - 'legalName': legal_name, - 'legalCountry': legal_country, - 'legalState': legal_state, - 'legalCity': legal_city, - 'legalAddress': legal_address, - 'legalTaxId': legal_tax_id - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_project(project_id:) - path = '/projects/{projectId}' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_keys(project_id:) - path = '/projects/{projectId}/keys' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_key(project_id:, name:, scopes:) - path = '/projects/{projectId}/keys' - .gsub('{project_id}', project_id) - - params = { - 'name': name, - 'scopes': scopes - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_key(project_id:, key_id:) - path = '/projects/{projectId}/keys/{keyId}' - .gsub('{project_id}', project_id) - .gsub('{key_id}', key_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_key(project_id:, key_id:, name:, scopes:) - path = '/projects/{projectId}/keys/{keyId}' - .gsub('{project_id}', project_id) - .gsub('{key_id}', key_id) - - params = { - 'name': name, - 'scopes': scopes - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_key(project_id:, key_id:) - path = '/projects/{projectId}/keys/{keyId}' - .gsub('{project_id}', project_id) - .gsub('{key_id}', key_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_project_o_auth(project_id:, provider:, app_id: '', secret: '') - path = '/projects/{projectId}/oauth' - .gsub('{project_id}', project_id) - - params = { - 'provider': provider, - 'appId': app_id, - 'secret': secret - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_platforms(project_id:) - path = '/projects/{projectId}/platforms' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_platform(project_id:, type:, name:, key: '', store: '', url: '') - path = '/projects/{projectId}/platforms' - .gsub('{project_id}', project_id) - - params = { - 'type': type, - 'name': name, - 'key': key, - 'store': store, - 'url': url - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_platform(project_id:, platform_id:) - path = '/projects/{projectId}/platforms/{platformId}' - .gsub('{project_id}', project_id) - .gsub('{platform_id}', platform_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_platform(project_id:, platform_id:, name:, key: '', store: '', url: '') - path = '/projects/{projectId}/platforms/{platformId}' - .gsub('{project_id}', project_id) - .gsub('{platform_id}', platform_id) - - params = { - 'name': name, - 'key': key, - 'store': store, - 'url': url - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_platform(project_id:, platform_id:) - path = '/projects/{projectId}/platforms/{platformId}' - .gsub('{project_id}', project_id) - .gsub('{platform_id}', platform_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_tasks(project_id:) - path = '/projects/{projectId}/tasks' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_task(project_id:, name:, status:, schedule:, security:, http_method:, http_url:, http_headers: [], http_user: '', http_pass: '') - path = '/projects/{projectId}/tasks' - .gsub('{project_id}', project_id) - - params = { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': http_method, - 'httpUrl': http_url, - 'httpHeaders': http_headers, - 'httpUser': http_user, - 'httpPass': http_pass - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_task(project_id:, task_id:) - path = '/projects/{projectId}/tasks/{taskId}' - .gsub('{project_id}', project_id) - .gsub('{task_id}', task_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_task(project_id:, task_id:, name:, status:, schedule:, security:, http_method:, http_url:, http_headers: [], http_user: '', http_pass: '') - path = '/projects/{projectId}/tasks/{taskId}' - .gsub('{project_id}', project_id) - .gsub('{task_id}', task_id) - - params = { - 'name': name, - 'status': status, - 'schedule': schedule, - 'security': security, - 'httpMethod': http_method, - 'httpUrl': http_url, - 'httpHeaders': http_headers, - 'httpUser': http_user, - 'httpPass': http_pass - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_task(project_id:, task_id:) - path = '/projects/{projectId}/tasks/{taskId}' - .gsub('{project_id}', project_id) - .gsub('{task_id}', task_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_project_usage(project_id:) - path = '/projects/{projectId}/usage' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_webhooks(project_id:) - path = '/projects/{projectId}/webhooks' - .gsub('{project_id}', project_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_webhook(project_id:, name:, events:, url:, security:, http_user: '', http_pass: '') - path = '/projects/{projectId}/webhooks' - .gsub('{project_id}', project_id) - - params = { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': http_user, - 'httpPass': http_pass - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_webhook(project_id:, webhook_id:) - path = '/projects/{projectId}/webhooks/{webhookId}' - .gsub('{project_id}', project_id) - .gsub('{webhook_id}', webhook_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_webhook(project_id:, webhook_id:, name:, events:, url:, security:, http_user: '', http_pass: '') - path = '/projects/{projectId}/webhooks/{webhookId}' - .gsub('{project_id}', project_id) - .gsub('{webhook_id}', webhook_id) - - params = { - 'name': name, - 'events': events, - 'url': url, - 'security': security, - 'httpUser': http_user, - 'httpPass': http_pass - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_webhook(project_id:, webhook_id:) - path = '/projects/{projectId}/webhooks/{webhookId}' - .gsub('{project_id}', project_id) - .gsub('{webhook_id}', webhook_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/ruby/lib/appwrite/services/teams.rb b/app/sdks/ruby/lib/appwrite/services/teams.rb index 143c2a650c..16ae20e676 100644 --- a/app/sdks/ruby/lib/appwrite/services/teams.rb +++ b/app/sdks/ruby/lib/appwrite/services/teams.rb @@ -107,21 +107,6 @@ module Appwrite }, params); end - def update_team_membership_status(team_id:, invite_id:, user_id:, secret:) - path = '/teams/{teamId}/memberships/{inviteId}/status' - .gsub('{team_id}', team_id) - .gsub('{invite_id}', invite_id) - - params = { - 'userId': user_id, - 'secret': secret - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - protected diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 3200540c1e..1918363fe4 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -48,8 +48,8 @@ $cli } Console::info('Fetching API Spec for '.$language['name'].' for '.$platform['name']); - - $spec = getSSLPage('http://localhost/v1/open-api-2.json?extensions=1'); + + $spec = getSSLPage('http://localhost/v1/open-api-2.json?extensions=1&platform='.$language['family']); $result = realpath(__DIR__.'/..').'/sdks/'.$language['key']; $target = realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/';