1
0
Fork 0
mirror of synced 2024-10-01 09:47:43 +13:00

Merge branch 'master' into master

This commit is contained in:
Eldad A. Fux 2019-10-12 06:17:58 +03:00 committed by GitHub
commit 7e127f1e77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 2950 additions and 1135 deletions

View file

@ -1,5 +1,4 @@
app/db/SQL app/db/SQL
docs
node_modules node_modules
storage storage
public/scripts public/scripts

View file

@ -1,6 +1,6 @@
# Version 0.3.0 (PRE-RELEASE) # Version 0.3.0 (PRE-RELEASE) - PLANNED
## Planned Issues ## Features
* Added 7 new locales for locale service and email templates (af, ar, cz, hu, lt, no, ru, si, sv, ta, vi, zh-cn, zh-tw) * Added 7 new locales for locale service and email templates (af, ar, cz, hu, lt, no, ru, si, sv, ta, vi, zh-cn, zh-tw)
* New users service routes to allow updates pref and name update * New users service routes to allow updates pref and name update
@ -10,6 +10,11 @@
* Limit HTTP origin check only to browser integrations * Limit HTTP origin check only to browser integrations
* Allow electron apps to not pass origin header * Allow electron apps to not pass origin header
* New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK) * New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK)
* Added support for ES6 require statements in JS SDK
## Breaking Changs
* users/deleteUsersSession method name changed to users/deleteUserSession in all SDKs for better consistency
# Version 0.2.0 (PRE-RELEASE) # Version 0.2.0 (PRE-RELEASE)

View file

@ -30,7 +30,7 @@ Appwrite uses a package manager for managing code dependencies for both backend
Many of Appwrite's internal modules are also used as dependencies to allow other Appwrite's projects to reuse them and as a way to contribute them back to the community. Many of Appwrite's internal modules are also used as dependencies to allow other Appwrite's projects to reuse them and as a way to contribute them back to the community.
Appwrite uses PHPs Composer for managing dependencies on the server-side and JS NPM for managing dependencies on the frontend side. Appwrite uses PHP's Composer for managing dependencies on the server-side and JS NPM for managing dependencies on the frontend side.
## Coding Standards ## Coding Standards

View file

@ -78,6 +78,7 @@ RUN chmod 775 /entrypoint.sh
# add PHP files # add PHP files
COPY ./app /usr/share/nginx/html/app COPY ./app /usr/share/nginx/html/app
COPY ./docs /usr/share/nginx/html/docs
COPY ./public /usr/share/nginx/html/public COPY ./public /usr/share/nginx/html/public
COPY ./src /usr/share/nginx/html/src COPY ./src /usr/share/nginx/html/src
COPY ./vendor /usr/share/nginx/html/vendor COPY ./vendor /usr/share/nginx/html/vendor

View file

@ -66,7 +66,7 @@ Getting started with Appwrite is as easy as creating a new project, choosing you
* [**Database**](https://appwrite.io/docs/database) - Manage database collections and document. Read, create, update and delete documents and filter lists of documents collections using an advanced filter with graph-like capabilities. * [**Database**](https://appwrite.io/docs/database) - Manage database collections and document. Read, create, update and delete documents and filter lists of documents collections using an advanced filter with graph-like capabilities.
* [**Storage**](https://appwrite.io/docs/storage) - Manage storage files. Read, create, delete and preview files. Manipulate the preview of your files to fit your app perfectly. All files are scanned by ClamAV and stored in a secure and encrypted way. * [**Storage**](https://appwrite.io/docs/storage) - Manage storage files. Read, create, delete and preview files. Manipulate the preview of your files to fit your app perfectly. All files are scanned by ClamAV and stored in a secure and encrypted way.
* [**Locale**](https://appwrite.io/docs/locale) - Track user's location, and manage your app locale-based data. * [**Locale**](https://appwrite.io/docs/locale) - Track user's location, and manage your app locale-based data.
* [**Avatars**](https://appwrite.io/docs/avatars) - Manage your user's avatars, country's flags, browser icons, credit card symbols and generate QR codes. * [**Avatars**](https://appwrite.io/docs/avatars) - Manage your users' avatars, countries' flags, browser icons, credit card symbols and generate QR codes.
For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io). For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io).

View file

@ -72,7 +72,7 @@ $utopia->init(function () use ($utopia, $request, $response, $register, &$user,
//->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain) //->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain)
->addHeader('X-Content-Type-Options', 'nosniff') ->addHeader('X-Content-Type-Options', 'nosniff')
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version')
->addHeader('Access-Control-Allow-Origin', $refDomain) ->addHeader('Access-Control-Allow-Origin', $refDomain)
->addHeader('Access-Control-Allow-Credentials', 'true') ->addHeader('Access-Control-Allow-Credentials', 'true')
; ;
@ -251,7 +251,7 @@ $utopia->options(function () use ($request, $response, $domain, $project) {
$response $response
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-SDK-Version')
->addHeader('Access-Control-Allow-Origin', $origin) ->addHeader('Access-Control-Allow-Origin', $origin)
->addHeader('Access-Control-Allow-Credentials', 'true') ->addHeader('Access-Control-Allow-Credentials', 'true')
->send(); ->send();
@ -490,7 +490,7 @@ $utopia->get('/v1/open-api-2.json')
'url' => 'https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE', 'url' => 'https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE',
], ],
], ],
'host' => $request->getServer('_APP_HOME', $domain), 'host' => parse_url($request->getServer('_APP_HOME', $domain), PHP_URL_HOST),
'basePath' => '/v1', 'basePath' => '/v1',
'schemes' => ['https'], 'schemes' => ['https'],
'consumes' => ['application/json', 'multipart/form-data'], 'consumes' => ['application/json', 'multipart/form-data'],
@ -499,13 +499,13 @@ $utopia->get('/v1/open-api-2.json')
'Project' => [ 'Project' => [
'type' => 'apiKey', 'type' => 'apiKey',
'name' => 'X-Appwrite-Project', 'name' => 'X-Appwrite-Project',
'description' => 'Your Appwrite project ID. You can find your project ID in your Appwrite console project settings.', 'description' => 'Your Appwrite project ID',
'in' => 'header', 'in' => 'header',
], ],
'Key' => [ 'Key' => [
'type' => 'apiKey', 'type' => 'apiKey',
'name' => 'X-Appwrite-Key', 'name' => 'X-Appwrite-Key',
'description' => 'Your Appwrite project secret key. You can can create a new API key from your Appwrite console API keys dashboard.', 'description' => 'Your Appwrite project secret key',
'in' => 'header', 'in' => 'header',
], ],
'Locale' => [ 'Locale' => [
@ -590,7 +590,7 @@ $utopia->get('/v1/open-api-2.json')
'operationId' => $route->getLabel('sdk.method', uniqid()), 'operationId' => $route->getLabel('sdk.method', uniqid()),
'consumes' => [], 'consumes' => [],
'tags' => [$route->getLabel('sdk.namespace', 'default')], 'tags' => [$route->getLabel('sdk.namespace', 'default')],
'description' => $route->getLabel('sdk.description', ''), 'description' => file_get_contents(realpath(__DIR__ . '/..' . $route->getLabel('sdk.description', ''))),
'responses' => [ 'responses' => [
200 => [ 200 => [
'description' => 'An paged array of pets', 'description' => 'An paged array of pets',
@ -607,6 +607,7 @@ $utopia->get('/v1/open-api-2.json')
'cookies' => $route->getLabel('sdk.cookies', false), 'cookies' => $route->getLabel('sdk.cookies', false),
'location' => $route->getLabel('sdk.location', false), 'location' => $route->getLabel('sdk.location', false),
'demo' => 'docs/examples/'.fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.fromCamelCaseToDash($temp['operationId']).'.md', 'demo' => 'docs/examples/'.fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.fromCamelCaseToDash($temp['operationId']).'.md',
'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''),
]; ];
} }
@ -680,7 +681,7 @@ $utopia->get('/v1/open-api-2.json')
case 'Utopia\Validator\Range': /* @var $validator \Utopia\Validator\Range */ case 'Utopia\Validator\Range': /* @var $validator \Utopia\Validator\Range */
$node['type'] = 'integer'; $node['type'] = 'integer';
$node['format'] = 'int32'; $node['format'] = 'int32';
$node['x-example'] = rand($validator->getMin(), $validator->getMax()); $node['x-example'] = $validator->getMin();
break; break;
case 'Utopia\Validator\Numeric': case 'Utopia\Validator\Numeric':
$node['type'] = 'integer'; $node['type'] = 'integer';

View file

@ -38,12 +38,24 @@ $collections = [
'$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS,
'name' => 'Localhost (SSL)', 'name' => 'Localhost (SSL)',
'type' => 'web', 'type' => 'web',
'url' => 'https://'.$request->getServer('HTTP_HOST'), 'url' => 'https://localhost',
], ],
[ [
'$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS,
'name' => 'Localhost (Non-SSL)', 'name' => 'Localhost (Non-SSL)',
'type' => 'web', 'type' => 'web',
'url' => 'http://localhost',
],
[
'$collection' => Database::SYSTEM_COLLECTION_PLATFORMS,
'name' => 'Current Host (SSL)',
'type' => 'web',
'url' => 'https://'.$request->getServer('HTTP_HOST'),
],
[
'$collection' => Database::SYSTEM_COLLECTION_PLATFORMS,
'name' => 'Current Host (Non-SSL)',
'type' => 'web',
'url' => 'http://'.$request->getServer('HTTP_HOST'), 'url' => 'http://'.$request->getServer('HTTP_HOST'),
], ],
], ],

View file

@ -145,7 +145,7 @@ return [
'KP' => 'Corea del Norte', 'KP' => 'Corea del Norte',
'PT' => 'Portugal', 'PT' => 'Portugal',
'PY' => 'Paraguay', 'PY' => 'Paraguay',
'QA' => 'Katar', 'QA' => 'Catar',
'RO' => 'Rumania', 'RO' => 'Rumania',
'RU' => 'Rusia', 'RU' => 'Rusia',
'RW' => 'Ruanda', 'RW' => 'Ruanda',

View file

@ -1,7 +1,7 @@
<?php <?php
return [ return [
'AF' => 'अफ्रीका', 'AF' => 'अफ्रीका',
'AN' => 'अंटार्कटिका', 'AN' => 'अंटार्कटिका',
'AS' => 'एशिया', 'AS' => 'एशिया',
'EU' => 'यूरोप', 'EU' => 'यूरोप',

View file

@ -1,7 +1,7 @@
<?php <?php
return [ return [
'settings.inspire' => '"यह जान लेना की क्या अनदेखा किया जा सकता है, ही बुद्धिमता का प्रतीक है |"', // This is the line printed in the homepage and console 'view-source' 'settings.inspire' => '"बुद्धिमान होने की कला यह जानने की कला है कि क्या अनदेखा करना चाहिए |"', // This is the line printed in the homepage and console 'view-source'
'settings.locale' => 'hi', 'settings.locale' => 'hi',
'settings.direction' => 'ltr', 'settings.direction' => 'ltr',

View file

@ -0,0 +1,11 @@
<?php
return [
'AF' => 'アフリカ',
'AN' => '南極',
'AS' => 'アジア',
'EU' => 'ヨーロッパ',
'NA' => '北米',
'OC' => 'オセアニア',
'SA' => '南アメリカ',
];

View file

@ -0,0 +1,198 @@
<?php
return [
'AF' => 'アフガニスタン',
'AO' => 'アンゴラ',
'AL' => 'アルバニア',
'AD' => 'アンドラ',
'AE' => 'アラブ首長国連邦',
'AR' => 'アルゼンチン',
'AM' => 'アルメニア',
'AG' => 'アンチグアバーブーダ',
'AU' => 'オーストラリア',
'AT' => 'オーストリア',
'AZ' => 'アゼルバイジャン',
'BI' => 'ブルンディ',
'BE' => 'ベルギー',
'BJ' => 'ベニン',
'BF' => 'ブルキナファソ',
'BD' => 'バングラデシュ',
'BG' => 'ブルガリア',
'BH' => 'バーレーン',
'BS' => 'バハマ',
'BA' => 'ボスニア・ヘルツェゴビナ',
'BY' => 'ベラルーシ',
'BZ' => 'ベリーズ',
'BO' => 'ボリビア',
'BR' => 'ブラジル',
'BB' => 'バルバドス',
'BN' => 'ブルネイ',
'BT' => 'ブータン',
'BW' => 'ボツワナ',
'CF' => '中央アフリカ共和国',
'CA' => 'カナダ',
'CH' => 'スイス',
'CL' => 'チリ',
'CN' => '中国',
'CI' => 'コートジボワール',
'CM' => 'カメルーン',
'CD' => 'DRコンゴ',
'CG' => 'コンゴ共和国',
'CO' => 'コロンビア',
'KM' => 'コモロ',
'CV' => 'カーボベルデ',
'CR' => 'コスタリカ',
'CU' => 'キューバ',
'CY' => 'キプロス',
'CZ' => 'チェコ',
'DE' => 'ドイツ',
'DJ' => 'ジブチ',
'DM' => 'ドミニカ',
'DK' => 'デンマーク',
'DO' => 'ドミニカ共和国',
'DZ' => 'アルジェリア',
'EC' => 'エクアドル',
'EG' => 'エジプト',
'ER' => 'エリトリア',
'ES' => 'スペイン',
'EE' => 'エストニア',
'ET' => 'エチオピア',
'FI' => 'フィンランド',
'FJ' => 'フィジー',
'FR' => 'フランス',
'FM' => 'ミクロネシア',
'GA' => 'ガボン',
'GB' => 'イギリス',
'GE' => 'ジョージア',
'GH' => 'ガーナ',
'GN' => 'ギニア',
'GM' => 'ガンビア',
'GW' => 'ギニアビサウ',
'GQ' => '赤道ギニア',
'GR' => 'ギリシャ',
'GD' => 'グレナダ',
'GT' => 'グアテマラ',
'GY' => 'ガイアナ',
'HN' => 'ホンジュラス',
'HR' => 'クロアチア',
'HT' => 'ハイチ',
'HU' => 'ハンガリー',
'ID' => 'インドネシア',
'IN' => 'インド',
'IE' => 'アイルランド',
'IR' => 'イラン',
'IQ' => 'イラク',
'IS' => 'アイスランド',
'IL' => 'イスラエル',
'IT' => 'イタリア',
'JM' => 'ジャマイカ',
'JO' => 'ヨルダン',
'JP' => '日本',
'KZ' => 'カザフスタン',
'KE' => 'ケニア',
'KG' => 'キルギスタン',
'KH' => 'カンボジア',
'KI' => 'キリバティ',
'KN' => 'セントクリストファー・ネイビス',
'KR' => '韓国',
'KW' => 'クウェート',
'LA' => 'ラオス',
'LB' => 'レバノン',
'LR' => 'リベリア',
'LY' => 'リビア',
'LC' => 'セントルシア',
'LI' => 'リヒテンシュタイン',
'LK' => 'スリランカ',
'LS' => 'レソト',
'LT' => 'リトアニア',
'LU' => 'ルクセンブルク',
'LV' => 'ラトビア',
'MA' => 'モロッコ',
'MC' => 'モナコ',
'MD' => 'モルドバ',
'MG' => 'マダガスカル',
'MV' => 'モルディブ',
'MX' => 'メキシコ',
'MH' => 'マーシャル諸島',
'MK' => 'マケドニア',
'ML' => 'マリ',
'MT' => 'マルタ',
'MM' => 'ミャンマー',
'ME' => 'モンテネグロ',
'MN' => 'モンゴル',
'MZ' => 'モザンビーク',
'MR' => 'モーリタニア',
'MU' => 'モーリシャス',
'MW' => 'マラウィ',
'MY' => 'マレーシア',
'NA' => 'ナミビア',
'NE' => 'ニジェール',
'NG' => 'ナイジェリア',
'NI' => 'ニカラグア',
'NL' => 'オランダ',
'NO' => 'ノルウェー',
'NP' => 'ネパール',
'NR' => 'ナウル',
'NZ' => 'ニュージーランド',
'OM' => 'オマーン',
'PK' => 'パキスタン',
'PA' => 'パナマ',
'PE' => 'ペルー',
'PH' => 'フィリピン',
'PW' => 'パラオ',
'PG' => 'パプアニューギニア',
'PL' => 'ポーランド',
'KP' => '北朝鮮',
'PT' => 'ポルトガル',
'PY' => 'パラグアイ',
'QA' => 'カタール',
'RO' => 'ルーマニア',
'RU' => 'ロシア',
'RW' => 'ルワンダ',
'SA' => 'サウジアラビア',
'SD' => 'スーダン',
'SN' => 'セネガル',
'SG' => 'シンガポール',
'SB' => 'ソロモン諸島',
'SL' => 'シエラレオネ',
'SV' => 'エルサルバドル',
'SM' => 'サンマリノ',
'SO' => 'ソマリア',
'RS' => 'セルビア',
'SS' => '南スーダン',
'ST' => 'サントメとプリンシペ',
'SR' => 'スリナム',
'SK' => 'スロバキア',
'SI' => 'スロベニア',
'SE' => 'スウェーデン',
'SZ' => 'スワジランド',
'SC' => 'セイシェル',
'SY' => 'シリア',
'TD' => 'チャド',
'TG' => 'トーゴ',
'TH' => 'タイ',
'TJ' => 'タジキスタン',
'TM' => 'トルクメニスタン',
'TL' => '東ティモール民主共和国',
'TO' => 'トンガ',
'TT' => 'トリニダード・トバゴ',
'TN' => 'チュニジア',
'TR' => 'トルコ',
'TV' => 'ツバル',
'TZ' => 'タンザニア',
'UG' => 'ウガンダ',
'UA' => 'ウクライナ',
'UY' => 'ウルグアイ',
'US' => 'アメリカ',
'UZ' => 'ウズベキスタン',
'VA' => 'バチカン',
'VC' => 'セントビンセントおよびグレナディーン諸島',
'VE' => 'ベネズエラ',
'VN' => 'ベトナム',
'VU' => 'バヌアツ',
'WS' => 'サモア',
'YE' => 'イエメン',
'ZA' => '南アフリカ',
'ZM' => 'ザンビア',
'ZW' => 'ジンバブエ',
];

21
app/config/locale/ja.php Normal file
View file

@ -0,0 +1,21 @@
<?php
return [
'settings.inspire' => '"賢明になる術は何を捨てるべきかを心得る術である。"', // This is the line printed in the homepage and console 'view-source'
'settings.locale' => 'ja',
'settings.direction' => 'ltr',
// Service - Users
'auth.emails.team' => '%s チーム',
'auth.emails.confirm.title' => 'アカウント確認のお願い',
'auth.emails.confirm.body' => 'ja.email.auth.confirm.tpl',
'auth.emails.recovery.title' => 'パスワード再設定のお願い',
'auth.emails.recovery.body' => 'ja.email.auth.recovery.tpl',
'auth.emails.invitation.title' => '%s チーム(%s プロジェクト)への招待',
'auth.emails.invitation.body' => 'ja.email.auth.invitation.tpl',
'locale.country.unknown' => '不明',
'countries' => include 'ja.countries.php',
'continents' => include 'ja.continents.php',
];

View file

@ -1,11 +1,11 @@
<?php <?php
// When there are multiple alternative correct country names please follow https://sv.wikipedia.org/wiki/ISO_3166 // When there are multiple alternative correct country names please follow https://sv.wikipedia.org/wiki/ISO_3166
return [ return [
'AF' => 'Afganistan', 'AF' => 'Afghanistan',
'AO' => 'Angola', 'AO' => 'Angola',
'AL' => 'Albanien', 'AL' => 'Albanien',
'AD' => 'Andorra', 'AD' => 'Andorra',
'AE' => 'Förenade Arabemiraterna', 'AE' => 'Förenade Arabemiraten',
'AR' => 'Argentina', 'AR' => 'Argentina',
'AM' => 'Armenien', 'AM' => 'Armenien',
'AG' => 'Antigua och Barbuda', 'AG' => 'Antigua och Barbuda',
@ -21,13 +21,13 @@ return [
'BH' => 'Bahrain', 'BH' => 'Bahrain',
'BS' => 'Bahamas', 'BS' => 'Bahamas',
'BA' => 'Bosnien och Hercegovina', 'BA' => 'Bosnien och Hercegovina',
'BY' => 'Vitrysslnd', 'BY' => 'Vitryssland',
'BZ' => 'Belize', 'BZ' => 'Belize',
'BO' => 'Bolivien', 'BO' => 'Bolivia',
'BR' => 'Brasilien', 'BR' => 'Brasilien',
'BB' => 'Barbados', 'BB' => 'Barbados',
'BN' => 'Brune', 'BN' => 'Brunei',
'BT' => 'Butan', 'BT' => 'Bhutan',
'BW' => 'Botswana', 'BW' => 'Botswana',
'CF' => 'Centralafrikanska republiken', 'CF' => 'Centralafrikanska republiken',
'CA' => 'Kanada', 'CA' => 'Kanada',
@ -51,18 +51,18 @@ return [
'DK' => 'Danmark', 'DK' => 'Danmark',
'DO' => 'Dominikanska republiken', 'DO' => 'Dominikanska republiken',
'DZ' => 'Algeriet', 'DZ' => 'Algeriet',
'EC' => 'Ekvador', 'EC' => 'Ecuador',
'EG' => 'Egypten', 'EG' => 'Egypten',
'ER' => 'Eritrea', 'ER' => 'Eritrea',
'ES' => 'Spanien', 'ES' => 'Spanien',
'EE' => 'Estonia', 'EE' => 'Estland',
'ET' => 'Etiopien', 'ET' => 'Etiopien',
'FI' => 'Finland', 'FI' => 'Finland',
'FJ' => 'Fiji', 'FJ' => 'Fiji',
'FR' => 'Frankrike', 'FR' => 'Frankrike',
'FM' => 'Mikronesien', 'FM' => 'Mikronesien',
'GA' => 'Gabon', 'GA' => 'Gabon',
'GB' => 'Storbrittannien', 'GB' => 'Storbritannien',
'GE' => 'Georgien', 'GE' => 'Georgien',
'GH' => 'Ghana', 'GH' => 'Ghana',
'GN' => 'Guinea', 'GN' => 'Guinea',
@ -98,7 +98,7 @@ return [
'KW' => 'Kuwait', 'KW' => 'Kuwait',
'LA' => 'Laos', 'LA' => 'Laos',
'LB' => 'Libanon', 'LB' => 'Libanon',
'LR' => 'Liberien', 'LR' => 'Liberia',
'LY' => 'Libyen', 'LY' => 'Libyen',
'LC' => 'Saint Lucia', 'LC' => 'Saint Lucia',
'LI' => 'Liechtenstein', 'LI' => 'Liechtenstein',
@ -106,22 +106,22 @@ return [
'LS' => 'Lesotho', 'LS' => 'Lesotho',
'LT' => 'Litauen', 'LT' => 'Litauen',
'LU' => 'Luxemburg', 'LU' => 'Luxemburg',
'LV' => 'Latvien', 'LV' => 'Lettland',
'MA' => 'Marocko', 'MA' => 'Marocko',
'MC' => 'Monaco', 'MC' => 'Monaco',
'MD' => 'Moldavien', 'MD' => 'Moldavien',
'MG' => 'Madagaskar', 'MG' => 'Madagaskar',
'MV' => 'Maldiverna', 'MV' => 'Maldiverna',
'MX' => 'Mexiko', 'MX' => 'Mexiko',
'MH' => 'Marshall Islands', 'MH' => 'Marshallöarna',
'MK' => 'Nordmakedonien', 'MK' => 'Nordmakedonien',
'ML' => 'Mali', 'ML' => 'Mali',
'MT' => 'Malta', 'MT' => 'Malta',
'MM' => 'Myanmar', 'MM' => 'Myanmar',
'ME' => 'Montenegro', 'ME' => 'Montenegro',
'MN' => 'Mongolien', 'MN' => 'Mongoliet',
'MZ' => 'Moçambique', 'MZ' => 'Moçambique',
'MR' => 'Mauritanien', 'MR' => 'Mauretanien',
'MU' => 'Mauritius', 'MU' => 'Mauritius',
'MW' => 'Malawi', 'MW' => 'Malawi',
'MY' => 'Malaysia', 'MY' => 'Malaysia',
@ -133,14 +133,14 @@ return [
'NO' => 'Norge', 'NO' => 'Norge',
'NP' => 'Nepal', 'NP' => 'Nepal',
'NR' => 'Nauru', 'NR' => 'Nauru',
'NZ' => 'Nya Zealand', 'NZ' => 'Nya Zeeland',
'OM' => 'Oman', 'OM' => 'Oman',
'PK' => 'Pakistan', 'PK' => 'Pakistan',
'PA' => 'Panama', 'PA' => 'Panama',
'PE' => 'Peru', 'PE' => 'Peru',
'PH' => 'Filppinerna', 'PH' => 'Filippinerna',
'PW' => 'Palau', 'PW' => 'Palau',
'PG' => 'Papua New Guinea', 'PG' => 'Papua Nya Guinea',
'PL' => 'Polen', 'PL' => 'Polen',
'KP' => 'Nordkorea', 'KP' => 'Nordkorea',
'PT' => 'Portugal', 'PT' => 'Portugal',
@ -152,12 +152,12 @@ return [
'SA' => 'Saudiarabien', 'SA' => 'Saudiarabien',
'SD' => 'Sudan', 'SD' => 'Sudan',
'SN' => 'Senegal', 'SN' => 'Senegal',
'SG' => 'Singapor', 'SG' => 'Singapore',
'SB' => 'Solomonöarna', 'SB' => 'Salomonöarna',
'SL' => 'Sierra Leone', 'SL' => 'Sierra Leone',
'SV' => 'El Salvador', 'SV' => 'El Salvador',
'SM' => 'San Marino', 'SM' => 'San Marino',
'SO' => 'Somalien', 'SO' => 'Somalia',
'RS' => 'Serbien', 'RS' => 'Serbien',
'SS' => 'Sydsudan', 'SS' => 'Sydsudan',
'ST' => 'São Tomé och Príncipe', 'ST' => 'São Tomé och Príncipe',

View file

@ -1,7 +1,7 @@
<?php <?php
return [ return [
'settings.inspire' => '"The art of being wise is the art of knowing what to overlook."', // This is the line printed in the homepage and console 'view-source' 'settings.inspire' => '"Vishet är konsten att förstå vad man ska förbise."', // This is the line printed in the homepage and console 'view-source'
'settings.locale' => 'sv', 'settings.locale' => 'sv',
'settings.direction' => 'ltr', 'settings.direction' => 'ltr',

View file

@ -10,7 +10,7 @@
नमस्ते, नमस्ते,
<br /> <br />
<br /> <br />
यह मेल आपको इसलिए भेजा गया था क्योंकि <b>{{owner}}</b> आपको टीम मेंबर बनने के लिए आमंत्रित करना चाहता है <b>{{team}}</b> टीम के लिए {{project}} प्रोजेक्ट पर यह मेल आपको इसलिए भेजा गया था क्योंकि <b>{{owner}}</b> आपको {{project}} के लिए <b>{{team}}</b> टीम में टीम मेंबर बनने के लिए आमंत्रित करना चाहते थे।
<br /> <br />
<br /> <br />
टीम <b>{{team}}</b> ज्वाइन करने के लिए इस लिंक पर क्लिक करे : टीम <b>{{team}}</b> ज्वाइन करने के लिए इस लिंक पर क्लिक करे :

View file

@ -10,7 +10,7 @@
नमस्ते {{name}}, नमस्ते {{name}},
<br /> <br />
<br /> <br />
{{project}} का पासवर्ड रिसेट करने के लिए लिंक पर क्लिक करे {{project}} का पासवर्ड रिसेट करने के लिए इस लिंक पर क्लिक करे
<br /> <br />
<a href="{{redirect}}">{{redirect}}</a> <a href="{{redirect}}">{{redirect}}</a>
<br /> <br />

View file

@ -0,0 +1,24 @@
<style>
* {
font-family: sans-serif,Arial;
-webkit-font-smoothing: antialiased;
font-weight: lighter;
}
</style>
<div style="direction: {{direction}}">
{{name}}さん こんにちは。
<br />
<br />
下記のリンクからメールアドレスを認証してください。
<br />
<a href="{{redirect}}">{{redirect}}</a>
<br />
<br />
お手数ですが、心当たりがない場合このメールを破棄してください。
<br />
<br />
ありがとうございます。
<br />
{{project}} チーム
</div>

View file

@ -0,0 +1,27 @@
<style>
* {
font-family: sans-serif,Arial;
-webkit-font-smoothing: antialiased;
font-weight: lighter;
}
</style>
<div style="direction: {{direction}}">
こんにちは。
<br />
<br />
<b>{{owner}}</b> さんから {{project}} プロジェクトの <b>{{team}}</b> チームへの参加招待が届きました。
<br />
<br />
下記のリンクから <b>{{team}}</b> へ参加してください。
<br />
<a href="{{redirect}}">{{redirect}}</a>
<br />
<br />
お手数ですが、心当たりがない場合このメールを破棄してください。
<br />
<br />
ありがとうございます。
<br />
{{project}} チーム
</div>

View file

@ -0,0 +1,24 @@
<style>
* {
font-family: sans-serif,Arial;
-webkit-font-smoothing: antialiased;
font-weight: lighter;
}
</style>
<div style="direction: {{direction}}">
{{name}}さん こんにちは。
<br />
<br />
下記のリンクから {{project}} プロジェクトのパスワードを再設定してください。
<br />
<a href="{{redirect}}">{{redirect}}</a>
<br />
<br />
お手数ですが、心当たりがない場合このメールを破棄してください。
<br />
<br />
ありがとうございます。
<br />
{{project}} チーム
</div>

View file

@ -15,10 +15,10 @@
<a href="{{redirect}}">{{redirect}}</a> <a href="{{redirect}}">{{redirect}}</a>
<br /> <br />
<br /> <br />
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.
<br /> <br />
<br /> <br />
Atenciosamente, Atenciosamente,
<br /> <br />
Equipe {{project}} Equipe {{project}}
</div> </div>

View file

@ -10,15 +10,15 @@
Olá, Olá,
<br /> <br />
<br /> <br />
Este email foi enviado a você porque <br>{{owner}} deseja convida-lo para se tornar membro da equipe <b>{{team}}<b> no {{project}}. Este email foi enviado a você porque <br>{{owner}} deseja convidá-lo para se tornar membro da equipe <b>{{team}}<b> no {{project}}.
<br /> <br />
<br /> <br />
Siga o link abaixo para se juntar a equipe <b>{{team}}<b>: Entre no link abaixo para se juntar a equipe <b>{{team}}<b>:
<br /> <br />
<a href="{{redirect}}">{{redirect}}</a> <a href="{{redirect}}">{{redirect}}</a>
<br /> <br />
<br /> <br />
Se não estiver interessado, por favor ignore esta mensagem. Caso não estiver interessado, por favor ignore esta mensagem.
<br /> <br />
<br /> <br />
Atenciosamente, Atenciosamente,

View file

@ -15,7 +15,7 @@
<a href="{{redirect}}">{{redirect}}</a> <a href="{{redirect}}">{{redirect}}</a>
<br /> <br />
<br /> <br />
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.
<br /> <br />
<br /> <br />
Atenciosamente, Atenciosamente,

View file

@ -10,7 +10,7 @@
Olá, Olá,
<br /> <br />
<br /> <br />
Recebeu este email porque <br>{{owner}} deseja convida-lo a tornar-se membro da equipa <b>{{team}}<b> no {{project}}. Recebeu este email porque <br>{{owner}} deseja convidá-lo a tornar-se membro da equipa <b>{{team}}<b> no {{project}}.
<br /> <br />
<br /> <br />
Use este link para se juntar à equipa <b>{{team}}<b>: Use este link para se juntar à equipa <b>{{team}}<b>:
@ -23,5 +23,5 @@
<br /> <br />
Com os melhores cumprimentos, Com os melhores cumprimentos,
<br /> <br />
Equipe {{project}} Equipa {{project}}
</div> </div>

View file

@ -15,7 +15,7 @@
<a href="{{redirect}}">{{redirect}}</a> <a href="{{redirect}}">{{redirect}}</a>
<br /> <br />
<br /> <br />
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.
<br /> <br />
<br /> <br />
Tack, Tack,

View file

@ -13,31 +13,31 @@ return [
], ],
'v1/account' => [ 'v1/account' => [
'name' => 'Account', 'name' => 'Account',
'description' => '/docs/service/account.md', 'description' => '/docs/services/account.md',
'controller' => 'controllers/account.php', 'controller' => 'controllers/account.php',
'sdk' => true, 'sdk' => true,
], ],
'v1/auth' => [ // Add to docs later: You can also learn how to [configure support for our supported OAuth providers](/docs/oauth) 'v1/auth' => [ // Add to docs later: You can also learn how to [configure support for our supported OAuth providers](/docs/oauth)
'name' => 'Auth', 'name' => 'Auth',
'description' => '/docs/service/auth.md', 'description' => '/docs/services/auth.md',
'controller' => 'controllers/auth.php', 'controller' => 'controllers/auth.php',
'sdk' => true, 'sdk' => true,
], ],
'v1/avatars' => [ 'v1/avatars' => [
'name' => 'Avatars', 'name' => 'Avatars',
'description' => '/docs/service/avatars.md', 'description' => '/docs/services/avatars.md',
'controller' => 'controllers/avatars.php', 'controller' => 'controllers/avatars.php',
'sdk' => true, 'sdk' => true,
], ],
'v1/database' => [ 'v1/database' => [
'name' => 'Database', 'name' => 'Database',
'description' => '/docs/service/database.md', 'description' => '/docs/services/database.md',
'controller' => 'controllers/database.php', 'controller' => 'controllers/database.php',
'sdk' => true, 'sdk' => true,
], ],
'v1/locale' => [ 'v1/locale' => [
'name' => 'Locale', 'name' => 'Locale',
'description' => '/docs/service/locale.md', 'description' => '/docs/services/locale.md',
'controller' => 'controllers/locale.php', 'controller' => 'controllers/locale.php',
'sdk' => true, 'sdk' => true,
], ],
@ -53,19 +53,19 @@ return [
], ],
'v1/storage' => [ 'v1/storage' => [
'name' => 'Storage', 'name' => 'Storage',
'description' => '/docs/service/storage.md', 'description' => '/docs/services/storage.md',
'controller' => 'controllers/storage.php', 'controller' => 'controllers/storage.php',
'sdk' => true, 'sdk' => true,
], ],
'v1/teams' => [ 'v1/teams' => [
'name' => 'Teams', 'name' => 'Teams',
'description' => '/docs/service/teams.md', 'description' => '/docs/services/teams.md',
'controller' => 'controllers/teams.php', 'controller' => 'controllers/teams.php',
'sdk' => true, 'sdk' => true,
], ],
'v1/users' => [ 'v1/users' => [
'name' => 'Users', 'name' => 'Users',
'description' => '/docs/service/users.md', 'description' => '/docs/services/users.md',
'controller' => 'controllers/users.php', 'controller' => 'controllers/users.php',
'sdk' => true, 'sdk' => true,
], ],

View file

@ -18,7 +18,7 @@ $utopia->get('/v1/account')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'get') ->label('sdk.method', 'get')
->label('sdk.description', 'Get currently logged in user data as JSON object.') ->label('sdk.description', '/docs/references/account/get.md')
->action( ->action(
function () use ($response, &$user, $providers) { function () use ($response, &$user, $providers) {
$oauthKeys = []; $oauthKeys = [];
@ -50,7 +50,7 @@ $utopia->get('/v1/account/prefs')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'getPrefs') ->label('sdk.method', 'getPrefs')
->label('sdk.description', 'Get currently logged in user preferences key-value object.') ->label('sdk.description', '/docs/references/account/get-prefs.md')
->action( ->action(
function () use ($response, $user) { function () use ($response, $user) {
$prefs = $user->getAttribute('prefs', '{}'); $prefs = $user->getAttribute('prefs', '{}');
@ -74,7 +74,7 @@ $utopia->get('/v1/account/sessions')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'getSessions') ->label('sdk.method', 'getSessions')
->label('sdk.description', 'Get currently logged in user list of active sessions across different devices.') ->label('sdk.description', '/docs/references/account/get-sessions.md')
->action( ->action(
function () use ($response, $user) { function () use ($response, $user) {
$tokens = $user->getAttribute('tokens', []); $tokens = $user->getAttribute('tokens', []);
@ -131,7 +131,7 @@ $utopia->get('/v1/account/security')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'getSecurity') ->label('sdk.method', 'getSecurity')
->label('sdk.description', 'Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.') ->label('sdk.description', '/docs/references/account/get-security.md')
->action( ->action(
function () use ($response, $register, $project, $user) { function () use ($response, $register, $project, $user) {
$ad = new \Audit\Adapter\MySQL($register->get('db')); $ad = new \Audit\Adapter\MySQL($register->get('db'));
@ -201,7 +201,7 @@ $utopia->patch('/v1/account/name')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'updateName') ->label('sdk.method', 'updateName')
->label('sdk.description', 'Update currently logged in user account name.') ->label('sdk.description', '/docs/references/account/update-name.md')
->param('name', '', function () { return new Text(100); }, 'User name') ->param('name', '', function () { return new Text(100); }, 'User name')
->action( ->action(
function ($name) use ($response, $user, $projectDB, $audit) { function ($name) use ($response, $user, $projectDB, $audit) {
@ -225,7 +225,7 @@ $utopia->patch('/v1/account/password')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'updatePassword') ->label('sdk.method', 'updatePassword')
->label('sdk.description', 'Update currently logged in user password. For validation, user is required to pass the password twice.') ->label('sdk.description', '/docs/references/account/update-password.md')
->param('password', '', function () { return new Password(); }, 'New password') ->param('password', '', function () { return new Password(); }, 'New password')
->param('old-password', '', function () { return new Password(); }, 'Old password') ->param('old-password', '', function () { return new Password(); }, 'Old password')
->action( ->action(
@ -254,7 +254,7 @@ $utopia->patch('/v1/account/email')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'updateEmail') ->label('sdk.method', 'updateEmail')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/account/update-email.md')
->param('email', '', function () { return new Email(); }, 'Email Address') ->param('email', '', function () { return new Email(); }, 'Email Address')
->param('password', '', function () { return new Password(); }, 'User Password') ->param('password', '', function () { return new Password(); }, 'User Password')
->action( ->action(
@ -299,7 +299,7 @@ $utopia->patch('/v1/account/prefs')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'updatePrefs') ->label('sdk.method', 'updatePrefs')
->param('prefs', '', function () { return new \Utopia\Validator\Mock();}, 'Prefs key-value JSON object string.') ->param('prefs', '', function () { return new \Utopia\Validator\Mock();}, 'Prefs key-value JSON object string.')
->label('sdk.description', 'Update currently logged in user account preferences. You can pass only the specific settings you wish to update.') ->label('sdk.description', '/docs/references/account/update-prefs.md')
->action( ->action(
function ($prefs) use ($response, $user, $projectDB, $audit) { function ($prefs) use ($response, $user, $projectDB, $audit) {
$user = $projectDB->updateDocument(array_merge($user->getArrayCopy(), [ $user = $projectDB->updateDocument(array_merge($user->getArrayCopy(), [
@ -322,7 +322,7 @@ $utopia->delete('/v1/account')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'delete') ->label('sdk.method', 'delete')
->label('sdk.description', 'Delete currently logged in user account.') ->label('sdk.description', '/docs/references/account/delete.md')
->action( ->action(
function () use ($response, $request, $user, $projectDB, $audit) { function () use ($response, $request, $user, $projectDB, $audit) {
$user = $projectDB->updateDocument(array_merge($user->getArrayCopy(), [ $user = $projectDB->updateDocument(array_merge($user->getArrayCopy(), [

View file

@ -24,7 +24,7 @@ $utopia->post('/v1/auth/register')
->label('scope', 'auth') ->label('scope', 'auth')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'register') ->label('sdk.method', 'register')
->label('sdk.description', '/docs/refernces/register.md') ->label('sdk.description', '/docs/references/auth/register.md')
->label('sdk.cookies', true) ->label('sdk.cookies', true)
->label('abuse-limit', 10) ->label('abuse-limit', 10)
->param('email', '', function () { return new Email(); }, 'Account email') ->param('email', '', function () { return new Email(); }, 'Account email')
@ -190,7 +190,7 @@ $utopia->post('/v1/auth/register/confirm')
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'confirm') ->label('sdk.method', 'confirm')
->label('sdk.description', '/docs/refernces/confirm.md') ->label('sdk.description', '/docs/references/auth/confirm.md')
->label('abuse-limit', 10) ->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}') ->label('abuse-key', 'url:{url},userId:{param-userId}')
->param('userId', '', function () { return new UID(); }, 'User unique ID') ->param('userId', '', function () { return new UID(); }, 'User unique ID')
@ -240,7 +240,7 @@ $utopia->post('/v1/auth/register/confirm/resend')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'confirmResend') ->label('sdk.method', 'confirmResend')
->label('sdk.description', '/docs/refernces/confirm-resend.md') ->label('sdk.description', '/docs/references/auth/confirm-resend.md')
->label('abuse-limit', 10) ->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}') ->label('abuse-key', 'url:{url},userId:{param-userId}')
->param('confirm', '', function () use ($clients) { return new Host($clients); }, 'Confirmation URL to redirect user to your app after confirm token has been sent to user email.') ->param('confirm', '', function () use ($clients) { return new Host($clients); }, 'Confirmation URL to redirect user to your app after confirm token has been sent to user email.')
@ -304,7 +304,7 @@ $utopia->post('/v1/auth/login')
->label('scope', 'auth') ->label('scope', 'auth')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'login') ->label('sdk.method', 'login')
->label('sdk.description', '/docs/refernces/login.md') ->label('sdk.description', '/docs/references/auth/login.md')
->label('sdk.cookies', true) ->label('sdk.cookies', true)
->label('abuse-limit', 10) ->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}') ->label('abuse-key', 'url:{url},email:{param-email}')
@ -389,7 +389,7 @@ $utopia->delete('/v1/auth/logout')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'logout') ->label('sdk.method', 'logout')
->label('sdk.description', '/docs/refernces/logout.md') ->label('sdk.description', '/docs/references/auth/logout.md')
->label('abuse-limit', 100) ->label('abuse-limit', 100)
->action( ->action(
function () use ($response, $request, $user, $projectDB, $audit, $webhook) { function () use ($response, $request, $user, $projectDB, $audit, $webhook) {
@ -420,7 +420,7 @@ $utopia->delete('/v1/auth/logout/:id')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'logoutBySession') ->label('sdk.method', 'logoutBySession')
->label('sdk.description', '/docs/refernces/logout-by-session.md') ->label('sdk.description', '/docs/references/auth/logout-by-session.md')
->label('abuse-limit', 100) ->label('abuse-limit', 100)
->param('id', null, function () { return new UID(); }, 'User specific session unique ID number. if 0 delete all sessions.') ->param('id', null, function () { return new UID(); }, 'User specific session unique ID number. if 0 delete all sessions.')
->action( ->action(
@ -453,7 +453,7 @@ $utopia->post('/v1/auth/recovery')
->label('scope', 'auth') ->label('scope', 'auth')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'recovery') ->label('sdk.method', 'recovery')
->label('sdk.description', '/docs/refernces/recovery.md') ->label('sdk.description', '/docs/references/auth/recovery.md')
->label('abuse-limit', 10) ->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}') ->label('abuse-key', 'url:{url},email:{param-email}')
->param('email', '', function () { return new Email(); }, 'User account email address.') ->param('email', '', function () { return new Email(); }, 'User account email address.')
@ -533,7 +533,7 @@ $utopia->put('/v1/auth/recovery/reset')
->label('scope', 'auth') ->label('scope', 'auth')
->label('sdk.namespace', 'auth') ->label('sdk.namespace', 'auth')
->label('sdk.method', 'recoveryReset') ->label('sdk.method', 'recoveryReset')
->label('sdk.description', '/docs/refernces/recovery-reset.md') ->label('sdk.description', '/docs/references/auth/recovery-reset.md')
->label('abuse-limit', 10) ->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}') ->label('abuse-key', 'url:{url},userId:{param-userId}')
->param('userId', '', function () { return new UID(); }, 'User account email address.') ->param('userId', '', function () { return new UID(); }, 'User account email address.')

View file

@ -1,6 +1,6 @@
<?php <?php
global $utopia, $request, $response; global $utopia, $request, $response, $version;
use Utopia\Exception; use Utopia\Exception;
use Utopia\Validator\Text; use Utopia\Validator\Text;
@ -94,7 +94,7 @@ $utopia->get('/v1/avatars/credit-cards/:code')
->label('scope', 'avatars.read') ->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars') ->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getCreditCard') ->label('sdk.method', 'getCreditCard')
->label('sdk.description', '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.') ->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); ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('credit-cards', $code, $width, $height, $quality);
}); });
@ -107,7 +107,7 @@ $utopia->get('/v1/avatars/browsers/:code')
->label('scope', 'avatars.read') ->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars') ->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getBrowser') ->label('sdk.method', 'getBrowser')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/avatars/get-browser.md')
->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('browsers', $code, $width, $height, $quality); ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('browsers', $code, $width, $height, $quality);
}); });
@ -120,7 +120,7 @@ $utopia->get('/v1/avatars/flags/:code')
->label('scope', 'avatars.read') ->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars') ->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getFlag') ->label('sdk.method', 'getFlag')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/avatars/get-flag.md')
->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('flags', $code, $width, $height, $quality); ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('flags', $code, $width, $height, $quality);
}); });
@ -132,9 +132,9 @@ $utopia->get('/v1/avatars/image')
->label('scope', 'avatars.read') ->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars') ->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getImage') ->label('sdk.method', 'getImage')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/avatars/get-image.md')
->action( ->action(
function ($url, $width, $height) use ($response, $request, $version) { function ($url, $width, $height) use ($response) {
$quality = 80; $quality = 80;
$output = 'png'; $output = 'png';
$date = date('D, d M Y H:i:s', time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache $date = date('D, d M Y H:i:s', time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache
@ -197,9 +197,9 @@ $utopia->get('/v1/avatars/favicon')
->label('scope', 'avatars.read') ->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars') ->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getFavicon') ->label('sdk.method', 'getFavicon')
->label('sdk.description', 'Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.') ->label('sdk.description', '/docs/references/avatars/get-favicon.md')
->action( ->action(
function ($url) use ($response, $request, $version) { function ($url) use ($response, $version) {
$width = 56; $width = 56;
$height = 56; $height = 56;
$quality = 80; $quality = 80;
@ -349,7 +349,7 @@ $utopia->get('/v1/avatars/qr')
->label('scope', 'avatars.read') ->label('scope', 'avatars.read')
->label('sdk.namespace', 'avatars') ->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getQR') ->label('sdk.method', 'getQR')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/avatars/get-qr.md')
->action( ->action(
function ($text, $size, $margin, $download) use ($response) { function ($text, $size, $margin, $download) use ($response) {
$renderer = new ImageRenderer( $renderer = new ImageRenderer(

View file

@ -26,7 +26,7 @@ $utopia->get('/v1/database')
->label('scope', 'collections.read') ->label('scope', 'collections.read')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'listCollections') ->label('sdk.method', 'listCollections')
->label('sdk.description', '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).') ->label('sdk.description', '/docs/references/database/list-collections.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, function () { return new Range(0, 40000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('offset', 0, function () { return new Range(0, 40000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
@ -73,7 +73,7 @@ $utopia->get('/v1/database/:collectionId')
->label('scope', 'collections.read') ->label('scope', 'collections.read')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'getCollection') ->label('sdk.method', 'getCollection')
->label('sdk.description', 'Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.') ->label('sdk.description', '/docs/references/database/get-collection.md')
->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
->action( ->action(
function ($collectionId) use ($response, $projectDB) { function ($collectionId) use ($response, $projectDB) {
@ -93,7 +93,7 @@ $utopia->post('/v1/database')
->label('scope', 'collections.write') ->label('scope', 'collections.write')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'createCollection') ->label('sdk.method', 'createCollection')
->label('sdk.description', 'Create a new Collection.') ->label('sdk.description', '/docs/references/database/create-collection.md')
->param('name', '', function () { return new Text(256); }, 'Collection name.') ->param('name', '', function () { return new Text(256); }, 'Collection name.')
->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -160,7 +160,7 @@ $utopia->put('/v1/database/:collectionId')
->label('scope', 'collections.write') ->label('scope', 'collections.write')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'updateCollection') ->label('sdk.method', 'updateCollection')
->label('sdk.description', 'Update collection by its unique ID.') ->label('sdk.description', '/docs/references/database/update-collection.md')
->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
->param('name', null, function () { return new Text(256); }, 'Collection name.') ->param('name', null, function () { return new Text(256); }, 'Collection name.')
->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -210,7 +210,7 @@ $utopia->delete('/v1/database/:collectionId')
->label('scope', 'collections.write') ->label('scope', 'collections.write')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'deleteCollection') ->label('sdk.method', 'deleteCollection')
->label('sdk.description', 'Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.') ->label('sdk.description', '/docs/references/database/delete-collection.md')
->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
->action( ->action(
function ($collectionId) use ($response, $projectDB, $audit) { function ($collectionId) use ($response, $projectDB, $audit) {
@ -239,7 +239,7 @@ $utopia->get('/v1/database/:collectionId/documents')
->label('scope', 'documents.read') ->label('scope', 'documents.read')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'listDocuments') ->label('sdk.method', 'listDocuments')
->label('sdk.description', '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).') ->label('sdk.description', '/docs/references/database/list-documents.md')
->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID.') ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID.')
->param('filters', [], function () { return new ArrayList(new Text(128)); }, 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$uid>=5bed2d152c362\'', true) ->param('filters', [], function () { return new ArrayList(new Text(128)); }, 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$uid>=5bed2d152c362\'', true)
->param('offset', 0, function () { return new Range(0, 900000000); }, 'Offset value. Use this value to manage pagination.', true) ->param('offset', 0, function () { return new Range(0, 900000000); }, 'Offset value. Use this value to manage pagination.', true)
@ -305,7 +305,7 @@ $utopia->get('/v1/database/:collectionId/documents/:documentId')
->label('scope', 'documents.read') ->label('scope', 'documents.read')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'getDocument') ->label('sdk.method', 'getDocument')
->label('sdk.description', 'Get document by its unique ID. This endpoint response returns a JSON object with the document data.') ->label('sdk.description', '/docs/references/database/get-document.md')
->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID') ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID')
->param('documentId', null, function () { return new UID(); }, 'Document unique ID') ->param('documentId', null, function () { return new UID(); }, 'Document unique ID')
->action( ->action(
@ -350,7 +350,7 @@ $utopia->post('/v1/database/:collectionId/documents')
->label('scope', 'documents.write') ->label('scope', 'documents.write')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'createDocument') ->label('sdk.method', 'createDocument')
->label('sdk.description', 'Create a new Document.') ->label('sdk.description', '/docs/references/database/create-document.md')
->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID.') ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID.')
->param('data', [], function () { return new \Utopia\Validator\Mock(); }, 'Document data as JSON string.') ->param('data', [], function () { return new \Utopia\Validator\Mock(); }, 'Document data as JSON string.')
->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -456,6 +456,7 @@ $utopia->patch('/v1/database/:collectionId/documents/:documentId')
->label('scope', 'documents.write') ->label('scope', 'documents.write')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'updateDocument') ->label('sdk.method', 'updateDocument')
->label('sdk.description', '/docs/references/database/update-document.md')
->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID') ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID')
->param('documentId', null, function () { return new UID(); }, 'Document unique ID') ->param('documentId', null, function () { return new UID(); }, 'Document unique ID')
->param('data', [], function () { return new \Utopia\Validator\Mock(); }, 'Document data as JSON string') ->param('data', [], function () { return new \Utopia\Validator\Mock(); }, 'Document data as JSON string')
@ -532,7 +533,7 @@ $utopia->delete('/v1/database/:collectionId/documents/:documentId')
->label('scope', 'documents.write') ->label('scope', 'documents.write')
->label('sdk.namespace', 'database') ->label('sdk.namespace', 'database')
->label('sdk.method', 'deleteDocument') ->label('sdk.method', 'deleteDocument')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/database/delete-document.md')
->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID') ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID')
->param('documentId', null, function () { return new UID(); }, 'Document unique ID') ->param('documentId', null, function () { return new UID(); }, 'Document unique ID')
->action( ->action(

View file

@ -11,7 +11,7 @@ $utopia->get('/v1/locale')
->label('scope', 'locale.read') ->label('scope', 'locale.read')
->label('sdk.namespace', 'locale') ->label('sdk.namespace', 'locale')
->label('sdk.method', 'getLocale') ->label('sdk.method', 'getLocale')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/locale/get-locale.md')
->action( ->action(
function () use ($response, $request, $utopia) { function () use ($response, $request, $utopia) {
$eu = include __DIR__.'/../config/eu.php'; $eu = include __DIR__.'/../config/eu.php';
@ -68,7 +68,7 @@ $utopia->get('/v1/locale/countries')
->label('scope', 'locale.read') ->label('scope', 'locale.read')
->label('sdk.namespace', 'locale') ->label('sdk.namespace', 'locale')
->label('sdk.method', 'getCountries') ->label('sdk.method', 'getCountries')
->label('sdk.description', 'List of all countries. You can use the locale header to get the data in supported language.') ->label('sdk.description', '/docs/references/locale/get-countries.md')
->action( ->action(
function () use ($response, $request) { function () use ($response, $request) {
$list = Locale::getText('countries'); /* @var $list array */ $list = Locale::getText('countries'); /* @var $list array */
@ -84,7 +84,7 @@ $utopia->get('/v1/locale/countries/eu')
->label('scope', 'locale.read') ->label('scope', 'locale.read')
->label('sdk.namespace', 'locale') ->label('sdk.namespace', 'locale')
->label('sdk.method', 'getCountriesEU') ->label('sdk.method', 'getCountriesEU')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/locale/get-countries-eu.md')
->action( ->action(
function () use ($response) { function () use ($response) {
$countries = Locale::getText('countries'); /* @var $countries array */ $countries = Locale::getText('countries'); /* @var $countries array */
@ -108,7 +108,7 @@ $utopia->get('/v1/locale/countries/phones')
->label('scope', 'locale.read') ->label('scope', 'locale.read')
->label('sdk.namespace', 'locale') ->label('sdk.namespace', 'locale')
->label('sdk.method', 'getCountriesPhones') ->label('sdk.method', 'getCountriesPhones')
->label('sdk.description', 'List of all countries phone codes. You can use the locale header to get the data in supported language.') ->label('sdk.description', '/docs/references/locale/get-countries-phones.md')
->action( ->action(
function () use ($response) { function () use ($response) {
$list = include __DIR__.'/../config/phones.php'; /* @var $list array */ $list = include __DIR__.'/../config/phones.php'; /* @var $list array */
@ -132,7 +132,7 @@ $utopia->get('/v1/locale/currencies')
->label('scope', 'locale.read') ->label('scope', 'locale.read')
->label('sdk.namespace', 'locale') ->label('sdk.namespace', 'locale')
->label('sdk.method', 'getCurrencies') ->label('sdk.method', 'getCurrencies')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/locale/get-currencies.md')
->action( ->action(
function () use ($response) { function () use ($response) {
$currencies = include __DIR__.'/../config/currencies.php'; $currencies = include __DIR__.'/../config/currencies.php';

View file

@ -118,7 +118,7 @@ $utopia->get('/v1/storage/files')
->label('scope', 'files.read') ->label('scope', 'files.read')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'listFiles') ->label('sdk.method', 'listFiles')
->label('sdk.description', '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).') ->label('sdk.description', '/docs/references/storage/list-files.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
@ -150,7 +150,7 @@ $utopia->get('/v1/storage/files/:fileId')
->label('scope', 'files.read') ->label('scope', 'files.read')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFile') ->label('sdk.method', 'getFile')
->label('sdk.description', 'Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.') ->label('sdk.description', '/docs/references/storage/get-file.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->action( ->action(
function ($fileId) use ($response, $projectDB) { function ($fileId) use ($response, $projectDB) {
@ -169,7 +169,7 @@ $utopia->get('/v1/storage/files/:fileId/preview')
->label('scope', 'files.read') ->label('scope', 'files.read')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFilePreview') ->label('sdk.method', 'getFilePreview')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/storage/get-file-preview.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID') ->param('fileId', '', function () { return new UID(); }, 'File unique ID')
->param('width', 0, function () { return new Range(0, 4000); }, 'Resize preview image width, Pass an integer between 0 to 4000', true) ->param('width', 0, function () { return new Range(0, 4000); }, 'Resize preview image width, Pass an integer between 0 to 4000', true)
->param('height', 0, function () { return new Range(0, 4000); }, 'Resize preview image height, Pass an integer between 0 to 4000', true) ->param('height', 0, function () { return new Range(0, 4000); }, 'Resize preview image height, Pass an integer between 0 to 4000', true)
@ -281,7 +281,7 @@ $utopia->get('/v1/storage/files/:fileId/download')
->label('scope', 'files.read') ->label('scope', 'files.read')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFileDownload') ->label('sdk.method', 'getFileDownload')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/storage/get-file-download.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->action( ->action(
function ($fileId) use ($response, $request, $projectDB) { function ($fileId) use ($response, $request, $projectDB) {
@ -331,7 +331,7 @@ $utopia->get('/v1/storage/files/:fileId/view')
->label('scope', 'files.read') ->label('scope', 'files.read')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFileView') ->label('sdk.method', 'getFileView')
->label('sdk.description', 'Get file content by its unique ID. This endpoint is similar to the download method but returns with no \'Content-Disposition: attachment\' header.') ->label('sdk.description', '/docs/references/storage/get-file-view.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->param('as', '', function () { return new WhiteList(['pdf', /*'html',*/ 'text']); }, 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true) ->param('as', '', function () { return new WhiteList(['pdf', /*'html',*/ 'text']); }, 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true)
->action( ->action(
@ -398,7 +398,7 @@ $utopia->post('/v1/storage/files')
->label('scope', 'files.write') ->label('scope', 'files.write')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'createFile') ->label('sdk.method', 'createFile')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/storage/create-file.md')
->label('sdk.consumes', 'multipart/form-data') ->label('sdk.consumes', 'multipart/form-data')
->param('files', [], function () { return new File(); }, 'Binary Files.', false) ->param('files', [], function () { return new File(); }, 'Binary Files.', false)
->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -521,7 +521,7 @@ $utopia->put('/v1/storage/files/:fileId')
->label('scope', 'files.write') ->label('scope', 'files.write')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'updateFile') ->label('sdk.method', 'updateFile')
->label('sdk.description', 'Update file by its unique ID. Only users with write permissions have access to update this resource.') ->label('sdk.description', '/docs/references/storage/update-file.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -555,7 +555,7 @@ $utopia->delete('/v1/storage/files/:fileId')
->label('scope', 'files.write') ->label('scope', 'files.write')
->label('sdk.namespace', 'storage') ->label('sdk.namespace', 'storage')
->label('sdk.method', 'deleteFile') ->label('sdk.method', 'deleteFile')
->label('sdk.description', 'Delete a file by its unique ID. Only users with write permissions have access to delete this resource.') ->label('sdk.description', '/docs/references/storage/delete-file.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->action( ->action(
function ($fileId) use ($response, $projectDB, $audit, $usage) { function ($fileId) use ($response, $projectDB, $audit, $usage) {

View file

@ -23,7 +23,7 @@ $utopia->get('/v1/teams')
->label('scope', 'teams.read') ->label('scope', 'teams.read')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'listTeams') ->label('sdk.method', 'listTeams')
->label('sdk.description', '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).') ->label('sdk.description', '/docs/references/teams/list-teams.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
@ -51,7 +51,7 @@ $utopia->get('/v1/teams/:teamId')
->label('scope', 'teams.read') ->label('scope', 'teams.read')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'getTeam') ->label('sdk.method', 'getTeam')
->label('sdk.description', 'Get team by its unique ID. All team members have read access for this resource.') ->label('sdk.description', '/docs/references/teams/get-team.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->action( ->action(
function ($teamId) use ($response, $projectDB) { function ($teamId) use ($response, $projectDB) {
@ -70,7 +70,7 @@ $utopia->get('/v1/teams/:teamId/members')
->label('scope', 'teams.read') ->label('scope', 'teams.read')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'getTeamMembers') ->label('sdk.method', 'getTeamMembers')
->label('sdk.description', 'Get team members by the team unique ID. All team members have read access for this list of resources.') ->label('sdk.description', '/docs/references/teams/get-team-members.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->action( ->action(
function ($teamId) use ($response, $projectDB) { function ($teamId) use ($response, $projectDB) {
@ -122,7 +122,7 @@ $utopia->post('/v1/teams')
->label('scope', 'teams.write') ->label('scope', 'teams.write')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'createTeam') ->label('sdk.method', 'createTeam')
->label('sdk.description', '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.') ->label('sdk.description', '/docs/references/teams/create-team.md')
->param('name', null, function () { return new Text(100); }, 'Team name.') ->param('name', null, function () { return new Text(100); }, 'Team name.')
->param('roles', ['owner'], function () { return new ArrayList(new Text(128)); }, 'User roles array. Use this param to set the roles in the team for the user who created the team. The default role is **owner**, a role can be any string.', true) ->param('roles', ['owner'], function () { return new ArrayList(new Text(128)); }, 'User roles array. Use this param to set the roles in the team for the user who created the team. The default role is **owner**, a role can be any string.', true)
->action( ->action(
@ -184,7 +184,7 @@ $utopia->put('/v1/teams/:teamId')
->label('scope', 'teams.write') ->label('scope', 'teams.write')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'updateTeam') ->label('sdk.method', 'updateTeam')
->label('sdk.description', 'Update team by its unique ID. Only team owners have write access for this resource.') ->label('sdk.description', '/docs/references/teams/update-team.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('name', null, function () { return new Text(100); }, 'Team name.') ->param('name', null, function () { return new Text(100); }, 'Team name.')
->action( ->action(
@ -212,7 +212,7 @@ $utopia->delete('/v1/teams/:teamId')
->label('scope', 'teams.write') ->label('scope', 'teams.write')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'deleteTeam') ->label('sdk.method', 'deleteTeam')
->label('sdk.description', 'Delete team by its unique ID. Only team owners have write access for this resource.') ->label('sdk.description', '/docs/references/teams/delete-team.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->action( ->action(
function ($teamId) use ($response, $projectDB) { function ($teamId) use ($response, $projectDB) {
@ -252,7 +252,7 @@ $utopia->post('/v1/teams/:teamId/memberships')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'createTeamMembership') ->label('sdk.method', 'createTeamMembership')
->label('sdk.description', "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.\n\nUse the redirect parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the user to the team.\n\nPlease 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.") ->label('sdk.description', '/docs/references/teams/create-team-membership.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('email', '', function () { return new Email(); }, 'New team member email address.') ->param('email', '', function () { return new Email(); }, 'New team member email address.')
->param('name', '', function () { return new Text(100); }, 'New team member name.', true) ->param('name', '', function () { return new Text(100); }, 'New team member name.', true)
@ -395,7 +395,7 @@ $utopia->post('/v1/teams/:teamId/memberships/:inviteId/resend')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'createTeamMembershipResend') ->label('sdk.method', 'createTeamMembershipResend')
->label('sdk.description', 'Use this endpoint to resend your invitation email for a user to join a team.') ->label('sdk.description', '/docs/references/teams/create-team-membership-resend.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.') ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.')
->param('redirect', '', function () use ($clients) { return new Host($clients); }, 'Reset page to redirect user back to your app from the invitation email.') ->param('redirect', '', function () use ($clients) { return new Host($clients); }, 'Reset page to redirect user back to your app from the invitation email.')
@ -475,7 +475,7 @@ $utopia->patch('/v1/teams/:teamId/memberships/:inviteId/status')
->label('scope', 'auth') ->label('scope', 'auth')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'updateTeamMembershipStatus') ->label('sdk.method', 'updateTeamMembershipStatus')
->label('sdk.description', "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.\n\nPlease 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.\n\nWhen not using the success or failure redirect arguments this endpoint will result with a 200 status code on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token.") ->label('sdk.description', '/docs/references/teams/update-team-membership-status.md')
->label('sdk.cookies', true) ->label('sdk.cookies', true)
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID') ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID')
@ -607,7 +607,7 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId')
->label('scope', 'account') ->label('scope', 'account')
->label('sdk.namespace', 'teams') ->label('sdk.namespace', 'teams')
->label('sdk.method', 'deleteTeamMembership') ->label('sdk.method', 'deleteTeamMembership')
->label('sdk.description', 'This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member.') ->label('sdk.description', '/docs/references/teams/delete-team-membership.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID') ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID')
->action( ->action(

View file

@ -22,7 +22,7 @@ $utopia->get('/v1/users')
->label('scope', 'users.read') ->label('scope', 'users.read')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'listUsers') ->label('sdk.method', 'listUsers')
->label('sdk.description', 'Get a list of all the project users. You can use the query params to filter your results.') ->label('sdk.description', '/docs/references/users/list-users.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
@ -74,7 +74,7 @@ $utopia->get('/v1/users/:userId')
->label('scope', 'users.read') ->label('scope', 'users.read')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'getUser') ->label('sdk.method', 'getUser')
->label('sdk.description', 'Get user by its unique ID.') ->label('sdk.description', '/docs/references/users/get-user.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action( ->action(
function ($userId) use ($response, $projectDB, $providers) { function ($userId) use ($response, $projectDB, $providers) {
@ -113,7 +113,7 @@ $utopia->get('/v1/users/:userId/prefs')
->label('scope', 'users.read') ->label('scope', 'users.read')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'getUserPrefs') ->label('sdk.method', 'getUserPrefs')
->label('sdk.description', 'Get user preferences by its unique ID.') ->label('sdk.description', '/docs/references/users/get-user-prefs.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action( ->action(
function ($userId) use ($response, $projectDB) { function ($userId) use ($response, $projectDB) {
@ -144,7 +144,7 @@ $utopia->get('/v1/users/:userId/sessions')
->label('scope', 'users.read') ->label('scope', 'users.read')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'getUserSessions') ->label('sdk.method', 'getUserSessions')
->label('sdk.description', 'Get user sessions list by its unique ID.') ->label('sdk.description', '/docs/references/users/get-user-sessions.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action( ->action(
function ($userId) use ($response, $projectDB) { function ($userId) use ($response, $projectDB) {
@ -206,7 +206,7 @@ $utopia->get('/v1/users/:userId/logs')
->label('scope', 'users.read') ->label('scope', 'users.read')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'getUserLogs') ->label('sdk.method', 'getUserLogs')
->label('sdk.description', 'Get user activity logs list by its unique ID.') ->label('sdk.description', '/docs/references/users/get-user-logs.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action( ->action(
function ($userId) use ($response, $register, $projectDB, $project) { function ($userId) use ($response, $register, $projectDB, $project) {
@ -267,7 +267,7 @@ $utopia->post('/v1/users')
->label('scope', 'users.write') ->label('scope', 'users.write')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'createUser') ->label('sdk.method', 'createUser')
->label('sdk.description', 'Create a new user.') ->label('sdk.description', '/docs/references/users/create-user.md')
->param('email', '', function () { return new Email(); }, 'User account email.') ->param('email', '', function () { return new Email(); }, 'User account email.')
->param('password', '', function () { return new Password(); }, 'User account password.') ->param('password', '', function () { return new Password(); }, 'User account password.')
->param('name', '', function () { return new Text(100); }, 'User account name.', true) ->param('name', '', function () { return new Text(100); }, 'User account name.', true)
@ -327,11 +327,11 @@ $utopia->post('/v1/users')
); );
$utopia->patch('/v1/users/:userId/status') $utopia->patch('/v1/users/:userId/status')
->desc('Update user status') ->desc('Update User Status')
->label('scope', 'users.write') ->label('scope', 'users.write')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'updateUserStatus') ->label('sdk.method', 'updateUserStatus')
->label('sdk.description', 'Update user status by its unique ID.') ->label('sdk.description', '/docs/references/users/update-user-status.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->param('status', '', function () { return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to blocking the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED) ->param('status', '', function () { return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to blocking the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED)
->action( ->action(
@ -356,13 +356,13 @@ $utopia->patch('/v1/users/:userId/status')
); );
$utopia->patch('/v1/users/:userId/prefs') $utopia->patch('/v1/users/:userId/prefs')
->desc('Update Account Prefs') ->desc('Update User Prefs')
->label('scope', 'users.write') ->label('scope', 'users.write')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'updateUserPrefs') ->label('sdk.method', 'updateUserPrefs')
->label('sdk.description', '/docs/references/users/update-user-prefs.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->param('prefs', '', function () { return new \Utopia\Validator\Mock(); }, 'Prefs key-value JSON object string.') ->param('prefs', '', function () { return new \Utopia\Validator\Mock(); }, 'Prefs key-value JSON object string.')
->label('sdk.description', 'Update user preferences by its unique ID. You can pass only the specific settings you wish to update.')
->action( ->action(
function ($userId, $prefs) use ($response, $projectDB) { function ($userId, $prefs) use ($response, $projectDB) {
$user = $projectDB->getDocument($userId); $user = $projectDB->getDocument($userId);
@ -387,8 +387,8 @@ $utopia->delete('/v1/users/:userId/sessions/:session')
->desc('Delete User Session') ->desc('Delete User Session')
->label('scope', 'users.write') ->label('scope', 'users.write')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'deleteUsersSession') ->label('sdk.method', 'deleteUserSession')
->label('sdk.description', 'Delete user sessions by its unique ID.') ->label('sdk.description', '/docs/references/users/delete-user-session.md')
->label('abuse-limit', 100) ->label('abuse-limit', 100)
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->param('sessionId', null, function () { return new UID(); }, 'User unique session ID.') ->param('sessionId', null, function () { return new UID(); }, 'User unique session ID.')
@ -419,7 +419,7 @@ $utopia->delete('/v1/users/:userId/sessions')
->label('scope', 'users.write') ->label('scope', 'users.write')
->label('sdk.namespace', 'users') ->label('sdk.namespace', 'users')
->label('sdk.method', 'deleteUserSessions') ->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) ->label('abuse-limit', 100)
->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action( ->action(

View file

@ -24,7 +24,7 @@ const APP_EMAIL_TEAM = 'team@'.APP_DOMAIN;
const APP_EMAIL_SECURITY = 'security@'.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_USERAGENT = APP_NAME.'-Server/%s Please report abuse at '.APP_EMAIL_SECURITY;
const APP_MODE_ADMIN = 'admin'; const APP_MODE_ADMIN = 'admin';
const APP_LOCALES = ['af', 'ar', 'cat', 'cz', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'hu', 'hy', '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', '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_PAGING_LIMIT = 15;
const APP_VERSION_STABLE = '0.2.0'; const APP_VERSION_STABLE = '0.2.0';
@ -128,7 +128,6 @@ $locale = $request->getParam('locale', $request->getHeader('X-Appwrite-Locale',
Locale::$exceptions = false; Locale::$exceptions = false;
Locale::setLanguage('af', include __DIR__.'/config/locale/af.php'); Locale::setLanguage('af', include __DIR__.'/config/locale/af.php');
Locale::setLanguage('ar', include __DIR__.'/config/locale/ar.php'); Locale::setLanguage('ar', include __DIR__.'/config/locale/ar.php');
Locale::setLanguage('cat', include __DIR__.'/config/locale/cat.php'); Locale::setLanguage('cat', include __DIR__.'/config/locale/cat.php');
@ -145,6 +144,7 @@ Locale::setLanguage('hu', include __DIR__.'/config/locale/hu.php');
Locale::setLanguage('hy', include __DIR__.'/config/locale/hy.php'); Locale::setLanguage('hy', include __DIR__.'/config/locale/hy.php');
Locale::setLanguage('id', include __DIR__.'/config/locale/id.php'); Locale::setLanguage('id', include __DIR__.'/config/locale/id.php');
Locale::setLanguage('it', include __DIR__.'/config/locale/it.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('jv', include __DIR__.'/config/locale/jv.php');
Locale::setLanguage('lt', include __DIR__.'/config/locale/lt.php'); Locale::setLanguage('lt', include __DIR__.'/config/locale/lt.php');
Locale::setLanguage('nl', include __DIR__.'/config/locale/nl.php'); Locale::setLanguage('nl', include __DIR__.'/config/locale/nl.php');
@ -164,6 +164,8 @@ Locale::setLanguage('vi', include __DIR__.'/config/locale/vi.php');
Locale::setLanguage('zh-cn', include __DIR__.'/config/locale/zh-cn.php'); Locale::setLanguage('zh-cn', include __DIR__.'/config/locale/zh-cn.php');
Locale::setLanguage('zh-tw', include __DIR__.'/config/locale/zh-tw.php'); Locale::setLanguage('zh-tw', include __DIR__.'/config/locale/zh-tw.php');
Locale::setDefault('en');
if (in_array($locale, APP_LOCALES)) { if (in_array($locale, APP_LOCALES)) {
Locale::setDefault($locale); Locale::setDefault($locale);
} }

View file

@ -1,7 +1,7 @@
# Appwrite SDK for Dart # Appwrite SDK for Dart
![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?v=1) ![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).** **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).**

View file

@ -9,7 +9,7 @@ class Client {
Dio http; Dio http;
Client() { Client() {
this.endPoint = 'https://https://appwrite.io/v1'; this.endPoint = 'https://appwrite.io/v1';
this.headers = { this.headers = {
'content-type': 'application/json', 'content-type': 'application/json',
'x-sdk-version': 'appwrite:dart:0.0.2', '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) { Client setProject(value) {
this.addHeader('X-Appwrite-Project', 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) { Client setKey(value) {
this.addHeader('X-Appwrite-Key', value); this.addHeader('X-Appwrite-Key', value);

View file

@ -15,7 +15,7 @@ class Auth extends Service {
/// the only valid redirect URL's are the once from domains you have set when /// the only valid redirect URL's are the once from domains you have set when
/// added your platforms in the console interface. /// 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 /// failure parameter URLs are required. Appwrite server will respond with a
/// 301 redirect status code and will set the user session cookie. This /// 301 redirect status code and will set the user session cookie. This
/// behavior is enforced because modern browsers are limiting 3rd party cookies /// 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 /// the only valid redirect URL's are the once from domains you have set when
/// added your platforms in the console interface. /// 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 /// failure parameter URLs are required. Appwrite server will respond with a
/// 301 redirect status code and will set the user session cookie. This /// 301 redirect status code and will set the user session cookie. This
/// behavior is enforced because modern browsers are limiting 3rd party cookies /// behavior is enforced because modern browsers are limiting 3rd party cookies

View file

@ -49,9 +49,9 @@ class Locale extends Service {
return await this.client.call('get', path: path, params: params); return await this.client.call('get', path: path, params: params);
} }
/// List of all currencies, including currency symbol, name, plural, and /// List of all currencies, including currency symol, name, plural, and decimal
/// decimal digits for all major and minor currencies. You can use the locale /// digits for all major and minor currencies. You can use the locale header to
/// header to get the data in supported language. /// get the data in supported language.
Future<Response> getCurrencies() async { Future<Response> getCurrencies() async {
String path = '/locale/currencies'; String path = '/locale/currencies';

View file

@ -58,6 +58,17 @@ class Users extends Service {
}; };
return await this.client.call('get', path: path, params: params); return await this.client.call('get', path: path, params: params);
}
/// Update user preferences by its unique ID. You can pass only the specific
/// settings you wish to update.
Future<Response> updateUserPrefs({userId, prefs}) async {
String path = '/users/{userId}/prefs'.replaceAll(RegExp('{userId}'), userId);
Map<String, dynamic> params = {
'prefs': prefs,
};
return await this.client.call('patch', path: path, params: params);
} }
/// Get user sessions list by its unique ID. /// Get user sessions list by its unique ID.
Future<Response> getUserSessions({userId}) async { Future<Response> getUserSessions({userId}) async {
@ -78,7 +89,7 @@ class Users extends Service {
return await this.client.call('delete', path: path, params: params); return await this.client.call('delete', path: path, params: params);
} }
/// Delete user sessions by its unique ID. /// Delete user sessions by its unique ID.
Future<Response> deleteUsersSession({userId, sessionId}) async { Future<Response> deleteUserSession({userId, sessionId}) async {
String path = '/users/{userId}/sessions/:session'.replaceAll(RegExp('{userId}'), userId); String path = '/users/{userId}/sessions/:session'.replaceAll(RegExp('{userId}'), userId);
Map<String, dynamic> params = { Map<String, dynamic> params = {

View file

@ -1,28 +1,52 @@
# Appwrite SDK for Javascript # Appwrite SDK for JavaScript
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1) ![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.** **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) Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
![Appwrite](https://appwrite.io/images/github.png) ![Appwrite](https://appwrite.io/images/github.png)
## Installation ## Installation
### NPM
To install via [NPM](https://www.npmjs.com/): To install via [NPM](https://www.npmjs.com/):
```bash ```bash
npm install appwrite --save 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 <body> tag, but before you use any Appwrite services:
```html ```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.0.22"></script> <script src="https://cdn.jsdelivr.net/npm/appwrite@1.0.23"></script>
```
## 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 ## License

View file

@ -4,7 +4,7 @@ sdk
.setProject('') .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) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -4,7 +4,7 @@ sdk
.setProject('') .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) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -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);
});

View file

@ -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);
});

View file

@ -2,7 +2,7 @@
"name": "appwrite", "name": "appwrite",
"homepage": "https://appwrite.io/support", "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)", "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", "license": "BSD-3-Clause",
"main": "src/sdk.js", "main": "src/sdk.js",
"repository": { "repository": {

File diff suppressed because it is too large Load diff

View file

@ -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=/(?:\?|&amp;|&)+([^=]+)(?:=([^&]*))*/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<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param))}}else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]))}} (function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&amp;|&)+([^=]+)(?:=([^&]*))*/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<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param))}}else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]))}}
return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.22');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')} return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.23');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')}
if(typeof path!=='string'){throw new Error('var path must be of type string')} if(typeof path!=='string'){throw new Error('var path must be of type string')}
if(typeof headers!=='object'){throw new Error('var headers must be of type object')} if(typeof headers!=='object'){throw new Error('var headers must be of type object')}
for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value)} for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value)}
@ -11,93 +11,213 @@ request.setRequestHeader(key,headers[key])}}
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break}
resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} 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)}} 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"')} 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/email';let payload={};if(email){payload.email=email}
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"')} 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"')} 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/password';let payload={};if(password){payload.password=password}
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"')} 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(password===undefined){throw new Error('Missing required parameter: "password"')}
if(success===undefined){throw new Error('Missing required parameter: "success"')} if(success===undefined){throw new Error('Missing required parameter: "success"')}
if(failure===undefined){throw new Error('Missing required parameter: "failure"')} 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/login';let payload={};if(email){payload.email=email}
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"')} if(password){payload.password=password}
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"')} 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"')} 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(token===undefined){throw new Error('Missing required parameter: "token"')}
if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')} if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')}
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')} 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(password===undefined){throw new Error('Missing required parameter: "password"')}
if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')} 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"')} 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';let payload={};if(userId){payload.userId=userId}
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"')} if(token){payload.token=token}
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"')} return http.post(path,{'content-type':'application/json'},payload)},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
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='/auth/register/confirm/resend';let payload={};if(confirm){payload.confirm=confirm}
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"')} 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/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/browsers/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
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"')} if(height){payload.height=height}
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"')} if(quality){payload.quality=quality}
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"')} 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='/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='/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"')} 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);let payload={};if(name){payload.name=name}
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"')} if(read){payload.read=read}
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"')} if(write){payload.write=write}
if(rules){payload.rules=rules}
return http.put(path,{'content-type':'application/json'},payload)},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(filters){payload.filters=filters}
if(offset){payload.offset=offset}
if(limit){payload.limit=limit}
if(orderField){payload['order-field']=orderField}
if(orderType){payload['order-type']=orderType}
if(orderCast){payload['order-cast']=orderCast}
if(search){payload.search=search}
if(first){payload.first=first}
if(last){payload.last=last}
return http.get(path,{'content-type':'application/json'},payload)},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
if(data===undefined){throw new Error('Missing required parameter: "data"')} if(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"')} 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(documentId===undefined){throw new Error('Missing required parameter: "documentId"')}
if(data===undefined){throw new Error('Missing required parameter: "data"')} 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"')} 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"')} 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';let payload={};if(name){payload.name=name}
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"')} 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"')} 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);let payload={};if(name){payload.name=name}
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"')} if(description){payload.description=description}
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"')} 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(name===undefined){throw new Error('Missing required parameter: "name"')}
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')} 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"')} 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(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
if(name===undefined){throw new Error('Missing required parameter: "name"')} if(name===undefined){throw new Error('Missing required parameter: "name"')}
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')} 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"')} 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"')} 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}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload.provider=provider}
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"')} 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(type===undefined){throw new Error('Missing required parameter: "type"')}
if(name===undefined){throw new Error('Missing required parameter: "name"')} 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"')} 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(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
if(name===undefined){throw new Error('Missing required parameter: "name"')} 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"')} 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}/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);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}/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(name===undefined){throw new Error('Missing required parameter: "name"')}
if(status===undefined){throw new Error('Missing required parameter: "status"')} if(status===undefined){throw new Error('Missing required parameter: "status"')}
if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')} if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')}
if(security===undefined){throw new Error('Missing required parameter: "security"')} if(security===undefined){throw new Error('Missing required parameter: "security"')}
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')} if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')}
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')} 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"')} 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(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
if(name===undefined){throw new Error('Missing required parameter: "name"')} if(name===undefined){throw new Error('Missing required parameter: "name"')}
if(status===undefined){throw new Error('Missing required parameter: "status"')} 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(security===undefined){throw new Error('Missing required parameter: "security"')}
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')} if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')}
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')} 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"')} 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}/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);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}/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);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}/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(name===undefined){throw new Error('Missing required parameter: "name"')}
if(events===undefined){throw new Error('Missing required parameter: "events"')} if(events===undefined){throw new Error('Missing required parameter: "events"')}
if(url===undefined){throw new Error('Missing required parameter: "url"')} if(url===undefined){throw new Error('Missing required parameter: "url"')}
if(security===undefined){throw new Error('Missing required parameter: "security"')} 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"')} 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(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
if(name===undefined){throw new Error('Missing required parameter: "name"')} if(name===undefined){throw new Error('Missing required parameter: "name"')}
if(events===undefined){throw new Error('Missing required parameter: "events"')} if(events===undefined){throw new Error('Missing required parameter: "events"')}
if(url===undefined){throw new Error('Missing required parameter: "url"')} if(url===undefined){throw new Error('Missing required parameter: "url"')}
if(security===undefined){throw new Error('Missing required parameter: "security"')} 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"')} 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='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search}
let path='/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"')} if(limit){payload.limit=limit}
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"')} if(offset){payload.offset=offset}
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"')} if(orderType){payload.orderType=orderType}
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"')} 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/{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';let payload={};if(files){payload.files=files}
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"')} if(read){payload.read=read}
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"')} if(write){payload.write=write}
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"')} if(folderId){payload.folderId=folderId}
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"')} 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"')} 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);let payload={};if(name){payload.name=name}
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"')} 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}/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={};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(email===undefined){throw new Error('Missing required parameter: "email"')}
if(roles===undefined){throw new Error('Missing required parameter: "roles"')} if(roles===undefined){throw new Error('Missing required parameter: "roles"')}
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} 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"')} 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(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} 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(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
if(userId===undefined){throw new Error('Missing required parameter: "userId"')} if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(secret===undefined){throw new Error('Missing required parameter: "secret"')} 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"')} 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';let payload={};if(email){payload.email=email}
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"')} if(password){payload.password=password}
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"')} if(name){payload.name=name}
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"')} 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}/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}'.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}/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/{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"')} 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"')} 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) 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:{})

View file

@ -1,7 +1,7 @@
# Appwrite SDK for NodeJS # Appwrite SDK for NodeJS
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1) ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.** **This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.**

View file

@ -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);
});

View file

@ -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);
});

View file

@ -4,7 +4,7 @@ const request = require('request-promise-native');
class Client { class Client {
constructor() { constructor() {
this.endpoint = 'https://https://appwrite.io/v1'; this.endpoint = 'https://appwrite.io/v1';
this.headers = { this.headers = {
'content-type': '', 'content-type': '',
'x-sdk-version': 'appwrite:nodejs:1.0.26', 'x-sdk-version': 'appwrite:nodejs:1.0.26',
@ -15,7 +15,7 @@ class Client {
/** /**
* Set Project * 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 * @param string value
* *
@ -30,7 +30,7 @@ class Client {
/** /**
* Set Key * 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 * @param string value
* *

View file

@ -14,7 +14,7 @@ class Auth extends Service {
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * 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 * failure parameter URLs are required. Appwrite server will respond with a
* 301 redirect status code and will set the user session cookie. This * 301 redirect status code and will set the user session cookie. This
* behavior is enforced because modern browsers are limiting 3rd party cookies * 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 * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * 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 * failure parameter URLs are required. Appwrite server will respond with a
* 301 redirect status code and will set the user session cookie. This * 301 redirect status code and will set the user session cookie. This
* behavior is enforced because modern browsers are limiting 3rd party cookies * behavior is enforced because modern browsers are limiting 3rd party cookies

View file

@ -76,9 +76,9 @@ class Locale extends Service {
/** /**
* List of currencies * List of currencies
* *
* List of all currencies, including currency symbol, name, plural, and * List of all currencies, including currency symol, name, plural, and decimal
* decimal digits for all major and minor currencies. You can use the locale * digits for all major and minor currencies. You can use the locale header to
* header to get the data in supported language. * get the data in supported language.
* *
* @throws Exception * @throws Exception
* @return {} * @return {}

View file

@ -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 * Get User Sessions
* *
@ -144,7 +164,7 @@ class Users extends Service {
* @throws Exception * @throws Exception
* @return {} * @return {}
*/ */
async deleteUsersSession(userId, sessionId) { async deleteUserSession(userId, sessionId) {
let path = '/users/{userId}/sessions/:session'.replace(new RegExp('{userId}', 'g'), userId); let path = '/users/{userId}/sessions/:session'.replace(new RegExp('{userId}', 'g'), userId);
return await this.client.call('delete', path, {'content-type': 'application/json'}, return await this.client.call('delete', path, {'content-type': 'application/json'},

View file

@ -1,7 +1,7 @@
# Appwrite SDK for PHP # Appwrite SDK for PHP
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1) ![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.** **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 ## Installation
To install via [Composer](https://getcomposer.org/): To install via [Composer](http://getcomposer.org/):
```bash ```bash
composer require appwrite/appwrite composer require appwrite/appwrite
@ -21,4 +21,4 @@ composer require appwrite/appwrite
## License ## 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.

View file

@ -3,7 +3,7 @@
## Get Account ## Get Account
```http request ```http request
GET https://https://appwrite.io/v1/account GET https://appwrite.io/v1/account
``` ```
** Get currently logged in user data as JSON object. ** ** Get currently logged in user data as JSON object. **
@ -11,7 +11,7 @@ GET https://https://appwrite.io/v1/account
## Delete Account ## Delete Account
```http request ```http request
DELETE https://https://appwrite.io/v1/account DELETE https://appwrite.io/v1/account
``` ```
** Delete currently logged in user account. ** ** Delete currently logged in user account. **
@ -19,7 +19,7 @@ DELETE https://https://appwrite.io/v1/account
## Update Account Email ## Update Account Email
```http request ```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. ** ** 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 ## Update Account Name
```http request ```http request
PATCH https://https://appwrite.io/v1/account/name PATCH https://appwrite.io/v1/account/name
``` ```
** Update currently logged in user account name. ** ** Update currently logged in user account name. **
@ -48,7 +48,7 @@ PATCH https://https://appwrite.io/v1/account/name
## Update Account Password ## Update Account Password
```http request ```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. ** ** 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 ## Get Account Preferences
```http request ```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. ** ** Get currently logged in user preferences key-value object. **
@ -71,7 +71,7 @@ GET https://https://appwrite.io/v1/account/prefs
## Update Account Prefs ## Update Account Prefs
```http request ```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. ** ** 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 ## Get Account Security Log
```http request ```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. ** ** 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 ## Get Account Active Sessions
```http request ```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. ** ** Get currently logged in user list of active sessions across different devices. **

View file

@ -3,14 +3,14 @@
## Login User ## Login User
```http request ```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\&#039;s back to your app when login is completed. ** 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\&#039;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&#039;s are the once from domains you have set when added your platforms in the console interface. 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&#039;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 ### Parameters
@ -24,7 +24,7 @@ When accessing this route using JavaScript from the browser, success and failure
## Logout Current Session ## Logout Current Session
```http request ```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. ** ** 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 ## Logout Specific Session
```http request ```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. ** ** 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 ## OAuth Login
```http request ```http request
GET https://https://appwrite.io/v1/auth/oauth/{provider} GET https://appwrite.io/v1/auth/oauth/{provider}
``` ```
### Parameters ### Parameters
@ -60,7 +60,7 @@ GET https://https://appwrite.io/v1/auth/oauth/{provider}
## Password Recovery ## Password Recovery
```http request ```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. ** ** 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 ## Password Reset
```http request ```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. ** 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 ## Register User
```http request ```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&#039;s to redirect users back to your application after signup completes. ** Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL&#039;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&#039;s are the once from domains you have set when added your platforms in the console interface. 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&#039;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 ### Parameters
@ -119,7 +119,7 @@ When accessing this route using JavaScript from the browser, success and failure
## Confirm User ## Confirm User
```http request ```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. ** ** 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 ## Resend Confirmation
```http request ```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. ** 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.

View file

@ -3,7 +3,7 @@
## Get Browser Icon ## Get Browser Icon
```http request ```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. ** ** 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 ## Get Credit Card Icon
```http request ```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. ** ** 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 ## Get Favicon
```http request ```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. ** ** 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 ## Get Country Flag
```http request ```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. ** ** 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 ## Get Image from URL
```http request ```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. ** ** 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 ## Text to QR Generator
```http request ```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. ** ** 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. **

View file

@ -3,7 +3,7 @@
## List Collections ## List Collections
```http request ```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). ** ** 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 ## Create Collection
```http request ```http request
POST https://https://appwrite.io/v1/database POST https://appwrite.io/v1/database
``` ```
** Create a new Collection. ** ** Create a new Collection. **
@ -37,7 +37,7 @@ POST https://https://appwrite.io/v1/database
## Get Collection ## Get Collection
```http request ```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. ** ** 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 ## Update Collection
```http request ```http request
PUT https://https://appwrite.io/v1/database/{collectionId} PUT https://appwrite.io/v1/database/{collectionId}
``` ```
** Update collection by its unique ID. ** ** Update collection by its unique ID. **
@ -69,7 +69,7 @@ PUT https://https://appwrite.io/v1/database/{collectionId}
## Delete Collection ## Delete Collection
```http request ```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. ** ** 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 ## List Documents
```http request ```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). ** ** 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 ## Create Document
```http request ```http request
POST https://https://appwrite.io/v1/database/{collectionId}/documents POST https://appwrite.io/v1/database/{collectionId}/documents
``` ```
** Create a new Document. ** ** Create a new Document. **
@ -126,7 +126,7 @@ POST https://https://appwrite.io/v1/database/{collectionId}/documents
## Get Document ## Get Document
```http request ```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. ** ** 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 ## Update Document
```http request ```http request
PATCH https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId} PATCH https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
``` ```
### Parameters ### Parameters
@ -157,7 +157,7 @@ PATCH https://https://appwrite.io/v1/database/{collectionId}/documents/{document
## Delete Document ## Delete Document
```http request ```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. ** ** 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. **

View file

@ -12,4 +12,4 @@ $client
$projects = new Projects($client); $projects = new Projects($client);
$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); $result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');

View file

@ -12,4 +12,4 @@ $client
$projects = new Projects($client); $projects = new Projects($client);
$result = $projects->updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0); $result = $projects->updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 1);

View file

@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Users;
$client = new Client();
$client
->setProject('')
->setKey('')
;
$users = new Users($client);
$result = $users->deleteUserSession('[USER_ID]', '[SESSION_ID]');

View file

@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Users;
$client = new Client();
$client
->setProject('')
->setKey('')
;
$users = new Users($client);
$result = $users->updateUserPrefs('[USER_ID]', '{}');

View file

@ -3,7 +3,7 @@
## Get User Locale ## Get User Locale
```http request ```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. ** ** 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 ## List Countries
```http request ```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. ** ** 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 ## List EU Countries
```http request ```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. ** ** 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 ## List Countries Phone Codes
```http request ```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. ** ** 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 ## List of currencies
```http request ```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. **

View file

@ -3,13 +3,13 @@
## List Projects ## List Projects
```http request ```http request
GET https://https://appwrite.io/v1/projects GET https://appwrite.io/v1/projects
``` ```
## Create Project ## Create Project
```http request ```http request
POST https://https://appwrite.io/v1/projects POST https://appwrite.io/v1/projects
``` ```
### Parameters ### Parameters
@ -31,7 +31,7 @@ POST https://https://appwrite.io/v1/projects
## Get Project ## Get Project
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId} GET https://appwrite.io/v1/projects/{projectId}
``` ```
### Parameters ### Parameters
@ -43,7 +43,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}
## Update Project ## Update Project
```http request ```http request
PATCH https://https://appwrite.io/v1/projects/{projectId} PATCH https://appwrite.io/v1/projects/{projectId}
``` ```
### Parameters ### Parameters
@ -65,7 +65,7 @@ PATCH https://https://appwrite.io/v1/projects/{projectId}
## Delete Project ## Delete Project
```http request ```http request
DELETE https://https://appwrite.io/v1/projects/{projectId} DELETE https://appwrite.io/v1/projects/{projectId}
``` ```
### Parameters ### Parameters
@ -77,7 +77,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}
## List Keys ## List Keys
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/keys GET https://appwrite.io/v1/projects/{projectId}/keys
``` ```
### Parameters ### Parameters
@ -89,7 +89,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/keys
## Create Key ## Create Key
```http request ```http request
POST https://https://appwrite.io/v1/projects/{projectId}/keys POST https://appwrite.io/v1/projects/{projectId}/keys
``` ```
### Parameters ### Parameters
@ -103,7 +103,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/keys
## Get Key ## Get Key
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId} GET https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
``` ```
### Parameters ### Parameters
@ -116,7 +116,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
## Update Key ## Update Key
```http request ```http request
PUT https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId} PUT https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
``` ```
### Parameters ### Parameters
@ -131,7 +131,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
## Delete Key ## Delete Key
```http request ```http request
DELETE https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId} DELETE https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
``` ```
### Parameters ### Parameters
@ -144,7 +144,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
## Update Project OAuth ## Update Project OAuth
```http request ```http request
PATCH https://https://appwrite.io/v1/projects/{projectId}/oauth PATCH https://appwrite.io/v1/projects/{projectId}/oauth
``` ```
### Parameters ### Parameters
@ -159,7 +159,7 @@ PATCH https://https://appwrite.io/v1/projects/{projectId}/oauth
## List Platforms ## List Platforms
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/platforms GET https://appwrite.io/v1/projects/{projectId}/platforms
``` ```
### Parameters ### Parameters
@ -171,7 +171,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/platforms
## Create Platform ## Create Platform
```http request ```http request
POST https://https://appwrite.io/v1/projects/{projectId}/platforms POST https://appwrite.io/v1/projects/{projectId}/platforms
``` ```
### Parameters ### Parameters
@ -188,7 +188,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/platforms
## Get Platform ## Get Platform
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId} GET https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
``` ```
### Parameters ### Parameters
@ -201,7 +201,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
## Update Platform ## Update Platform
```http request ```http request
PUT https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId} PUT https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
``` ```
### Parameters ### Parameters
@ -218,7 +218,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
## Delete Platform ## Delete Platform
```http request ```http request
DELETE https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId} DELETE https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
``` ```
### Parameters ### Parameters
@ -231,7 +231,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId
## List Tasks ## List Tasks
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/tasks GET https://appwrite.io/v1/projects/{projectId}/tasks
``` ```
### Parameters ### Parameters
@ -243,7 +243,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/tasks
## Create Task ## Create Task
```http request ```http request
POST https://https://appwrite.io/v1/projects/{projectId}/tasks POST https://appwrite.io/v1/projects/{projectId}/tasks
``` ```
### Parameters ### Parameters
@ -264,7 +264,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/tasks
## Get Task ## Get Task
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId} GET https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
``` ```
### Parameters ### Parameters
@ -277,7 +277,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
## Update Task ## Update Task
```http request ```http request
PUT https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId} PUT https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
``` ```
### Parameters ### Parameters
@ -299,7 +299,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
## Delete Task ## Delete Task
```http request ```http request
DELETE https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId} DELETE https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
``` ```
### Parameters ### Parameters
@ -312,7 +312,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
## Get Project ## Get Project
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/usage GET https://appwrite.io/v1/projects/{projectId}/usage
``` ```
### Parameters ### Parameters
@ -324,7 +324,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/usage
## List Webhooks ## List Webhooks
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/webhooks GET https://appwrite.io/v1/projects/{projectId}/webhooks
``` ```
### Parameters ### Parameters
@ -336,7 +336,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/webhooks
## Create Webhook ## Create Webhook
```http request ```http request
POST https://https://appwrite.io/v1/projects/{projectId}/webhooks POST https://appwrite.io/v1/projects/{projectId}/webhooks
``` ```
### Parameters ### Parameters
@ -354,7 +354,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/webhooks
## Get Webhook ## Get Webhook
```http request ```http request
GET https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId} GET https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
``` ```
### Parameters ### Parameters
@ -367,7 +367,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
## Update Webhook ## Update Webhook
```http request ```http request
PUT https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId} PUT https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
``` ```
### Parameters ### Parameters
@ -386,7 +386,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
## Delete Webhook ## Delete Webhook
```http request ```http request
DELETE https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId} DELETE https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
``` ```
### Parameters ### Parameters

View file

@ -3,7 +3,7 @@
## List Files ## List Files
```http request ```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). ** ** 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 ## Create File
```http request ```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. ** ** 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 ## Get File
```http request ```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. ** ** 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 ## Update File
```http request ```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. ** ** 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 ## Delete File
```http request ```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. ** ** 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 ## Get File for Download
```http request ```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 &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory. ** ** Get file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; 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 ## Get File Preview
```http request ```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. ** ** 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 ## Get File for View
```http request ```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 &#039;Content-Disposition: attachment&#039; header. ** ** Get file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header. **

View file

@ -3,7 +3,7 @@
## List Teams ## List Teams
```http request ```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). ** ** 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 ## Create Team
```http request ```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. ** ** 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 ## Get Team
```http request ```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. ** ** 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 ## Update Team
```http request ```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. ** ** 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 ## Delete Team
```http request ```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. ** ** 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 ## Get Team Members
```http request ```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. ** ** 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 ## Create Team Membership
```http request ```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&#039;t exists in the project it will be automatically created. ** 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&#039;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 ## Delete Team Membership
```http request ```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. ** ** 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) ## Create Team Membership (Resend)
```http request ```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. ** ** 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 ## Update Team Membership Status
```http request ```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&#039;s to redirect users back to your application after the request completes. ** 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&#039;s to redirect users back to your application after the request completes.

View file

@ -3,7 +3,7 @@
## List Users ## List Users
```http request ```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. ** ** 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 ## Create User
```http request ```http request
POST https://https://appwrite.io/v1/users POST https://appwrite.io/v1/users
``` ```
** Create a new user. ** ** Create a new user. **
@ -36,7 +36,7 @@ POST https://https://appwrite.io/v1/users
## Get User ## Get User
```http request ```http request
GET https://https://appwrite.io/v1/users/{userId} GET https://appwrite.io/v1/users/{userId}
``` ```
** Get user by its unique ID. ** ** Get user by its unique ID. **
@ -50,7 +50,7 @@ GET https://https://appwrite.io/v1/users/{userId}
## Get User Logs ## Get User Logs
```http request ```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. ** ** 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 ## Get User Prefs
```http request ```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. ** ** 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. | | | 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 ## Get User Sessions
```http request ```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. ** ** Get user sessions list by its unique ID. **
@ -92,7 +107,7 @@ GET https://https://appwrite.io/v1/users/{userId}/sessions
## Delete User Sessions ## Delete User Sessions
```http request ```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. ** ** Delete all user sessions by its unique ID. **
@ -106,7 +121,7 @@ DELETE https://https://appwrite.io/v1/users/{userId}/sessions
## Delete User Session ## Delete User Session
```http request ```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. ** ** Delete user sessions by its unique ID. **
@ -121,7 +136,7 @@ DELETE https://https://appwrite.io/v1/users/{userId}/sessions/:session
## Update user status ## Update user status
```http request ```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. ** ** Update user status by its unique ID. **

View file

@ -28,7 +28,7 @@ class Client
* *
* @var string * @var string
*/ */
protected $endpoint = 'https://https://appwrite.io/v1'; protected $endpoint = 'https://appwrite.io/v1';
/** /**
* Global Headers * Global Headers
@ -50,7 +50,7 @@ class Client
/** /**
* Set Project * 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 * @param string $value
* *
@ -66,7 +66,7 @@ class Client
/** /**
* Set Key * 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 * @param string $value
* *

View file

@ -20,7 +20,7 @@ class Auth extends Service
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * 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 * failure parameter URLs are required. Appwrite server will respond with a
* 301 redirect status code and will set the user session cookie. This * 301 redirect status code and will set the user session cookie. This
* behavior is enforced because modern browsers are limiting 3rd party cookies * 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 * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * 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 * failure parameter URLs are required. Appwrite server will respond with a
* 301 redirect status code and will set the user session cookie. This * 301 redirect status code and will set the user session cookie. This
* behavior is enforced because modern browsers are limiting 3rd party cookies * behavior is enforced because modern browsers are limiting 3rd party cookies

View file

@ -90,9 +90,9 @@ class Locale extends Service
/** /**
* List of currencies * List of currencies
* *
* List of all currencies, including currency symbol, name, plural, and * List of all currencies, including currency symol, name, plural, and decimal
* decimal digits for all major and minor currencies. You can use the locale * digits for all major and minor currencies. You can use the locale header to
* header to get the data in supported language. * get the data in supported language.
* *
* @throws Exception * @throws Exception
* @return array * @return array

View file

@ -116,6 +116,28 @@ class Users extends Service
], $params); ], $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 * Get User Sessions
* *
@ -164,7 +186,7 @@ class Users extends Service
* @throws Exception * @throws Exception
* @return array * @return array
*/ */
public function deleteUsersSession($userId, $sessionId) public function deleteUserSession($userId, $sessionId)
{ {
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions/:session'); $path = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions/:session');
$params = []; $params = [];

View file

@ -1,7 +1,7 @@
# Appwrite SDK for Python # Appwrite SDK for Python
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1) ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).** **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).**

View file

@ -4,7 +4,7 @@ import requests
class Client: class Client:
def __init__(self): def __init__(self):
self._self_signed = False self._self_signed = False
self._endpoint = 'https://https://appwrite.io/v1' self._endpoint = 'https://appwrite.io/v1'
self._global_headers = { self._global_headers = {
'content-type': '', 'content-type': '',
'x-sdk-version': 'appwrite:python:1.0.0', 'x-sdk-version': 'appwrite:python:1.0.0',
@ -23,13 +23,13 @@ class Client:
return self return self
def set_project(self, value): 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() self._global_headers['x-appwrite-project'] = value.lower()
return self return self
def set_key(self, value): 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() self._global_headers['x-appwrite-key'] = value.lower()
return self return self

View file

@ -58,6 +58,17 @@ class Users(Service):
return self.client.call('get', path, { return self.client.call('get', path, {
}, params) }, 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): def get_user_sessions(self, user_id):
"""Get User Sessions""" """Get User Sessions"""
@ -78,7 +89,7 @@ class Users(Service):
return self.client.call('delete', path, { return self.client.call('delete', path, {
}, params) }, params)
def delete_users_session(self, user_id, session_id): def delete_user_session(self, user_id, session_id):
"""Delete User Session""" """Delete User Session"""
params = {} params = {}

View file

@ -1,7 +1,7 @@
# Appwrite SDK for Ruby # Appwrite SDK for Ruby
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1) ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).** **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).**

View file

@ -61,6 +61,18 @@ module Appwrite
}, params); }, params);
end 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:) def get_user_sessions(user_id:)
path = '/users/{userId}/sessions' path = '/users/{userId}/sessions'
.gsub('{user_id}', user_id) .gsub('{user_id}', user_id)
@ -83,7 +95,7 @@ module Appwrite
}, params); }, params);
end end
def delete_users_session(user_id:, session_id:) def delete_user_session(user_id:, session_id:)
path = '/users/{userId}/sessions/:session' path = '/users/{userId}/sessions/:session'
.gsub('{user_id}', user_id) .gsub('{user_id}', user_id)

View file

@ -45,16 +45,18 @@ $cli
'gitRepoName' => 'sdk-for-php', 'gitRepoName' => 'sdk-for-php',
'gitUserName' => 'appwrite', 'gitUserName' => 'appwrite',
'warning' => $warning, 'warning' => $warning,
'readme' => false,
'platform' => 'server', 'platform' => 'server',
], ],
'js' => [ 'js' => [
'version' => '1.0.22', 'version' => '1.0.23',
'result' => __DIR__.'/../sdks/js/', 'result' => __DIR__.'/../sdks/js/',
'gitURL' => 'https://github.com/appwrite/sdk-for-js.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-js.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git',
'gitRepoName' => 'sdk-for-js', 'gitRepoName' => 'sdk-for-js',
'gitUserName' => 'appwrite', 'gitUserName' => 'appwrite',
'warning' => $warning, 'warning' => $warning,
'readme' => realpath(__DIR__ . '/../../docs/sdks/js.md'),
'platform' => 'client', 'platform' => 'client',
], ],
'node' => [ 'node' => [
@ -65,6 +67,7 @@ $cli
'gitRepoName' => 'sdk-for-node', 'gitRepoName' => 'sdk-for-node',
'gitUserName' => 'appwrite', 'gitUserName' => 'appwrite',
'warning' => $warning, 'warning' => $warning,
'readme' => false,
'platform' => 'server', 'platform' => 'server',
], ],
'python' => [ 'python' => [
@ -75,6 +78,7 @@ $cli
'gitRepoName' => 'sdk-for-python', 'gitRepoName' => 'sdk-for-python',
'gitUserName' => 'appwrite', '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).**', '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', 'platform' => 'server',
], ],
'ruby' => [ 'ruby' => [
@ -85,6 +89,7 @@ $cli
'gitRepoName' => 'sdk-for-ruby', 'gitRepoName' => 'sdk-for-ruby',
'gitUserName' => 'appwrite', '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).**', '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', 'platform' => 'server',
], ],
'dart' => [ 'dart' => [
@ -95,6 +100,7 @@ $cli
'gitRepoName' => 'sdk-for-dart', 'gitRepoName' => 'sdk-for-dart',
'gitUserName' => 'appwrite', '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).**', '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', 'platform' => 'client',
], ],
]; ];
@ -176,8 +182,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
->setShareURL('http://appwrite.io') ->setShareURL('http://appwrite.io')
->setShareTags('JS,javascript,reactjs,angular,ios,android') ->setShareTags('JS,javascript,reactjs,angular,ios,android')
->setShareVia('appwrite_io') ->setShareVia('appwrite_io')
//->setWarning('**WORK IN PROGRESS - NOT READY FOR USAGE**')
->setWarning($client['warning']) ->setWarning($client['warning'])
->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : '')
; ;
$target = __DIR__.'/../sdks/git/'.$name; $target = __DIR__.'/../sdks/git/'.$name;

View file

@ -238,7 +238,7 @@
data-event="submit" data-event="submit"
data-success="trigger,redirect" data-success="trigger,redirect"
data-success-param-trigger-events="session-delete" data-success-param-trigger-events="session-delete"
data-success-redirect-url="/" data-success-param-redirect-url="/"
data-failure="alert" data-failure="alert"
data-failure-param-alert-text="Logout from All Sessions Failed" data-failure-param-alert-text="Logout from All Sessions Failed"
data-failure-param-alert-classname="error"> data-failure-param-alert-classname="error">

View file

@ -6,7 +6,7 @@
data-param-token="{{router.params.token}}" data-param-token="{{router.params.token}}"
data-param-user-id="{{router.params.userId}}" data-param-user-id="{{router.params.userId}}"
data-success="redirect,alert,trigger" data-success="redirect,alert,trigger"
data-success-redirect-url="/console" data-success-param-redirect-url="/console"
data-success-alert="Confirmation Completed Successfully" data-success-alert="Confirmation Completed Successfully"
data-success-triggers="account.update" data-success-triggers="account.update"
data-failure="alert" data-failure="alert"

View file

@ -13,8 +13,8 @@
data-scope="console" data-scope="console"
data-event="submit" data-event="submit"
data-success="alert,redirect" data-success="alert,redirect"
data-success-alert="Password Reset Completed" data-success-param-alert="Password Reset Completed"
data-success-redirect-url="/auth/signin" data-success-param-url="/auth/signin"
data-failure="alert" data-failure="alert"
data-failure-param-alert-text="Password Reset Failed" data-failure-param-alert-text="Password Reset Failed"
data-failure-param-alert-classname="error"> data-failure-param-alert-classname="error">

View file

@ -13,7 +13,7 @@
data-event="submit" data-event="submit"
data-success="trigger,redirect" data-success="trigger,redirect"
data-success-param-trigger-events="auth-register" data-success-param-trigger-events="auth-register"
data-success-redirect-url="/console/setup" data-success-param-redirect-url="/console/setup"
data-failure="alert" data-failure="alert"
data-failure-param-alert-text="Registration Failed. Please try again later" data-failure-param-alert-text="Registration Failed. Please try again later"
data-failure-param-alert-classname="error"> data-failure-param-alert-classname="error">

28
composer.lock generated
View file

@ -12,12 +12,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/appwrite/sdk-for-php.git", "url": "https://github.com/appwrite/sdk-for-php.git",
"reference": "ab0fe8f5669e6a8fc7a8d5e8c711f939412fb33e" "reference": "ac310ede83c8520c038fdab6e646322eb634d9e3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/ab0fe8f5669e6a8fc7a8d5e8c711f939412fb33e", "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/ac310ede83c8520c038fdab6e646322eb634d9e3",
"reference": "ab0fe8f5669e6a8fc7a8d5e8c711f939412fb33e", "reference": "ac310ede83c8520c038fdab6e646322eb634d9e3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -39,7 +39,7 @@
"BSD-3-Clause" "BSD-3-Clause"
], ],
"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)", "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)",
"time": "2019-10-03T22:07:26+00:00" "time": "2019-10-09T10:26:29+00:00"
}, },
{ {
"name": "appwrite/php-clamav", "name": "appwrite/php-clamav",
@ -92,7 +92,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/appwrite/sdk-generator", "url": "https://github.com/appwrite/sdk-generator",
"reference": "0ece44cf81c04ebb8784a60830b088238189ec78" "reference": "45d82c2c53c38926a45c5e153aaa4794860954a0"
}, },
"require": { "require": {
"ext-curl": "*", "ext-curl": "*",
@ -122,7 +122,7 @@
} }
], ],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2019-10-04 05:50:53" "time": "2019-10-09 14:12:31"
}, },
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -1440,12 +1440,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "4625774716e3737580e407a02e53ff4defd3cdfa" "reference": "23419a940881f50525515726eec7507792ace5e0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/4625774716e3737580e407a02e53ff4defd3cdfa", "url": "https://api.github.com/repos/twigphp/Twig/zipball/23419a940881f50525515726eec7507792ace5e0",
"reference": "4625774716e3737580e407a02e53ff4defd3cdfa", "reference": "23419a940881f50525515726eec7507792ace5e0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1499,7 +1499,7 @@
"keywords": [ "keywords": [
"templating" "templating"
], ],
"time": "2019-10-01T10:31:38+00:00" "time": "2019-10-05T16:44:39+00:00"
}, },
{ {
"name": "utopia-php/abuse", "name": "utopia-php/abuse",
@ -2409,12 +2409,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" "reference": "36bdcb91de0484f77e256fd3d6119dcf7171c164"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/36bdcb91de0484f77e256fd3d6119dcf7171c164",
"reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "reference": "36bdcb91de0484f77e256fd3d6119dcf7171c164",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2450,7 +2450,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2019-09-17T06:23:10+00:00" "time": "2019-10-05T05:20:56+00:00"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",

View file

@ -6,6 +6,7 @@ services:
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./app:/usr/share/nginx/html/app - ./app:/usr/share/nginx/html/app
- ./docs:/usr/share/nginx/html/docs
- ./public:/usr/share/nginx/html/public - ./public:/usr/share/nginx/html/public
- ./src:/usr/share/nginx/html/src - ./src:/usr/share/nginx/html/src
- ./vendor:/usr/share/nginx/html/vendor - ./vendor:/usr/share/nginx/html/vendor

View file

@ -0,0 +1 @@
test

View file

@ -0,0 +1 @@
test 1

View file

@ -0,0 +1 @@
test 2

View file

@ -0,0 +1 @@
Update user preferences by its unique ID. You can pass only the specific settings you wish to update.

15
docs/sdks/js.md Normal file
View file

@ -0,0 +1,15 @@
## 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
;
```

View file

@ -1 +1,5 @@
The account service allow you to fetch and update information related to the currently logged in user. You can also retrieve a list of all the user sessions across different devices and a security log with the account recent activity. The account service allows you to fetch and update information related to the currently logged-in user. You can use the service to retrieve a list of all the user sessions across different devices and a security log with the recent account activity.
Using the account service, you can also allow the logged-in user to update his account name, email, or passwords.
This service also exposes an endpoint to save and read [user preferences](/docs/account#updatePrefs) as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user preferred locale, timezone, or custom app theme. The usage of this feature is only limited only by your imagination.

View file

@ -1,3 +1,3 @@
The authentication service allows you to verify users accounts using basic email and password login or with a supported OAuth provider. The auth service also exposes methods to confirm users email account and recover users forgotten passwords. The authentication service allows you to verify users' accounts using basic email and password login or with a supported OAuth provider. The auth service also exposes methods to confirm users' email account and recover users forgotten passwords.
You can review our currently available OAuth providers from your project console under the **'users'** menu. You can review and enable our currently available OAuth providers from your project console under the **'users -> providers'** menu.

View file

@ -1 +1,5 @@
The avatars service aims to help you complete common and recitative tasks related to your app images, icons and avatars. Using this service we hope to save you some precious time and help you focus on solving your app real challenges. The avatars service aims to help you complete everyday tasks related to your app images, icons, and avatars. Using this service, we hope to save you some precious time and help you focus on solving your real app challenges.
The Avatars service allows you to fetch countries' flags, browser icons, payment methods logos, websites favicons, generate QR codes, and manipulate remote images URLs.
All endpoints in this service allow you to resize, crop, and change the output image quality to best fit in your app both in terms of look and performance.

View file

@ -1,7 +1,5 @@
The database service allows you to create structured document collections, query and filter lists of documents and manage an advanced set of read and write access. The database service allows you to create structured document collections, query and filter lists of documents, and manage an advanced set of read and write access.
All the data in the database service is stored in JSON format. The service also allows you to nest child documents and use advanced filters to search and query the database just like you would with a classic graph database. All the data in the database service is stored in JSON format. The service also allows you to nest child documents and use advanced filters to search and query the database just like you would with a classic graph database.
By leveraging the database permission management you can assign read or write access to the database documents for a specific user, team, user role or even grant public access to all visitors of your project. You can learn more about [how Appwrite handles permissions and role access control](/docs/permissions). By leveraging the database permission management, you can assign read or write access to the database documents for a specific user, team, user role, or even grant public access to all visitors to your project. You can learn more about [how Appwrite handles permissions and role access control](/docs/permissions).

View file

@ -1 +1,5 @@
The locale service allow you customize your app based on your user location. Get your user location, IP address, list of countries names, phone codes, currencies and more. This product includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com). The locale service allows you to customize your app based on your users' location. Using this service, you can get your users' location, IP address, list of countries and continents names, phone codes, currencies, and more.
The user service supports multiple locales. This feature allows you to fetch countries and continents information in your app language. To switch locales, all you need to do is pass the 'X-Appwrite-Locale' header or set the 'setLocale' method using any of our available SDKs. [View here the list of available locales](https://github.com/appwrite/appwrite/blob/master/app/init.php#L13).
This product includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com).

View file

@ -2,4 +2,4 @@ The storage service allows you to manage your project files. You can upload, vie
Each file is granted read and write permissions to manage who has access to view or manage it. You can also learn more about how to manage your [resources permissions](/docs/permissions). Each file is granted read and write permissions to manage who has access to view or manage it. You can also learn more about how to manage your [resources permissions](/docs/permissions).
You can also use the storage file preview endpoint to show the app users preview images of your files. The preview endpoint also allows you to manipulate the resulting image, so it will fit perfectly inside your app. You can also use the storage service file preview endpoint to show the app users' preview images of your files. The preview endpoint also allows you to manipulate the resulting image so that it will fit perfectly inside your app in terms of size and style.

View file

@ -1,3 +1,3 @@
The teams' service allows you to group together users of your project and allow them to share read and write access to your project resources, such as, database documents or storage files. The teams' service allows you to group users of your project and will enable them to share read and write access to your project resources, such as database documents or storage files.
Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to the team. Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to their team.

View file

@ -1 +1 @@
The users' service allows you to to manage your users in admin mode, you can search, block and view your users' current sessions and latest activity. The users' service allows you to manage your users in admin mode (AKA server-side integration). Use this service to search, block, and view your Users info, current sessions, and latest activities. You can also use the Users service to edit your users' preferences and personal info.

6
package-lock.json generated
View file

@ -834,9 +834,9 @@
} }
}, },
"appwrite": { "appwrite": {
"version": "1.0.22", "version": "1.0.23",
"resolved": "https://registry.npmjs.org/appwrite/-/appwrite-1.0.22.tgz", "resolved": "https://registry.npmjs.org/appwrite/-/appwrite-1.0.23.tgz",
"integrity": "sha512-ofwb9opdkoY+AV8W2AkZY1z7gAqRlBZhbFj4ZMC9+UYhRAtLfaGnuyfRaWIKMFt7DII2Or261newdlwL/R2NsQ==", "integrity": "sha512-L1kLLkrjy0xPOd3lgjN+ZWDbzCLXNaGIWaijypv9ty7Rzu+gkktKPfQ6mp4TdBOubQoOTvTveZd+7DiMRUXrXQ==",
"dev": true "dev": true
}, },
"archy": { "archy": {

Some files were not shown because too many files have changed in this diff Show more