+ Hello,
+
+
+ এই মেইলটি আপনাকে পাঠানো হয়েছে কারণ {{owner}} আমন্ত্রণ করেছেন আপনাকে {{team}} এই টীমর মেম্বার হতে যেটি {{project}} এই প্রজেক্টর অন্তর্গত |
+
+
+ এই লিংকটি অনুসরণ করুন {{team}} এই টীম-এ যোগ দিতে:
+
+ {{redirect}}
+
+
+ আপনি যদি অনাগ্রহী হন, এই মেসেজটি অগ্রাহ্য করতে পারেন |
+
+
+ ধন্যবাদান্তে,
+
+ {{project}} টীম
+
- यह मेल आपको इसलिए भेजा गया था क्योंकि {{owner}} आपको टीम मेंबर बनने के लिए आमंत्रित करना चाहता है {{team}} टीम के लिए {{project}} प्रोजेक्ट पर
+ यह मेल आपको इसलिए भेजा गया था क्योंकि {{owner}} आपको {{project}} के लिए {{team}} टीम में टीम मेंबर बनने के लिए आमंत्रित करना चाहते थे।
टीम {{team}} ज्वाइन करने के लिए इस लिंक पर क्लिक करे :
diff --git a/app/config/locale/templates/hi.email.auth.recovery.tpl b/app/config/locale/templates/hi.email.auth.recovery.tpl
index 163cd0c285..697c839480 100644
--- a/app/config/locale/templates/hi.email.auth.recovery.tpl
+++ b/app/config/locale/templates/hi.email.auth.recovery.tpl
@@ -10,7 +10,7 @@
नमस्ते {{name}},
- {{project}} का पासवर्ड रिसेट करने के लिए लिंक पर क्लिक करे
+ {{project}} का पासवर्ड रिसेट करने के लिए इस लिंक पर क्लिक करे।
{{redirect}}
diff --git a/app/config/locale/templates/hy.email.auth.confirm.tpl b/app/config/locale/templates/hy.email.auth.confirm.tpl
new file mode 100644
index 0000000000..f8c8f99670
--- /dev/null
+++ b/app/config/locale/templates/hy.email.auth.confirm.tpl
@@ -0,0 +1,24 @@
+
+
+
+ Ողջույն, {{name}},
+
+
+ Անցեք հղումով, որպեսզի հաստատեք Ձեր էլեկտրոնային հասցեն։
+
+ {{redirect}}
+
+
+ Եթե չեք պահանջել էլեկտրոնային հասցեի հաստատում, պարզապես արհամարհեք այս նամակը։
+
+
+ Շնորհակալություն,
+
+ {{project}} թիմ
+
\ No newline at end of file
diff --git a/app/config/locale/templates/hy.email.auth.invitation.tpl b/app/config/locale/templates/hy.email.auth.invitation.tpl
new file mode 100644
index 0000000000..e471c81b63
--- /dev/null
+++ b/app/config/locale/templates/hy.email.auth.invitation.tpl
@@ -0,0 +1,27 @@
+
+
+
+ Ողջույն,
+
+
+ Դուք ստացել եք այս նամակը, քանի որ {{owner}}-ը հրավիրում է Ձեզ {{team}} խումբ, {{project}} պրոեկտում։
+
+
+ Անցեք հղումով, որ միանաք {{team}} թիմին՝
+
+ {{redirect}}
+
+
+ Եթե հետաքրքրված չեք դրանով, պարզապես արհամարհեք այս նամակը։
+
+
+ Շնորհակալություն,
+
+ {{project}} թիմ
+
\ No newline at end of file
diff --git a/app/config/locale/templates/ja.email.auth.invitation.tpl b/app/config/locale/templates/ja.email.auth.invitation.tpl
new file mode 100644
index 0000000000..ed59caff07
--- /dev/null
+++ b/app/config/locale/templates/ja.email.auth.invitation.tpl
@@ -0,0 +1,27 @@
+
+
+
- Se a confirmação de email não foi solicitada por você, ignore esta mensagem.
+ Caso a confirmação de email não foi solicitada por você, ignore esta mensagem.
Atenciosamente,
Equipe {{project}}
-
\ No newline at end of file
+
diff --git a/app/config/locale/templates/pt-br.email.auth.invitation.tpl b/app/config/locale/templates/pt-br.email.auth.invitation.tpl
index d0dceefb2f..f4255ffafa 100644
--- a/app/config/locale/templates/pt-br.email.auth.invitation.tpl
+++ b/app/config/locale/templates/pt-br.email.auth.invitation.tpl
@@ -10,15 +10,15 @@
Olá,
- Este email foi enviado a você porque {{owner}} deseja convida-lo para se tornar membro da equipe {{team}} no {{project}}.
+ Este email foi enviado a você porque {{owner}} deseja convidá-lo para se tornar membro da equipe {{team}} no {{project}}.
- Siga o link abaixo para se juntar a equipe {{team}}:
+ Entre no link abaixo para se juntar a equipe {{team}}:
{{redirect}}
- Se não estiver interessado, por favor ignore esta mensagem.
+ Caso não estiver interessado, por favor ignore esta mensagem.
- Se você não solicitou a redefinição de senha, por favor ignore esta mensagem.
+ Caso você não solicitou a redefinição de senha, por favor ignore esta mensagem.
- Recebeu este email porque {{owner}} deseja convida-lo a tornar-se membro da equipa {{team}} no {{project}}.
+ Recebeu este email porque {{owner}} deseja convidá-lo a tornar-se membro da equipa {{team}} no {{project}}.
Use este link para se juntar à equipa {{team}}:
@@ -23,5 +23,5 @@
Com os melhores cumprimentos,
- Equipe {{project}}
+ Equipa {{project}}
diff --git a/app/config/locale/templates/sv.email.auth.recovery.tpl b/app/config/locale/templates/sv.email.auth.recovery.tpl
index dba9221559..673d914bd1 100644
--- a/app/config/locale/templates/sv.email.auth.recovery.tpl
+++ b/app/config/locale/templates/sv.email.auth.recovery.tpl
@@ -15,7 +15,7 @@
{{redirect}}
- Om du inte bett om att ändr ditt lösenord så kan du ignorera detta meddelande.
+ Om du inte bett om att ändra ditt lösenord så kan du ignorera detta meddelande.
Tack,
diff --git a/app/config/services.php b/app/config/services.php
index 9b83eb1c56..0f4c44599d 100644
--- a/app/config/services.php
+++ b/app/config/services.php
@@ -13,31 +13,31 @@ return [
],
'v1/account' => [
'name' => 'Account',
- 'description' => '/docs/service/account.md',
+ 'description' => '/docs/services/account.md',
'controller' => 'controllers/account.php',
'sdk' => true,
],
'v1/auth' => [ // Add to docs later: You can also learn how to [configure support for our supported OAuth providers](/docs/oauth)
'name' => 'Auth',
- 'description' => '/docs/service/auth.md',
+ 'description' => '/docs/services/auth.md',
'controller' => 'controllers/auth.php',
'sdk' => true,
],
'v1/avatars' => [
'name' => 'Avatars',
- 'description' => '/docs/service/avatars.md',
+ 'description' => '/docs/services/avatars.md',
'controller' => 'controllers/avatars.php',
'sdk' => true,
],
'v1/database' => [
'name' => 'Database',
- 'description' => '/docs/service/database.md',
+ 'description' => '/docs/services/database.md',
'controller' => 'controllers/database.php',
'sdk' => true,
],
'v1/locale' => [
'name' => 'Locale',
- 'description' => '/docs/service/locale.md',
+ 'description' => '/docs/services/locale.md',
'controller' => 'controllers/locale.php',
'sdk' => true,
],
@@ -53,19 +53,19 @@ return [
],
'v1/storage' => [
'name' => 'Storage',
- 'description' => '/docs/service/storage.md',
+ 'description' => '/docs/services/storage.md',
'controller' => 'controllers/storage.php',
'sdk' => true,
],
'v1/teams' => [
'name' => 'Teams',
- 'description' => '/docs/service/teams.md',
+ 'description' => '/docs/services/teams.md',
'controller' => 'controllers/teams.php',
'sdk' => true,
],
'v1/users' => [
'name' => 'Users',
- 'description' => '/docs/service/users.md',
+ 'description' => '/docs/services/users.md',
'controller' => 'controllers/users.php',
'sdk' => true,
],
diff --git a/app/controllers/auth.php b/app/controllers/auth.php
index 8a3fe7f317..68c30212ab 100644
--- a/app/controllers/auth.php
+++ b/app/controllers/auth.php
@@ -310,8 +310,8 @@ $utopia->post('/v1/auth/login')
->label('abuse-key', 'url:{url},email:{param-email}')
->param('email', '', function () { return new Email(); }, 'User account email address')
->param('password', '', function () { return new Password(); }, 'User account password')
- ->param('success', null, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt.')
- ->param('failure', null, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt.')
+ ->param('success', null, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt.', true)
+ ->param('failure', null, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt.', true)
->action(
function ($email, $password, $success, $failure) use ($response, $request, $projectDB, $audit, $webhook) {
$profile = $projectDB->getCollection([ // Get user by email address
@@ -597,6 +597,7 @@ $utopia->get('/v1/auth/oauth/:provider')
->label('sdk.namespace', 'auth')
->label('sdk.method', 'oauth')
->label('sdk.location', true)
+ ->label('sdk.cookies', true)
->label('abuse-limit', 50)
->label('abuse-key', 'ip:{ip}')
->param('provider', '', function () use ($providers) { return new WhiteList(array_keys($providers)); }, 'OAuth Provider')
diff --git a/app/controllers/avatars.php b/app/controllers/avatars.php
index 8d6dcde882..432fd0c62c 100644
--- a/app/controllers/avatars.php
+++ b/app/controllers/avatars.php
@@ -1,6 +1,6 @@
get('/v1/avatars/credit-cards/:code')
->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getCreditCard')
- ->label('sdk.description', '/docs/references/avatars/get-credit-cards.md')
+ ->label('sdk.description', '/docs/references/avatars/get-credit-card.md')
->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('credit-cards', $code, $width, $height, $quality);
});
@@ -134,7 +134,7 @@ $utopia->get('/v1/avatars/image')
->label('sdk.method', 'getImage')
->label('sdk.description', '/docs/references/avatars/get-image.md')
->action(
- function ($url, $width, $height) use ($response, $request, $version) {
+ function ($url, $width, $height) use ($response) {
$quality = 80;
$output = 'png';
$date = date('D, d M Y H:i:s', time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache
@@ -199,7 +199,7 @@ $utopia->get('/v1/avatars/favicon')
->label('sdk.method', 'getFavicon')
->label('sdk.description', '/docs/references/avatars/get-favicon.md')
->action(
- function ($url) use ($response, $request, $version) {
+ function ($url) use ($response, $version) {
$width = 56;
$height = 56;
$quality = 80;
diff --git a/app/controllers/console.php b/app/controllers/console.php
index b213158d2a..6b3e36a862 100644
--- a/app/controllers/console.php
+++ b/app/controllers/console.php
@@ -197,9 +197,13 @@ $utopia->get('/console/storage')
->desc('Platform console project settings')
->label('permission', 'public')
->label('scope', 'console')
- ->action(function () use ($layout) {
+ ->action(function () use ($request, $layout) {
$page = new View(__DIR__.'/../views/console/storage/index.phtml');
+ $page
+ ->setParam('home', $request->getServer('_APP_HOME', ''))
+ ;
+
$layout
->setParam('title', APP_NAME.' - Storage')
->setParam('body', $page);
diff --git a/app/controllers/locale.php b/app/controllers/locale.php
index 1126701d6d..62c7c0b24b 100644
--- a/app/controllers/locale.php
+++ b/app/controllers/locale.php
@@ -68,7 +68,7 @@ $utopia->get('/v1/locale/countries')
->label('scope', 'locale.read')
->label('sdk.namespace', 'locale')
->label('sdk.method', 'getCountries')
- ->label('sdk.description', '/docs/references/locale/get-countires.md')
+ ->label('sdk.description', '/docs/references/locale/get-countries.md')
->action(
function () use ($response, $request) {
$list = Locale::getText('countries'); /* @var $list array */
diff --git a/app/controllers/users.php b/app/controllers/users.php
index eff5010aec..76153386bd 100644
--- a/app/controllers/users.php
+++ b/app/controllers/users.php
@@ -327,7 +327,7 @@ $utopia->post('/v1/users')
);
$utopia->patch('/v1/users/:userId/status')
- ->desc('Update user status')
+ ->desc('Update User Status')
->label('scope', 'users.write')
->label('sdk.namespace', 'users')
->label('sdk.method', 'updateUserStatus')
@@ -356,7 +356,7 @@ $utopia->patch('/v1/users/:userId/status')
);
$utopia->patch('/v1/users/:userId/prefs')
- ->desc('Update Account Prefs')
+ ->desc('Update User Prefs')
->label('scope', 'users.write')
->label('sdk.namespace', 'users')
->label('sdk.method', 'updateUserPrefs')
@@ -419,7 +419,7 @@ $utopia->delete('/v1/users/:userId/sessions')
->label('scope', 'users.write')
->label('sdk.namespace', 'users')
->label('sdk.method', 'deleteUserSessions')
- ->label('sdk.description', 'Delete all user sessions by its unique ID.')
+ ->label('sdk.description', '/docs/references/users/delete-user-sessions.md')
->label('abuse-limit', 100)
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action(
diff --git a/app/init.php b/app/init.php
index d399a59dc6..1ade533f35 100644
--- a/app/init.php
+++ b/app/init.php
@@ -24,7 +24,7 @@ const APP_EMAIL_TEAM = 'team@'.APP_DOMAIN;
const APP_EMAIL_SECURITY = 'security@'.APP_DOMAIN;
const APP_USERAGENT = APP_NAME.'-Server/%s Please report abuse at '.APP_EMAIL_SECURITY;
const APP_MODE_ADMIN = 'admin';
-const APP_LOCALES = ['af', 'ar', 'cat', 'cz', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'hu', 'id', 'it', 'jv', 'lt', 'nl', 'no', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'si', 'sl', 'sv', 'ta', 'tr', 'ua', 'vi', 'zh-cn', 'zh-tw'];
+const APP_LOCALES = ['af', 'ar', 'bn', 'cat', 'cz', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'hu', 'hy', 'id', 'it', 'ja', 'jv', 'lt', 'nl', 'no', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'si', 'sl', 'sv', 'ta', 'tr', 'ua', 'vi', 'zh-cn', 'zh-tw'];
const APP_PAGING_LIMIT = 15;
const APP_VERSION_STABLE = '0.2.0';
@@ -128,9 +128,9 @@ $locale = $request->getParam('locale', $request->getHeader('X-Appwrite-Locale',
Locale::$exceptions = false;
-
Locale::setLanguage('af', include __DIR__.'/config/locale/af.php');
Locale::setLanguage('ar', include __DIR__.'/config/locale/ar.php');
+Locale::setLanguage('bn', include __DIR__.'/config/locale/bn.php');
Locale::setLanguage('cat', include __DIR__.'/config/locale/cat.php');
Locale::setLanguage('cz', include __DIR__.'/config/locale/cz.php');
Locale::setLanguage('de', include __DIR__.'/config/locale/de.php');
@@ -142,8 +142,10 @@ Locale::setLanguage('gr', include __DIR__.'/config/locale/gr.php');
Locale::setLanguage('he', include __DIR__.'/config/locale/he.php');
Locale::setLanguage('hi', include __DIR__.'/config/locale/hi.php');
Locale::setLanguage('hu', include __DIR__.'/config/locale/hu.php');
+Locale::setLanguage('hy', include __DIR__.'/config/locale/hy.php');
Locale::setLanguage('id', include __DIR__.'/config/locale/id.php');
Locale::setLanguage('it', include __DIR__.'/config/locale/it.php');
+Locale::setLanguage('jv', include __DIR__.'/config/locale/ja.php');
Locale::setLanguage('jv', include __DIR__.'/config/locale/jv.php');
Locale::setLanguage('lt', include __DIR__.'/config/locale/lt.php');
Locale::setLanguage('nl', include __DIR__.'/config/locale/nl.php');
@@ -163,6 +165,8 @@ Locale::setLanguage('vi', include __DIR__.'/config/locale/vi.php');
Locale::setLanguage('zh-cn', include __DIR__.'/config/locale/zh-cn.php');
Locale::setLanguage('zh-tw', include __DIR__.'/config/locale/zh-tw.php');
+Locale::setDefault('en');
+
if (in_array($locale, APP_LOCALES)) {
Locale::setDefault($locale);
}
diff --git a/app/sdks/dart/README.md b/app/sdks/dart/README.md
index de99069bd5..effbe7922c 100644
--- a/app/sdks/dart/README.md
+++ b/app/sdks/dart/README.md
@@ -1,7 +1,7 @@
# Appwrite SDK for Dart

-
+
**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).**
diff --git a/app/sdks/dart/lib/client.dart b/app/sdks/dart/lib/client.dart
index 77a4092f08..c03342e33e 100644
--- a/app/sdks/dart/lib/client.dart
+++ b/app/sdks/dart/lib/client.dart
@@ -9,7 +9,7 @@ class Client {
Dio http;
Client() {
- this.endPoint = 'https://https://appwrite.io/v1';
+ this.endPoint = 'https://appwrite.io/v1';
this.headers = {
'content-type': 'application/json',
'x-sdk-version': 'appwrite:dart:0.0.2',
@@ -23,7 +23,7 @@ class Client {
}
- /// Your Appwrite project ID. You can find your project ID in your Appwrite console project settings.
+ /// Your Appwrite project ID
Client setProject(value) {
this.addHeader('X-Appwrite-Project', value);
@@ -31,7 +31,7 @@ class Client {
}
- /// Your Appwrite project secret key. You can can create a new API key from your Appwrite console API keys dashboard.
+ /// Your Appwrite project secret key
Client setKey(value) {
this.addHeader('X-Appwrite-Key', value);
diff --git a/app/sdks/dart/lib/services/auth.dart b/app/sdks/dart/lib/services/auth.dart
index 0db9f429db..45c0be71a7 100644
--- a/app/sdks/dart/lib/services/auth.dart
+++ b/app/sdks/dart/lib/services/auth.dart
@@ -15,7 +15,7 @@ class Auth extends Service {
/// the only valid redirect URL's are the once from domains you have set when
/// added your platforms in the console interface.
///
- /// When accessing this route using JavaScript from the browser, success and
+ /// 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
@@ -116,7 +116,7 @@ class Auth extends Service {
/// the only valid redirect URL's are the once from domains you have set when
/// added your platforms in the console interface.
///
- /// When accessing this route using JavaScript from the browser, success and
+ /// 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
diff --git a/app/sdks/dart/lib/services/locale.dart b/app/sdks/dart/lib/services/locale.dart
index 406d25bbb9..29f87ac5ea 100644
--- a/app/sdks/dart/lib/services/locale.dart
+++ b/app/sdks/dart/lib/services/locale.dart
@@ -49,9 +49,9 @@ class Locale extends Service {
return await this.client.call('get', path: path, params: params);
}
- /// List of all currencies, including currency symbol, name, plural, and
- /// decimal digits for all major and minor currencies. You can use the locale
- /// header to get the data in supported language.
+ /// 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 supported language.
Future getCurrencies() async {
String path = '/locale/currencies';
diff --git a/app/sdks/dart/lib/services/users.dart b/app/sdks/dart/lib/services/users.dart
index 761206fb1b..3e84ddd287 100644
--- a/app/sdks/dart/lib/services/users.dart
+++ b/app/sdks/dart/lib/services/users.dart
@@ -58,6 +58,17 @@ class Users extends Service {
};
return await this.client.call('get', path: path, params: params);
+ }
+ /// Update user preferences by its unique ID. You can pass only the specific
+ /// settings you wish to update.
+ Future updateUserPrefs({userId, prefs}) async {
+ String path = '/users/{userId}/prefs'.replaceAll(RegExp('{userId}'), userId);
+
+ Map params = {
+ 'prefs': prefs,
+ };
+
+ return await this.client.call('patch', path: path, params: params);
}
/// Get user sessions list by its unique ID.
Future getUserSessions({userId}) async {
@@ -78,7 +89,7 @@ class Users extends Service {
return await this.client.call('delete', path: path, params: params);
}
/// Delete user sessions by its unique ID.
- Future deleteUsersSession({userId, sessionId}) async {
+ Future deleteUserSession({userId, sessionId}) async {
String path = '/users/{userId}/sessions/:session'.replaceAll(RegExp('{userId}'), userId);
Map params = {
diff --git a/app/sdks/js/README.md b/app/sdks/js/README.md
index 4e6cd6bc0f..65711154fa 100644
--- a/app/sdks/js/README.md
+++ b/app/sdks/js/README.md
@@ -1,28 +1,52 @@
-# Appwrite SDK for Javascript
+# Appwrite SDK for JavaScript

-
+
**This SDK is compatible with Appwrite server version 0.2.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)
-
-

## Installation
+### NPM
+
To install via [NPM](https://www.npmjs.com/):
```bash
npm install appwrite --save
```
-Install with CDN:
+If you're using a bundler (like [Browserify](http://browserify.org/) or [webpack](https://webpack.js.org/)), you can import the Appwrite module when you need it:
+
+```js
+import * as Appwrite from "appwrite";
+```
+
+### CDN
+
+To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services:
```html
-
+
+```
+
+## Getting Started
+
+Initialise the Appwrite SDK in your code, and setup your API credentials:
+
+```js
+
+// Init your JS SDK
+var appwrite = new Appwrite();
+
+appwrite
+ .setEndpoint('http://localhost/v1') // Set only when using self-hosted solution
+ .setProject('455x34dfkj') // Your Appwrite Project UID
+;
+
```
## License
diff --git a/app/sdks/js/docs/examples/projects/create-task.md b/app/sdks/js/docs/examples/projects/create-task.md
index 3262b4d9fe..4338198465 100644
--- a/app/sdks/js/docs/examples/projects/create-task.md
+++ b/app/sdks/js/docs/examples/projects/create-task.md
@@ -4,7 +4,7 @@ sdk
.setProject('')
;
-let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
+let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
promise.then(function (response) {
console.log(response);
diff --git a/app/sdks/js/docs/examples/projects/create-webhook.md b/app/sdks/js/docs/examples/projects/create-webhook.md
index 66a76c26c2..1136c5eedf 100644
--- a/app/sdks/js/docs/examples/projects/create-webhook.md
+++ b/app/sdks/js/docs/examples/projects/create-webhook.md
@@ -4,7 +4,7 @@ sdk
.setProject('')
;
-let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0);
+let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 1);
promise.then(function (response) {
console.log(response);
diff --git a/app/sdks/js/docs/examples/users/delete-user-session.md b/app/sdks/js/docs/examples/users/delete-user-session.md
new file mode 100644
index 0000000000..4b5df53439
--- /dev/null
+++ b/app/sdks/js/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/js/docs/examples/users/update-user-prefs.md b/app/sdks/js/docs/examples/users/update-user-prefs.md
new file mode 100644
index 0000000000..54208f5f96
--- /dev/null
+++ b/app/sdks/js/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/js/package.json b/app/sdks/js/package.json
index 13499d41ed..db7a1916ab 100644
--- a/app/sdks/js/package.json
+++ b/app/sdks/js/package.json
@@ -2,7 +2,7 @@
"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.22",
+ "version": "1.0.23",
"license": "BSD-3-Clause",
"main": "src/sdk.js",
"repository": {
diff --git a/app/sdks/js/src/sdk.js b/app/sdks/js/src/sdk.js
index f142af9c29..5c8a0bc134 100644
--- a/app/sdks/js/src/sdk.js
+++ b/app/sdks/js/src/sdk.js
@@ -1,8 +1,11 @@
(function (window) {
+
+ 'use strict';
+
window.Appwrite = function () {
let config = {
- endpoint: 'https://https://appwrite.io/v1',
+ endpoint: 'https://appwrite.io/v1',
project: '',
key: '',
locale: '',
@@ -22,8 +25,7 @@
/**
* Set Project
*
- * Your Appwrite project ID. You can find your project ID in your Appwrite
-\ * console project settings.
+ * Your Appwrite project ID
*
* @param value string
*
@@ -41,8 +43,7 @@
/**
* Set Key
*
- * Your Appwrite project secret key. You can can create a new API key from
-\ * your Appwrite console API keys dashboard.
+ * Your Appwrite project secret key
*
* @param value string
*
@@ -138,7 +139,7 @@
globalParams.push({key: key, value: value});
};
- addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.22');
+ addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.23');
addGlobalHeader('content-type', '');
/**
@@ -304,14 +305,15 @@
* Get currently logged in user data as JSON object.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
get: function() {
let path = '/account';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -320,14 +322,15 @@
* Delete currently logged in user account.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
delete: function() {
let path = '/account';
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -341,7 +344,8 @@
* @param {string} email
* @param {string} password
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateEmail: function(email, password) {
if(email === undefined) {
throw new Error('Missing required parameter: "email"');
@@ -353,12 +357,18 @@
let path = '/account/email';
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(password) {
+ payload['password'] = password;
+ }
+
return http
- .patch(path, {'content-type': 'application/json'},
- {
- 'email': email,
- 'password': password
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -368,7 +378,8 @@
*
* @param {string} name
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateName: function(name) {
if(name === undefined) {
throw new Error('Missing required parameter: "name"');
@@ -376,11 +387,14 @@
let path = '/account/name';
+ let payload = {};
+
+ if(name) {
+ payload['name'] = name;
+ }
+
return http
- .patch(path, {'content-type': 'application/json'},
- {
- 'name': name
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -392,7 +406,8 @@
* @param {string} password
* @param {string} oldPassword
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updatePassword: function(password, oldPassword) {
if(password === undefined) {
throw new Error('Missing required parameter: "password"');
@@ -404,12 +419,18 @@
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'},
- {
- 'password': password,
- 'old-password': oldPassword
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -418,14 +439,15 @@
* Get currently logged in user preferences key-value object.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getPrefs: function() {
let path = '/account/prefs';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -436,7 +458,8 @@
*
* @param {string} prefs
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updatePrefs: function(prefs) {
if(prefs === undefined) {
throw new Error('Missing required parameter: "prefs"');
@@ -444,11 +467,14 @@
let path = '/account/prefs';
+ let payload = {};
+
+ if(prefs) {
+ payload['prefs'] = prefs;
+ }
+
return http
- .patch(path, {'content-type': 'application/json'},
- {
- 'prefs': prefs
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -458,14 +484,15 @@
* log returns user IP address, location and date and time of log.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getSecurity: function() {
let path = '/account/security';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -475,14 +502,15 @@
* devices.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getSessions: function() {
let path = '/account/sessions';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
}
};
@@ -500,7 +528,7 @@
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
- * When accessing this route using JavaScript from the browser, success and
+ * 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
@@ -511,7 +539,8 @@
* @param {string} success
* @param {string} failure
* @throws {Error}
- * @return {null} */
+ * @return {null}
+ */
login: function(email, password, success, failure) {
if(email === undefined) {
throw new Error('Missing required parameter: "email"');
@@ -531,12 +560,27 @@
let path = '/auth/login';
- return iframe('post', path, {project: config.project,
- 'email': email,
- 'password': password,
- 'success': success,
- 'failure': failure
- });
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(password) {
+ payload['password'] = password;
+ }
+
+ if(success) {
+ payload['success'] = success;
+ }
+
+ if(failure) {
+ payload['failure'] = failure;
+ }
+
+ payload['project'] = config.project;
+
+ return iframe('post', path, payload);
},
/**
@@ -547,14 +591,15 @@
* session secret cookie from the user client.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
logout: function() {
let path = '/auth/logout';
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -566,7 +611,8 @@
*
* @param {string} id
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
logoutBySession: function(id) {
if(id === undefined) {
throw new Error('Missing required parameter: "id"');
@@ -574,10 +620,10 @@
let path = '/auth/logout/{id}'.replace(new RegExp('{id}', 'g'), id);
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -588,7 +634,8 @@
* @param {string} success
* @param {string} failure
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
oauth: function(provider, success = '', failure = '') {
if(provider === undefined) {
throw new Error('Missing required parameter: "provider"');
@@ -596,12 +643,18 @@
let path = '/auth/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'},
- {
- 'success': success,
- 'failure': failure
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -617,7 +670,8 @@
* @param {string} email
* @param {string} reset
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
recovery: function(email, reset) {
if(email === undefined) {
throw new Error('Missing required parameter: "email"');
@@ -629,12 +683,18 @@
let path = '/auth/recovery';
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(reset) {
+ payload['reset'] = reset;
+ }
+
return http
- .post(path, {'content-type': 'application/json'},
- {
- 'email': email,
- 'reset': reset
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -655,7 +715,8 @@
* @param {string} passwordA
* @param {string} passwordB
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
recoveryReset: function(userId, token, passwordA, passwordB) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -675,14 +736,26 @@
let path = '/auth/recovery/reset';
+ let payload = {};
+
+ if(userId) {
+ payload['userId'] = userId;
+ }
+
+ if(token) {
+ payload['token'] = token;
+ }
+
+ if(passwordA) {
+ payload['password-a'] = passwordA;
+ }
+
+ if(passwordB) {
+ payload['password-b'] = passwordB;
+ }
+
return http
- .put(path, {'content-type': 'application/json'},
- {
- 'userId': userId,
- 'token': token,
- 'password-a': passwordA,
- 'password-b': passwordB
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -703,7 +776,7 @@
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
- * When accessing this route using JavaScript from the browser, success and
+ * 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
@@ -716,7 +789,8 @@
* @param {string} failure
* @param {string} name
* @throws {Error}
- * @return {null} */
+ * @return {null}
+ */
register: function(email, password, confirm, success = '', failure = '', name = '') {
if(email === undefined) {
throw new Error('Missing required parameter: "email"');
@@ -732,14 +806,35 @@
let path = '/auth/register';
- return iframe('post', path, {project: config.project,
- 'email': email,
- 'password': password,
- 'confirm': confirm,
- 'success': success,
- 'failure': failure,
- 'name': name
- });
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(password) {
+ payload['password'] = password;
+ }
+
+ if(confirm) {
+ payload['confirm'] = confirm;
+ }
+
+ if(success) {
+ payload['success'] = success;
+ }
+
+ if(failure) {
+ payload['failure'] = failure;
+ }
+
+ if(name) {
+ payload['name'] = name;
+ }
+
+ payload['project'] = config.project;
+
+ return iframe('post', path, payload);
},
/**
@@ -753,7 +848,8 @@
* @param {string} userId
* @param {string} token
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
confirm: function(userId, token) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -765,12 +861,18 @@
let path = '/auth/register/confirm';
+ let payload = {};
+
+ if(userId) {
+ payload['userId'] = userId;
+ }
+
+ if(token) {
+ payload['token'] = token;
+ }
+
return http
- .post(path, {'content-type': 'application/json'},
- {
- 'userId': userId,
- 'token': token
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -787,7 +889,8 @@
*
* @param {string} confirm
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
confirmResend: function(confirm) {
if(confirm === undefined) {
throw new Error('Missing required parameter: "confirm"');
@@ -795,11 +898,14 @@
let path = '/auth/register/confirm/resend';
+ let payload = {};
+
+ if(confirm) {
+ payload['confirm'] = confirm;
+ }
+
return http
- .post(path, {'content-type': 'application/json'},
- {
- 'confirm': confirm
- });
+ .post(path, {'content-type': 'application/json'}, payload);
}
};
@@ -818,7 +924,8 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getBrowser: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
throw new Error('Missing required parameter: "code"');
@@ -826,13 +933,22 @@
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'},
- {
- 'width': width,
- 'height': height,
- 'quality': quality
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -848,7 +964,8 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getCreditCard: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
throw new Error('Missing required parameter: "code"');
@@ -856,13 +973,22 @@
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'},
- {
- 'width': width,
- 'height': height,
- 'quality': quality
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -873,7 +999,8 @@
*
* @param {string} url
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getFavicon: function(url) {
if(url === undefined) {
throw new Error('Missing required parameter: "url"');
@@ -881,11 +1008,14 @@
let path = '/avatars/favicon';
+ let payload = {};
+
+ if(url) {
+ payload['url'] = url;
+ }
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- 'url': url
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -900,7 +1030,8 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getFlag: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
throw new Error('Missing required parameter: "code"');
@@ -908,13 +1039,22 @@
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'},
- {
- 'width': width,
- 'height': height,
- 'quality': quality
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -929,7 +1069,8 @@
* @param {number} width
* @param {number} height
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getImage: function(url, width = 400, height = 400) {
if(url === undefined) {
throw new Error('Missing required parameter: "url"');
@@ -937,13 +1078,22 @@
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'},
- {
- 'url': url,
- 'width': width,
- 'height': height
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -957,7 +1107,8 @@
* @param {number} margin
* @param {number} download
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getQR: function(text, size = 400, margin = 1, download = 0) {
if(text === undefined) {
throw new Error('Missing required parameter: "text"');
@@ -965,14 +1116,26 @@
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'},
- {
- 'text': text,
- 'size': size,
- 'margin': margin,
- 'download': download
- });
+ .get(path, {'content-type': 'application/json'}, payload);
}
};
@@ -991,18 +1154,31 @@
* @param {number} offset
* @param {string} orderType
* @throws {Error}
- * @return {Promise} */
+ * @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'},
- {
- 'search': search,
- 'limit': limit,
- 'offset': offset,
- 'orderType': orderType
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1015,7 +1191,8 @@
* @param {array} write
* @param {array} rules
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createCollection: function(name, read = [], write = [], rules = []) {
if(name === undefined) {
throw new Error('Missing required parameter: "name"');
@@ -1023,14 +1200,26 @@
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'},
- {
- 'name': name,
- 'read': read,
- 'write': write,
- 'rules': rules
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1041,7 +1230,8 @@
*
* @param {string} collectionId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getCollection: function(collectionId) {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1049,10 +1239,10 @@
let path = '/database/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1066,7 +1256,8 @@
* @param {array} write
* @param {array} rules
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateCollection: function(collectionId, name, read = [], write = [], rules = []) {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1078,14 +1269,26 @@
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'},
- {
- 'name': name,
- 'read': read,
- 'write': write,
- 'rules': rules
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1096,7 +1299,8 @@
*
* @param {string} collectionId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteCollection: function(collectionId) {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1104,10 +1308,10 @@
let path = '/database/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId);
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1129,7 +1333,8 @@
* @param {number} first
* @param {number} last
* @throws {Error}
- * @return {Promise} */
+ * @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"');
@@ -1137,19 +1342,46 @@
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'},
- {
- 'filters': filters,
- 'offset': offset,
- 'limit': limit,
- 'order-field': orderField,
- 'order-type': orderType,
- 'order-cast': orderCast,
- 'search': search,
- 'first': first,
- 'last': last
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1165,7 +1397,8 @@
* @param {string} parentProperty
* @param {string} parentPropertyType
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createDocument: function(collectionId, data, read = [], write = [], parentDocument = '', parentProperty = '', parentPropertyType = 'assign') {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1177,16 +1410,34 @@
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'},
- {
- 'data': data,
- 'read': read,
- 'write': write,
- 'parentDocument': parentDocument,
- 'parentProperty': parentProperty,
- 'parentPropertyType': parentPropertyType
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1198,7 +1449,8 @@
* @param {string} collectionId
* @param {string} documentId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getDocument: function(collectionId, documentId) {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1210,10 +1462,10 @@
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'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1226,7 +1478,8 @@
* @param {array} read
* @param {array} write
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateDocument: function(collectionId, documentId, data, read = [], write = []) {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1242,13 +1495,22 @@
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'},
- {
- 'data': data,
- 'read': read,
- 'write': write
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1261,7 +1523,8 @@
* @param {string} collectionId
* @param {string} documentId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteDocument: function(collectionId, documentId) {
if(collectionId === undefined) {
throw new Error('Missing required parameter: "collectionId"');
@@ -1273,10 +1536,10 @@
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'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
}
};
@@ -1291,14 +1554,15 @@
* supported language.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getLocale: function() {
let path = '/locale';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1308,14 +1572,15 @@
* supported language.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getCountries: function() {
let path = '/locale/countries';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1326,14 +1591,15 @@
* currently set to 2019-10-31 and will be updated if and when needed.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getCountriesEU: function() {
let path = '/locale/countries/eu';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1343,32 +1609,34 @@
* data in supported language.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getCountriesPhones: function() {
let path = '/locale/countries/phones';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
* List of currencies
*
- * List of all currencies, including currency symbol, name, plural, and
- * decimal digits for all major and minor currencies. You can use the locale
- * header to get the data in supported language.
+ * 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 supported language.
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getCurrencies: function() {
let path = '/locale/currencies';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
}
};
@@ -1379,14 +1647,15 @@
*
*
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
listProjects: function() {
let path = '/projects';
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1405,7 +1674,8 @@
* @param {string} legalAddress
* @param {string} legalTaxId
* @throws {Error}
- * @return {Promise} */
+ * @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"');
@@ -1417,21 +1687,54 @@
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'},
- {
- 'name': name,
- 'teamId': teamId,
- 'description': description,
- 'logo': logo,
- 'url': url,
- 'legalName': legalName,
- 'legalCountry': legalCountry,
- 'legalState': legalState,
- 'legalCity': legalCity,
- 'legalAddress': legalAddress,
- 'legalTaxId': legalTaxId
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1440,7 +1743,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getProject: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1448,10 +1752,10 @@
let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1470,7 +1774,8 @@
* @param {string} legalAddress
* @param {string} legalTaxId
* @throws {Error}
- * @return {Promise} */
+ * @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"');
@@ -1482,20 +1787,50 @@
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'},
- {
- 'name': name,
- 'description': description,
- 'logo': logo,
- 'url': url,
- 'legalName': legalName,
- 'legalCountry': legalCountry,
- 'legalState': legalState,
- 'legalCity': legalCity,
- 'legalAddress': legalAddress,
- 'legalTaxId': legalTaxId
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1504,7 +1839,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteProject: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1512,10 +1848,10 @@
let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1524,7 +1860,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
listKeys: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1532,10 +1869,10 @@
let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1546,7 +1883,8 @@
* @param {string} name
* @param {array} scopes
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createKey: function(projectId, name, scopes) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1562,12 +1900,18 @@
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'},
- {
- 'name': name,
- 'scopes': scopes
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1577,7 +1921,8 @@
* @param {string} projectId
* @param {string} keyId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getKey: function(projectId, keyId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1589,10 +1934,10 @@
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'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1604,7 +1949,8 @@
* @param {string} name
* @param {array} scopes
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateKey: function(projectId, keyId, name, scopes) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1624,12 +1970,18 @@
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'},
- {
- 'name': name,
- 'scopes': scopes
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1639,7 +1991,8 @@
* @param {string} projectId
* @param {string} keyId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteKey: function(projectId, keyId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1651,10 +2004,10 @@
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'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1666,7 +2019,8 @@
* @param {string} appId
* @param {string} secret
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateProjectOAuth: function(projectId, provider, appId = '', secret = '') {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1678,13 +2032,22 @@
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'},
- {
- 'provider': provider,
- 'appId': appId,
- 'secret': secret
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1693,7 +2056,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
listPlatforms: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1701,10 +2065,10 @@
let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1718,7 +2082,8 @@
* @param {string} store
* @param {string} url
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createPlatform: function(projectId, type, name, key = '', store = '', url = '') {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1734,15 +2099,30 @@
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'},
- {
- 'type': type,
- 'name': name,
- 'key': key,
- 'store': store,
- 'url': url
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1752,7 +2132,8 @@
* @param {string} projectId
* @param {string} platformId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getPlatform: function(projectId, platformId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1764,10 +2145,10 @@
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'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1781,7 +2162,8 @@
* @param {string} store
* @param {string} url
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updatePlatform: function(projectId, platformId, name, key = '', store = '', url = '') {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1797,14 +2179,26 @@
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'},
- {
- 'name': name,
- 'key': key,
- 'store': store,
- 'url': url
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1814,7 +2208,8 @@
* @param {string} projectId
* @param {string} platformId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deletePlatform: function(projectId, platformId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1826,10 +2221,10 @@
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'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1838,7 +2233,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
listTasks: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1846,10 +2242,10 @@
let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1867,7 +2263,8 @@
* @param {string} httpUser
* @param {string} httpPass
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createTask: function(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1899,19 +2296,46 @@
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'},
- {
- 'name': name,
- 'status': status,
- 'schedule': schedule,
- 'security': security,
- 'httpMethod': httpMethod,
- 'httpUrl': httpUrl,
- 'httpHeaders': httpHeaders,
- 'httpUser': httpUser,
- 'httpPass': httpPass
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1921,7 +2345,8 @@
* @param {string} projectId
* @param {string} taskId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getTask: function(projectId, taskId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -1933,10 +2358,10 @@
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'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -1955,7 +2380,8 @@
* @param {string} httpUser
* @param {string} httpPass
* @throws {Error}
- * @return {Promise} */
+ * @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"');
@@ -1991,19 +2417,46 @@
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'},
- {
- 'name': name,
- 'status': status,
- 'schedule': schedule,
- 'security': security,
- 'httpMethod': httpMethod,
- 'httpUrl': httpUrl,
- 'httpHeaders': httpHeaders,
- 'httpUser': httpUser,
- 'httpPass': httpPass
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2013,7 +2466,8 @@
* @param {string} projectId
* @param {string} taskId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteTask: function(projectId, taskId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2025,10 +2479,10 @@
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'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2037,7 +2491,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getProjectUsage: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2045,10 +2500,10 @@
let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2057,7 +2512,8 @@
*
* @param {string} projectId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
listWebhooks: function(projectId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2065,10 +2521,10 @@
let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2083,7 +2539,8 @@
* @param {string} httpUser
* @param {string} httpPass
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createWebhook: function(projectId, name, events, url, security, httpUser = '', httpPass = '') {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2107,16 +2564,34 @@
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'},
- {
- 'name': name,
- 'events': events,
- 'url': url,
- 'security': security,
- 'httpUser': httpUser,
- 'httpPass': httpPass
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2126,7 +2601,8 @@
* @param {string} projectId
* @param {string} webhookId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getWebhook: function(projectId, webhookId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2138,10 +2614,10 @@
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'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2157,7 +2633,8 @@
* @param {string} httpUser
* @param {string} httpPass
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateWebhook: function(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2185,16 +2662,34 @@
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'},
- {
- 'name': name,
- 'events': events,
- 'url': url,
- 'security': security,
- 'httpUser': httpUser,
- 'httpPass': httpPass
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2204,7 +2699,8 @@
* @param {string} projectId
* @param {string} webhookId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteWebhook: function(projectId, webhookId) {
if(projectId === undefined) {
throw new Error('Missing required parameter: "projectId"');
@@ -2216,10 +2712,10 @@
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'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
}
};
@@ -2237,18 +2733,31 @@
* @param {number} offset
* @param {string} orderType
* @throws {Error}
- * @return {Promise} */
+ * @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'},
- {
- 'search': search,
- 'limit': limit,
- 'offset': offset,
- 'orderType': orderType
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2263,7 +2772,8 @@
* @param {array} write
* @param {string} folderId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createFile: function(files, read = [], write = [], folderId = '') {
if(files === undefined) {
throw new Error('Missing required parameter: "files"');
@@ -2271,14 +2781,26 @@
let path = '/storage/files';
+ let payload = {};
+
+ if(files) {
+ payload['files'] = files;
+ }
+
+ if(read) {
+ payload['read'] = read;
+ }
+
+ if(write) {
+ payload['write'] = write;
+ }
+
+ if(folderId) {
+ payload['folderId'] = folderId;
+ }
+
return http
- .post(path, {'content-type': 'multipart/form-data'},
- {
- 'files': files,
- 'read': read,
- 'write': write,
- 'folderId': folderId
- });
+ .post(path, {'content-type': 'multipart/form-data'}, payload);
},
/**
@@ -2289,7 +2811,8 @@
*
* @param {string} fileId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getFile: function(fileId) {
if(fileId === undefined) {
throw new Error('Missing required parameter: "fileId"');
@@ -2297,10 +2820,10 @@
let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2314,7 +2837,8 @@
* @param {array} write
* @param {string} folderId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateFile: function(fileId, read = [], write = [], folderId = '') {
if(fileId === undefined) {
throw new Error('Missing required parameter: "fileId"');
@@ -2322,13 +2846,22 @@
let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId);
+ let payload = {};
+
+ if(read) {
+ payload['read'] = read;
+ }
+
+ if(write) {
+ payload['write'] = write;
+ }
+
+ if(folderId) {
+ payload['folderId'] = folderId;
+ }
+
return http
- .put(path, {'content-type': 'application/json'},
- {
- 'read': read,
- 'write': write,
- 'folderId': folderId
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2339,7 +2872,8 @@
*
* @param {string} fileId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteFile: function(fileId) {
if(fileId === undefined) {
throw new Error('Missing required parameter: "fileId"');
@@ -2347,10 +2881,10 @@
let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId);
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2362,7 +2896,8 @@
*
* @param {string} fileId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getFileDownload: function(fileId) {
if(fileId === undefined) {
throw new Error('Missing required parameter: "fileId"');
@@ -2370,10 +2905,10 @@
let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2391,7 +2926,8 @@
* @param {string} background
* @param {string} output
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getFilePreview: function(fileId, width = 0, height = 0, quality = 100, background = '', output = '') {
if(fileId === undefined) {
throw new Error('Missing required parameter: "fileId"');
@@ -2399,15 +2935,30 @@
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'},
- {
- 'width': width,
- 'height': height,
- 'quality': quality,
- 'background': background,
- 'output': output
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2419,7 +2970,8 @@
* @param {string} fileId
* @param {string} as
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getFileView: function(fileId, as = '') {
if(fileId === undefined) {
throw new Error('Missing required parameter: "fileId"');
@@ -2427,11 +2979,14 @@
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'},
- {
- 'as': as
- });
+ .get(path, {'content-type': 'application/json'}, payload);
}
};
@@ -2449,18 +3004,31 @@
* @param {number} offset
* @param {string} orderType
* @throws {Error}
- * @return {Promise} */
+ * @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'},
- {
- 'search': search,
- 'limit': limit,
- 'offset': offset,
- 'orderType': orderType
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2474,7 +3042,8 @@
* @param {string} name
* @param {array} roles
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createTeam: function(name, roles = ["owner"]) {
if(name === undefined) {
throw new Error('Missing required parameter: "name"');
@@ -2482,12 +3051,18 @@
let path = '/teams';
+ let payload = {};
+
+ if(name) {
+ payload['name'] = name;
+ }
+
+ if(roles) {
+ payload['roles'] = roles;
+ }
+
return http
- .post(path, {'content-type': 'application/json'},
- {
- 'name': name,
- 'roles': roles
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2498,7 +3073,8 @@
*
* @param {string} teamId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getTeam: function(teamId) {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2506,10 +3082,10 @@
let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2521,7 +3097,8 @@
* @param {string} teamId
* @param {string} name
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateTeam: function(teamId, name) {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2533,11 +3110,14 @@
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'},
- {
- 'name': name
- });
+ .put(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2548,7 +3128,8 @@
*
* @param {string} teamId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteTeam: function(teamId) {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2556,10 +3137,10 @@
let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId);
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2570,7 +3151,8 @@
*
* @param {string} teamId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getTeamMembers: function(teamId) {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2578,10 +3160,10 @@
let path = '/teams/{teamId}/members'.replace(new RegExp('{teamId}', 'g'), teamId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2607,7 +3189,8 @@
* @param {string} redirect
* @param {string} name
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createTeamMembership: function(teamId, email, roles, redirect, name = '') {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2627,14 +3210,26 @@
let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId);
+ let payload = {};
+
+ if(email) {
+ payload['email'] = email;
+ }
+
+ if(name) {
+ payload['name'] = name;
+ }
+
+ if(roles) {
+ payload['roles'] = roles;
+ }
+
+ if(redirect) {
+ payload['redirect'] = redirect;
+ }
+
return http
- .post(path, {'content-type': 'application/json'},
- {
- 'email': email,
- 'name': name,
- 'roles': roles,
- 'redirect': redirect
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2646,7 +3241,8 @@
* @param {string} teamId
* @param {string} inviteId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteTeamMembership: function(teamId, inviteId) {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2658,10 +3254,10 @@
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'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2674,7 +3270,8 @@
* @param {string} inviteId
* @param {string} redirect
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createTeamMembershipResend: function(teamId, inviteId, redirect) {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2690,11 +3287,14 @@
let path = '/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId);
+ let payload = {};
+
+ if(redirect) {
+ payload['redirect'] = redirect;
+ }
+
return http
- .post(path, {'content-type': 'application/json'},
- {
- 'redirect': redirect
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2723,7 +3323,8 @@
* @param {string} success
* @param {string} failure
* @throws {Error}
- * @return {null} */
+ * @return {null}
+ */
updateTeamMembershipStatus: function(teamId, inviteId, userId, secret, success = '', failure = '') {
if(teamId === undefined) {
throw new Error('Missing required parameter: "teamId"');
@@ -2743,12 +3344,27 @@
let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId);
- return iframe('patch', path, {project: config.project,
- 'userId': userId,
- 'secret': secret,
- 'success': success,
- 'failure': failure
- });
+ let payload = {};
+
+ if(userId) {
+ payload['userId'] = userId;
+ }
+
+ if(secret) {
+ payload['secret'] = secret;
+ }
+
+ if(success) {
+ payload['success'] = success;
+ }
+
+ if(failure) {
+ payload['failure'] = failure;
+ }
+
+ payload['project'] = config.project;
+
+ return iframe('patch', path, payload);
}
};
@@ -2765,18 +3381,31 @@
* @param {number} offset
* @param {string} orderType
* @throws {Error}
- * @return {Promise} */
+ * @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'},
- {
- 'search': search,
- 'limit': limit,
- 'offset': offset,
- 'orderType': orderType
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2788,7 +3417,8 @@
* @param {string} password
* @param {string} name
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
createUser: function(email, password, name = '') {
if(email === undefined) {
throw new Error('Missing required parameter: "email"');
@@ -2800,13 +3430,22 @@
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'},
- {
- 'email': email,
- 'password': password,
- 'name': name
- });
+ .post(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2816,7 +3455,8 @@
*
* @param {string} userId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getUser: function(userId) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -2824,10 +3464,10 @@
let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2837,7 +3477,8 @@
*
* @param {string} userId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getUserLogs: function(userId) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -2845,10 +3486,10 @@
let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2858,7 +3499,8 @@
*
* @param {string} userId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getUserPrefs: function(userId) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -2866,10 +3508,42 @@
let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
+ },
+
+ /**
+ * Update Account Prefs
+ *
+ * Update user preferences by its unique ID. You can pass only the specific
+ * settings you wish to update.
+ *
+ * @param {string} userId
+ * @param {string} prefs
+ * @throws {Error}
+ * @return {Promise}
+ */
+ updateUserPrefs: function(userId, prefs) {
+ if(userId === undefined) {
+ throw new Error('Missing required parameter: "userId"');
+ }
+
+ if(prefs === undefined) {
+ throw new Error('Missing required parameter: "prefs"');
+ }
+
+ let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId);
+
+ let payload = {};
+
+ if(prefs) {
+ payload['prefs'] = prefs;
+ }
+
+ return http
+ .patch(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2879,7 +3553,8 @@
*
* @param {string} userId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
getUserSessions: function(userId) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -2887,10 +3562,10 @@
let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId);
+ let payload = {};
+
return http
- .get(path, {'content-type': 'application/json'},
- {
- });
+ .get(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2900,7 +3575,8 @@
*
* @param {string} userId
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
deleteUserSessions: function(userId) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -2908,10 +3584,10 @@
let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId);
+ let payload = {};
+
return http
- .delete(path, {'content-type': 'application/json'},
- {
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2922,8 +3598,9 @@
* @param {string} userId
* @param {string} sessionId
* @throws {Error}
- * @return {Promise} */
- deleteUsersSession: function(userId, sessionId) {
+ * @return {Promise}
+ */
+ deleteUserSession: function(userId, sessionId) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
}
@@ -2934,11 +3611,14 @@
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'},
- {
- 'sessionId': sessionId
- });
+ .delete(path, {'content-type': 'application/json'}, payload);
},
/**
@@ -2949,7 +3629,8 @@
* @param {string} userId
* @param {string} status
* @throws {Error}
- * @return {Promise} */
+ * @return {Promise}
+ */
updateUserStatus: function(userId, status) {
if(userId === undefined) {
throw new Error('Missing required parameter: "userId"');
@@ -2961,11 +3642,14 @@
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'},
- {
- 'status': status
- });
+ .patch(path, {'content-type': 'application/json'}, payload);
}
};
@@ -2987,4 +3671,8 @@
};
};
-})(window);
\ No newline at end of file
+ if(typeof module !== "undefined") {
+ module.exports = window.Appwrite;
+ }
+
+})((typeof window !== "undefined") ? window : {});
\ No newline at end of file
diff --git a/app/sdks/js/src/sdk.min.js b/app/sdks/js/src/sdk.min.js
index 4bd61f2d4c..a1d7e392a1 100644
--- a/app/sdks/js/src/sdk.min.js
+++ b/app/sdks/js/src/sdk.min.js
@@ -1,5 +1,5 @@
-(function(window){window.Appwrite=function(){let config={endpoint:'https://https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break}
resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)}
request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField)}}
-document.body.appendChild(form);return form.submit()};let account={get:function(){let path='/account';return http.get(path,{'content-type':'application/json'},{})},delete:function(){let path='/account';return http.delete(path,{'content-type':'application/json'},{})},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')}
+document.body.appendChild(form);return form.submit()};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json'},payload)},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json'},payload)},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(password===undefined){throw new Error('Missing required parameter: "password"')}
-let path='/account/email';return http.patch(path,{'content-type':'application/json'},{'email':email,'password':password})},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')}
-let path='/account/name';return http.patch(path,{'content-type':'application/json'},{'name':name})},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')}
+let path='/account/email';let payload={};if(email){payload.email=email}
+if(password){payload.password=password}
+return http.patch(path,{'content-type':'application/json'},payload)},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')}
+let path='/account/name';let payload={};if(name){payload.name=name}
+return http.patch(path,{'content-type':'application/json'},payload)},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')}
if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"')}
-let path='/account/password';return http.patch(path,{'content-type':'application/json'},{'password':password,'old-password':oldPassword})},getPrefs:function(){let path='/account/prefs';return http.get(path,{'content-type':'application/json'},{})},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
-let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs})},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{})},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{})}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"')}
+let path='/account/password';let payload={};if(password){payload.password=password}
+if(oldPassword){payload['old-password']=oldPassword}
+return http.patch(path,{'content-type':'application/json'},payload)},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json'},payload)},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
+let path='/account/prefs';let payload={};if(prefs){payload.prefs=prefs}
+return http.patch(path,{'content-type':'application/json'},payload)},getSecurity:function(){let path='/account/security';let payload={};return http.get(path,{'content-type':'application/json'},payload)},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json'},payload)}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(password===undefined){throw new Error('Missing required parameter: "password"')}
if(success===undefined){throw new Error('Missing required parameter: "success"')}
if(failure===undefined){throw new Error('Missing required parameter: "failure"')}
-let path='/auth/login';return iframe('post',path,{project:config.project,'email':email,'password':password,'success':success,'failure':failure})},logout:function(){let path='/auth/logout';return http.delete(path,{'content-type':'application/json'},{})},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')}
-let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{})},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
-let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure})},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"')}
+let path='/auth/login';let payload={};if(email){payload.email=email}
+if(password){payload.password=password}
+if(success){payload.success=success}
+if(failure){payload.failure=failure}
+payload.project=config.project;return iframe('post',path,payload)},logout:function(){let path='/auth/logout';let payload={};return http.delete(path,{'content-type':'application/json'},payload)},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')}
+let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
+let path='/auth/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)},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(reset===undefined){throw new Error('Missing required parameter: "reset"')}
-let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'reset':reset})},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+let path='/auth/recovery';let payload={};if(email){payload.email=email}
+if(reset){payload.reset=reset}
+return http.post(path,{'content-type':'application/json'},payload)},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(token===undefined){throw new Error('Missing required parameter: "token"')}
if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')}
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')}
-let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB})},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
+let path='/auth/recovery/reset';let payload={};if(userId){payload.userId=userId}
+if(token){payload.token=token}
+if(passwordA){payload['password-a']=passwordA}
+if(passwordB){payload['password-b']=passwordB}
+return http.put(path,{'content-type':'application/json'},payload)},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(password===undefined){throw new Error('Missing required parameter: "password"')}
if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
-let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'confirm':confirm,'success':success,'failure':failure,'name':name})},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+let path='/auth/register';let payload={};if(email){payload.email=email}
+if(password){payload.password=password}
+if(confirm){payload.confirm=confirm}
+if(success){payload.success=success}
+if(failure){payload.failure=failure}
+if(name){payload.name=name}
+payload.project=config.project;return iframe('post',path,payload)},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(token===undefined){throw new Error('Missing required parameter: "token"')}
-let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token})},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
-let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'confirm':confirm})}};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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
-let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url})},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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
-let path='/avatars/image';return http.get(path,{'content-type':'application/json'},{'url':url,'width':width,'height':height})},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
-let path='/avatars/qr';return http.get(path,{'content-type':'application/json'},{'text':text,'size':size,'margin':margin,'download':download})}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
-let path='/database';return http.post(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules})},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
-let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{})},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
+let path='/auth/register/confirm';let payload={};if(userId){payload.userId=userId}
+if(token){payload.token=token}
+return http.post(path,{'content-type':'application/json'},payload)},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
+let path='/auth/register/confirm/resend';let payload={};if(confirm){payload.confirm=confirm}
+return http.post(path,{'content-type':'application/json'},payload)}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
+let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
+if(height){payload.height=height}
+if(quality){payload.quality=quality}
+return http.get(path,{'content-type':'application/json'},payload)},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
+let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
+if(height){payload.height=height}
+if(quality){payload.quality=quality}
+return http.get(path,{'content-type':'application/json'},payload)},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
+let path='/avatars/favicon';let payload={};if(url){payload.url=url}
+return http.get(path,{'content-type':'application/json'},payload)},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
+let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
+if(height){payload.height=height}
+if(quality){payload.quality=quality}
+return http.get(path,{'content-type':'application/json'},payload)},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
+let path='/avatars/image';let payload={};if(url){payload.url=url}
+if(width){payload.width=width}
+if(height){payload.height=height}
+return http.get(path,{'content-type':'application/json'},payload)},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
+let path='/avatars/qr';let payload={};if(text){payload.text=text}
+if(size){payload.size=size}
+if(margin){payload.margin=margin}
+if(download){payload.download=download}
+return http.get(path,{'content-type':'application/json'},payload)}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database';let payload={};if(search){payload.search=search}
+if(limit){payload.limit=limit}
+if(offset){payload.offset=offset}
+if(orderType){payload.orderType=orderType}
+return http.get(path,{'content-type':'application/json'},payload)},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
+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"')}
-let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.put(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules})},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
-let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.delete(path,{'content-type':'application/json'},{})},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);return http.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})},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
+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"')}
-let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.post(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write,'parentDocument':parentDocument,'parentProperty':parentProperty,'parentPropertyType':parentPropertyType})},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
+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);return http.get(path,{'content-type':'application/json'},{})},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
+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"')}
-let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.patch(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write})},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
+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);return http.delete(path,{'content-type':'application/json'},{})}};let locale={getLocale:function(){let path='/locale';return http.get(path,{'content-type':'application/json'},{})},getCountries:function(){let path='/locale/countries';return http.get(path,{'content-type':'application/json'},{})},getCountriesEU:function(){let path='/locale/countries/eu';return http.get(path,{'content-type':'application/json'},{})},getCountriesPhones:function(){let path='/locale/countries/phones';return http.get(path,{'content-type':'application/json'},{})},getCurrencies:function(){let path='/locale/currencies';return http.get(path,{'content-type':'application/json'},{})}};let projects={listProjects:function(){let path='/projects';return http.get(path,{'content-type':'application/json'},{})},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')}
+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)},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';return http.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})},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.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})},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.delete(path,{'content-type':'application/json'},{})},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.post(path,{'content-type':'application/json'},{'name':name,'scopes':scopes})},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.get(path,{'content-type':'application/json'},{})},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.put(path,{'content-type':'application/json'},{'name':name,'scopes':scopes})},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.delete(path,{'content-type':'application/json'},{})},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.patch(path,{'content-type':'application/json'},{'provider':provider,'appId':appId,'secret':secret})},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.post(path,{'content-type':'application/json'},{'type':type,'name':name,'key':key,'store':store,'url':url})},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.get(path,{'content-type':'application/json'},{})},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.put(path,{'content-type':'application/json'},{'name':name,'key':key,'store':store,'url':url})},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.delete(path,{'content-type':'application/json'},{})},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.post(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass})},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.get(path,{'content-type':'application/json'},{})},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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"')}
@@ -105,60 +225,126 @@ 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);return http.put(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass})},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.delete(path,{'content-type':'application/json'},{})},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
-let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.post(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass})},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.get(path,{'content-type':'application/json'},{})},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.put(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass})},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
+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);return http.delete(path,{'content-type':'application/json'},{})}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"')}
-let path='/storage/files';return http.post(path,{'content-type':'multipart/form-data'},{'files':files,'read':read,'write':write,'folderId':folderId})},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
-let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{})},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
-let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.put(path,{'content-type':'application/json'},{'read':read,'write':write,'folderId':folderId})},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
-let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.delete(path,{'content-type':'application/json'},{})},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);return http.get(path,{'content-type':'application/json'},{})},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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality,'background':background,'output':output})},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);return http.get(path,{'content-type':'application/json'},{'as':as})}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
-let path='/teams';return http.post(path,{'content-type':'application/json'},{'name':name,'roles':roles})},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
-let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{})},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search}
+if(limit){payload.limit=limit}
+if(offset){payload.offset=offset}
+if(orderType){payload.orderType=orderType}
+return http.get(path,{'content-type':'application/json'},payload)},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"')}
+let path='/storage/files';let payload={};if(files){payload.files=files}
+if(read){payload.read=read}
+if(write){payload.write=write}
+if(folderId){payload.folderId=folderId}
+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=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
+let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload.read=read}
+if(write){payload.write=write}
+if(folderId){payload.folderId=folderId}
+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);return http.put(path,{'content-type':'application/json'},{'name':name})},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
-let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.delete(path,{'content-type':'application/json'},{})},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
-let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{})},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name}
+return http.put(path,{'content-type':'application/json'},payload)},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(roles===undefined){throw new Error('Missing required parameter: "roles"')}
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')}
-let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);return http.post(path,{'content-type':'application/json'},{'email':email,'name':name,'roles':roles,'redirect':redirect})},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload.email=email}
+if(name){payload.name=name}
+if(roles){payload.roles=roles}
+if(redirect){payload.redirect=redirect}
+return http.post(path,{'content-type':'application/json'},payload)},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
-let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.delete(path,{'content-type':'application/json'},{})},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')}
-let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.post(path,{'content-type':'application/json'},{'redirect':redirect})},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
+let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(redirect){payload.redirect=redirect}
+return http.post(path,{'content-type':'application/json'},payload)},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(secret===undefined){throw new Error('Missing required parameter: "secret"')}
-let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return iframe('patch',path,{project:config.project,'userId':userId,'secret':secret,'success':success,'failure':failure})}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
+let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload.userId=userId}
+if(secret){payload.secret=secret}
+if(success){payload.success=success}
+if(failure){payload.failure=failure}
+payload.project=config.project;return iframe('patch',path,payload)}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload.search=search}
+if(limit){payload.limit=limit}
+if(offset){payload.offset=offset}
+if(orderType){payload.orderType=orderType}
+return http.get(path,{'content-type':'application/json'},payload)},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(password===undefined){throw new Error('Missing required parameter: "password"')}
-let path='/users';return http.post(path,{'content-type':'application/json'},{'email':email,'password':password,'name':name})},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
-let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
-let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
-let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
-let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
-let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{})},deleteUsersSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+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);return http.delete(path,{'content-type':'application/json'},{'sessionId':sessionId})},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+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);return http.patch(path,{'content-type':'application/json'},{'status':status})}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users}}})(window)
\ No newline at end of file
+let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload.status=status}
+return http.patch(path,{'content-type':'application/json'},payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{})
\ No newline at end of file
diff --git a/app/sdks/node/README.md b/app/sdks/node/README.md
index 29cf410fdb..286b14bc9d 100644
--- a/app/sdks/node/README.md
+++ b/app/sdks/node/README.md
@@ -1,7 +1,7 @@
# Appwrite SDK for NodeJS

-
+
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.**
diff --git a/app/sdks/node/docs/examples/users/delete-user-session.md b/app/sdks/node/docs/examples/users/delete-user-session.md
new file mode 100644
index 0000000000..dab704e2d4
--- /dev/null
+++ b/app/sdks/node/docs/examples/users/delete-user-session.md
@@ -0,0 +1,19 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+ .setKey('')
+;
+
+let promise = users.deleteUserSession('[USER_ID]', '[SESSION_ID]');
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/node/docs/examples/users/update-user-prefs.md b/app/sdks/node/docs/examples/users/update-user-prefs.md
new file mode 100644
index 0000000000..beacba0b0a
--- /dev/null
+++ b/app/sdks/node/docs/examples/users/update-user-prefs.md
@@ -0,0 +1,19 @@
+const sdk = require('node-appwrite');
+
+// Init SDK
+let client = new sdk.Client();
+
+let users = new sdk.Users(client);
+
+client
+ .setProject('')
+ .setKey('')
+;
+
+let promise = users.updateUserPrefs('[USER_ID]', '{}');
+
+promise.then(function (response) {
+ console.log(response);
+}, function (error) {
+ console.log(error);
+});
\ No newline at end of file
diff --git a/app/sdks/node/lib/client.js b/app/sdks/node/lib/client.js
index 07deb786af..f3329fe080 100644
--- a/app/sdks/node/lib/client.js
+++ b/app/sdks/node/lib/client.js
@@ -4,7 +4,7 @@ const request = require('request-promise-native');
class Client {
constructor() {
- this.endpoint = 'https://https://appwrite.io/v1';
+ this.endpoint = 'https://appwrite.io/v1';
this.headers = {
'content-type': '',
'x-sdk-version': 'appwrite:nodejs:1.0.26',
@@ -15,7 +15,7 @@ class Client {
/**
* Set Project
*
- * Your Appwrite project ID. You can find your project ID in your Appwrite console project settings.
+ * Your Appwrite project ID
*
* @param string value
*
@@ -30,7 +30,7 @@ class Client {
/**
* Set Key
*
- * Your Appwrite project secret key. You can can create a new API key from your Appwrite console API keys dashboard.
+ * Your Appwrite project secret key
*
* @param string value
*
diff --git a/app/sdks/node/lib/services/auth.js b/app/sdks/node/lib/services/auth.js
index e8bdd2bc2c..f31d24b01f 100644
--- a/app/sdks/node/lib/services/auth.js
+++ b/app/sdks/node/lib/services/auth.js
@@ -14,7 +14,7 @@ class Auth extends Service {
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
- * When accessing this route using JavaScript from the browser, success and
+ * 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
@@ -170,7 +170,7 @@ class Auth extends Service {
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
- * When accessing this route using JavaScript from the browser, success and
+ * 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
diff --git a/app/sdks/node/lib/services/locale.js b/app/sdks/node/lib/services/locale.js
index 5231e1a1e4..0a9ffad1a9 100644
--- a/app/sdks/node/lib/services/locale.js
+++ b/app/sdks/node/lib/services/locale.js
@@ -76,9 +76,9 @@ class Locale extends Service {
/**
* List of currencies
*
- * List of all currencies, including currency symbol, name, plural, and
- * decimal digits for all major and minor currencies. You can use the locale
- * header to get the data in supported language.
+ * 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 supported language.
*
* @throws Exception
* @return {}
diff --git a/app/sdks/node/lib/services/users.js b/app/sdks/node/lib/services/users.js
index c378e329f2..6367acad4b 100644
--- a/app/sdks/node/lib/services/users.js
+++ b/app/sdks/node/lib/services/users.js
@@ -100,6 +100,26 @@ class Users extends Service {
});
}
+ /**
+ * Update Account Prefs
+ *
+ * Update user preferences by its unique ID. You can pass only the specific
+ * settings you wish to update.
+ *
+ * @param string userId
+ * @param string prefs
+ * @throws Exception
+ * @return {}
+ */
+ async updateUserPrefs(userId, prefs) {
+ let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId);
+
+ return await this.client.call('patch', path, {'content-type': 'application/json'},
+ {
+ 'prefs': prefs
+ });
+ }
+
/**
* Get User Sessions
*
@@ -144,7 +164,7 @@ class Users extends Service {
* @throws Exception
* @return {}
*/
- async deleteUsersSession(userId, sessionId) {
+ 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'},
diff --git a/app/sdks/php/README.md b/app/sdks/php/README.md
index 50f218e0df..62f8ddf679 100644
--- a/app/sdks/php/README.md
+++ b/app/sdks/php/README.md
@@ -1,7 +1,7 @@
# Appwrite SDK for PHP

-
+
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.**
@@ -13,7 +13,7 @@ Appwrite backend as a service cuts up to 70% of the time and costs required for
## Installation
-To install via [Composer](https://getcomposer.org/):
+To install via [Composer](http://getcomposer.org/):
```bash
composer require appwrite/appwrite
@@ -21,4 +21,4 @@ composer require appwrite/appwrite
## License
-Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
+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/php/docs/account.md b/app/sdks/php/docs/account.md
index d1772d26cd..a18d978e63 100644
--- a/app/sdks/php/docs/account.md
+++ b/app/sdks/php/docs/account.md
@@ -3,7 +3,7 @@
## Get Account
```http request
-GET https://https://appwrite.io/v1/account
+GET https://appwrite.io/v1/account
```
** Get currently logged in user data as JSON object. **
@@ -11,7 +11,7 @@ GET https://https://appwrite.io/v1/account
## Delete Account
```http request
-DELETE https://https://appwrite.io/v1/account
+DELETE https://appwrite.io/v1/account
```
** Delete currently logged in user account. **
@@ -19,7 +19,7 @@ DELETE https://https://appwrite.io/v1/account
## Update Account Email
```http request
-PATCH https://https://appwrite.io/v1/account/email
+PATCH https://appwrite.io/v1/account/email
```
** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. **
@@ -34,7 +34,7 @@ PATCH https://https://appwrite.io/v1/account/email
## Update Account Name
```http request
-PATCH https://https://appwrite.io/v1/account/name
+PATCH https://appwrite.io/v1/account/name
```
** Update currently logged in user account name. **
@@ -48,7 +48,7 @@ PATCH https://https://appwrite.io/v1/account/name
## Update Account Password
```http request
-PATCH https://https://appwrite.io/v1/account/password
+PATCH https://appwrite.io/v1/account/password
```
** Update currently logged in user password. For validation, user is required to pass the password twice. **
@@ -63,7 +63,7 @@ PATCH https://https://appwrite.io/v1/account/password
## Get Account Preferences
```http request
-GET https://https://appwrite.io/v1/account/prefs
+GET https://appwrite.io/v1/account/prefs
```
** Get currently logged in user preferences key-value object. **
@@ -71,7 +71,7 @@ GET https://https://appwrite.io/v1/account/prefs
## Update Account Prefs
```http request
-PATCH https://https://appwrite.io/v1/account/prefs
+PATCH https://appwrite.io/v1/account/prefs
```
** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. **
@@ -85,7 +85,7 @@ PATCH https://https://appwrite.io/v1/account/prefs
## Get Account Security Log
```http request
-GET https://https://appwrite.io/v1/account/security
+GET https://appwrite.io/v1/account/security
```
** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
@@ -93,7 +93,7 @@ GET https://https://appwrite.io/v1/account/security
## Get Account Active Sessions
```http request
-GET https://https://appwrite.io/v1/account/sessions
+GET https://appwrite.io/v1/account/sessions
```
** Get currently logged in user list of active sessions across different devices. **
diff --git a/app/sdks/php/docs/auth.md b/app/sdks/php/docs/auth.md
index 5cf2481975..19fd6d4a0e 100644
--- a/app/sdks/php/docs/auth.md
+++ b/app/sdks/php/docs/auth.md
@@ -3,14 +3,14 @@
## Login User
```http request
-POST https://https://appwrite.io/v1/auth/login
+POST https://appwrite.io/v1/auth/login
```
** Allow the user to login into his account by providing a valid email and password combination. Use the success and failure arguments to provide a redirect URL\'s back to your app when login is completed.
Please notice that in order to avoid a [Redirect 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 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. **
+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
@@ -24,7 +24,7 @@ When accessing this route using JavaScript from the browser, success and failure
## Logout Current Session
```http request
-DELETE https://https://appwrite.io/v1/auth/logout
+DELETE https://appwrite.io/v1/auth/logout
```
** Use this endpoint to log out the currently logged in user from his account. When succeed this endpoint will delete the user session and remove the session secret cookie from the user client. **
@@ -32,7 +32,7 @@ DELETE https://https://appwrite.io/v1/auth/logout
## Logout Specific Session
```http request
-DELETE https://https://appwrite.io/v1/auth/logout/{id}
+DELETE https://appwrite.io/v1/auth/logout/{id}
```
** Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. **
@@ -46,7 +46,7 @@ DELETE https://https://appwrite.io/v1/auth/logout/{id}
## OAuth Login
```http request
-GET https://https://appwrite.io/v1/auth/oauth/{provider}
+GET https://appwrite.io/v1/auth/oauth/{provider}
```
### Parameters
@@ -60,7 +60,7 @@ GET https://https://appwrite.io/v1/auth/oauth/{provider}
## Password Recovery
```http request
-POST https://https://appwrite.io/v1/auth/recovery
+POST https://appwrite.io/v1/auth/recovery
```
** Sends the user an email with a temporary secret token for password reset. When the user clicks the confirmation link he is redirected back to your app password reset redirect URL with a secret token and email address values attached to the URL query string. Use the query string params to submit a request to the /auth/password/reset endpoint to complete the process. **
@@ -75,7 +75,7 @@ POST https://https://appwrite.io/v1/auth/recovery
## Password Reset
```http request
-PUT https://https://appwrite.io/v1/auth/recovery/reset
+PUT https://appwrite.io/v1/auth/recovery/reset
```
** Use this endpoint to complete the user account password reset. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/recovery endpoint.
@@ -94,7 +94,7 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
## Register User
```http request
-POST https://https://appwrite.io/v1/auth/register
+POST https://appwrite.io/v1/auth/register
```
** Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL's to redirect users back to your application after signup completes.
@@ -103,7 +103,7 @@ If registration completes successfully user will be sent with a confirmation ema
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
-When 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. **
+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
@@ -119,7 +119,7 @@ When accessing this route using JavaScript from the browser, success and failure
## Confirm User
```http request
-POST https://https://appwrite.io/v1/auth/register/confirm
+POST https://appwrite.io/v1/auth/register/confirm
```
** Use this endpoint to complete the confirmation of the user account email address. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/register endpoint. **
@@ -134,7 +134,7 @@ POST https://https://appwrite.io/v1/auth/register/confirm
## Resend Confirmation
```http request
-POST https://https://appwrite.io/v1/auth/register/confirm/resend
+POST https://appwrite.io/v1/auth/register/confirm/resend
```
** This endpoint allows the user to request your app to resend him his email confirmation message. The redirect arguments acts the same way as in /auth/register endpoint.
diff --git a/app/sdks/php/docs/avatars.md b/app/sdks/php/docs/avatars.md
index 11a7beeddc..9c1c3018aa 100644
--- a/app/sdks/php/docs/avatars.md
+++ b/app/sdks/php/docs/avatars.md
@@ -3,7 +3,7 @@
## Get Browser Icon
```http request
-GET https://https://appwrite.io/v1/avatars/browsers/{code}
+GET https://appwrite.io/v1/avatars/browsers/{code}
```
** You can use this endpoint to show different browser icons to your users, The code argument receives the browser code as appear in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. **
@@ -20,7 +20,7 @@ GET https://https://appwrite.io/v1/avatars/browsers/{code}
## Get Credit Card Icon
```http request
-GET https://https://appwrite.io/v1/avatars/credit-cards/{code}
+GET https://appwrite.io/v1/avatars/credit-cards/{code}
```
** Need to display your users with your billing method or there 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. **
@@ -37,7 +37,7 @@ GET https://https://appwrite.io/v1/avatars/credit-cards/{code}
## Get Favicon
```http request
-GET https://https://appwrite.io/v1/avatars/favicon
+GET https://appwrite.io/v1/avatars/favicon
```
** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. **
@@ -51,7 +51,7 @@ GET https://https://appwrite.io/v1/avatars/favicon
## Get Country Flag
```http request
-GET https://https://appwrite.io/v1/avatars/flags/{code}
+GET https://appwrite.io/v1/avatars/flags/{code}
```
** You can use this endpoint to show different country flags icons to your users, The code argument receives the a 2 letter country code. Use width, height and quality arguments to change the output settings. **
@@ -68,7 +68,7 @@ GET https://https://appwrite.io/v1/avatars/flags/{code}
## Get Image from URL
```http request
-GET https://https://appwrite.io/v1/avatars/image
+GET https://appwrite.io/v1/avatars/image
```
** 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 cases, you want to make sure a 3rd party image is properly served using a TLS protocol. **
@@ -84,7 +84,7 @@ GET https://https://appwrite.io/v1/avatars/image
## Text to QR Generator
```http request
-GET https://https://appwrite.io/v1/avatars/qr
+GET https://appwrite.io/v1/avatars/qr
```
** 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. **
diff --git a/app/sdks/php/docs/database.md b/app/sdks/php/docs/database.md
index 33d8e2d9bd..3ab8bda823 100644
--- a/app/sdks/php/docs/database.md
+++ b/app/sdks/php/docs/database.md
@@ -3,7 +3,7 @@
## List Collections
```http request
-GET https://https://appwrite.io/v1/database
+GET https://appwrite.io/v1/database
```
** 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/modes). **
@@ -20,7 +20,7 @@ GET https://https://appwrite.io/v1/database
## Create Collection
```http request
-POST https://https://appwrite.io/v1/database
+POST https://appwrite.io/v1/database
```
** Create a new Collection. **
@@ -37,7 +37,7 @@ POST https://https://appwrite.io/v1/database
## Get Collection
```http request
-GET https://https://appwrite.io/v1/database/{collectionId}
+GET https://appwrite.io/v1/database/{collectionId}
```
** Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. **
@@ -51,7 +51,7 @@ GET https://https://appwrite.io/v1/database/{collectionId}
## Update Collection
```http request
-PUT https://https://appwrite.io/v1/database/{collectionId}
+PUT https://appwrite.io/v1/database/{collectionId}
```
** Update collection by its unique ID. **
@@ -69,7 +69,7 @@ PUT https://https://appwrite.io/v1/database/{collectionId}
## Delete Collection
```http request
-DELETE https://https://appwrite.io/v1/database/{collectionId}
+DELETE https://appwrite.io/v1/database/{collectionId}
```
** Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. **
@@ -83,7 +83,7 @@ DELETE https://https://appwrite.io/v1/database/{collectionId}
## List Documents
```http request
-GET https://https://appwrite.io/v1/database/{collectionId}/documents
+GET https://appwrite.io/v1/database/{collectionId}/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/modes). **
@@ -106,7 +106,7 @@ GET https://https://appwrite.io/v1/database/{collectionId}/documents
## Create Document
```http request
-POST https://https://appwrite.io/v1/database/{collectionId}/documents
+POST https://appwrite.io/v1/database/{collectionId}/documents
```
** Create a new Document. **
@@ -126,7 +126,7 @@ POST https://https://appwrite.io/v1/database/{collectionId}/documents
## Get Document
```http request
-GET https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
+GET https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
```
** Get document by its unique ID. This endpoint response returns a JSON object with the document data. **
@@ -141,7 +141,7 @@ GET https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId
## Update Document
```http request
-PATCH https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
+PATCH https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
```
### Parameters
@@ -157,7 +157,7 @@ PATCH https://https://appwrite.io/v1/database/{collectionId}/documents/{document
## Delete Document
```http request
-DELETE https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
+DELETE https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
```
** 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. **
diff --git a/app/sdks/php/docs/examples/projects/create-task.md b/app/sdks/php/docs/examples/projects/create-task.md
index fab9e27653..436ebc6f06 100644
--- a/app/sdks/php/docs/examples/projects/create-task.md
+++ b/app/sdks/php/docs/examples/projects/create-task.md
@@ -12,4 +12,4 @@ $client
$projects = new Projects($client);
-$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
\ No newline at end of file
+$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
\ No newline at end of file
diff --git a/app/sdks/php/docs/examples/projects/update-webhook.md b/app/sdks/php/docs/examples/projects/update-webhook.md
index a7e42dcce2..6f176a01fb 100644
--- a/app/sdks/php/docs/examples/projects/update-webhook.md
+++ b/app/sdks/php/docs/examples/projects/update-webhook.md
@@ -12,4 +12,4 @@ $client
$projects = new Projects($client);
-$result = $projects->updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0);
\ No newline at end of file
+$result = $projects->updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 1);
\ No newline at end of file
diff --git a/app/sdks/php/docs/examples/users/delete-user-session.md b/app/sdks/php/docs/examples/users/delete-user-session.md
new file mode 100644
index 0000000000..28ad6dd165
--- /dev/null
+++ b/app/sdks/php/docs/examples/users/delete-user-session.md
@@ -0,0 +1,15 @@
+setProject('')
+ ->setKey('')
+;
+
+$users = new Users($client);
+
+$result = $users->deleteUserSession('[USER_ID]', '[SESSION_ID]');
\ No newline at end of file
diff --git a/app/sdks/php/docs/examples/users/update-user-prefs.md b/app/sdks/php/docs/examples/users/update-user-prefs.md
new file mode 100644
index 0000000000..073df70bd3
--- /dev/null
+++ b/app/sdks/php/docs/examples/users/update-user-prefs.md
@@ -0,0 +1,15 @@
+setProject('')
+ ->setKey('')
+;
+
+$users = new Users($client);
+
+$result = $users->updateUserPrefs('[USER_ID]', '{}');
\ No newline at end of file
diff --git a/app/sdks/php/docs/locale.md b/app/sdks/php/docs/locale.md
index 5ea8ab37fb..91956eee3b 100644
--- a/app/sdks/php/docs/locale.md
+++ b/app/sdks/php/docs/locale.md
@@ -3,7 +3,7 @@
## Get User Locale
```http request
-GET https://https://appwrite.io/v1/locale
+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 supported language. **
@@ -11,7 +11,7 @@ GET https://https://appwrite.io/v1/locale
## List Countries
```http request
-GET https://https://appwrite.io/v1/locale/countries
+GET https://appwrite.io/v1/locale/countries
```
** List of all countries. You can use the locale header to get the data in supported language. **
@@ -19,7 +19,7 @@ GET https://https://appwrite.io/v1/locale/countries
## List EU Countries
```http request
-GET https://https://appwrite.io/v1/locale/countries/eu
+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 supported language. UK brexit date is currently set to 2019-10-31 and will be updated if and when needed. **
@@ -27,7 +27,7 @@ GET https://https://appwrite.io/v1/locale/countries/eu
## List Countries Phone Codes
```http request
-GET https://https://appwrite.io/v1/locale/countries/phones
+GET https://appwrite.io/v1/locale/countries/phones
```
** List of all countries phone codes. You can use the locale header to get the data in supported language. **
@@ -35,8 +35,8 @@ GET https://https://appwrite.io/v1/locale/countries/phones
## List of currencies
```http request
-GET https://https://appwrite.io/v1/locale/currencies
+GET https://appwrite.io/v1/locale/currencies
```
-** List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in supported language. **
+** 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 supported language. **
diff --git a/app/sdks/php/docs/projects.md b/app/sdks/php/docs/projects.md
index 6db3e1b510..bc4026970d 100644
--- a/app/sdks/php/docs/projects.md
+++ b/app/sdks/php/docs/projects.md
@@ -3,13 +3,13 @@
## List Projects
```http request
-GET https://https://appwrite.io/v1/projects
+GET https://appwrite.io/v1/projects
```
## Create Project
```http request
-POST https://https://appwrite.io/v1/projects
+POST https://appwrite.io/v1/projects
```
### Parameters
@@ -31,7 +31,7 @@ POST https://https://appwrite.io/v1/projects
## Get Project
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}
+GET https://appwrite.io/v1/projects/{projectId}
```
### Parameters
@@ -43,7 +43,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}
## Update Project
```http request
-PATCH https://https://appwrite.io/v1/projects/{projectId}
+PATCH https://appwrite.io/v1/projects/{projectId}
```
### Parameters
@@ -65,7 +65,7 @@ PATCH https://https://appwrite.io/v1/projects/{projectId}
## Delete Project
```http request
-DELETE https://https://appwrite.io/v1/projects/{projectId}
+DELETE https://appwrite.io/v1/projects/{projectId}
```
### Parameters
@@ -77,7 +77,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}
## List Keys
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/keys
+GET https://appwrite.io/v1/projects/{projectId}/keys
```
### Parameters
@@ -89,7 +89,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/keys
## Create Key
```http request
-POST https://https://appwrite.io/v1/projects/{projectId}/keys
+POST https://appwrite.io/v1/projects/{projectId}/keys
```
### Parameters
@@ -103,7 +103,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/keys
## Get Key
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
+GET https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
```
### Parameters
@@ -116,7 +116,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
## Update Key
```http request
-PUT https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
+PUT https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
```
### Parameters
@@ -131,7 +131,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
## Delete Key
```http request
-DELETE https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
+DELETE https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
```
### Parameters
@@ -144,7 +144,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
## Update Project OAuth
```http request
-PATCH https://https://appwrite.io/v1/projects/{projectId}/oauth
+PATCH https://appwrite.io/v1/projects/{projectId}/oauth
```
### Parameters
@@ -159,7 +159,7 @@ PATCH https://https://appwrite.io/v1/projects/{projectId}/oauth
## List Platforms
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/platforms
+GET https://appwrite.io/v1/projects/{projectId}/platforms
```
### Parameters
@@ -171,7 +171,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/platforms
## Create Platform
```http request
-POST https://https://appwrite.io/v1/projects/{projectId}/platforms
+POST https://appwrite.io/v1/projects/{projectId}/platforms
```
### Parameters
@@ -188,7 +188,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/platforms
## Get Platform
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
+GET https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
```
### Parameters
@@ -201,7 +201,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
## Update Platform
```http request
-PUT https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
+PUT https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
```
### Parameters
@@ -218,7 +218,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
## Delete Platform
```http request
-DELETE https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
+DELETE https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
```
### Parameters
@@ -231,7 +231,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId
## List Tasks
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/tasks
+GET https://appwrite.io/v1/projects/{projectId}/tasks
```
### Parameters
@@ -243,7 +243,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/tasks
## Create Task
```http request
-POST https://https://appwrite.io/v1/projects/{projectId}/tasks
+POST https://appwrite.io/v1/projects/{projectId}/tasks
```
### Parameters
@@ -264,7 +264,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/tasks
## Get Task
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
+GET https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
```
### Parameters
@@ -277,7 +277,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
## Update Task
```http request
-PUT https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
+PUT https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
```
### Parameters
@@ -299,7 +299,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
## Delete Task
```http request
-DELETE https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
+DELETE https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
```
### Parameters
@@ -312,7 +312,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
## Get Project
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/usage
+GET https://appwrite.io/v1/projects/{projectId}/usage
```
### Parameters
@@ -324,7 +324,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/usage
## List Webhooks
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/webhooks
+GET https://appwrite.io/v1/projects/{projectId}/webhooks
```
### Parameters
@@ -336,7 +336,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/webhooks
## Create Webhook
```http request
-POST https://https://appwrite.io/v1/projects/{projectId}/webhooks
+POST https://appwrite.io/v1/projects/{projectId}/webhooks
```
### Parameters
@@ -354,7 +354,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/webhooks
## Get Webhook
```http request
-GET https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
+GET https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
```
### Parameters
@@ -367,7 +367,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
## Update Webhook
```http request
-PUT https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
+PUT https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
```
### Parameters
@@ -386,7 +386,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
## Delete Webhook
```http request
-DELETE https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
+DELETE https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
```
### Parameters
diff --git a/app/sdks/php/docs/storage.md b/app/sdks/php/docs/storage.md
index fd9268ef8e..177357eea1 100644
--- a/app/sdks/php/docs/storage.md
+++ b/app/sdks/php/docs/storage.md
@@ -3,7 +3,7 @@
## List Files
```http request
-GET https://https://appwrite.io/v1/storage/files
+GET https://appwrite.io/v1/storage/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/modes). **
@@ -20,7 +20,7 @@ GET https://https://appwrite.io/v1/storage/files
## Create File
```http request
-POST https://https://appwrite.io/v1/storage/files
+POST https://appwrite.io/v1/storage/files
```
** 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. **
@@ -37,7 +37,7 @@ POST https://https://appwrite.io/v1/storage/files
## Get File
```http request
-GET https://https://appwrite.io/v1/storage/files/{fileId}
+GET https://appwrite.io/v1/storage/files/{fileId}
```
** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. **
@@ -51,7 +51,7 @@ GET https://https://appwrite.io/v1/storage/files/{fileId}
## Update File
```http request
-PUT https://https://appwrite.io/v1/storage/files/{fileId}
+PUT https://appwrite.io/v1/storage/files/{fileId}
```
** Update file by its unique ID. Only users with write permissions have access to update this resource. **
@@ -68,7 +68,7 @@ PUT https://https://appwrite.io/v1/storage/files/{fileId}
## Delete File
```http request
-DELETE https://https://appwrite.io/v1/storage/files/{fileId}
+DELETE https://appwrite.io/v1/storage/files/{fileId}
```
** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. **
@@ -82,7 +82,7 @@ DELETE https://https://appwrite.io/v1/storage/files/{fileId}
## Get File for Download
```http request
-GET https://https://appwrite.io/v1/storage/files/{fileId}/download
+GET https://appwrite.io/v1/storage/files/{fileId}/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. **
@@ -96,7 +96,7 @@ GET https://https://appwrite.io/v1/storage/files/{fileId}/download
## Get File Preview
```http request
-GET https://https://appwrite.io/v1/storage/files/{fileId}/preview
+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. **
@@ -115,7 +115,7 @@ GET https://https://appwrite.io/v1/storage/files/{fileId}/preview
## Get File for View
```http request
-GET https://https://appwrite.io/v1/storage/files/{fileId}/view
+GET https://appwrite.io/v1/storage/files/{fileId}/view
```
** Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. **
diff --git a/app/sdks/php/docs/teams.md b/app/sdks/php/docs/teams.md
index e71ca83e8f..8d6e7f2321 100644
--- a/app/sdks/php/docs/teams.md
+++ b/app/sdks/php/docs/teams.md
@@ -3,7 +3,7 @@
## List Teams
```http request
-GET https://https://appwrite.io/v1/teams
+GET https://appwrite.io/v1/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/modes). **
@@ -20,7 +20,7 @@ GET https://https://appwrite.io/v1/teams
## Create Team
```http request
-POST https://https://appwrite.io/v1/teams
+POST https://appwrite.io/v1/teams
```
** 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. **
@@ -35,7 +35,7 @@ POST https://https://appwrite.io/v1/teams
## Get Team
```http request
-GET https://https://appwrite.io/v1/teams/{teamId}
+GET https://appwrite.io/v1/teams/{teamId}
```
** Get team by its unique ID. All team members have read access for this resource. **
@@ -49,7 +49,7 @@ GET https://https://appwrite.io/v1/teams/{teamId}
## Update Team
```http request
-PUT https://https://appwrite.io/v1/teams/{teamId}
+PUT https://appwrite.io/v1/teams/{teamId}
```
** Update team by its unique ID. Only team owners have write access for this resource. **
@@ -64,7 +64,7 @@ PUT https://https://appwrite.io/v1/teams/{teamId}
## Delete Team
```http request
-DELETE https://https://appwrite.io/v1/teams/{teamId}
+DELETE https://appwrite.io/v1/teams/{teamId}
```
** Delete team by its unique ID. Only team owners have write access for this resource. **
@@ -78,7 +78,7 @@ DELETE https://https://appwrite.io/v1/teams/{teamId}
## Get Team Members
```http request
-GET https://https://appwrite.io/v1/teams/{teamId}/members
+GET https://appwrite.io/v1/teams/{teamId}/members
```
** Get team members by the team unique ID. All team members have read access for this list of resources. **
@@ -92,7 +92,7 @@ GET https://https://appwrite.io/v1/teams/{teamId}/members
## Create Team Membership
```http request
-POST https://https://appwrite.io/v1/teams/{teamId}/memberships
+POST https://appwrite.io/v1/teams/{teamId}/memberships
```
** Use this endpoint to invite a new member to your team. An email with a link to join the team will be sent to the new member email address. If member doesn't exists in the project it will be automatically created.
@@ -114,7 +114,7 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
## Delete Team Membership
```http request
-DELETE https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
+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. **
@@ -129,7 +129,7 @@ DELETE https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
## Create Team Membership (Resend)
```http request
-POST https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/resend
+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. **
@@ -145,7 +145,7 @@ POST https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/resend
## Update Team Membership Status
```http request
-PATCH https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status
+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.
diff --git a/app/sdks/php/docs/users.md b/app/sdks/php/docs/users.md
index abd22e4884..dba2aa35d0 100644
--- a/app/sdks/php/docs/users.md
+++ b/app/sdks/php/docs/users.md
@@ -3,7 +3,7 @@
## List Users
```http request
-GET https://https://appwrite.io/v1/users
+GET https://appwrite.io/v1/users
```
** Get a list of all the project users. You can use the query params to filter your results. **
@@ -20,7 +20,7 @@ GET https://https://appwrite.io/v1/users
## Create User
```http request
-POST https://https://appwrite.io/v1/users
+POST https://appwrite.io/v1/users
```
** Create a new user. **
@@ -36,7 +36,7 @@ POST https://https://appwrite.io/v1/users
## Get User
```http request
-GET https://https://appwrite.io/v1/users/{userId}
+GET https://appwrite.io/v1/users/{userId}
```
** Get user by its unique ID. **
@@ -50,7 +50,7 @@ GET https://https://appwrite.io/v1/users/{userId}
## Get User Logs
```http request
-GET https://https://appwrite.io/v1/users/{userId}/logs
+GET https://appwrite.io/v1/users/{userId}/logs
```
** Get user activity logs list by its unique ID. **
@@ -64,7 +64,7 @@ GET https://https://appwrite.io/v1/users/{userId}/logs
## Get User Prefs
```http request
-GET https://https://appwrite.io/v1/users/{userId}/prefs
+GET https://appwrite.io/v1/users/{userId}/prefs
```
** Get user preferences by its unique ID. **
@@ -75,10 +75,25 @@ GET https://https://appwrite.io/v1/users/{userId}/prefs
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
+## Update Account Prefs
+
+```http request
+PATCH https://appwrite.io/v1/users/{userId}/prefs
+```
+
+** Update user preferences by its unique ID. You can pass only the specific settings you wish to update. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| userId | string | **Required** User unique ID. | |
+| prefs | string | Prefs key-value JSON object string. | |
+
## Get User Sessions
```http request
-GET https://https://appwrite.io/v1/users/{userId}/sessions
+GET https://appwrite.io/v1/users/{userId}/sessions
```
** Get user sessions list by its unique ID. **
@@ -92,7 +107,7 @@ GET https://https://appwrite.io/v1/users/{userId}/sessions
## Delete User Sessions
```http request
-DELETE https://https://appwrite.io/v1/users/{userId}/sessions
+DELETE https://appwrite.io/v1/users/{userId}/sessions
```
** Delete all user sessions by its unique ID. **
@@ -106,7 +121,7 @@ DELETE https://https://appwrite.io/v1/users/{userId}/sessions
## Delete User Session
```http request
-DELETE https://https://appwrite.io/v1/users/{userId}/sessions/:session
+DELETE https://appwrite.io/v1/users/{userId}/sessions/:session
```
** Delete user sessions by its unique ID. **
@@ -121,7 +136,7 @@ DELETE https://https://appwrite.io/v1/users/{userId}/sessions/:session
## Update user status
```http request
-PATCH https://https://appwrite.io/v1/users/{userId}/status
+PATCH https://appwrite.io/v1/users/{userId}/status
```
** Update user status by its unique ID. **
diff --git a/app/sdks/php/src/Appwrite/Client.php b/app/sdks/php/src/Appwrite/Client.php
index 0a07f6588d..29240ec495 100644
--- a/app/sdks/php/src/Appwrite/Client.php
+++ b/app/sdks/php/src/Appwrite/Client.php
@@ -28,7 +28,7 @@ class Client
*
* @var string
*/
- protected $endpoint = 'https://https://appwrite.io/v1';
+ protected $endpoint = 'https://appwrite.io/v1';
/**
* Global Headers
@@ -50,7 +50,7 @@ class Client
/**
* Set Project
*
- * Your Appwrite project ID. You can find your project ID in your Appwrite console project settings.
+ * Your Appwrite project ID
*
* @param string $value
*
@@ -66,7 +66,7 @@ class Client
/**
* Set Key
*
- * Your Appwrite project secret key. You can can create a new API key from your Appwrite console API keys dashboard.
+ * Your Appwrite project secret key
*
* @param string $value
*
diff --git a/app/sdks/php/src/Appwrite/Services/Auth.php b/app/sdks/php/src/Appwrite/Services/Auth.php
index aa0c32c3f2..dae305144c 100644
--- a/app/sdks/php/src/Appwrite/Services/Auth.php
+++ b/app/sdks/php/src/Appwrite/Services/Auth.php
@@ -20,7 +20,7 @@ class Auth extends Service
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
- * When accessing this route using JavaScript from the browser, success and
+ * 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
@@ -188,7 +188,7 @@ class Auth extends Service
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
- * When accessing this route using JavaScript from the browser, success and
+ * 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
diff --git a/app/sdks/php/src/Appwrite/Services/Locale.php b/app/sdks/php/src/Appwrite/Services/Locale.php
index b03c1c3e73..1ae5ae0427 100644
--- a/app/sdks/php/src/Appwrite/Services/Locale.php
+++ b/app/sdks/php/src/Appwrite/Services/Locale.php
@@ -90,9 +90,9 @@ class Locale extends Service
/**
* List of currencies
*
- * List of all currencies, including currency symbol, name, plural, and
- * decimal digits for all major and minor currencies. You can use the locale
- * header to get the data in supported language.
+ * 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 supported language.
*
* @throws Exception
* @return array
diff --git a/app/sdks/php/src/Appwrite/Services/Users.php b/app/sdks/php/src/Appwrite/Services/Users.php
index 3b893c0e96..89d97f1893 100644
--- a/app/sdks/php/src/Appwrite/Services/Users.php
+++ b/app/sdks/php/src/Appwrite/Services/Users.php
@@ -116,6 +116,28 @@ class Users extends Service
], $params);
}
+ /**
+ * Update Account Prefs
+ *
+ * Update user preferences by its unique ID. You can pass only the specific
+ * settings you wish to update.
+ *
+ * @param string $userId
+ * @param string $prefs
+ * @throws Exception
+ * @return array
+ */
+ public function updateUserPrefs($userId, $prefs)
+ {
+ $path = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs');
+ $params = [];
+
+ $params['prefs'] = $prefs;
+
+ return $this->client->call(Client::METHOD_PATCH, $path, [
+ ], $params);
+ }
+
/**
* Get User Sessions
*
@@ -164,7 +186,7 @@ class Users extends Service
* @throws Exception
* @return array
*/
- public function deleteUsersSession($userId, $sessionId)
+ public function deleteUserSession($userId, $sessionId)
{
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions/:session');
$params = [];
diff --git a/app/sdks/python/README.md b/app/sdks/python/README.md
index 2ced831bf7..16f76cf3be 100644
--- a/app/sdks/python/README.md
+++ b/app/sdks/python/README.md
@@ -1,7 +1,7 @@
# Appwrite SDK for Python

-
+
**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).**
diff --git a/app/sdks/python/appwrite/client.py b/app/sdks/python/appwrite/client.py
index 0de0b48346..835c3ba011 100644
--- a/app/sdks/python/appwrite/client.py
+++ b/app/sdks/python/appwrite/client.py
@@ -4,7 +4,7 @@ import requests
class Client:
def __init__(self):
self._self_signed = False
- self._endpoint = 'https://https://appwrite.io/v1'
+ self._endpoint = 'https://appwrite.io/v1'
self._global_headers = {
'content-type': '',
'x-sdk-version': 'appwrite:python:1.0.0',
@@ -23,13 +23,13 @@ class Client:
return self
def set_project(self, value):
- """Your Appwrite project ID. You can find your project ID in your Appwrite console project settings."""
+ """Your Appwrite project ID"""
self._global_headers['x-appwrite-project'] = value.lower()
return self
def set_key(self, value):
- """Your Appwrite project secret key. You can can create a new API key from your Appwrite console API keys dashboard."""
+ """Your Appwrite project secret key"""
self._global_headers['x-appwrite-key'] = value.lower()
return self
diff --git a/app/sdks/python/appwrite/services/users.py b/app/sdks/python/appwrite/services/users.py
index 33e26d7d56..abafb6aa1f 100644
--- a/app/sdks/python/appwrite/services/users.py
+++ b/app/sdks/python/appwrite/services/users.py
@@ -58,6 +58,17 @@ class Users(Service):
return self.client.call('get', path, {
}, params)
+ def update_user_prefs(self, user_id, prefs):
+ """Update Account Prefs"""
+
+ params = {}
+ path = '/users/{userId}/prefs'
+ path.replace('{userId}', user_id)
+ params['prefs'] = prefs
+
+ return self.client.call('patch', path, {
+ }, params)
+
def get_user_sessions(self, user_id):
"""Get User Sessions"""
@@ -78,7 +89,7 @@ class Users(Service):
return self.client.call('delete', path, {
}, params)
- def delete_users_session(self, user_id, session_id):
+ def delete_user_session(self, user_id, session_id):
"""Delete User Session"""
params = {}
diff --git a/app/sdks/ruby/README.md b/app/sdks/ruby/README.md
index 4124c7550a..600f40a33d 100644
--- a/app/sdks/ruby/README.md
+++ b/app/sdks/ruby/README.md
@@ -1,7 +1,7 @@
# Appwrite SDK for Ruby

-
+
**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).**
diff --git a/app/sdks/ruby/lib/appwrite/services/users.rb b/app/sdks/ruby/lib/appwrite/services/users.rb
index eed594d004..b2ffc4fd0e 100644
--- a/app/sdks/ruby/lib/appwrite/services/users.rb
+++ b/app/sdks/ruby/lib/appwrite/services/users.rb
@@ -61,6 +61,18 @@ module Appwrite
}, params);
end
+ def update_user_prefs(user_id:, prefs:)
+ path = '/users/{userId}/prefs'
+ .gsub('{user_id}', user_id)
+
+ params = {
+ 'prefs': prefs
+ }
+
+ return @client.call('patch', path, {
+ }, params);
+ end
+
def get_user_sessions(user_id:)
path = '/users/{userId}/sessions'
.gsub('{user_id}', user_id)
@@ -83,7 +95,7 @@ module Appwrite
}, params);
end
- def delete_users_session(user_id:, session_id:)
+ def delete_user_session(user_id:, session_id:)
path = '/users/{userId}/sessions/:session'
.gsub('{user_id}', user_id)
diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php
index 8f2cd6043e..313b0fb776 100644
--- a/app/tasks/sdks.php
+++ b/app/tasks/sdks.php
@@ -45,16 +45,18 @@ $cli
'gitRepoName' => 'sdk-for-php',
'gitUserName' => 'appwrite',
'warning' => $warning,
+ 'readme' => false,
'platform' => 'server',
],
'js' => [
- 'version' => '1.0.22',
+ 'version' => '1.0.23',
'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' => [
@@ -65,6 +67,7 @@ $cli
'gitRepoName' => 'sdk-for-node',
'gitUserName' => 'appwrite',
'warning' => $warning,
+ 'readme' => false,
'platform' => 'server',
],
'python' => [
@@ -75,6 +78,7 @@ $cli
'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' => [
@@ -85,6 +89,7 @@ $cli
'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' => [
@@ -95,6 +100,7 @@ $cli
'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',
],
];
@@ -176,8 +182,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
->setShareURL('http://appwrite.io')
->setShareTags('JS,javascript,reactjs,angular,ios,android')
->setShareVia('appwrite_io')
- //->setWarning('**WORK IN PROGRESS - NOT READY FOR USAGE**')
->setWarning($client['warning'])
+ ->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : '')
;
$target = __DIR__.'/../sdks/git/'.$name;
diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml
index 6686cf5e52..25d67b62c7 100644
--- a/app/views/console/account/index.phtml
+++ b/app/views/console/account/index.phtml
@@ -238,7 +238,7 @@
data-event="submit"
data-success="trigger,redirect"
data-success-param-trigger-events="session-delete"
- data-success-redirect-url="/"
+ data-success-param-redirect-url="/"
data-failure="alert"
data-failure-param-alert-text="Logout from All Sessions Failed"
data-failure-param-alert-classname="error">
diff --git a/app/views/console/storage/index.phtml b/app/views/console/storage/index.phtml
index b0eb656e5c..ef37dbf8e9 100644
--- a/app/views/console/storage/index.phtml
+++ b/app/views/console/storage/index.phtml
@@ -1,3 +1,6 @@
+getParam('home', '');
+?>