diff --git a/app/config/platforms.php b/app/config/platforms.php
index b1f8504970..2eeabbcc73 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -8,6 +8,20 @@ const APP_PLATFORM_FLUTTER = 'flutter';
const APP_PLATFORM_SERVER = 'server';
const APP_PLATFORM_CLIENT = 'client';
+$langDart = [
+ 'key' => 'dart',
+ 'name' => 'Dart',
+ 'version' => '0.0.6',
+ 'url' => 'https://github.com/appwrite/sdk-for-dart',
+ 'enabled' => true,
+ 'beta' => false,
+ 'prism' => 'dart',
+ 'source' => realpath(__DIR__ . '/../sdks/dart'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git',
+ 'gitRepoName' => 'sdk-for-dart',
+ 'gitUserName' => 'appwrite',
+];
+
return [
APP_PLATFORM_WEB => [
'name' => 'Web',
@@ -17,20 +31,27 @@ return [
[
'key' => 'javascript',
'name' => 'JS',
- 'repository' => 'https://github.com/appwrite/sdk-for-js',
+ 'version' => '1.0.28',
+ 'url' => 'https://github.com/appwrite/sdk-for-js',
'enabled' => true,
'beta' => false,
'prism' => 'javascript',
- 'source' => realpath(__DIR__ . '/../sdks/js'),
+ 'source' => realpath(__DIR__ . '/../sdks/javascript'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-js.git',
+ 'gitRepoName' => 'sdk-for-js',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'typescript',
'name' => 'TypeScript',
- 'repository' => '',
- 'enabled' => true,
+ 'url' => '',
+ 'enabled' => false,
'beta' => false,
'prism' => 'typescript',
- 'source' => '',
+ 'source' => false,
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-typescript.git',
+ 'gitRepoName' => 'sdk-for-typescript',
+ 'gitUserName' => 'appwrite',
],
],
],
@@ -43,20 +64,26 @@ return [
[
'key' => 'swift',
'name' => 'Swift',
- 'repository' => '',
+ 'url' => '',
'enabled' => false,
'beta' => false,
'prism' => 'swift',
- 'source' => '',
+ 'source' => false,
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-swift.git',
+ 'gitRepoName' => 'sdk-for-swift',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'objective-c',
'name' => 'Objective C',
- 'repository' => '',
+ 'url' => '',
'enabled' => false,
'beta' => false,
'prism' => '',
- 'source' => '',
+ 'source' => false,
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-objective-c.git',
+ 'gitRepoName' => 'sdk-for-objective-c',
+ 'gitUserName' => 'appwrite',
],
],
],
@@ -69,20 +96,26 @@ return [
[
'key' => 'kotlin',
'name' => 'Kotlin',
- 'repository' => '',
+ 'url' => '',
'enabled' => false,
'beta' => false,
'prism' => 'kotlin',
'source' => false,
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-kotlin.git',
+ 'gitRepoName' => 'sdk-for-kotlin',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'java',
'name' => 'Java',
- 'repository' => '',
+ 'url' => '',
'enabled' => false,
'beta' => false,
'prism' => 'java',
'source' => false,
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-java.git',
+ 'gitRepoName' => 'sdk-for-java',
+ 'gitUserName' => 'appwrite',
],
],
],
@@ -95,46 +128,66 @@ return [
[
'key' => 'nodejs',
'name' => 'Node.js',
- 'repository' => 'https://github.com/appwrite/sdk-for-node',
+ 'version' => '1.0.31',
+ 'url' => 'https://github.com/appwrite/sdk-for-node',
'enabled' => true,
'beta' => false,
'prism' => 'javascript',
'source' => realpath(__DIR__ . '/../sdks/node'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-node.git',
+ 'gitRepoName' => 'sdk-for-node',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'php',
'name' => 'PHP',
- 'repository' => 'https://github.com/appwrite/sdk-for-php',
+ 'version' => '1.0.16',
+ 'url' => 'https://github.com/appwrite/sdk-for-php',
'enabled' => true,
'prism' => 'php',
'source' => realpath(__DIR__ . '/../sdks/php'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-php.git',
+ 'gitRepoName' => 'sdk-for-php',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'python',
'name' => 'Python',
- 'repository' => 'https://github.com/appwrite/sdk-for-python',
+ 'version' => '0.0.3',
+ 'url' => 'https://github.com/appwrite/sdk-for-python',
'enabled' => true,
'beta' => true,
'prism' => 'python',
'source' => realpath(__DIR__ . '/../sdks/python'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-python.git',
+ 'gitRepoName' => 'sdk-for-python',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'go',
'name' => 'Go',
- 'repository' => 'https://github.com/appwrite/sdk-for-go',
+ 'version' => '0.0.5',
+ 'url' => 'https://github.com/appwrite/sdk-for-go',
'enabled' => true,
'beta' => true,
'prism' => 'go',
'source' => realpath(__DIR__ . '/../sdks/go'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-go.git',
+ 'gitRepoName' => 'sdk-for-go',
+ 'gitUserName' => 'appwrite',
],
[
'key' => 'ruby',
'name' => 'Ruby',
- 'repository' => 'https://github.com/appwrite/sdk-for-ruby',
+ 'version' => '1.0.8',
+ 'url' => 'https://github.com/appwrite/sdk-for-ruby',
'enabled' => true,
'beta' => true,
'prism' => 'ruby',
'source' => realpath(__DIR__ . '/../sdks/ruby'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-ruby.git',
+ 'gitRepoName' => 'sdk-for-ruby',
+ 'gitUserName' => 'appwrite',
],
],
],
diff --git a/app/sdks/go/README.md b/app/sdks/go/README.md
index 672d0fa488..35fd446507 100644
--- a/app/sdks/go/README.md
+++ b/app/sdks/go/README.md
@@ -3,7 +3,7 @@


-**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).**
+**This SDK is compatible with Appwrite server version . For older versions, please check previous releases.**
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
diff --git a/app/sdks/go/account.go b/app/sdks/go/account.go
index debadc42f5..e255dfde52 100644
--- a/app/sdks/go/account.go
+++ b/app/sdks/go/account.go
@@ -1,6 +1,7 @@
package appwrite
import (
+ "strings"
)
// Account service
@@ -8,8 +9,8 @@ type Account struct {
client *Client
}
-// Get get currently logged in user data as JSON object.
-func (srv *Account) Get() (map[string]interface{}, error) {
+// GetAccount get currently logged in user data as JSON object.
+func (srv *Account) GetAccount() (map[string]interface{}, error) {
path := "/account"
params := map[string]interface{}{
@@ -18,6 +19,38 @@ func (srv *Account) Get() (map[string]interface{}, error) {
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
@@ -47,8 +80,20 @@ func (srv *Account) UpdateEmail(Email string, Password string) (map[string]inter
return srv.client.Call("PATCH", path, nil, params)
}
-// UpdateName update currently logged in user account name.
-func (srv *Account) UpdateName(Name string) (map[string]interface{}, error) {
+// 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{}{
@@ -58,9 +103,9 @@ func (srv *Account) UpdateName(Name string) (map[string]interface{}, error) {
return srv.client.Call("PATCH", path, nil, params)
}
-// UpdatePassword update currently logged in user password. For validation,
-// user is required to pass the password twice.
-func (srv *Account) UpdatePassword(Password string, OldPassword string) (map[string]interface{}, error) {
+// 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{}{
@@ -71,8 +116,8 @@ func (srv *Account) UpdatePassword(Password string, OldPassword string) (map[str
return srv.client.Call("PATCH", path, nil, params)
}
-// GetPrefs get currently logged in user preferences key-value object.
-func (srv *Account) GetPrefs() (map[string]interface{}, error) {
+// 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{}{
@@ -93,20 +138,48 @@ func (srv *Account) UpdatePrefs(Prefs string) (map[string]interface{}, error) {
return srv.client.Call("PATCH", path, nil, params)
}
-// GetSecurity 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) GetSecurity() (map[string]interface{}, error) {
- path := "/account/security"
+// CreateAccountRecovery 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 *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("GET", path, nil, params)
+ return srv.client.Call("POST", path, nil, params)
}
-// GetSessions get currently logged in user list of active sessions across
-// different devices.
-func (srv *Account) GetSessions() (map[string]interface{}, error) {
+// UpdateAccountRecovery 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 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{}{
@@ -114,3 +187,121 @@ func (srv *Account) GetSessions() (map[string]interface{}, error) {
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 **token** 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 **token** 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 **token** 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/docs/examples/Account/Delete.md b/app/sdks/go/docs/examples/Account/Delete.md
index a029c47c14..67ace9a461 100644
--- a/app/sdks/go/docs/examples/Account/Delete.md
+++ b/app/sdks/go/docs/examples/Account/Delete.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Account service passing Client
var srv := appwrite.Account{
diff --git a/app/sdks/go/docs/examples/Account/create-account-recovery.md b/app/sdks/go/docs/examples/Account/create-account-recovery.md
new file mode 100644
index 0000000000..9dfef57968
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/create-account-recovery.md
@@ -0,0 +1,33 @@
+# 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
new file mode 100644
index 0000000000..7bcf83b527
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/create-account-session-o-auth.md
@@ -0,0 +1,33 @@
+# 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
new file mode 100644
index 0000000000..979313a4bb
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/create-account-session.md
@@ -0,0 +1,33 @@
+# 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
new file mode 100644
index 0000000000..ceda5fc3c8
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/create-account-verification.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..f942eed4bc
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/create-account.md
@@ -0,0 +1,33 @@
+# 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
new file mode 100644
index 0000000000..4ba93be456
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/delete-account-current-session.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..2ef9751568
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/delete-account-session.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..b1934ba852
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/delete-account-sessions.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..fe8a036959
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/get-account-logs.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..a1483646f8
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/get-account-prefs.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..b6f9dd92ba
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/get-account-sessions.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..5ece106aed
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/get-account.md
@@ -0,0 +1,34 @@
+# 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/update-account-name.md b/app/sdks/go/docs/examples/Account/update-account-name.md
new file mode 100644
index 0000000000..c5f47a0592
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/update-account-name.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..2025742290
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/update-account-password.md
@@ -0,0 +1,34 @@
+# 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
new file mode 100644
index 0000000000..4463522761
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/update-account-recovery.md
@@ -0,0 +1,33 @@
+# 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
new file mode 100644
index 0000000000..494db24089
--- /dev/null
+++ b/app/sdks/go/docs/examples/Account/update-account-verification.md
@@ -0,0 +1,33 @@
+# 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
index 6f9895257e..5866aac613 100644
--- a/app/sdks/go/docs/examples/Account/update-email.md
+++ b/app/sdks/go/docs/examples/Account/update-email.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Account service passing Client
var srv := appwrite.Account{
diff --git a/app/sdks/go/docs/examples/Account/update-prefs.md b/app/sdks/go/docs/examples/Account/update-prefs.md
index 869e12572d..44cd77c898 100644
--- a/app/sdks/go/docs/examples/Account/update-prefs.md
+++ b/app/sdks/go/docs/examples/Account/update-prefs.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Account service passing Client
var srv := appwrite.Account{
@@ -25,7 +24,7 @@
}
// Call UpdatePrefs method and handle results
- var res, err := srv.UpdatePrefs("{}")
+ var res, err := srv.UpdatePrefs("")
if err != nil {
panic(err)
}
diff --git a/app/sdks/go/docs/examples/Avatars/get-browser.md b/app/sdks/go/docs/examples/Avatars/get-browser.md
index 9628da910b..f94c34aab4 100644
--- a/app/sdks/go/docs/examples/Avatars/get-browser.md
+++ b/app/sdks/go/docs/examples/Avatars/get-browser.md
@@ -17,7 +17,6 @@
// 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 488077cfc3..4d3c60600a 100644
--- a/app/sdks/go/docs/examples/Avatars/get-credit-card.md
+++ b/app/sdks/go/docs/examples/Avatars/get-credit-card.md
@@ -17,7 +17,6 @@
// 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 c235967d6b..4cb5a5c5e3 100644
--- a/app/sdks/go/docs/examples/Avatars/get-favicon.md
+++ b/app/sdks/go/docs/examples/Avatars/get-favicon.md
@@ -17,7 +17,6 @@
// 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 955c96c530..0428944e12 100644
--- a/app/sdks/go/docs/examples/Avatars/get-flag.md
+++ b/app/sdks/go/docs/examples/Avatars/get-flag.md
@@ -17,7 +17,6 @@
// 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 11d1c6523d..9fc5892c68 100644
--- a/app/sdks/go/docs/examples/Avatars/get-image.md
+++ b/app/sdks/go/docs/examples/Avatars/get-image.md
@@ -17,7 +17,6 @@
// 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 0874c0e6be..4d5b93ebdc 100644
--- a/app/sdks/go/docs/examples/Avatars/get-q-r.md
+++ b/app/sdks/go/docs/examples/Avatars/get-q-r.md
@@ -17,7 +17,6 @@
// 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/create-collection.md b/app/sdks/go/docs/examples/Database/create-collection.md
index 48e5977c60..3c940b0f8f 100644
--- a/app/sdks/go/docs/examples/Database/create-collection.md
+++ b/app/sdks/go/docs/examples/Database/create-collection.md
@@ -17,7 +17,6 @@
// 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 ccaa02f578..b6411c0638 100644
--- a/app/sdks/go/docs/examples/Database/create-document.md
+++ b/app/sdks/go/docs/examples/Database/create-document.md
@@ -17,7 +17,6 @@
// 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 85928bde3b..574fc498d1 100644
--- a/app/sdks/go/docs/examples/Database/delete-collection.md
+++ b/app/sdks/go/docs/examples/Database/delete-collection.md
@@ -17,7 +17,6 @@
// 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 256a0abccb..4a8442861e 100644
--- a/app/sdks/go/docs/examples/Database/delete-document.md
+++ b/app/sdks/go/docs/examples/Database/delete-document.md
@@ -17,7 +17,6 @@
// 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 120ad0a19e..46b70412e7 100644
--- a/app/sdks/go/docs/examples/Database/get-collection.md
+++ b/app/sdks/go/docs/examples/Database/get-collection.md
@@ -17,7 +17,6 @@
// 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 8866442b6b..2c7a6fdb60 100644
--- a/app/sdks/go/docs/examples/Database/get-document.md
+++ b/app/sdks/go/docs/examples/Database/get-document.md
@@ -17,7 +17,6 @@
// 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 1db6530df7..f4fe864615 100644
--- a/app/sdks/go/docs/examples/Database/list-collections.md
+++ b/app/sdks/go/docs/examples/Database/list-collections.md
@@ -17,7 +17,6 @@
// 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 6c46ead8db..5542d89b9a 100644
--- a/app/sdks/go/docs/examples/Database/list-documents.md
+++ b/app/sdks/go/docs/examples/Database/list-documents.md
@@ -17,7 +17,6 @@
// 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 7cf07ac2c0..1fd860d466 100644
--- a/app/sdks/go/docs/examples/Database/update-collection.md
+++ b/app/sdks/go/docs/examples/Database/update-collection.md
@@ -17,7 +17,6 @@
// 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 88f57eefa9..5b225d62f3 100644
--- a/app/sdks/go/docs/examples/Database/update-document.md
+++ b/app/sdks/go/docs/examples/Database/update-document.md
@@ -17,7 +17,6 @@
// 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/get-continents.md b/app/sdks/go/docs/examples/Locale/get-continents.md
index faeab3a977..ee76b8f574 100644
--- a/app/sdks/go/docs/examples/Locale/get-continents.md
+++ b/app/sdks/go/docs/examples/Locale/get-continents.md
@@ -17,7 +17,6 @@
// 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 ca8ed7ca48..b79057d7e7 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,7 +17,6 @@
// 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 8847258258..aaa02a6585 100644
--- a/app/sdks/go/docs/examples/Locale/get-countries-phones.md
+++ b/app/sdks/go/docs/examples/Locale/get-countries-phones.md
@@ -17,7 +17,6 @@
// 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 be286c1979..f206e66ea6 100644
--- a/app/sdks/go/docs/examples/Locale/get-countries.md
+++ b/app/sdks/go/docs/examples/Locale/get-countries.md
@@ -17,7 +17,6 @@
// 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 fcbb679fd3..69fba7c7bd 100644
--- a/app/sdks/go/docs/examples/Locale/get-currencies.md
+++ b/app/sdks/go/docs/examples/Locale/get-currencies.md
@@ -17,7 +17,6 @@
// 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 67cfcdccc9..002b841f2a 100644
--- a/app/sdks/go/docs/examples/Locale/get-locale.md
+++ b/app/sdks/go/docs/examples/Locale/get-locale.md
@@ -17,7 +17,6 @@
// 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/create-key.md b/app/sdks/go/docs/examples/Projects/create-key.md
index 7fa69e4b67..d5197d2a1e 100644
--- a/app/sdks/go/docs/examples/Projects/create-key.md
+++ b/app/sdks/go/docs/examples/Projects/create-key.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/create-platform.md b/app/sdks/go/docs/examples/Projects/create-platform.md
index 7f2d247741..fd4a61884d 100644
--- a/app/sdks/go/docs/examples/Projects/create-platform.md
+++ b/app/sdks/go/docs/examples/Projects/create-platform.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/create-project.md b/app/sdks/go/docs/examples/Projects/create-project.md
index 44525bdcd2..74ffc04444 100644
--- a/app/sdks/go/docs/examples/Projects/create-project.md
+++ b/app/sdks/go/docs/examples/Projects/create-project.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/create-task.md b/app/sdks/go/docs/examples/Projects/create-task.md
index 25c617ec9b..aa642b536a 100644
--- a/app/sdks/go/docs/examples/Projects/create-task.md
+++ b/app/sdks/go/docs/examples/Projects/create-task.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/create-webhook.md b/app/sdks/go/docs/examples/Projects/create-webhook.md
index 58e5dc548f..60b62ed828 100644
--- a/app/sdks/go/docs/examples/Projects/create-webhook.md
+++ b/app/sdks/go/docs/examples/Projects/create-webhook.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/delete-key.md b/app/sdks/go/docs/examples/Projects/delete-key.md
index 3160b37d1c..b4929842f0 100644
--- a/app/sdks/go/docs/examples/Projects/delete-key.md
+++ b/app/sdks/go/docs/examples/Projects/delete-key.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/delete-platform.md b/app/sdks/go/docs/examples/Projects/delete-platform.md
index a9e3f0d3b9..1f04f26bd2 100644
--- a/app/sdks/go/docs/examples/Projects/delete-platform.md
+++ b/app/sdks/go/docs/examples/Projects/delete-platform.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/delete-project.md b/app/sdks/go/docs/examples/Projects/delete-project.md
index 446f640c0d..b8b7f2d60d 100644
--- a/app/sdks/go/docs/examples/Projects/delete-project.md
+++ b/app/sdks/go/docs/examples/Projects/delete-project.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/delete-task.md b/app/sdks/go/docs/examples/Projects/delete-task.md
index a5275e3b04..934a80f405 100644
--- a/app/sdks/go/docs/examples/Projects/delete-task.md
+++ b/app/sdks/go/docs/examples/Projects/delete-task.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/delete-webhook.md b/app/sdks/go/docs/examples/Projects/delete-webhook.md
index 377708f6a3..f30e3906e6 100644
--- a/app/sdks/go/docs/examples/Projects/delete-webhook.md
+++ b/app/sdks/go/docs/examples/Projects/delete-webhook.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/get-key.md b/app/sdks/go/docs/examples/Projects/get-key.md
index abe636ba31..d58e13d211 100644
--- a/app/sdks/go/docs/examples/Projects/get-key.md
+++ b/app/sdks/go/docs/examples/Projects/get-key.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/get-platform.md b/app/sdks/go/docs/examples/Projects/get-platform.md
index 14a9d3bda5..1a0d3fc29f 100644
--- a/app/sdks/go/docs/examples/Projects/get-platform.md
+++ b/app/sdks/go/docs/examples/Projects/get-platform.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/get-project-usage.md b/app/sdks/go/docs/examples/Projects/get-project-usage.md
index 2bb6bc4dc5..89f87f3345 100644
--- a/app/sdks/go/docs/examples/Projects/get-project-usage.md
+++ b/app/sdks/go/docs/examples/Projects/get-project-usage.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/get-project.md b/app/sdks/go/docs/examples/Projects/get-project.md
index 8e0986f592..b942ba7249 100644
--- a/app/sdks/go/docs/examples/Projects/get-project.md
+++ b/app/sdks/go/docs/examples/Projects/get-project.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/get-task.md b/app/sdks/go/docs/examples/Projects/get-task.md
index c6efdf553b..1168f7ab6f 100644
--- a/app/sdks/go/docs/examples/Projects/get-task.md
+++ b/app/sdks/go/docs/examples/Projects/get-task.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/get-webhook.md b/app/sdks/go/docs/examples/Projects/get-webhook.md
index b46bf392b5..349f0fea47 100644
--- a/app/sdks/go/docs/examples/Projects/get-webhook.md
+++ b/app/sdks/go/docs/examples/Projects/get-webhook.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/list-keys.md b/app/sdks/go/docs/examples/Projects/list-keys.md
index e084035bb5..cd405846b3 100644
--- a/app/sdks/go/docs/examples/Projects/list-keys.md
+++ b/app/sdks/go/docs/examples/Projects/list-keys.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/list-platforms.md b/app/sdks/go/docs/examples/Projects/list-platforms.md
index ecce7449e1..c0aa3adda9 100644
--- a/app/sdks/go/docs/examples/Projects/list-platforms.md
+++ b/app/sdks/go/docs/examples/Projects/list-platforms.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/list-projects.md b/app/sdks/go/docs/examples/Projects/list-projects.md
index f17ea76beb..14c283306d 100644
--- a/app/sdks/go/docs/examples/Projects/list-projects.md
+++ b/app/sdks/go/docs/examples/Projects/list-projects.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/list-tasks.md b/app/sdks/go/docs/examples/Projects/list-tasks.md
index 84f5356c34..37dd64fa1a 100644
--- a/app/sdks/go/docs/examples/Projects/list-tasks.md
+++ b/app/sdks/go/docs/examples/Projects/list-tasks.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/list-webhooks.md b/app/sdks/go/docs/examples/Projects/list-webhooks.md
index aee6b8da62..2e277cc6d6 100644
--- a/app/sdks/go/docs/examples/Projects/list-webhooks.md
+++ b/app/sdks/go/docs/examples/Projects/list-webhooks.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/update-key.md b/app/sdks/go/docs/examples/Projects/update-key.md
index 205caef8c8..7a34cfd090 100644
--- a/app/sdks/go/docs/examples/Projects/update-key.md
+++ b/app/sdks/go/docs/examples/Projects/update-key.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/update-platform.md b/app/sdks/go/docs/examples/Projects/update-platform.md
index bc966f73a8..d85b5b04d6 100644
--- a/app/sdks/go/docs/examples/Projects/update-platform.md
+++ b/app/sdks/go/docs/examples/Projects/update-platform.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
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
index 58f23b698b..a402bed516 100644
--- a/app/sdks/go/docs/examples/Projects/update-project-o-auth.md
+++ b/app/sdks/go/docs/examples/Projects/update-project-o-auth.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/update-project.md b/app/sdks/go/docs/examples/Projects/update-project.md
index 7663ec4c4e..b4f8e90090 100644
--- a/app/sdks/go/docs/examples/Projects/update-project.md
+++ b/app/sdks/go/docs/examples/Projects/update-project.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/update-task.md b/app/sdks/go/docs/examples/Projects/update-task.md
index f977fd5540..31ca901e94 100644
--- a/app/sdks/go/docs/examples/Projects/update-task.md
+++ b/app/sdks/go/docs/examples/Projects/update-task.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Projects/update-webhook.md b/app/sdks/go/docs/examples/Projects/update-webhook.md
index 0120707ad5..fde81679cc 100644
--- a/app/sdks/go/docs/examples/Projects/update-webhook.md
+++ b/app/sdks/go/docs/examples/Projects/update-webhook.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Projects service passing Client
var srv := appwrite.Projects{
diff --git a/app/sdks/go/docs/examples/Storage/create-file.md b/app/sdks/go/docs/examples/Storage/create-file.md
index 1d0bf35af8..72f5ca8da9 100644
--- a/app/sdks/go/docs/examples/Storage/create-file.md
+++ b/app/sdks/go/docs/examples/Storage/create-file.md
@@ -17,7 +17,6 @@
// 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 c6ecabdf99..420814abb0 100644
--- a/app/sdks/go/docs/examples/Storage/delete-file.md
+++ b/app/sdks/go/docs/examples/Storage/delete-file.md
@@ -17,7 +17,6 @@
// 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 4513337425..8c90942705 100644
--- a/app/sdks/go/docs/examples/Storage/get-file-download.md
+++ b/app/sdks/go/docs/examples/Storage/get-file-download.md
@@ -17,7 +17,6 @@
// 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 a30a271d93..4c24617095 100644
--- a/app/sdks/go/docs/examples/Storage/get-file-preview.md
+++ b/app/sdks/go/docs/examples/Storage/get-file-preview.md
@@ -17,7 +17,6 @@
// 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 7782cb3b1e..712ab69ab3 100644
--- a/app/sdks/go/docs/examples/Storage/get-file-view.md
+++ b/app/sdks/go/docs/examples/Storage/get-file-view.md
@@ -17,7 +17,6 @@
// 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 0e7bff0952..fccfbbc793 100644
--- a/app/sdks/go/docs/examples/Storage/get-file.md
+++ b/app/sdks/go/docs/examples/Storage/get-file.md
@@ -17,7 +17,6 @@
// 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 7c5d800f6e..e8058befc5 100644
--- a/app/sdks/go/docs/examples/Storage/list-files.md
+++ b/app/sdks/go/docs/examples/Storage/list-files.md
@@ -17,7 +17,6 @@
// 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 01b44bc620..bf73435ca6 100644
--- a/app/sdks/go/docs/examples/Storage/update-file.md
+++ b/app/sdks/go/docs/examples/Storage/update-file.md
@@ -17,7 +17,6 @@
// 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/create-team-membership.md b/app/sdks/go/docs/examples/Teams/create-team-membership.md
index 9d74105ec5..5b9b53494a 100644
--- a/app/sdks/go/docs/examples/Teams/create-team-membership.md
+++ b/app/sdks/go/docs/examples/Teams/create-team-membership.md
@@ -17,7 +17,6 @@
// 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 7922f904f8..79c8fa0daf 100644
--- a/app/sdks/go/docs/examples/Teams/create-team.md
+++ b/app/sdks/go/docs/examples/Teams/create-team.md
@@ -17,7 +17,6 @@
// 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 80cdc936b0..5f545111dd 100644
--- a/app/sdks/go/docs/examples/Teams/delete-team-membership.md
+++ b/app/sdks/go/docs/examples/Teams/delete-team-membership.md
@@ -17,7 +17,6 @@
// 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 fa15cce6d6..34f5dac131 100644
--- a/app/sdks/go/docs/examples/Teams/delete-team.md
+++ b/app/sdks/go/docs/examples/Teams/delete-team.md
@@ -17,7 +17,6 @@
// 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-memberships.md b/app/sdks/go/docs/examples/Teams/get-team-memberships.md
new file mode 100644
index 0000000000..ab17cdcd08
--- /dev/null
+++ b/app/sdks/go/docs/examples/Teams/get-team-memberships.md
@@ -0,0 +1,34 @@
+# Teams Examples
+
+## GetTeamMemberships
+
+```go
+ package appwrite-getteammemberships
+
+ 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 Teams service passing Client
+ var srv := appwrite.Teams{
+ client: &clt
+ }
+
+ // Call GetTeamMemberships method and handle results
+ var res, err := srv.GetTeamMemberships("[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.md b/app/sdks/go/docs/examples/Teams/get-team.md
index 8418da4d14..ed75792881 100644
--- a/app/sdks/go/docs/examples/Teams/get-team.md
+++ b/app/sdks/go/docs/examples/Teams/get-team.md
@@ -17,7 +17,6 @@
// 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 089daf4697..8a132ef97e 100644
--- a/app/sdks/go/docs/examples/Teams/list-teams.md
+++ b/app/sdks/go/docs/examples/Teams/list-teams.md
@@ -17,7 +17,6 @@
// 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
index 7d4346d2a3..effb5eed67 100644
--- a/app/sdks/go/docs/examples/Teams/update-team-membership-status.md
+++ b/app/sdks/go/docs/examples/Teams/update-team-membership-status.md
@@ -16,8 +16,6 @@
var clt := appwrite.Client{}
// 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.md b/app/sdks/go/docs/examples/Teams/update-team.md
index d32a67800a..4635d3068e 100644
--- a/app/sdks/go/docs/examples/Teams/update-team.md
+++ b/app/sdks/go/docs/examples/Teams/update-team.md
@@ -17,7 +17,6 @@
// 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/create-user.md b/app/sdks/go/docs/examples/Users/create-user.md
index b790840277..17b770577f 100644
--- a/app/sdks/go/docs/examples/Users/create-user.md
+++ b/app/sdks/go/docs/examples/Users/create-user.md
@@ -17,7 +17,6 @@
// 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 6bc880b88a..c583cf1ea1 100644
--- a/app/sdks/go/docs/examples/Users/delete-user-session.md
+++ b/app/sdks/go/docs/examples/Users/delete-user-session.md
@@ -17,7 +17,6 @@
// 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 8d36d951d5..61e0d255b2 100644
--- a/app/sdks/go/docs/examples/Users/delete-user-sessions.md
+++ b/app/sdks/go/docs/examples/Users/delete-user-sessions.md
@@ -17,7 +17,6 @@
// 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 227d123413..02c484f58f 100644
--- a/app/sdks/go/docs/examples/Users/get-user-logs.md
+++ b/app/sdks/go/docs/examples/Users/get-user-logs.md
@@ -17,7 +17,6 @@
// 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 fc9515a4af..fb94dc1f1c 100644
--- a/app/sdks/go/docs/examples/Users/get-user-prefs.md
+++ b/app/sdks/go/docs/examples/Users/get-user-prefs.md
@@ -17,7 +17,6 @@
// 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 99dd8b3fff..c5c6deb9c8 100644
--- a/app/sdks/go/docs/examples/Users/get-user-sessions.md
+++ b/app/sdks/go/docs/examples/Users/get-user-sessions.md
@@ -17,7 +17,6 @@
// 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 d61430718b..0d3fbc760c 100644
--- a/app/sdks/go/docs/examples/Users/get-user.md
+++ b/app/sdks/go/docs/examples/Users/get-user.md
@@ -17,7 +17,6 @@
// 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 8332347ba8..71fc3c0bfc 100644
--- a/app/sdks/go/docs/examples/Users/list-users.md
+++ b/app/sdks/go/docs/examples/Users/list-users.md
@@ -17,7 +17,6 @@
// 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 50614f238e..2315287fbb 100644
--- a/app/sdks/go/docs/examples/Users/update-user-prefs.md
+++ b/app/sdks/go/docs/examples/Users/update-user-prefs.md
@@ -17,7 +17,6 @@
// Set Client required headers
clt.SetProject("")
- clt.SetKey("")
// Create a new Users service passing Client
var srv := appwrite.Users{
@@ -25,7 +24,7 @@
}
// Call UpdateUserPrefs method and handle results
- var res, err := srv.UpdateUserPrefs("[USER_ID]", "{}")
+ var res, err := srv.UpdateUserPrefs("[USER_ID]", "")
if err != nil {
panic(err)
}
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 d5570ca041..23ea9afc1c 100644
--- a/app/sdks/go/docs/examples/Users/update-user-status.md
+++ b/app/sdks/go/docs/examples/Users/update-user-status.md
@@ -17,7 +17,6 @@
// 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/locale.go b/app/sdks/go/locale.go
index fa66971182..cf6a0cfdd3 100644
--- a/app/sdks/go/locale.go
+++ b/app/sdks/go/locale.go
@@ -12,6 +12,8 @@ type Locale struct {
// 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.
+//
+// ([IP Geolocation by DB-IP](https://db-ip.com))
func (srv *Locale) GetLocale() (map[string]interface{}, error) {
path := "/locale"
@@ -44,9 +46,7 @@ func (srv *Locale) GetCountries() (map[string]interface{}, error) {
}
// GetCountriesEU 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.
+// You can use the locale header to get the data in a supported language.
func (srv *Locale) GetCountriesEU() (map[string]interface{}, error) {
path := "/locale/countries/eu"
diff --git a/app/sdks/go/storage.go b/app/sdks/go/storage.go
index c0023cf9af..e4edd23bf4 100644
--- a/app/sdks/go/storage.go
+++ b/app/sdks/go/storage.go
@@ -28,11 +28,11 @@ func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType st
// CreateFile 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.
-func (srv *Storage) CreateFile(Files string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) {
+func (srv *Storage) CreateFile(File string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) {
path := "/storage/files"
params := map[string]interface{}{
- "files": Files,
+ "file": File,
"read": Read,
"write": Write,
}
@@ -91,10 +91,10 @@ func (srv *Storage) GetFileDownload(FileId string) (map[string]interface{}, erro
return srv.client.Call("GET", path, nil, params)
}
-// GetFilePreview get file preview image. Currently, this method supports
+// GetFilePreview get a 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
+// pdf, docs, slides, and spreadsheets, will return the file icon image. You
+// can also pass query string arguments for cutting and resizing your preview
// image.
func (srv *Storage) GetFilePreview(FileId string, Width int, Height int, Quality int, Background string, Output string) (map[string]interface{}, error) {
r := strings.NewReplacer("{fileId}", FileId)
diff --git a/app/sdks/go/teams.go b/app/sdks/go/teams.go
index 7a4263f593..f9b7b949cb 100644
--- a/app/sdks/go/teams.go
+++ b/app/sdks/go/teams.go
@@ -78,11 +78,11 @@ func (srv *Teams) DeleteTeam(TeamId string) (map[string]interface{}, error) {
return srv.client.Call("DELETE", path, nil, params)
}
-// GetTeamMembers get team members by the team unique ID. All team members
+// GetTeamMemberships get team members by the team unique ID. All team members
// have read access for this list of resources.
-func (srv *Teams) GetTeamMembers(TeamId string) (map[string]interface{}, error) {
+func (srv *Teams) GetTeamMemberships(TeamId string) (map[string]interface{}, error) {
r := strings.NewReplacer("{teamId}", TeamId)
- path := r.Replace("/teams/{teamId}/members")
+ path := r.Replace("/teams/{teamId}/memberships")
params := map[string]interface{}{
}
@@ -95,16 +95,16 @@ func (srv *Teams) GetTeamMembers(TeamId string) (map[string]interface{}, error)
// 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.
+// Use the 'url' parameter to redirect the user from the invitation email back
+// to your app. When the user is redirected, use the [Update Team Membership
+// Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join
+// the user to the team.
//
-// Please notice that in order to avoid a [Redirect
+// 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.
-func (srv *Teams) CreateTeamMembership(TeamId string, Email string, Roles []interface{}, Redirect string, Name string) (map[string]interface{}, error) {
+func (srv *Teams) CreateTeamMembership(TeamId string, Email string, Roles []interface{}, Url string, Name string) (map[string]interface{}, error) {
r := strings.NewReplacer("{teamId}", TeamId)
path := r.Replace("/teams/{teamId}/memberships")
@@ -112,14 +112,15 @@ func (srv *Teams) CreateTeamMembership(TeamId string, Email string, Roles []inte
"email": Email,
"name": Name,
"roles": Roles,
- "redirect": Redirect,
+ "url": Url,
}
return srv.client.Call("POST", path, nil, params)
}
// DeleteTeamMembership this endpoint allows a user to leave a team or for a
-// team owner to delete the membership of any other team member.
+// team owner to delete the membership of any other team member. You can also
+// use this endpoint to delete a user membership even if he didn't accept it.
func (srv *Teams) DeleteTeamMembership(TeamId string, InviteId string) (map[string]interface{}, error) {
r := strings.NewReplacer("{teamId}", TeamId, "{inviteId}", InviteId)
path := r.Replace("/teams/{teamId}/memberships/{inviteId}")
@@ -130,25 +131,12 @@ func (srv *Teams) DeleteTeamMembership(TeamId string, InviteId string) (map[stri
return srv.client.Call("DELETE", path, nil, params)
}
-// CreateTeamMembershipResend use this endpoint to resend your invitation
-// email for a user to join a team.
-func (srv *Teams) CreateTeamMembershipResend(TeamId string, InviteId string, Redirect string) (map[string]interface{}, error) {
- r := strings.NewReplacer("{teamId}", TeamId, "{inviteId}", InviteId)
- path := r.Replace("/teams/{teamId}/memberships/{inviteId}/resend")
-
- params := map[string]interface{}{
- "redirect": Redirect,
- }
-
- return srv.client.Call("POST", 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 notice that in order to avoid a [Redirect
+// 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.
@@ -158,15 +146,13 @@ func (srv *Teams) CreateTeamMembershipResend(TeamId string, InviteId string, Red
// 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.
-func (srv *Teams) UpdateTeamMembershipStatus(TeamId string, InviteId string, UserId string, Secret string, Success string, Failure string) (map[string]interface{}, error) {
+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,
- "success": Success,
- "failure": Failure,
}
return srv.client.Call("PATCH", path, nil, params)
diff --git a/app/sdks/javascript/LICENSE b/app/sdks/javascript/LICENSE
new file mode 100644
index 0000000000..fc7c051a91
--- /dev/null
+++ b/app/sdks/javascript/LICENSE
@@ -0,0 +1,12 @@
+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/javascript/README.md b/app/sdks/javascript/README.md
new file mode 100644
index 0000000000..581527d4a0
--- /dev/null
+++ b/app/sdks/javascript/README.md
@@ -0,0 +1,38 @@
+# Appwrite SDK for JavaScript
+
+
+
+
+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)
+
+
+
+## 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
+
+```
+
+
+
+## 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/javascript/docs/examples/account/create-account-recovery.md b/app/sdks/javascript/docs/examples/account/create-account-recovery.md
new file mode 100644
index 0000000000..c72cb2e55e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/create-account-recovery.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+let promise = sdk.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/javascript/docs/examples/account/create-account-session-o-auth.md b/app/sdks/javascript/docs/examples/account/create-account-session-o-auth.md
new file mode 100644
index 0000000000..f5fa4781e1
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/create-account-session-o-auth.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+let promise = sdk.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/javascript/docs/examples/account/create-account-session.md b/app/sdks/javascript/docs/examples/account/create-account-session.md
new file mode 100644
index 0000000000..030c8a0997
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/create-account-session.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+let promise = sdk.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/javascript/docs/examples/account/create-account-verification.md b/app/sdks/javascript/docs/examples/account/create-account-verification.md
new file mode 100644
index 0000000000..1f3191732e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/create-account-verification.md
@@ -0,0 +1,13 @@
+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/account/create-account.md b/app/sdks/javascript/docs/examples/account/create-account.md
new file mode 100644
index 0000000000..0c10009e12
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/create-account.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+let promise = sdk.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/javascript/docs/examples/account/delete-account-current-session.md b/app/sdks/javascript/docs/examples/account/delete-account-current-session.md
new file mode 100644
index 0000000000..1ec94ce7e6
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/delete-account-current-session.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/delete-account-session.md b/app/sdks/javascript/docs/examples/account/delete-account-session.md
new file mode 100644
index 0000000000..bd916923e0
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/delete-account-session.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/delete-account-sessions.md b/app/sdks/javascript/docs/examples/account/delete-account-sessions.md
new file mode 100644
index 0000000000..5c89537df8
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/delete-account-sessions.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/delete.md b/app/sdks/javascript/docs/examples/account/delete.md
new file mode 100644
index 0000000000..c199f0f719
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/delete.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/account/get-account-logs.md b/app/sdks/javascript/docs/examples/account/get-account-logs.md
new file mode 100644
index 0000000000..f913b22d34
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/get-account-logs.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/get-account-prefs.md b/app/sdks/javascript/docs/examples/account/get-account-prefs.md
new file mode 100644
index 0000000000..043c9f2e71
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/get-account-prefs.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/get-account-sessions.md b/app/sdks/javascript/docs/examples/account/get-account-sessions.md
new file mode 100644
index 0000000000..ab550e510f
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/get-account-sessions.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/get-account.md b/app/sdks/javascript/docs/examples/account/get-account.md
new file mode 100644
index 0000000000..951c0339c4
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/get-account.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/update-account-name.md b/app/sdks/javascript/docs/examples/account/update-account-name.md
new file mode 100644
index 0000000000..e527233999
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/update-account-name.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/update-account-password.md b/app/sdks/javascript/docs/examples/account/update-account-password.md
new file mode 100644
index 0000000000..fcf39adf17
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/update-account-password.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.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/javascript/docs/examples/account/update-account-recovery.md b/app/sdks/javascript/docs/examples/account/update-account-recovery.md
new file mode 100644
index 0000000000..2bf315b42e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/update-account-recovery.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+let promise = sdk.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/javascript/docs/examples/account/update-account-verification.md b/app/sdks/javascript/docs/examples/account/update-account-verification.md
new file mode 100644
index 0000000000..796e8d2aa5
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/update-account-verification.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+let promise = sdk.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/javascript/docs/examples/account/update-email.md b/app/sdks/javascript/docs/examples/account/update-email.md
new file mode 100644
index 0000000000..e9fb9c9ed2
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/update-email.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/account/update-prefs.md b/app/sdks/javascript/docs/examples/account/update-prefs.md
new file mode 100644
index 0000000000..9deb78a41f
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/account/update-prefs.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/avatars/get-browser.md b/app/sdks/javascript/docs/examples/avatars/get-browser.md
new file mode 100644
index 0000000000..84c992621e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/avatars/get-browser.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/avatars/get-credit-card.md b/app/sdks/javascript/docs/examples/avatars/get-credit-card.md
new file mode 100644
index 0000000000..c9fb87edc7
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/avatars/get-credit-card.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/avatars/get-favicon.md b/app/sdks/javascript/docs/examples/avatars/get-favicon.md
new file mode 100644
index 0000000000..5876eb2b5a
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/avatars/get-favicon.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/avatars/get-flag.md b/app/sdks/javascript/docs/examples/avatars/get-flag.md
new file mode 100644
index 0000000000..694c6b399e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/avatars/get-flag.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/avatars/get-image.md b/app/sdks/javascript/docs/examples/avatars/get-image.md
new file mode 100644
index 0000000000..b807ff734e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/avatars/get-image.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/avatars/get-q-r.md b/app/sdks/javascript/docs/examples/avatars/get-q-r.md
new file mode 100644
index 0000000000..e64d83a5c4
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/avatars/get-q-r.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/database/create-collection.md b/app/sdks/javascript/docs/examples/database/create-collection.md
new file mode 100644
index 0000000000..a93fe45778
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/create-collection.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.database.createCollection('[NAME]', [], [], []);
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/javascript/docs/examples/database/create-document.md b/app/sdks/javascript/docs/examples/database/create-document.md
new file mode 100644
index 0000000000..aa251ae2b2
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/create-document.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/database/delete-collection.md b/app/sdks/javascript/docs/examples/database/delete-collection.md
new file mode 100644
index 0000000000..1a116c58b9
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/delete-collection.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.database.deleteCollection('[COLLECTION_ID]');
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/javascript/docs/examples/database/delete-document.md b/app/sdks/javascript/docs/examples/database/delete-document.md
new file mode 100644
index 0000000000..7dd7fc4db4
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/delete-document.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/database/get-collection.md b/app/sdks/javascript/docs/examples/database/get-collection.md
new file mode 100644
index 0000000000..abe8d482d4
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/get-collection.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.database.getCollection('[COLLECTION_ID]');
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/javascript/docs/examples/database/get-document.md b/app/sdks/javascript/docs/examples/database/get-document.md
new file mode 100644
index 0000000000..1bcb5b00ac
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/get-document.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/database/list-collections.md b/app/sdks/javascript/docs/examples/database/list-collections.md
new file mode 100644
index 0000000000..3160903309
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/list-collections.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.database.listCollections();
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/javascript/docs/examples/database/list-documents.md b/app/sdks/javascript/docs/examples/database/list-documents.md
new file mode 100644
index 0000000000..68ce8d6c23
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/list-documents.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/database/update-collection.md b/app/sdks/javascript/docs/examples/database/update-collection.md
new file mode 100644
index 0000000000..726c244c79
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/update-collection.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.database.updateCollection('[COLLECTION_ID]', '[NAME]', [], []);
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/javascript/docs/examples/database/update-document.md b/app/sdks/javascript/docs/examples/database/update-document.md
new file mode 100644
index 0000000000..7809b97bfd
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/database/update-document.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/locale/get-continents.md b/app/sdks/javascript/docs/examples/locale/get-continents.md
new file mode 100644
index 0000000000..a8de63eb91
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/locale/get-continents.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/locale/get-countries-e-u.md b/app/sdks/javascript/docs/examples/locale/get-countries-e-u.md
new file mode 100644
index 0000000000..44ceffd7e7
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/locale/get-countries-e-u.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/locale/get-countries-phones.md b/app/sdks/javascript/docs/examples/locale/get-countries-phones.md
new file mode 100644
index 0000000000..afd084f5d4
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/locale/get-countries-phones.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/locale/get-countries.md b/app/sdks/javascript/docs/examples/locale/get-countries.md
new file mode 100644
index 0000000000..521195bfaa
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/locale/get-countries.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/locale/get-currencies.md b/app/sdks/javascript/docs/examples/locale/get-currencies.md
new file mode 100644
index 0000000000..8032307f86
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/locale/get-currencies.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/locale/get-locale.md b/app/sdks/javascript/docs/examples/locale/get-locale.md
new file mode 100644
index 0000000000..4cc5a3f3b2
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/locale/get-locale.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/projects/create-key.md b/app/sdks/javascript/docs/examples/projects/create-key.md
new file mode 100644
index 0000000000..3c12c8a8c2
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/create-key.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..b67b84ba56
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/create-platform.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..a1b6922fed
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/create-project.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..3262b4d9fe
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/create-task.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..66a76c26c2
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/create-webhook.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..e5ae8e426c
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/delete-key.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..450f9cd0a6
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/delete-platform.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..b60d4de3c9
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/delete-project.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..3208d38bf8
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/delete-task.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..030a3b77f1
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/delete-webhook.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..7207b33bf7
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/get-key.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..6f353f3aca
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/get-platform.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..87a2e3148a
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/get-project-usage.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..084e48c253
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/get-project.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..e5195bce8c
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/get-task.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..a2b6089c3e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/get-webhook.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..14ef64fb6f
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/list-keys.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..7cfd9341a7
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/list-platforms.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..3ba3afc41e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/list-projects.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..fd8ab61ffa
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/list-tasks.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..b19851c8b1
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/list-webhooks.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..063f4daea4
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/update-key.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..e28846f050
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/update-platform.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..9ab78a4ea9
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/update-project-o-auth.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..6fcaa49f37
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/update-project.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..54116a41d0
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/update-task.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..ce876d5a64
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/projects/update-webhook.md
@@ -0,0 +1,13 @@
+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/storage/create-file.md b/app/sdks/javascript/docs/examples/storage/create-file.md
new file mode 100644
index 0000000000..53157d19a3
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/create-file.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/delete-file.md b/app/sdks/javascript/docs/examples/storage/delete-file.md
new file mode 100644
index 0000000000..4e39bd9811
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/delete-file.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/get-file-download.md b/app/sdks/javascript/docs/examples/storage/get-file-download.md
new file mode 100644
index 0000000000..a53142184c
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/get-file-download.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/get-file-preview.md b/app/sdks/javascript/docs/examples/storage/get-file-preview.md
new file mode 100644
index 0000000000..1cce3acd24
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/get-file-preview.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/get-file-view.md b/app/sdks/javascript/docs/examples/storage/get-file-view.md
new file mode 100644
index 0000000000..4844b22ce3
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/get-file-view.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/get-file.md b/app/sdks/javascript/docs/examples/storage/get-file.md
new file mode 100644
index 0000000000..32b11a2175
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/get-file.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/list-files.md b/app/sdks/javascript/docs/examples/storage/list-files.md
new file mode 100644
index 0000000000..0033bb254d
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/list-files.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/storage/update-file.md b/app/sdks/javascript/docs/examples/storage/update-file.md
new file mode 100644
index 0000000000..72d6ee3166
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/storage/update-file.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/create-team-membership.md b/app/sdks/javascript/docs/examples/teams/create-team-membership.md
new file mode 100644
index 0000000000..60f996c209
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/create-team-membership.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/create-team.md b/app/sdks/javascript/docs/examples/teams/create-team.md
new file mode 100644
index 0000000000..2dafeac2ab
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/create-team.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/delete-team-membership.md b/app/sdks/javascript/docs/examples/teams/delete-team-membership.md
new file mode 100644
index 0000000000..551dfd7dbb
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/delete-team-membership.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/delete-team.md b/app/sdks/javascript/docs/examples/teams/delete-team.md
new file mode 100644
index 0000000000..3f9cd8b6f5
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/delete-team.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/get-team-memberships.md b/app/sdks/javascript/docs/examples/teams/get-team-memberships.md
new file mode 100644
index 0000000000..20ce7b2bea
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/get-team-memberships.md
@@ -0,0 +1,13 @@
+let sdk = new Appwrite();
+
+sdk
+ .setProject('')
+;
+
+let promise = sdk.teams.getTeamMemberships('[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/teams/get-team.md b/app/sdks/javascript/docs/examples/teams/get-team.md
new file mode 100644
index 0000000000..7e1f8254fe
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/get-team.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/list-teams.md b/app/sdks/javascript/docs/examples/teams/list-teams.md
new file mode 100644
index 0000000000..abd4fa420b
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/list-teams.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/teams/update-team-membership-status.md b/app/sdks/javascript/docs/examples/teams/update-team-membership-status.md
new file mode 100644
index 0000000000..d4d83e9705
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/update-team-membership-status.md
@@ -0,0 +1,12 @@
+let sdk = new Appwrite();
+
+sdk
+;
+
+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/javascript/docs/examples/teams/update-team.md b/app/sdks/javascript/docs/examples/teams/update-team.md
new file mode 100644
index 0000000000..2ec35ec906
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/teams/update-team.md
@@ -0,0 +1,13 @@
+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/javascript/docs/examples/users/create-user.md b/app/sdks/javascript/docs/examples/users/create-user.md
new file mode 100644
index 0000000000..1242fe70c2
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/create-user.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..4b5df53439
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/delete-user-session.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..1a6851ce15
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/delete-user-sessions.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..85175b0e1e
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/get-user-logs.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..0d9c8dbb22
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/get-user-prefs.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..8cc7b1f85b
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/get-user-sessions.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..feb40dff2d
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/get-user.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..561826cbd1
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/list-users.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..7c9918cc07
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/update-user-prefs.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..15b7376ca7
--- /dev/null
+++ b/app/sdks/javascript/docs/examples/users/update-user-status.md
@@ -0,0 +1,13 @@
+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/package.json b/app/sdks/javascript/package.json
new file mode 100644
index 0000000000..e718733189
--- /dev/null
+++ b/app/sdks/javascript/package.json
@@ -0,0 +1,14 @@
+{
+ "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"
+ },
+ "devDependencies": {},
+ "dependencies": {}
+}
\ No newline at end of file
diff --git a/app/sdks/javascript/src/sdk.js b/app/sdks/javascript/src/sdk.js
new file mode 100644
index 0000000000..8e286fd404
--- /dev/null
+++ b/app/sdks/javascript/src/sdk.js
@@ -0,0 +1,3886 @@
+(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}
+ */
+ getAccount: function() {
+ let path = '/account';
+
+ let payload = {};
+
+ return http
+ .get(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * 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 {Error}
+ * @return {Promise}
+ */
+ createAccount: 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 = '/account';
+
+ 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);
+ },
+
+ /**
+ * 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);
+ },
+
+ /**
+ * 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 {Error}
+ * @return {Promise}
+ */
+ getAccountLogs: function() {
+ let path = '/account/logs';
+
+ let payload = {};
+
+ return http
+ .get(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * Update Account Name
+ *
+ * Update currently logged in user account name.
+ *
+ * @param {string} name
+ * @throws {Error}
+ * @return {Promise}
+ */
+ updateAccountName: 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}
+ */
+ updateAccountPassword: 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}
+ */
+ getAccountPrefs: function() {
+ let path = '/account/prefs';
+
+ let payload = {};
+
+ return http
+ .get(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * 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 {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);
+ },
+
+ /**
+ * 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} url
+ * @throws {Error}
+ * @return {Promise}
+ */
+ createAccountRecovery: function(email, url) {
+ if(email === undefined) {
+ throw new Error('Missing required parameter: "email"');
+ }
+
+ if(url === undefined) {
+ throw new Error('Missing required parameter: "url"');
+ }
+
+ let path = '/account/recovery';
+
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(url) {
+ payload['url'] = url;
+ }
+
+ 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 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 {Error}
+ * @return {Promise}
+ */
+ updateAccountRecovery: function(userId, secret, passwordA, passwordB) {
+ if(userId === undefined) {
+ throw new Error('Missing required parameter: "userId"');
+ }
+
+ if(secret === undefined) {
+ throw new Error('Missing required parameter: "secret"');
+ }
+
+ if(passwordA === undefined) {
+ throw new Error('Missing required parameter: "passwordA"');
+ }
+
+ if(passwordB === undefined) {
+ throw new Error('Missing required parameter: "passwordB"');
+ }
+
+ let path = '/account/recovery';
+
+ let payload = {};
+
+ if(userId) {
+ payload['userId'] = userId;
+ }
+
+ if(secret) {
+ payload['secret'] = secret;
+ }
+
+ if(passwordA) {
+ payload['password-a'] = passwordA;
+ }
+
+ if(passwordB) {
+ payload['password-b'] = passwordB;
+ }
+
+ return http
+ .put(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * Get Account Sessions
+ *
+ * Get currently logged in user list of active sessions across different
+ * devices.
+ *
+ * @throws {Error}
+ * @return {Promise}
+ */
+ getAccountSessions: function() {
+ let path = '/account/sessions';
+
+ let payload = {};
+
+ return http
+ .get(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * 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 {Error}
+ * @return {Promise}
+ */
+ createAccountSession: 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/sessions';
+
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(password) {
+ payload['password'] = password;
+ }
+
+ return http
+ .post(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * Delete All Account Sessions
+ *
+ * Delete all sessions from the user account and remove any sessions cookies
+ * from the end client.
+ *
+ * @throws {Error}
+ * @return {Promise}
+ */
+ deleteAccountSessions: function() {
+ let path = '/account/sessions';
+
+ let payload = {};
+
+ return http
+ .delete(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * Delete Current Account Session
+ *
+ * Use this endpoint to log out the currently logged in user from his account.
+ * When successful this endpoint will delete the user session and remove the
+ * session secret cookie from the user client.
+ *
+ * @throws {Error}
+ * @return {Promise}
+ */
+ deleteAccountCurrentSession: function() {
+ let path = '/account/sessions/current';
+
+ let payload = {};
+
+ return http
+ .delete(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * 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 {Error}
+ * @return {Promise}
+ */
+ createAccountSessionOAuth: function(provider, success, failure) {
+ if(provider === undefined) {
+ throw new Error('Missing required parameter: "provider"');
+ }
+
+ if(success === undefined) {
+ throw new Error('Missing required parameter: "success"');
+ }
+
+ if(failure === undefined) {
+ throw new Error('Missing required parameter: "failure"');
+ }
+
+ let path = '/account/sessions/oauth/{provider}'.replace(new RegExp('{provider}', 'g'), provider);
+
+ let payload = {};
+
+ if(success) {
+ payload['success'] = success;
+ }
+
+ if(failure) {
+ payload['failure'] = failure;
+ }
+
+ return http
+ .get(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
+ /**
+ * 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 {Error}
+ * @return {Promise}
+ */
+ 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);
+ },
+
+ /**
+ * 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 **token** 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 **token**
+ * 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
+ *
+ * Use this endpoint to complete the user email verification process. Use both
+ * the **userId** and **token** 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 {Error}
+ * @return {Promise}
+ */
+ 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;
+ }
+
+ if(secret) {
+ payload['secret'] = secret;
+ }
+
+ if(passwordB) {
+ payload['password-b'] = passwordB;
+ }
+
+ return http
+ .put(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.
+ *
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
+ *
+ * @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.
+ *
+ * @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} file
+ * @param {array} read
+ * @param {array} write
+ * @throws {Error}
+ * @return {Promise}
+ */
+ createFile: function(file, read, write) {
+ if(file === undefined) {
+ throw new Error('Missing required parameter: "file"');
+ }
+
+ 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(file) {
+ payload['file'] = file;
+ }
+
+ 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 a 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 the 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 Memberships
+ *
+ * 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}
+ */
+ getTeamMemberships: function(teamId) {
+ if(teamId === undefined) {
+ throw new Error('Missing required parameter: "teamId"');
+ }
+
+ let path = '/teams/{teamId}/memberships'.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 'url' parameter to redirect the user from the invitation email back
+ * to your app. When the user is redirected, use the [Update Team Membership
+ * Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join
+ * the user to the team.
+ *
+ * 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.
+ *
+ * @param {string} teamId
+ * @param {string} email
+ * @param {array} roles
+ * @param {string} url
+ * @param {string} name
+ * @throws {Error}
+ * @return {Promise}
+ */
+ createTeamMembership: function(teamId, email, roles, url, 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(url === undefined) {
+ throw new Error('Missing required parameter: "url"');
+ }
+
+ 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(url) {
+ payload['url'] = url;
+ }
+
+ 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. You can also use this endpoint to
+ * delete a user membership even if he didn't accept it.
+ *
+ * @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);
+ },
+
+ /**
+ * 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 token.
+ *
+ * @param {string} teamId
+ * @param {string} inviteId
+ * @param {string} userId
+ * @param {string} secret
+ * @throws {Error}
+ * @return {null}
+ */
+ updateTeamMembershipStatus: function(teamId, inviteId, userId, secret) {
+ 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;
+ }
+
+ 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 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,
+ 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
diff --git a/app/sdks/javascript/src/sdk.min.js b/app/sdks/javascript/src/sdk.min.js
new file mode 100644
index 0000000000..493765dd7c
--- /dev/null
+++ b/app/sdks/javascript/src/sdk.min.js
@@ -0,0 +1,351 @@
+(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={getAccount:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload)},createAccount: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='/account';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)},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)},getAccountLogs:function(){let path='/account/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateAccountName: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)},updateAccountPassword: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)},getAccountPrefs: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)},createAccountRecovery:function(email,url){if(email===undefined){throw new Error('Missing required parameter: "email"')}
+if(url===undefined){throw new Error('Missing required parameter: "url"')}
+let path='/account/recovery';let payload={};if(email){payload.email=email}
+if(url){payload.url=url}
+return http.post(path,{'content-type':'application/json',},payload)},updateAccountRecovery:function(userId,secret,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+if(secret===undefined){throw new Error('Missing required parameter: "secret"')}
+if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')}
+if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')}
+let path='/account/recovery';let payload={};if(userId){payload.userId=userId}
+if(secret){payload.secret=secret}
+if(passwordA){payload['password-a']=passwordA}
+if(passwordB){payload['password-b']=passwordB}
+return http.put(path,{'content-type':'application/json',},payload)},getAccountSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json',},payload)},createAccountSession: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/sessions';let payload={};if(email){payload.email=email}
+if(password){payload.password=password}
+return http.post(path,{'content-type':'application/json',},payload)},deleteAccountSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},deleteAccountCurrentSession:function(){let path='/account/sessions/current';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createAccountSessionOAuth:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
+if(success===undefined){throw new Error('Missing required parameter: "success"')}
+if(failure===undefined){throw new Error('Missing required parameter: "failure"')}
+let path='/account/sessions/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success}
+if(failure){payload.failure=failure}
+return http.get(path,{'content-type':'application/json',},payload)},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"')}
+if(secret===undefined){throw new Error('Missing required parameter: "secret"')}
+if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')}
+let path='/account/verification';let payload={};if(userId){payload.userId=userId}
+if(secret){payload.secret=secret}
+if(passwordB){payload['password-b']=passwordB}
+return http.put(path,{'content-type':'application/json',},payload)}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
+let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
+if(height){payload.height=height}
+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(file,read,write){if(file===undefined){throw new Error('Missing required parameter: "file"')}
+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(file){payload.file=file}
+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)},getTeamMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createTeamMembership:function(teamId,email,roles,url,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(url===undefined){throw new Error('Missing required parameter: "url"')}
+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(url){payload.url=url}
+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)},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret){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}
+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
diff --git a/app/sdks/nodejs/LICENSE b/app/sdks/nodejs/LICENSE
new file mode 100644
index 0000000000..fc7c051a91
--- /dev/null
+++ b/app/sdks/nodejs/LICENSE
@@ -0,0 +1,12 @@
+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/nodejs/README.md b/app/sdks/nodejs/README.md
new file mode 100644
index 0000000000..eac061f52e
--- /dev/null
+++ b/app/sdks/nodejs/README.md
@@ -0,0 +1,22 @@
+# Appwrite SDK for NodeJS
+
+
+
+
+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)
+
+
+
+
+
+## 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/nodejs/docs/examples/account/create-account-recovery.md b/app/sdks/nodejs/docs/examples/account/create-account-recovery.md
new file mode 100644
index 0000000000..192870a20f
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/create-account-recovery.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..7e401a4161
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/create-account-session-o-auth.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..755f4bd3e5
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/create-account-session.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..3e2082273f
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/create-account-verification.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..ea36651887
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/create-account.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..1d617e20e6
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/delete-account-current-session.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..23388767ce
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/delete-account-session.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..5571d7af4e
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/delete-account-sessions.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..a2294e7a2b
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/delete.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..7c241510dd
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/get-account-logs.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..f6c6ce0ab7
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/get-account-prefs.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..60adb274c7
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/get-account-sessions.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..5b27263b55
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/get-account.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..8c819ac65b
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/update-account-name.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..d58273c139
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/update-account-password.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..a161f077f6
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/update-account-recovery.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..d935d0d635
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/update-account-verification.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..e1937eb31a
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/update-email.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..c52e3a560a
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/account/update-prefs.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..ae650dae9b
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/avatars/get-browser.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let avatars = new sdk.Avatars(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/avatars/get-credit-card.md b/app/sdks/nodejs/docs/examples/avatars/get-credit-card.md
new file mode 100644
index 0000000000..567ff2c81f
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/avatars/get-credit-card.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let avatars = new sdk.Avatars(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/avatars/get-favicon.md b/app/sdks/nodejs/docs/examples/avatars/get-favicon.md
new file mode 100644
index 0000000000..10e05eef00
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/avatars/get-favicon.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let avatars = new sdk.Avatars(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/avatars/get-flag.md b/app/sdks/nodejs/docs/examples/avatars/get-flag.md
new file mode 100644
index 0000000000..4793f320af
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/avatars/get-flag.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let avatars = new sdk.Avatars(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/avatars/get-image.md b/app/sdks/nodejs/docs/examples/avatars/get-image.md
new file mode 100644
index 0000000000..5329174988
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/avatars/get-image.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let avatars = new sdk.Avatars(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/avatars/get-q-r.md b/app/sdks/nodejs/docs/examples/avatars/get-q-r.md
new file mode 100644
index 0000000000..adb6ea9ca1
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/avatars/get-q-r.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let avatars = new sdk.Avatars(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/create-collection.md b/app/sdks/nodejs/docs/examples/database/create-collection.md
new file mode 100644
index 0000000000..cdd31c2c40
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/create-collection.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/create-document.md b/app/sdks/nodejs/docs/examples/database/create-document.md
new file mode 100644
index 0000000000..b1d3745d3c
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/create-document.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/delete-collection.md b/app/sdks/nodejs/docs/examples/database/delete-collection.md
new file mode 100644
index 0000000000..4fe87892ef
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/delete-collection.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/delete-document.md b/app/sdks/nodejs/docs/examples/database/delete-document.md
new file mode 100644
index 0000000000..1dba553a31
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/delete-document.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/get-collection.md b/app/sdks/nodejs/docs/examples/database/get-collection.md
new file mode 100644
index 0000000000..a634fcb9e8
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/get-collection.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/get-document.md b/app/sdks/nodejs/docs/examples/database/get-document.md
new file mode 100644
index 0000000000..034ab82c37
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/get-document.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/list-collections.md b/app/sdks/nodejs/docs/examples/database/list-collections.md
new file mode 100644
index 0000000000..27e960111f
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/list-collections.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/list-documents.md b/app/sdks/nodejs/docs/examples/database/list-documents.md
new file mode 100644
index 0000000000..4dd99052af
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/list-documents.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/update-collection.md b/app/sdks/nodejs/docs/examples/database/update-collection.md
new file mode 100644
index 0000000000..37e4ef9fa1
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/update-collection.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/database/update-document.md b/app/sdks/nodejs/docs/examples/database/update-document.md
new file mode 100644
index 0000000000..1be1d9672a
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/database/update-document.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let database = new sdk.Database(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/locale/get-continents.md b/app/sdks/nodejs/docs/examples/locale/get-continents.md
new file mode 100644
index 0000000000..84ea74f1b5
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/locale/get-continents.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let locale = new sdk.Locale(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/locale/get-countries-e-u.md b/app/sdks/nodejs/docs/examples/locale/get-countries-e-u.md
new file mode 100644
index 0000000000..a022ddee34
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/locale/get-countries-e-u.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let locale = new sdk.Locale(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/locale/get-countries-phones.md b/app/sdks/nodejs/docs/examples/locale/get-countries-phones.md
new file mode 100644
index 0000000000..b7d870f7df
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/locale/get-countries-phones.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let locale = new sdk.Locale(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/locale/get-countries.md b/app/sdks/nodejs/docs/examples/locale/get-countries.md
new file mode 100644
index 0000000000..610d679dfb
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/locale/get-countries.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let locale = new sdk.Locale(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/locale/get-currencies.md b/app/sdks/nodejs/docs/examples/locale/get-currencies.md
new file mode 100644
index 0000000000..0bfb6b1951
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/locale/get-currencies.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let locale = new sdk.Locale(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/locale/get-locale.md b/app/sdks/nodejs/docs/examples/locale/get-locale.md
new file mode 100644
index 0000000000..f07554e149
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/locale/get-locale.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let locale = new sdk.Locale(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/projects/create-key.md b/app/sdks/nodejs/docs/examples/projects/create-key.md
new file mode 100644
index 0000000000..2328b381a4
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/create-key.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..7ca5744429
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/create-platform.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..787cba3cdb
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/create-project.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..6aeab88830
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/create-task.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..3998c671e2
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/create-webhook.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..7aaa57ea15
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/delete-key.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..96a539a160
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/delete-platform.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..755733f80b
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/delete-project.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..944f31cc1c
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/delete-task.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..faa5b59b6a
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/delete-webhook.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..fa0c34f520
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/get-key.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..a54b7e6788
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/get-platform.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..b97c7b6366
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/get-project-usage.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..d548b12ffd
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/get-project.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..f6b6c6b558
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/get-task.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..dbfa0f508f
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/get-webhook.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..c66aee9905
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/list-keys.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..f92efcd1ce
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/list-platforms.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..a8f40d3bd7
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/list-projects.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..fe8176abe9
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/list-tasks.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..b878f71618
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/list-webhooks.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..72f13ea361
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/update-key.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..44fad61cfb
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/update-platform.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..29a3c6359f
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/update-project-o-auth.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..ced5f47fb3
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/update-project.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..eaa54d89a5
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/update-task.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..26f47557be
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/projects/update-webhook.md
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..d8d108017d
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/create-file.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/delete-file.md b/app/sdks/nodejs/docs/examples/storage/delete-file.md
new file mode 100644
index 0000000000..fae85d0b1d
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/delete-file.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/get-file-download.md b/app/sdks/nodejs/docs/examples/storage/get-file-download.md
new file mode 100644
index 0000000000..10ca0322a3
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/get-file-download.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/get-file-preview.md b/app/sdks/nodejs/docs/examples/storage/get-file-preview.md
new file mode 100644
index 0000000000..f8a4b1ea02
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/get-file-preview.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/get-file-view.md b/app/sdks/nodejs/docs/examples/storage/get-file-view.md
new file mode 100644
index 0000000000..34260abe30
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/get-file-view.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/get-file.md b/app/sdks/nodejs/docs/examples/storage/get-file.md
new file mode 100644
index 0000000000..16e109f2ef
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/get-file.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/list-files.md b/app/sdks/nodejs/docs/examples/storage/list-files.md
new file mode 100644
index 0000000000..61fcc799b0
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/list-files.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/storage/update-file.md b/app/sdks/nodejs/docs/examples/storage/update-file.md
new file mode 100644
index 0000000000..fbe5d588fb
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/storage/update-file.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let storage = new sdk.Storage(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/create-team-membership.md b/app/sdks/nodejs/docs/examples/teams/create-team-membership.md
new file mode 100644
index 0000000000..4106ac2a11
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/create-team-membership.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/create-team.md b/app/sdks/nodejs/docs/examples/teams/create-team.md
new file mode 100644
index 0000000000..c0bf9b7d59
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/create-team.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/delete-team-membership.md b/app/sdks/nodejs/docs/examples/teams/delete-team-membership.md
new file mode 100644
index 0000000000..859a9ca8a9
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/delete-team-membership.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/delete-team.md b/app/sdks/nodejs/docs/examples/teams/delete-team.md
new file mode 100644
index 0000000000..7c87cc9260
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/delete-team.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/get-team-memberships.md b/app/sdks/nodejs/docs/examples/teams/get-team-memberships.md
new file mode 100644
index 0000000000..4dd49446fa
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/get-team-memberships.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+let promise = teams.getTeamMemberships('[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/teams/get-team.md b/app/sdks/nodejs/docs/examples/teams/get-team.md
new file mode 100644
index 0000000000..0e65a57e7e
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/get-team.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/list-teams.md b/app/sdks/nodejs/docs/examples/teams/list-teams.md
new file mode 100644
index 0000000000..d8d3ca7010
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/list-teams.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/teams/update-team-membership-status.md b/app/sdks/nodejs/docs/examples/teams/update-team-membership-status.md
new file mode 100644
index 0000000000..daeaf47fa0
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/update-team-membership-status.md
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..d527ca95ab
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/teams/update-team.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let teams = new sdk.Teams(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/create-user.md b/app/sdks/nodejs/docs/examples/users/create-user.md
new file mode 100644
index 0000000000..a5c637c383
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/create-user.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/delete-user-session.md b/app/sdks/nodejs/docs/examples/users/delete-user-session.md
new file mode 100644
index 0000000000..a3cbeb522c
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/delete-user-session.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/delete-user-sessions.md b/app/sdks/nodejs/docs/examples/users/delete-user-sessions.md
new file mode 100644
index 0000000000..0b972bd21c
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/delete-user-sessions.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/get-user-logs.md b/app/sdks/nodejs/docs/examples/users/get-user-logs.md
new file mode 100644
index 0000000000..1ff249ea31
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/get-user-logs.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/get-user-prefs.md b/app/sdks/nodejs/docs/examples/users/get-user-prefs.md
new file mode 100644
index 0000000000..33e26ebda8
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/get-user-prefs.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/get-user-sessions.md b/app/sdks/nodejs/docs/examples/users/get-user-sessions.md
new file mode 100644
index 0000000000..09e7e4bbdb
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/get-user-sessions.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/get-user.md b/app/sdks/nodejs/docs/examples/users/get-user.md
new file mode 100644
index 0000000000..1a9b1b5463
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/get-user.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/list-users.md b/app/sdks/nodejs/docs/examples/users/list-users.md
new file mode 100644
index 0000000000..0e609113a8
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/list-users.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/update-user-prefs.md b/app/sdks/nodejs/docs/examples/users/update-user-prefs.md
new file mode 100644
index 0000000000..58009109f8
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/update-user-prefs.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/docs/examples/users/update-user-status.md b/app/sdks/nodejs/docs/examples/users/update-user-status.md
new file mode 100644
index 0000000000..99227df81b
--- /dev/null
+++ b/app/sdks/nodejs/docs/examples/users/update-user-status.md
@@ -0,0 +1,18 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+;
+
+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/nodejs/index.js b/app/sdks/nodejs/index.js
new file mode 100644
index 0000000000..89e82ef555
--- /dev/null
+++ b/app/sdks/nodejs/index.js
@@ -0,0 +1,21 @@
+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,
+};
\ No newline at end of file
diff --git a/app/sdks/nodejs/lib/client.js b/app/sdks/nodejs/lib/client.js
new file mode 100644
index 0000000000..253bf95f02
--- /dev/null
+++ b/app/sdks/nodejs/lib/client.js
@@ -0,0 +1,122 @@
+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/nodejs/lib/service.js b/app/sdks/nodejs/lib/service.js
new file mode 100644
index 0000000000..e799c064be
--- /dev/null
+++ b/app/sdks/nodejs/lib/service.js
@@ -0,0 +1,10 @@
+class Service {
+ /**
+ * @param client
+ */
+ constructor(client) {
+ this.client = client;
+ }
+}
+
+module.exports = Service;
\ No newline at end of file
diff --git a/app/sdks/nodejs/lib/services/account.js b/app/sdks/nodejs/lib/services/account.js
new file mode 100644
index 0000000000..8ad6a312ea
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/account.js
@@ -0,0 +1,475 @@
+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 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 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 **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 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 **token** 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 **token**
+ * 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 **token** 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/avatars.js b/app/sdks/nodejs/lib/services/avatars.js
new file mode 100644
index 0000000000..c34bdde966
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/avatars.js
@@ -0,0 +1,164 @@
+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/nodejs/lib/services/database.js b/app/sdks/nodejs/lib/services/database.js
new file mode 100644
index 0000000000..4287484038
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/database.js
@@ -0,0 +1,266 @@
+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/nodejs/lib/services/locale.js b/app/sdks/nodejs/lib/services/locale.js
new file mode 100644
index 0000000000..2b5f3f2b2f
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/locale.js
@@ -0,0 +1,125 @@
+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.
+ *
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
+ *
+ * @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.
+ *
+ * @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/nodejs/lib/services/projects.js b/app/sdks/nodejs/lib/services/projects.js
new file mode 100644
index 0000000000..58a03980a2
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/projects.js
@@ -0,0 +1,609 @@
+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/storage.js b/app/sdks/nodejs/lib/services/storage.js
new file mode 100644
index 0000000000..7237ccfc6f
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/storage.js
@@ -0,0 +1,199 @@
+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 file
+ * @param array read
+ * @param array write
+ * @throws Exception
+ * @return {}
+ */
+ async createFile(file, read, write) {
+ let path = '/storage/files';
+
+ return await this.client.call('post', path, {
+ 'content-type': 'multipart/form-data',
+ },
+ {
+ 'file': file,
+ '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 a 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 the 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/nodejs/lib/services/teams.js b/app/sdks/nodejs/lib/services/teams.js
new file mode 100644
index 0000000000..324837977f
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/teams.js
@@ -0,0 +1,240 @@
+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 Memberships
+ *
+ * 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 getTeamMemberships(teamId) {
+ let path = '/teams/{teamId}/memberships'.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 'url' parameter to redirect the user from the invitation email back
+ * to your app. When the user is redirected, use the [Update Team Membership
+ * Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join
+ * the user to the team.
+ *
+ * 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.
+ *
+ * @param string teamId
+ * @param string email
+ * @param array roles
+ * @param string url
+ * @param string name
+ * @throws Exception
+ * @return {}
+ */
+ async createTeamMembership(teamId, email, roles, url, 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,
+ 'url': url
+ });
+ }
+
+ /**
+ * Delete Team Membership
+ *
+ * This endpoint allows a user to leave a team or for a team owner to delete
+ * the membership of any other team member. You can also use this endpoint to
+ * delete a user membership even if he didn't accept it.
+ *
+ * @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',
+ },
+ {
+ });
+ }
+
+ /**
+ * 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 token.
+ *
+ * @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/nodejs/lib/services/users.js b/app/sdks/nodejs/lib/services/users.js
new file mode 100644
index 0000000000..5fe21c7350
--- /dev/null
+++ b/app/sdks/nodejs/lib/services/users.js
@@ -0,0 +1,216 @@
+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 Preferences
+ *
+ * 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 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 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/nodejs/package.json b/app/sdks/nodejs/package.json
new file mode 100644
index 0000000000..b10f63562a
--- /dev/null
+++ b/app/sdks/nodejs/package.json
@@ -0,0 +1,17 @@
+{
+ "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"
+ },
+ "devDependencies": {},
+ "dependencies": {
+ "request": "^2.88.0",
+ "request-promise-native": "^1.0.7"
+ }
+}
\ No newline at end of file
diff --git a/app/sdks/php/README.md b/app/sdks/php/README.md
index 8244a4d953..03ce462fe9 100644
--- a/app/sdks/php/README.md
+++ b/app/sdks/php/README.md
@@ -3,8 +3,6 @@


-**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)
diff --git a/app/sdks/php/docs/account.md b/app/sdks/php/docs/account.md
index 7d4455ffef..a9dc7f39a7 100644
--- a/app/sdks/php/docs/account.md
+++ b/app/sdks/php/docs/account.md
@@ -8,6 +8,28 @@ 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
@@ -28,8 +50,16 @@ PATCH https://appwrite.io/v1/account/email
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
-| email | string | Email Address | |
-| password | string | User Password | |
+| 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
@@ -68,7 +98,7 @@ GET https://appwrite.io/v1/account/prefs
** Get currently logged in user preferences key-value object. **
-## Update Account Prefs
+## Update Account Preferences
```http request
PATCH https://appwrite.io/v1/account/prefs
@@ -80,17 +110,43 @@ PATCH https://appwrite.io/v1/account/prefs
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
-| prefs | string | Prefs key-value JSON object string. | |
+| prefs | string | Prefs key-value JSON object. | |
-## Get Account Security Log
+## Password Recovery
```http request
-GET https://appwrite.io/v1/account/security
+POST https://appwrite.io/v1/account/recovery
```
-** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
+** 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. **
-## Get Account Active Sessions
+### 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 **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 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
@@ -98,3 +154,100 @@ 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 **token** 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 **token** 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 **token** 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/examples/account/create-account-recovery.md b/app/sdks/php/docs/examples/account/create-account-recovery.md
new file mode 100644
index 0000000000..0ba77c1e1f
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/create-account-recovery.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..7e0e4decaf
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/create-account-session-o-auth.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..daa9aefab6
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/create-account-session.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..a7cbb8da35
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/create-account-verification.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..d6425fc205
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/create-account.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..85f7d27622
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/delete-account-current-session.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..b7581763c9
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/delete-account-session.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..45799e649c
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/delete-account-sessions.md
@@ -0,0 +1,14 @@
+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
index 4aeb1f0096..2e3b5553a5 100644
--- a/app/sdks/php/docs/examples/account/delete.md
+++ b/app/sdks/php/docs/examples/account/delete.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$account = new Account($client);
diff --git a/app/sdks/php/docs/examples/account/get-account-logs.md b/app/sdks/php/docs/examples/account/get-account-logs.md
new file mode 100644
index 0000000000..48809b17cb
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/get-account-logs.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..f480df1927
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/get-account-prefs.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..60b8cdc97c
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/get-account-sessions.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..14226f7014
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/get-account.md
@@ -0,0 +1,14 @@
+setProject('')
+;
+
+$account = new Account($client);
+
+$result = $account->getAccount();
\ 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
new file mode 100644
index 0000000000..a8701822ce
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/update-account-name.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..5a6135fea2
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/update-account-password.md
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..dcd8dda921
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/update-account-recovery.md
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..1a2a788984
--- /dev/null
+++ b/app/sdks/php/docs/examples/account/update-account-verification.md
@@ -0,0 +1,13 @@
+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
index 66cb6dff4a..3e2ed0f62b 100644
--- a/app/sdks/php/docs/examples/account/update-email.md
+++ b/app/sdks/php/docs/examples/account/update-email.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$account = new Account($client);
diff --git a/app/sdks/php/docs/examples/account/update-prefs.md b/app/sdks/php/docs/examples/account/update-prefs.md
index df73bac861..66f70fa643 100644
--- a/app/sdks/php/docs/examples/account/update-prefs.md
+++ b/app/sdks/php/docs/examples/account/update-prefs.md
@@ -7,9 +7,8 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$account = new Account($client);
-$result = $account->updatePrefs('{}');
\ No newline at end of file
+$result = $account->updatePrefs('');
\ 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 c9a6a6b6c0..464ca10e9d 100644
--- a/app/sdks/php/docs/examples/avatars/get-browser.md
+++ b/app/sdks/php/docs/examples/avatars/get-browser.md
@@ -7,7 +7,6 @@ $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 206b0cc8c8..88fa1299b9 100644
--- a/app/sdks/php/docs/examples/avatars/get-credit-card.md
+++ b/app/sdks/php/docs/examples/avatars/get-credit-card.md
@@ -7,7 +7,6 @@ $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 01f28add89..982408e5e2 100644
--- a/app/sdks/php/docs/examples/avatars/get-favicon.md
+++ b/app/sdks/php/docs/examples/avatars/get-favicon.md
@@ -7,7 +7,6 @@ $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 26740446cd..9a254b5907 100644
--- a/app/sdks/php/docs/examples/avatars/get-flag.md
+++ b/app/sdks/php/docs/examples/avatars/get-flag.md
@@ -7,7 +7,6 @@ $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 bbbe68d2d0..a3810f2dde 100644
--- a/app/sdks/php/docs/examples/avatars/get-image.md
+++ b/app/sdks/php/docs/examples/avatars/get-image.md
@@ -7,7 +7,6 @@ $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 e10ec33d59..ebb4a9dc15 100644
--- a/app/sdks/php/docs/examples/avatars/get-q-r.md
+++ b/app/sdks/php/docs/examples/avatars/get-q-r.md
@@ -7,7 +7,6 @@ $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 183d906905..8be0238d10 100644
--- a/app/sdks/php/docs/examples/database/create-collection.md
+++ b/app/sdks/php/docs/examples/database/create-collection.md
@@ -7,7 +7,6 @@ $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 84c4d7fd06..aff513cf42 100644
--- a/app/sdks/php/docs/examples/database/create-document.md
+++ b/app/sdks/php/docs/examples/database/create-document.md
@@ -7,7 +7,6 @@ $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 2319d52c57..35594a5d95 100644
--- a/app/sdks/php/docs/examples/database/delete-collection.md
+++ b/app/sdks/php/docs/examples/database/delete-collection.md
@@ -7,7 +7,6 @@ $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 b364e0bcd5..4193c27d3f 100644
--- a/app/sdks/php/docs/examples/database/delete-document.md
+++ b/app/sdks/php/docs/examples/database/delete-document.md
@@ -7,7 +7,6 @@ $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 9daa61ddfc..3e967c5829 100644
--- a/app/sdks/php/docs/examples/database/get-collection.md
+++ b/app/sdks/php/docs/examples/database/get-collection.md
@@ -7,7 +7,6 @@ $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 da72bd8f1b..9644378337 100644
--- a/app/sdks/php/docs/examples/database/get-document.md
+++ b/app/sdks/php/docs/examples/database/get-document.md
@@ -7,7 +7,6 @@ $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 c46daa2cda..b522cfc989 100644
--- a/app/sdks/php/docs/examples/database/list-collections.md
+++ b/app/sdks/php/docs/examples/database/list-collections.md
@@ -7,7 +7,6 @@ $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 973f9c477e..21ea55d9da 100644
--- a/app/sdks/php/docs/examples/database/list-documents.md
+++ b/app/sdks/php/docs/examples/database/list-documents.md
@@ -7,7 +7,6 @@ $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 2576449e5c..f6ea3a8593 100644
--- a/app/sdks/php/docs/examples/database/update-collection.md
+++ b/app/sdks/php/docs/examples/database/update-collection.md
@@ -7,7 +7,6 @@ $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 2051d09772..eff2b554e6 100644
--- a/app/sdks/php/docs/examples/database/update-document.md
+++ b/app/sdks/php/docs/examples/database/update-document.md
@@ -7,7 +7,6 @@ $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 22b1528c0a..96c8b219cd 100644
--- a/app/sdks/php/docs/examples/locale/get-continents.md
+++ b/app/sdks/php/docs/examples/locale/get-continents.md
@@ -7,7 +7,6 @@ $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 9f0f1973cc..7c3fd4d285 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,7 +7,6 @@ $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 2478c7c730..73726aab03 100644
--- a/app/sdks/php/docs/examples/locale/get-countries-phones.md
+++ b/app/sdks/php/docs/examples/locale/get-countries-phones.md
@@ -7,7 +7,6 @@ $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 111dc52777..0433724631 100644
--- a/app/sdks/php/docs/examples/locale/get-countries.md
+++ b/app/sdks/php/docs/examples/locale/get-countries.md
@@ -7,7 +7,6 @@ $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 e01d5fd623..f8f3c77d3a 100644
--- a/app/sdks/php/docs/examples/locale/get-currencies.md
+++ b/app/sdks/php/docs/examples/locale/get-currencies.md
@@ -7,7 +7,6 @@ $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 ac56f068de..edec17a38f 100644
--- a/app/sdks/php/docs/examples/locale/get-locale.md
+++ b/app/sdks/php/docs/examples/locale/get-locale.md
@@ -7,7 +7,6 @@ $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
index b732c540ab..5eb7f27687 100644
--- a/app/sdks/php/docs/examples/projects/create-key.md
+++ b/app/sdks/php/docs/examples/projects/create-key.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/create-platform.md b/app/sdks/php/docs/examples/projects/create-platform.md
index 4f5f6a3355..cde5eddad8 100644
--- a/app/sdks/php/docs/examples/projects/create-platform.md
+++ b/app/sdks/php/docs/examples/projects/create-platform.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/create-project.md b/app/sdks/php/docs/examples/projects/create-project.md
index c7a36650af..edb6bb6ab0 100644
--- a/app/sdks/php/docs/examples/projects/create-project.md
+++ b/app/sdks/php/docs/examples/projects/create-project.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/create-task.md b/app/sdks/php/docs/examples/projects/create-task.md
index fab9e27653..aaa12d98cc 100644
--- a/app/sdks/php/docs/examples/projects/create-task.md
+++ b/app/sdks/php/docs/examples/projects/create-task.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/create-webhook.md b/app/sdks/php/docs/examples/projects/create-webhook.md
index 6eacda1fc0..5721c423a2 100644
--- a/app/sdks/php/docs/examples/projects/create-webhook.md
+++ b/app/sdks/php/docs/examples/projects/create-webhook.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/delete-key.md b/app/sdks/php/docs/examples/projects/delete-key.md
index 4af28f9929..da74fa05c8 100644
--- a/app/sdks/php/docs/examples/projects/delete-key.md
+++ b/app/sdks/php/docs/examples/projects/delete-key.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/delete-platform.md b/app/sdks/php/docs/examples/projects/delete-platform.md
index cab8785a49..c21a7bb93c 100644
--- a/app/sdks/php/docs/examples/projects/delete-platform.md
+++ b/app/sdks/php/docs/examples/projects/delete-platform.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/delete-project.md b/app/sdks/php/docs/examples/projects/delete-project.md
index d02ceb6e2b..10158026d8 100644
--- a/app/sdks/php/docs/examples/projects/delete-project.md
+++ b/app/sdks/php/docs/examples/projects/delete-project.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/delete-task.md b/app/sdks/php/docs/examples/projects/delete-task.md
index 0e8632cf3f..1e62f3401a 100644
--- a/app/sdks/php/docs/examples/projects/delete-task.md
+++ b/app/sdks/php/docs/examples/projects/delete-task.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/delete-webhook.md b/app/sdks/php/docs/examples/projects/delete-webhook.md
index fff5956e0c..7ec160d048 100644
--- a/app/sdks/php/docs/examples/projects/delete-webhook.md
+++ b/app/sdks/php/docs/examples/projects/delete-webhook.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/get-key.md b/app/sdks/php/docs/examples/projects/get-key.md
index 4863bc23d4..d5b5ed742f 100644
--- a/app/sdks/php/docs/examples/projects/get-key.md
+++ b/app/sdks/php/docs/examples/projects/get-key.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/get-platform.md b/app/sdks/php/docs/examples/projects/get-platform.md
index 94f23656f5..13777df0f4 100644
--- a/app/sdks/php/docs/examples/projects/get-platform.md
+++ b/app/sdks/php/docs/examples/projects/get-platform.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/get-project-usage.md b/app/sdks/php/docs/examples/projects/get-project-usage.md
index 495ba2fe9f..f4ebfa5d2e 100644
--- a/app/sdks/php/docs/examples/projects/get-project-usage.md
+++ b/app/sdks/php/docs/examples/projects/get-project-usage.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/get-project.md b/app/sdks/php/docs/examples/projects/get-project.md
index b64f8a0e26..f3bbd65043 100644
--- a/app/sdks/php/docs/examples/projects/get-project.md
+++ b/app/sdks/php/docs/examples/projects/get-project.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/get-task.md b/app/sdks/php/docs/examples/projects/get-task.md
index 598bba69e5..3ca455c2bc 100644
--- a/app/sdks/php/docs/examples/projects/get-task.md
+++ b/app/sdks/php/docs/examples/projects/get-task.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/get-webhook.md b/app/sdks/php/docs/examples/projects/get-webhook.md
index c765dfb108..bfde5a94e3 100644
--- a/app/sdks/php/docs/examples/projects/get-webhook.md
+++ b/app/sdks/php/docs/examples/projects/get-webhook.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/list-keys.md b/app/sdks/php/docs/examples/projects/list-keys.md
index 69db3fda45..ec00ca41ad 100644
--- a/app/sdks/php/docs/examples/projects/list-keys.md
+++ b/app/sdks/php/docs/examples/projects/list-keys.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/list-platforms.md b/app/sdks/php/docs/examples/projects/list-platforms.md
index ae0155379e..c9272711e7 100644
--- a/app/sdks/php/docs/examples/projects/list-platforms.md
+++ b/app/sdks/php/docs/examples/projects/list-platforms.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/list-projects.md b/app/sdks/php/docs/examples/projects/list-projects.md
index 5e39729bc2..53b7047e57 100644
--- a/app/sdks/php/docs/examples/projects/list-projects.md
+++ b/app/sdks/php/docs/examples/projects/list-projects.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/list-tasks.md b/app/sdks/php/docs/examples/projects/list-tasks.md
index 7f0bc62a5b..175b580420 100644
--- a/app/sdks/php/docs/examples/projects/list-tasks.md
+++ b/app/sdks/php/docs/examples/projects/list-tasks.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/list-webhooks.md b/app/sdks/php/docs/examples/projects/list-webhooks.md
index 121698a240..299b9e3ecc 100644
--- a/app/sdks/php/docs/examples/projects/list-webhooks.md
+++ b/app/sdks/php/docs/examples/projects/list-webhooks.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/update-key.md b/app/sdks/php/docs/examples/projects/update-key.md
index 09aa0d2517..960761c01c 100644
--- a/app/sdks/php/docs/examples/projects/update-key.md
+++ b/app/sdks/php/docs/examples/projects/update-key.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/update-platform.md b/app/sdks/php/docs/examples/projects/update-platform.md
index e7c35dd232..0537dec85a 100644
--- a/app/sdks/php/docs/examples/projects/update-platform.md
+++ b/app/sdks/php/docs/examples/projects/update-platform.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
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
index cd0ef51f3a..283ecbddff 100644
--- a/app/sdks/php/docs/examples/projects/update-project-o-auth.md
+++ b/app/sdks/php/docs/examples/projects/update-project-o-auth.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/update-project.md b/app/sdks/php/docs/examples/projects/update-project.md
index 0d7997c16d..f878bc9119 100644
--- a/app/sdks/php/docs/examples/projects/update-project.md
+++ b/app/sdks/php/docs/examples/projects/update-project.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/update-task.md b/app/sdks/php/docs/examples/projects/update-task.md
index 59308c5d6d..95f64e6188 100644
--- a/app/sdks/php/docs/examples/projects/update-task.md
+++ b/app/sdks/php/docs/examples/projects/update-task.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/projects/update-webhook.md b/app/sdks/php/docs/examples/projects/update-webhook.md
index a7e42dcce2..d550c0c178 100644
--- a/app/sdks/php/docs/examples/projects/update-webhook.md
+++ b/app/sdks/php/docs/examples/projects/update-webhook.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$projects = new Projects($client);
diff --git a/app/sdks/php/docs/examples/storage/create-file.md b/app/sdks/php/docs/examples/storage/create-file.md
index 225b9e2bec..1e8df67482 100644
--- a/app/sdks/php/docs/examples/storage/create-file.md
+++ b/app/sdks/php/docs/examples/storage/create-file.md
@@ -7,7 +7,6 @@ $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 74448e5a7c..21755b6cfb 100644
--- a/app/sdks/php/docs/examples/storage/delete-file.md
+++ b/app/sdks/php/docs/examples/storage/delete-file.md
@@ -7,7 +7,6 @@ $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 3a6db00081..545cf88bbf 100644
--- a/app/sdks/php/docs/examples/storage/get-file-download.md
+++ b/app/sdks/php/docs/examples/storage/get-file-download.md
@@ -7,7 +7,6 @@ $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 8b02bdd2a9..6cfc61ffb0 100644
--- a/app/sdks/php/docs/examples/storage/get-file-preview.md
+++ b/app/sdks/php/docs/examples/storage/get-file-preview.md
@@ -7,7 +7,6 @@ $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 59cc25bc74..438e18479c 100644
--- a/app/sdks/php/docs/examples/storage/get-file-view.md
+++ b/app/sdks/php/docs/examples/storage/get-file-view.md
@@ -7,7 +7,6 @@ $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 63fa59b40a..ae442c8924 100644
--- a/app/sdks/php/docs/examples/storage/get-file.md
+++ b/app/sdks/php/docs/examples/storage/get-file.md
@@ -7,7 +7,6 @@ $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 434e1fe70d..3384a3f6fd 100644
--- a/app/sdks/php/docs/examples/storage/list-files.md
+++ b/app/sdks/php/docs/examples/storage/list-files.md
@@ -7,7 +7,6 @@ $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 637870a7a6..0a9a17f9eb 100644
--- a/app/sdks/php/docs/examples/storage/update-file.md
+++ b/app/sdks/php/docs/examples/storage/update-file.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$storage = new Storage($client);
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 12a47b6f15..f43d527a8c 100644
--- a/app/sdks/php/docs/examples/teams/create-team-membership.md
+++ b/app/sdks/php/docs/examples/teams/create-team-membership.md
@@ -7,7 +7,6 @@ $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 11928b37cc..7f51f15152 100644
--- a/app/sdks/php/docs/examples/teams/create-team.md
+++ b/app/sdks/php/docs/examples/teams/create-team.md
@@ -7,7 +7,6 @@ $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 d53e1ed7ce..80e324d83b 100644
--- a/app/sdks/php/docs/examples/teams/delete-team-membership.md
+++ b/app/sdks/php/docs/examples/teams/delete-team-membership.md
@@ -7,7 +7,6 @@ $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 7fb04015be..4647a11e75 100644
--- a/app/sdks/php/docs/examples/teams/delete-team.md
+++ b/app/sdks/php/docs/examples/teams/delete-team.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$teams = new Teams($client);
diff --git a/app/sdks/php/docs/examples/teams/get-team-memberships.md b/app/sdks/php/docs/examples/teams/get-team-memberships.md
new file mode 100644
index 0000000000..10c19ab59c
--- /dev/null
+++ b/app/sdks/php/docs/examples/teams/get-team-memberships.md
@@ -0,0 +1,14 @@
+setProject('')
+;
+
+$teams = new Teams($client);
+
+$result = $teams->getTeamMemberships('[TEAM_ID]');
\ No newline at end of file
diff --git a/app/sdks/php/docs/examples/teams/get-team.md b/app/sdks/php/docs/examples/teams/get-team.md
index e58a9d0dc2..e9307dc934 100644
--- a/app/sdks/php/docs/examples/teams/get-team.md
+++ b/app/sdks/php/docs/examples/teams/get-team.md
@@ -7,7 +7,6 @@ $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 9b753c6d16..2b8d208c7e 100644
--- a/app/sdks/php/docs/examples/teams/list-teams.md
+++ b/app/sdks/php/docs/examples/teams/list-teams.md
@@ -7,7 +7,6 @@ $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
index 19f14550e4..cd387f598e 100644
--- a/app/sdks/php/docs/examples/teams/update-team-membership-status.md
+++ b/app/sdks/php/docs/examples/teams/update-team-membership-status.md
@@ -6,8 +6,6 @@ use Appwrite\Services\Teams;
$client = new Client();
$client
- ->setProject('')
- ->setKey('')
;
$teams = new Teams($client);
diff --git a/app/sdks/php/docs/examples/teams/update-team.md b/app/sdks/php/docs/examples/teams/update-team.md
index a76fce3a83..1047fd8ce3 100644
--- a/app/sdks/php/docs/examples/teams/update-team.md
+++ b/app/sdks/php/docs/examples/teams/update-team.md
@@ -7,7 +7,6 @@ $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 b25a479c89..e0db30a5f2 100644
--- a/app/sdks/php/docs/examples/users/create-user.md
+++ b/app/sdks/php/docs/examples/users/create-user.md
@@ -7,7 +7,6 @@ $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 28ad6dd165..40db227ec1 100644
--- a/app/sdks/php/docs/examples/users/delete-user-session.md
+++ b/app/sdks/php/docs/examples/users/delete-user-session.md
@@ -7,7 +7,6 @@ $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 a83c648f69..346eff92b0 100644
--- a/app/sdks/php/docs/examples/users/delete-user-sessions.md
+++ b/app/sdks/php/docs/examples/users/delete-user-sessions.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$users = new Users($client);
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 bb9a70e975..926d83ac78 100644
--- a/app/sdks/php/docs/examples/users/get-user-logs.md
+++ b/app/sdks/php/docs/examples/users/get-user-logs.md
@@ -7,7 +7,6 @@ $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 949d206065..68b6c7c894 100644
--- a/app/sdks/php/docs/examples/users/get-user-prefs.md
+++ b/app/sdks/php/docs/examples/users/get-user-prefs.md
@@ -7,7 +7,6 @@ $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 9f29697960..2b7eb49666 100644
--- a/app/sdks/php/docs/examples/users/get-user-sessions.md
+++ b/app/sdks/php/docs/examples/users/get-user-sessions.md
@@ -7,7 +7,6 @@ $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 bc776d4313..abf6c1f32c 100644
--- a/app/sdks/php/docs/examples/users/get-user.md
+++ b/app/sdks/php/docs/examples/users/get-user.md
@@ -7,7 +7,6 @@ $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 d3824540fc..c5f8d92b35 100644
--- a/app/sdks/php/docs/examples/users/list-users.md
+++ b/app/sdks/php/docs/examples/users/list-users.md
@@ -7,7 +7,6 @@ $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 073df70bd3..a42aedb9fa 100644
--- a/app/sdks/php/docs/examples/users/update-user-prefs.md
+++ b/app/sdks/php/docs/examples/users/update-user-prefs.md
@@ -7,9 +7,8 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$users = new Users($client);
-$result = $users->updateUserPrefs('[USER_ID]', '{}');
\ No newline at end of file
+$result = $users->updateUserPrefs('[USER_ID]', '');
\ No newline at end of file
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 918d827962..7cc61dd05b 100644
--- a/app/sdks/php/docs/examples/users/update-user-status.md
+++ b/app/sdks/php/docs/examples/users/update-user-status.md
@@ -7,7 +7,6 @@ $client = new Client();
$client
->setProject('')
- ->setKey('')
;
$users = new Users($client);
diff --git a/app/sdks/php/docs/locale.md b/app/sdks/php/docs/locale.md
index 81190fa96c..604d4f37fb 100644
--- a/app/sdks/php/docs/locale.md
+++ b/app/sdks/php/docs/locale.md
@@ -6,7 +6,9 @@
GET https://appwrite.io/v1/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. **
+** 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.
+
+([IP Geolocation by DB-IP](https://db-ip.com)) **
## List Countries
@@ -30,7 +32,7 @@ GET https://appwrite.io/v1/locale/countries
GET https://appwrite.io/v1/locale/countries/eu
```
-** 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. **
+** 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. **
## List Countries Phone Codes
diff --git a/app/sdks/php/docs/storage.md b/app/sdks/php/docs/storage.md
index f7eca89305..cb13a9968b 100644
--- a/app/sdks/php/docs/storage.md
+++ b/app/sdks/php/docs/storage.md
@@ -29,7 +29,7 @@ POST https://appwrite.io/v1/storage/files
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
-| files | file | Binary Files. | |
+| file | file | Binary Files. | |
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
@@ -97,7 +97,7 @@ GET https://appwrite.io/v1/storage/files/{fileId}/download
GET https://appwrite.io/v1/storage/files/{fileId}/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. **
+** Get a 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 the file icon image. You can also pass query string arguments for cutting and resizing your preview image. **
### Parameters
diff --git a/app/sdks/php/docs/teams.md b/app/sdks/php/docs/teams.md
index 109c1e7280..dfd4ae91d4 100644
--- a/app/sdks/php/docs/teams.md
+++ b/app/sdks/php/docs/teams.md
@@ -75,10 +75,10 @@ DELETE https://appwrite.io/v1/teams/{teamId}
| --- | --- | --- | --- |
| teamId | string | **Required** Team unique ID. | |
-## Get Team Members
+## Get Team Memberships
```http request
-GET https://appwrite.io/v1/teams/{teamId}/members
+GET https://appwrite.io/v1/teams/{teamId}/memberships
```
** Get team members by the team unique ID. All team members have read access for this list of resources. **
@@ -97,9 +97,9 @@ POST https://appwrite.io/v1/teams/{teamId}/memberships
** Use this endpoint to invite a new member to your team. An email with a link to join the team will be sent to the new member email address. If member doesn't exists in the project it will be automatically created.
-Use 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.
+Use the 'url' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join the user to the team.
-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. **
+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. **
### Parameters
@@ -109,7 +109,7 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
| email | string | New team member email address. | |
| name | string | New team member name. | |
| roles | array | Invite roles array. Learn more about [roles and permissions](/docs/permissions). | |
-| redirect | string | Reset page to redirect user back to your app from the invitation email. | |
+| url | string | URL to redirect the user back to your app from the invitation email. | |
## Delete Team Membership
@@ -117,7 +117,7 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
```
-** This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. **
+** This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it. **
### Parameters
@@ -126,22 +126,6 @@ DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
| teamId | string | **Required** Team unique ID. | |
| inviteId | string | **Required** Invite unique ID | |
-## Create Team Membership (Resend)
-
-```http request
-POST https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/resend
-```
-
-** Use this endpoint to resend your invitation email for a user to join a team. **
-
-### Parameters
-
-| Field Name | Type | Description | Default |
-| --- | --- | --- | --- |
-| teamId | string | **Required** Team unique ID. | |
-| inviteId | string | **Required** Invite unique ID. | |
-| redirect | string | Reset page to redirect user back to your app from the invitation email. | |
-
## Update Team Membership Status
```http request
@@ -150,7 +134,7 @@ 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 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.
+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 token. **
@@ -162,6 +146,4 @@ When not using the success or failure redirect arguments this endpoint will resu
| inviteId | string | **Required** Invite unique ID | |
| userId | string | User unique ID | |
| secret | string | Secret Key | |
-| success | string | Redirect when registration succeed | |
-| failure | string | Redirect when registration failed | |
diff --git a/app/sdks/php/docs/users.md b/app/sdks/php/docs/users.md
index fedcd71d54..c1056933d3 100644
--- a/app/sdks/php/docs/users.md
+++ b/app/sdks/php/docs/users.md
@@ -61,7 +61,7 @@ GET https://appwrite.io/v1/users/{userId}/logs
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
-## Get User Prefs
+## Get User Preferences
```http request
GET https://appwrite.io/v1/users/{userId}/prefs
@@ -75,7 +75,7 @@ GET https://appwrite.io/v1/users/{userId}/prefs
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
-## Update User Prefs
+## Update User Preferences
```http request
PATCH https://appwrite.io/v1/users/{userId}/prefs
@@ -88,7 +88,7 @@ PATCH https://appwrite.io/v1/users/{userId}/prefs
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
-| prefs | string | Prefs key-value JSON object string. | |
+| prefs | string | Prefs key-value JSON object. | |
## Get User Sessions
diff --git a/app/sdks/php/src/Appwrite/Client.php b/app/sdks/php/src/Appwrite/Client.php
index 360a6d614f..5db33c303f 100644
--- a/app/sdks/php/src/Appwrite/Client.php
+++ b/app/sdks/php/src/Appwrite/Client.php
@@ -185,6 +185,7 @@ class Client
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion());
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) {
$len = strlen($header);
$header = explode(':', strtolower($header), 2);
diff --git a/app/sdks/php/src/Appwrite/Services/Account.php b/app/sdks/php/src/Appwrite/Services/Account.php
index d56ea4c941..871ff73c0c 100644
--- a/app/sdks/php/src/Appwrite/Services/Account.php
+++ b/app/sdks/php/src/Appwrite/Services/Account.php
@@ -16,7 +16,7 @@ class Account extends Service
* @throws Exception
* @return array
*/
- public function get():array
+ public function getAccount():array
{
$path = str_replace([], [], '/account');
$params = [];
@@ -27,6 +27,50 @@ class Account extends Service
], $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
*
@@ -76,6 +120,26 @@ class Account extends Service
], $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
*
@@ -85,7 +149,7 @@ class Account extends Service
* @throws Exception
* @return array
*/
- public function updateName(string $name):array
+ public function updateAccountName(string $name):array
{
$path = str_replace([], [], '/account/name');
$params = [];
@@ -108,7 +172,7 @@ class Account extends Service
* @throws Exception
* @return array
*/
- public function updatePassword(string $password, string $oldPassword):array
+ public function updateAccountPassword(string $password, string $oldPassword):array
{
$path = str_replace([], [], '/account/password');
$params = [];
@@ -129,7 +193,7 @@ class Account extends Service
* @throws Exception
* @return array
*/
- public function getPrefs():array
+ public function getAccountPrefs():array
{
$path = str_replace([], [], '/account/prefs');
$params = [];
@@ -141,7 +205,7 @@ class Account extends Service
}
/**
- * Update Account Prefs
+ * Update Account Preferences
*
* Update currently logged in user account preferences. You can pass only the
* specific settings you wish to update.
@@ -163,27 +227,70 @@ class Account extends Service
}
/**
- * Get Account Security Log
+ * Password Recovery
*
- * Get currently logged in user list of latest security activity logs. Each
- * log returns user IP address, location and date and time of log.
+ * 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 $url
* @throws Exception
* @return array
*/
- public function getSecurity():array
+ public function createAccountRecovery(string $email, string $url):array
{
- $path = str_replace([], [], '/account/security');
+ $path = str_replace([], [], '/account/recovery');
$params = [];
+ $params['email'] = $email;
+ $params['url'] = $url;
- return $this->client->call(Client::METHOD_GET, $path, [
+ return $this->client->call(Client::METHOD_POST, $path, [
'content-type' => 'application/json',
], $params);
}
/**
- * Get Account Active Sessions
+ * 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 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.
@@ -191,7 +298,7 @@ class Account extends Service
* @throws Exception
* @return array
*/
- public function getSessions():array
+ public function getAccountSessions():array
{
$path = str_replace([], [], '/account/sessions');
$params = [];
@@ -202,4 +309,191 @@ class Account extends Service
], $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 **token** 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 **token**
+ * 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 **token** 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/Locale.php b/app/sdks/php/src/Appwrite/Services/Locale.php
index fafeabc7fd..5304f91924 100644
--- a/app/sdks/php/src/Appwrite/Services/Locale.php
+++ b/app/sdks/php/src/Appwrite/Services/Locale.php
@@ -15,6 +15,8 @@ class Locale extends Service
* 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.
+ *
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
*
* @throws Exception
* @return array
@@ -74,8 +76,7 @@ class Locale extends Service
* 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.
+ * locale header to get the data in a supported language.
*
* @throws Exception
* @return array
diff --git a/app/sdks/php/src/Appwrite/Services/Storage.php b/app/sdks/php/src/Appwrite/Services/Storage.php
index 37b0117d60..09b74fbf8f 100644
--- a/app/sdks/php/src/Appwrite/Services/Storage.php
+++ b/app/sdks/php/src/Appwrite/Services/Storage.php
@@ -44,18 +44,18 @@ class Storage extends Service
* assigned to read and write access unless he has passed custom values for
* read and write arguments.
*
- * @param \CurlFile $files
+ * @param \CurlFile $file
* @param array $read
* @param array $write
* @throws Exception
* @return array
*/
- public function createFile(\CurlFile $files, array $read, array $write):array
+ public function createFile(\CurlFile $file, array $read, array $write):array
{
$path = str_replace([], [], '/storage/files');
$params = [];
- $params['files'] = $files;
+ $params['file'] = $file;
$params['read'] = $read;
$params['write'] = $write;
@@ -156,9 +156,9 @@ class Storage extends Service
/**
* Get File Preview
*
- * Get file preview image. Currently, this method supports preview for image
+ * Get a 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
+ * and spreadsheets, will return the file icon image. You can also pass query
* string arguments for cutting and resizing your preview image.
*
* @param string $fileId
diff --git a/app/sdks/php/src/Appwrite/Services/Teams.php b/app/sdks/php/src/Appwrite/Services/Teams.php
index 4109aef893..fffee9877b 100644
--- a/app/sdks/php/src/Appwrite/Services/Teams.php
+++ b/app/sdks/php/src/Appwrite/Services/Teams.php
@@ -129,7 +129,7 @@ class Teams extends Service
}
/**
- * Get Team Members
+ * Get Team Memberships
*
* Get team members by the team unique ID. All team members have read access
* for this list of resources.
@@ -138,9 +138,9 @@ class Teams extends Service
* @throws Exception
* @return array
*/
- public function getTeamMembers(string $teamId):array
+ public function getTeamMemberships(string $teamId):array
{
- $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/members');
+ $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/memberships');
$params = [];
@@ -156,12 +156,12 @@ class Teams extends Service
* 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.
+ * Use the 'url' parameter to redirect the user from the invitation email back
+ * to your app. When the user is redirected, use the [Update Team Membership
+ * Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join
+ * the user to the team.
*
- * Please notice that in order to avoid a [Redirect
+ * 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.
@@ -169,12 +169,12 @@ class Teams extends Service
* @param string $teamId
* @param string $email
* @param array $roles
- * @param string $redirect
+ * @param string $url
* @param string $name
* @throws Exception
* @return array
*/
- public function createTeamMembership(string $teamId, string $email, array $roles, string $redirect, string $name = ''):array
+ public function createTeamMembership(string $teamId, string $email, array $roles, string $url, string $name = ''):array
{
$path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/memberships');
$params = [];
@@ -182,7 +182,7 @@ class Teams extends Service
$params['email'] = $email;
$params['name'] = $name;
$params['roles'] = $roles;
- $params['redirect'] = $redirect;
+ $params['url'] = $url;
return $this->client->call(Client::METHOD_POST, $path, [
'content-type' => 'application/json',
@@ -193,7 +193,8 @@ class Teams extends Service
* 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.
+ * the membership of any other team member. You can also use this endpoint to
+ * delete a user membership even if he didn't accept it.
*
* @param string $teamId
* @param string $inviteId
@@ -211,30 +212,6 @@ class Teams extends Service
], $params);
}
- /**
- * 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 array
- */
- public function createTeamMembershipResend(string $teamId, string $inviteId, string $redirect):array
- {
- $path = str_replace(['{teamId}', '{inviteId}'], [$teamId, $inviteId], '/teams/{teamId}/memberships/{inviteId}/resend');
- $params = [];
-
- $params['redirect'] = $redirect;
-
- return $this->client->call(Client::METHOD_POST, $path, [
- 'content-type' => 'application/json',
- ], $params);
- }
-
/**
* Update Team Membership Status
*
@@ -243,7 +220,7 @@ class Teams extends Service
* 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
+ * 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.
@@ -258,20 +235,16 @@ class Teams extends Service
* @param string $inviteId
* @param string $userId
* @param string $secret
- * @param string $success
- * @param string $failure
* @throws Exception
* @return array
*/
- public function updateTeamMembershipStatus(string $teamId, string $inviteId, string $userId, string $secret, string $success = '', string $failure = ''):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;
- $params['success'] = $success;
- $params['failure'] = $failure;
return $this->client->call(Client::METHOD_PATCH, $path, [
'content-type' => 'application/json',
diff --git a/app/sdks/php/src/Appwrite/Services/Users.php b/app/sdks/php/src/Appwrite/Services/Users.php
index aca2a1edb1..3d59006f57 100644
--- a/app/sdks/php/src/Appwrite/Services/Users.php
+++ b/app/sdks/php/src/Appwrite/Services/Users.php
@@ -102,7 +102,7 @@ class Users extends Service
}
/**
- * Get User Prefs
+ * Get User Preferences
*
* Get user preferences by its unique ID.
*
@@ -122,7 +122,7 @@ class Users extends Service
}
/**
- * Update User Prefs
+ * Update User Preferences
*
* Update user preferences by its unique ID. You can pass only the specific
* settings you wish to update.
diff --git a/app/sdks/python/README.md b/app/sdks/python/README.md
index 0d388a4486..e5a3c8a652 100644
--- a/app/sdks/python/README.md
+++ b/app/sdks/python/README.md
@@ -3,7 +3,7 @@


-**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).**
+**This SDK is compatible with Appwrite server version . For older versions, please check previous releases.**
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
diff --git a/app/sdks/python/appwrite/client.py b/app/sdks/python/appwrite/client.py
index 7fbadfaff4..92d8651a55 100644
--- a/app/sdks/python/appwrite/client.py
+++ b/app/sdks/python/appwrite/client.py
@@ -1,6 +1,4 @@
import requests
-
-
class Client:
def __init__(self):
self._self_signed = False
@@ -73,5 +71,11 @@ class Client:
)
response.raise_for_status()
-
- return response.json()
+
+ content_type = response.headers['Content-Type']
+
+ if content_type.startswith('application/json'):
+ return response.json()
+
+ return response._content
+
diff --git a/app/sdks/python/appwrite/services/account.py b/app/sdks/python/appwrite/services/account.py
index 4b38e4a824..ab045782da 100644
--- a/app/sdks/python/appwrite/services/account.py
+++ b/app/sdks/python/appwrite/services/account.py
@@ -6,7 +6,7 @@ class Account(Service):
def __init__(self, client):
super(Account, self).__init__(client)
- def get(self):
+ def get_account(self):
"""Get Account"""
params = {}
@@ -16,6 +16,19 @@ class Account(Service):
'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"""
@@ -38,7 +51,17 @@ class Account(Service):
'content-type': 'application/json',
}, params)
- def update_name(self, name):
+ 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 = {}
@@ -49,7 +72,7 @@ class Account(Service):
'content-type': 'application/json',
}, params)
- def update_password(self, password, old_password):
+ def update_account_password(self, password, old_password):
"""Update Account Password"""
params = {}
@@ -61,7 +84,7 @@ class Account(Service):
'content-type': 'application/json',
}, params)
- def get_prefs(self):
+ def get_account_prefs(self):
"""Get Account Preferences"""
params = {}
@@ -72,7 +95,7 @@ class Account(Service):
}, params)
def update_prefs(self, prefs):
- """Update Account Prefs"""
+ """Update Account Preferences"""
params = {}
path = '/account/prefs'
@@ -82,18 +105,34 @@ class Account(Service):
'content-type': 'application/json',
}, params)
- def get_security(self):
- """Get Account Security Log"""
+ def create_account_recovery(self, email, url):
+ """Password Recovery"""
params = {}
- path = '/account/security'
+ path = '/account/recovery'
+ params['email'] = email
+ params['url'] = url
- return self.client.call('get', path, {
+ return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
- def get_sessions(self):
- """Get Account Active Sessions"""
+ 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'
@@ -101,3 +140,83 @@ class Account(Service):
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/storage.py b/app/sdks/python/appwrite/services/storage.py
index 7b8fa23581..7e2a986f6e 100644
--- a/app/sdks/python/appwrite/services/storage.py
+++ b/app/sdks/python/appwrite/services/storage.py
@@ -20,12 +20,12 @@ class Storage(Service):
'content-type': 'application/json',
}, params)
- def create_file(self, files, read, write):
+ def create_file(self, file, read, write):
"""Create File"""
params = {}
path = '/storage/files'
- params['files'] = files
+ params['file'] = file
params['read'] = read
params['write'] = write
diff --git a/app/sdks/python/appwrite/services/teams.py b/app/sdks/python/appwrite/services/teams.py
index c69424d8ba..7112e45a87 100644
--- a/app/sdks/python/appwrite/services/teams.py
+++ b/app/sdks/python/appwrite/services/teams.py
@@ -66,18 +66,18 @@ class Teams(Service):
'content-type': 'application/json',
}, params)
- def get_team_members(self, team_id):
- """Get Team Members"""
+ def get_team_memberships(self, team_id):
+ """Get Team Memberships"""
params = {}
- path = '/teams/{teamId}/members'
+ path = '/teams/{teamId}/memberships'
path = path.replace('{teamId}', team_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
- def create_team_membership(self, team_id, email, roles, redirect, name=''):
+ def create_team_membership(self, team_id, email, roles, url, name=''):
"""Create Team Membership"""
params = {}
@@ -86,7 +86,7 @@ class Teams(Service):
params['email'] = email
params['name'] = name
params['roles'] = roles
- params['redirect'] = redirect
+ params['url'] = url
return self.client.call('post', path, {
'content-type': 'application/json',
@@ -104,20 +104,7 @@ class Teams(Service):
'content-type': 'application/json',
}, params)
- def create_team_membership_resend(self, team_id, invite_id, redirect):
- """Create Team Membership (Resend)"""
-
- params = {}
- path = '/teams/{teamId}/memberships/{inviteId}/resend'
- path = path.replace('{teamId}', team_id)
- path = path.replace('{inviteId}', invite_id)
- params['redirect'] = redirect
-
- return self.client.call('post', path, {
- 'content-type': 'application/json',
- }, params)
-
- def update_team_membership_status(self, team_id, invite_id, user_id, secret, success='', failure=''):
+ def update_team_membership_status(self, team_id, invite_id, user_id, secret):
"""Update Team Membership Status"""
params = {}
@@ -126,8 +113,6 @@ class Teams(Service):
path = path.replace('{inviteId}', invite_id)
params['userId'] = user_id
params['secret'] = secret
- params['success'] = success
- params['failure'] = failure
return self.client.call('patch', path, {
'content-type': 'application/json',
diff --git a/app/sdks/python/appwrite/services/users.py b/app/sdks/python/appwrite/services/users.py
index e97a961901..1fbe5c7518 100644
--- a/app/sdks/python/appwrite/services/users.py
+++ b/app/sdks/python/appwrite/services/users.py
@@ -56,7 +56,7 @@ class Users(Service):
}, params)
def get_user_prefs(self, user_id):
- """Get User Prefs"""
+ """Get User Preferences"""
params = {}
path = '/users/{userId}/prefs'
@@ -67,7 +67,7 @@ class Users(Service):
}, params)
def update_user_prefs(self, user_id, prefs):
- """Update User Prefs"""
+ """Update User Preferences"""
params = {}
path = '/users/{userId}/prefs'
diff --git a/app/sdks/ruby/README.md b/app/sdks/ruby/README.md
index af0c396288..dcf68a0384 100644
--- a/app/sdks/ruby/README.md
+++ b/app/sdks/ruby/README.md
@@ -3,7 +3,7 @@


-**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).**
+**This SDK is compatible with Appwrite server version . For older versions, please check previous releases.**
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
diff --git a/app/sdks/ruby/lib/appwrite.rb b/app/sdks/ruby/lib/appwrite.rb
index 7f12c9aedf..c93a767938 100644
--- a/app/sdks/ruby/lib/appwrite.rb
+++ b/app/sdks/ruby/lib/appwrite.rb
@@ -4,7 +4,6 @@ require 'json'
require_relative 'appwrite/client'
require_relative 'appwrite/service'
require_relative 'appwrite/services/account'
-require_relative 'appwrite/services/auth'
require_relative 'appwrite/services/avatars'
require_relative 'appwrite/services/database'
require_relative 'appwrite/services/locale'
diff --git a/app/sdks/ruby/lib/appwrite/client.rb b/app/sdks/ruby/lib/appwrite/client.rb
index 43dd47a235..86bef71f02 100644
--- a/app/sdks/ruby/lib/appwrite/client.rb
+++ b/app/sdks/ruby/lib/appwrite/client.rb
@@ -62,7 +62,17 @@ module Appwrite
end
def call(method, path = '', headers = {}, params = {})
- uri = URI.parse(@endpoint + path + ((method == METHOD_GET) ? '?' + encode(params) : ''))
+ uri = URI.parse(@endpoint + path + ((method == METHOD_GET && params.length) ? '?' + encode(params) : ''))
+ return fetch(method, uri, headers, params)
+ end
+
+ protected
+
+ private
+
+ def fetch(method, uri, headers, params, limit = 5)
+ raise ArgumentError, 'Too Many HTTP Redirects' if limit == 0
+
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == 'https')
payload = ''
@@ -83,14 +93,18 @@ module Appwrite
rescue => error
raise 'Request Failed: ' + error.message
end
+
+ # Handle Redirects
+ if (response.class == Net::HTTPRedirection || response.class == Net::HTTPMovedPermanently)
+ location = response['location']
+ uri = URI.parse(uri.scheme + "://" + uri.host + "" + location)
+
+ return fetch(method, uri, headers, {}, limit - 1)
+ end
return JSON.parse(response.body);
end
- protected
-
- private
-
def encode(value, key = nil)
case value
when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&')
diff --git a/app/sdks/ruby/lib/appwrite/services/account.rb b/app/sdks/ruby/lib/appwrite/services/account.rb
index 8f2a8b3e2a..51c4a614f4 100644
--- a/app/sdks/ruby/lib/appwrite/services/account.rb
+++ b/app/sdks/ruby/lib/appwrite/services/account.rb
@@ -1,7 +1,7 @@
module Appwrite
class Account < Service
- def get()
+ def get_account()
path = '/account'
params = {
@@ -12,6 +12,20 @@ module Appwrite
}, 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'
@@ -36,7 +50,18 @@ module Appwrite
}, params);
end
- def update_name(name:)
+ 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 = {
@@ -48,7 +73,7 @@ module Appwrite
}, params);
end
- def update_password(password:, old_password:)
+ def update_account_password(password:, old_password:)
path = '/account/password'
params = {
@@ -61,7 +86,7 @@ module Appwrite
}, params);
end
- def get_prefs()
+ def get_account_prefs()
path = '/account/prefs'
params = {
@@ -84,18 +109,35 @@ module Appwrite
}, params);
end
- def get_security()
- path = '/account/security'
+ def create_account_recovery(email:, url:)
+ path = '/account/recovery'
params = {
+ 'email': email,
+ 'url': url
}
- return @client.call('get', path, {
+ return @client.call('post', path, {
'content-type' => 'application/json',
}, params);
end
- def get_sessions()
+ 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 = {
@@ -106,6 +148,93 @@ module Appwrite
}, 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
diff --git a/app/sdks/ruby/lib/appwrite/services/storage.rb b/app/sdks/ruby/lib/appwrite/services/storage.rb
index 6e854b1f6d..2fe1a5762f 100644
--- a/app/sdks/ruby/lib/appwrite/services/storage.rb
+++ b/app/sdks/ruby/lib/appwrite/services/storage.rb
@@ -16,11 +16,11 @@ module Appwrite
}, params);
end
- def create_file(files:, read:, write:)
+ def create_file(file:, read:, write:)
path = '/storage/files'
params = {
- 'files': files,
+ 'file': file,
'read': read,
'write': write
}
diff --git a/app/sdks/ruby/lib/appwrite/services/teams.rb b/app/sdks/ruby/lib/appwrite/services/teams.rb
index 109786e542..143c2a650c 100644
--- a/app/sdks/ruby/lib/appwrite/services/teams.rb
+++ b/app/sdks/ruby/lib/appwrite/services/teams.rb
@@ -66,8 +66,8 @@ module Appwrite
}, params);
end
- def get_team_members(team_id:)
- path = '/teams/{teamId}/members'
+ def get_team_memberships(team_id:)
+ path = '/teams/{teamId}/memberships'
.gsub('{team_id}', team_id)
params = {
@@ -78,7 +78,7 @@ module Appwrite
}, params);
end
- def create_team_membership(team_id:, email:, roles:, redirect:, name: '')
+ def create_team_membership(team_id:, email:, roles:, url:, name: '')
path = '/teams/{teamId}/memberships'
.gsub('{team_id}', team_id)
@@ -86,7 +86,7 @@ module Appwrite
'email': email,
'name': name,
'roles': roles,
- 'redirect': redirect
+ 'url': url
}
return @client.call('post', path, {
@@ -107,30 +107,14 @@ module Appwrite
}, params);
end
- def create_team_membership_resend(team_id:, invite_id:, redirect:)
- path = '/teams/{teamId}/memberships/{inviteId}/resend'
- .gsub('{team_id}', team_id)
- .gsub('{invite_id}', invite_id)
-
- params = {
- 'redirect': redirect
- }
-
- return @client.call('post', path, {
- 'content-type' => 'application/json',
- }, params);
- end
-
- def update_team_membership_status(team_id:, invite_id:, user_id:, secret:, success: '', failure: '')
+ 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,
- 'success': success,
- 'failure': failure
+ 'secret': secret
}
return @client.call('patch', path, {
diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php
index ef830044fd..0df9b7b762 100644
--- a/app/tasks/sdks.php
+++ b/app/tasks/sdks.php
@@ -37,155 +37,27 @@ $cli
return $result;
}
- $clients = [
- 'php' => [
- 'version' => '1.0.16',
- 'result' => __DIR__.'/../sdks/php/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-php.git',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-php.git',
- 'gitRepoName' => 'sdk-for-php',
- 'gitUserName' => 'appwrite',
- 'warning' => $warning,
- 'readme' => false,
- 'platform' => 'server',
- ],
- 'js' => [
- 'version' => '1.0.28',
- 'result' => __DIR__.'/../sdks/js/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-js.git',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git',
- 'gitRepoName' => 'sdk-for-js',
- 'gitUserName' => 'appwrite',
- 'warning' => $warning,
- 'readme' => realpath(__DIR__ . '/../../docs/sdks/js.md'),
- 'platform' => 'client',
- ],
- 'node' => [
- 'version' => '1.0.31',
- 'result' => __DIR__.'/../sdks/node/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-node.git',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-node.git',
- 'gitRepoName' => 'sdk-for-node',
- 'gitUserName' => 'appwrite',
- 'warning' => $warning,
- 'readme' => false,
- 'platform' => 'server',
- ],
- 'python' => [
- 'version' => '0.0.3',
- 'result' => __DIR__.'/../sdks/python/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-python.git',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-python.git',
- 'gitRepoName' => 'sdk-for-python',
- 'gitUserName' => 'appwrite',
- 'warning' => '**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).**',
- 'readme' => false,
- 'platform' => 'server',
- ],
- 'ruby' => [
- 'version' => '1.0.8',
- 'result' => __DIR__.'/../sdks/ruby/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-ruby.git',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-ruby.git',
- 'gitRepoName' => 'sdk-for-ruby',
- 'gitUserName' => 'appwrite',
- 'warning' => '**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).**',
- 'readme' => false,
- 'platform' => 'server',
- ],
- 'dart' => [
- 'version' => '0.0.6',
- 'result' => __DIR__.'/../sdks/dart/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-dart',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-dart.git',
- 'gitRepoName' => 'sdk-for-dart',
- 'gitUserName' => 'appwrite',
- 'warning' => '**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).**',
- 'readme' => false,
- 'platform' => 'client',
- ],
- 'go' => [
- 'version' => '0.0.5',
- 'result' => __DIR__.'/../sdks/go/',
- 'gitURL' => 'https://github.com/appwrite/sdk-for-go',
- 'gitRepo' => 'git@github.com:appwrite/sdk-for-go.git',
- 'gitRepoName' => 'sdk-for-go',
- 'gitUserName' => 'appwrite',
- 'warning' => '**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).**',
- 'readme' => false,
- 'platform' => 'server',
- ],
- ];
+ $platforms = include __DIR__ . '/../config/platforms.php';
+ $message = Console::confirm('Please enter your commit message:');
-
- foreach ($clients as $name => $client) {
+ foreach($platforms as $platform) {
+ foreach($platform['languages'] as $language) {
+ if(!$language['enabled']) {
+ Console::warning($language['name'].' for '.$platform['name'] . ' is disabled');
+ continue;
+ }
- Console::info('Fetching API Spec for '.$name.' ('.$client['platform'].')');
-
- $spec = getSSLPage('https://localhost/v1/open-api-2.json?extensions=1&platform='.$client['platform']);
- $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform='.$client['platform']);
-
- $license = 'BSD-3-Clause';
+ Console::info('Fetching API Spec for '.$language['name'].' for '.$platform['name']);
- switch ($name) {
- case 'php':
- $language = new PHP();
- $language
- ->setComposerVendor('appwrite')
- ->setComposerPackage('appwrite')
- ;
- break;
- case 'js':
- $language = new JS();
- $language
- ->setNPMPackage('appwrite')
- ->setBowerPackage('appwrite')
- ;
- break;
- case 'node':
- $language = new Node();
- $language
- ->setNPMPackage('node-appwrite')
- ->setBowerPackage('appwrite')
- ;
- break;
- case 'python':
- $language = new Python();
- $language
- ->setPipPackage('appwrite')
- ;
- $license = 'BSD License'; // license edited due to classifiers in pypi
- break;
- case 'ruby':
- $language = new Ruby();
- $language
- ->setGemPackage('appwrite')
- ;
- break;
- case 'dart':
- $language = new Dart();
- $language
- ->setPackageName('appwrite')
- ;
- break;
- break;
- case 'go':
- $language = new Go();
- break;
- default:
- throw new Exception('Language not supported');
- break;
- }
+ $spec = getSSLPage('http://localhost/v1/open-api-2.json?extensions=1');
- $target = __DIR__.'/../sdks/git/'.$name;
-
- Console::success("Generating {$name} SDK");
-
- $sdk = new SDK($language, new Swagger2($spec));
-
- $sdk
- ->setLicense($license)
- ->setLicenseContent('Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
+ $result = realpath(__DIR__.'/..').'/sdks/'.$language['key'];
+ $target = realpath(__DIR__.'/..').'/sdks/git/'.$language['key'];
+ $readme = realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'.md');
+ $readme = ($readme) ? file_get_contents($readme) : '';
+ $warning = ($language['beta']) ? '**This SDK is compatible with Appwrite server version ' . $version . '. For older versions, please check previous releases.**' : '';
+ $license = 'BSD-3-Clause';
+ $licenseContent = '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:
@@ -196,7 +68,112 @@ Redistribution and use in source and binary forms, with or without modification,
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.')
+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.';
+
+ switch ($language['key']) {
+ case 'php':
+ $config = new PHP();
+ $config
+ ->setComposerVendor('appwrite')
+ ->setComposerPackage('appwrite')
+ ;
+ break;
+ case 'javascript':
+ $config = new JS();
+ $config
+ ->setNPMPackage('appwrite')
+ ->setBowerPackage('appwrite')
+ ;
+ break;
+ case 'nodejs':
+ $config = new Node();
+ $config
+ ->setNPMPackage('node-appwrite')
+ ->setBowerPackage('appwrite')
+ ;
+ break;
+ case 'python':
+ $config = new Python();
+ $config
+ ->setPipPackage('appwrite')
+ ;
+ $license = 'BSD License'; // license edited due to classifiers in pypi
+ break;
+ case 'ruby':
+ $config = new Ruby();
+ $config
+ ->setGemPackage('appwrite')
+ ;
+ break;
+ case 'dart':
+ $config = new Dart();
+ $config
+ ->setPackageName('appwrite')
+ ;
+ break;
+ case 'go':
+ $config = new Go();
+ break;
+ default:
+ throw new Exception('Language "'.$language['key'].'" not supported');
+ break;
+ }
+
+ Console::info("Generating {$language['name']} SDK...");
+
+ $sdk = new SDK($config, new Swagger2($spec));
+
+ $sdk
+ ->setLicense($license)
+ ->setLicenseContent($licenseContent)
+ ->setVersion($language['version'])
+ ->setGitURL($language['url'])
+ ->setGitRepo($language['gitUrl'])
+ ->setGitRepoName($language['gitRepoName'])
+ ->setGitUserName($language['gitUserName'])
+ ->setLogo('https://appwrite.io/images/github.png')
+ ->setURL('https://appwrite.io')
+ ->setShareText('Appwrite is a backend as a service for building web or mobile apps')
+ ->setShareURL('http://appwrite.io')
+ ->setShareTags('JS,javascript,reactjs,angular,ios,android,serverless')
+ ->setShareVia('appwrite_io')
+ ->setWarning($warning)
+ ->setReadme($readme)
+ ;
+
+ try {
+ $sdk->generate($result);
+ } catch (Exception $exception) {
+ Console::error($exception->getMessage());
+ } catch (Throwable $exception) {
+ Console::error($exception->getMessage());
+ }
+
+ var_dump('rm -rf '.$target.' && \
+ mkdir -p '.$target.' && \
+ cd '.$target.' && \
+ git init && \
+ git remote add origin '.$language['gitUrl'].' && \
+ git fetch && \
+ git pull '.$language['gitUrl'].' && \
+ rm -rf '.$target.'/* && \
+ cp -r '.$result.' '.$target.' && \
+ git add . && \
+ git commit -m "'.$message.'" && \
+ git push -u origin master');
+
+ Console::success("Pushed {$language['name']} SDK to {$language['url']}");
+ }
+ }
+ exit();
+
+ foreach ($clients as $name => $client) {
+
+
+
+ $sdk
+ ->setLicense($license)
+ ->setLicenseContent($licenseContent)
->setVersion($client['version'])
->setGitRepo($client['gitRepo'])
->setGitURL($client['gitURL'])
@@ -219,6 +196,19 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
Console::error($exception->getMessage());
}
+ var_dump('rm -rf '.$target.' && \
+ mkdir -p '.$target.' && \
+ cd '.$target.' && \
+ git init && \
+ git remote add origin '.$client['gitRepo'].' && \
+ git fetch && \
+ git pull '.$client['gitRepo'].' && \
+ rm -rf '.$target.'/* && \
+ cp -r '.$client['result'].' '.$target.' && \
+ git add . && \
+ git commit -m "Initial commit" && \
+ git push -u origin master');
+
exec('rm -rf '.$target.' && \
mkdir -p '.$target.' && \
cd '.$target.' && \
diff --git a/docs/references/account/create-recovery.md b/docs/references/account/create-recovery.md
index e15db5ac6b..45ff5f83f2 100644
--- a/docs/references/account/create-recovery.md
+++ b/docs/references/account/create-recovery.md
@@ -1 +1 @@
-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.
\ No newline at end of file
+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.
\ No newline at end of file
diff --git a/docs/references/account/create-verification.md b/docs/references/account/create-verification.md
index 1710e34068..a9aa04e104 100644
--- a/docs/references/account/create-verification.md
+++ b/docs/references/account/create-verification.md
@@ -1,3 +1,3 @@
-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 **token** 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 **token** parameters. Learn more about how to [complete the verification process](/docs/account#updateAccountVerification).
+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.
\ No newline at end of file
diff --git a/docs/references/account/update-recovery.md b/docs/references/account/update-recovery.md
index 1936120e82..4a58ef92f8 100644
--- a/docs/references/account/update-recovery.md
+++ b/docs/references/account/update-recovery.md
@@ -1,3 +1,3 @@
-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.
+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.
\ No newline at end of file
diff --git a/docs/references/account/update-verification.md b/docs/references/account/update-verification.md
index 4b11befa13..d089cc51b1 100644
--- a/docs/references/account/update-verification.md
+++ b/docs/references/account/update-verification.md
@@ -1 +1 @@
-Use this endpoint to complete the user email verification process. Use both the **userId** and **token** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
\ No newline at end of file
+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.
\ No newline at end of file
diff --git a/docs/references/teams/update-team-membership-status.md b/docs/references/teams/update-team-membership-status.md
index 199c243a08..fa75a56628 100644
--- a/docs/references/teams/update-team-membership-status.md
+++ b/docs/references/teams/update-team-membership-status.md
@@ -2,4 +2,4 @@ Use this endpoint to let user accept an invitation to join a team after he is be
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 token.
\ No newline at end of file
+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.
\ No newline at end of file