mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '0.8.x' of github.com:appwrite/appwrite into 0.8.x
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Version 0.8.0 (Not Released Yet)
|
||||
# Version 0.8.0
|
||||
|
||||
## Features
|
||||
- Refactoring SSL generation to work on every request so no domain environment variable is required for SSL generation (#1133)
|
||||
|
||||
+11
-11
@@ -15,7 +15,7 @@ return [
|
||||
[
|
||||
'key' => 'web',
|
||||
'name' => 'Web',
|
||||
'version' => '2.0.0',
|
||||
'version' => '3.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-web',
|
||||
'package' => 'https://www.npmjs.com/package/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -62,7 +62,7 @@ return [
|
||||
[
|
||||
'key' => 'flutter',
|
||||
'name' => 'Flutter',
|
||||
'version' => '0.5.0-dev.1',
|
||||
'version' => '0.6.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-flutter',
|
||||
'package' => 'https://pub.dev/packages/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -151,7 +151,7 @@ return [
|
||||
[
|
||||
'key' => 'web',
|
||||
'name' => 'Console',
|
||||
'version' => '1.0.0',
|
||||
'version' => '2.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-console',
|
||||
'package' => '',
|
||||
'enabled' => true,
|
||||
@@ -178,7 +178,7 @@ return [
|
||||
[
|
||||
'key' => 'nodejs',
|
||||
'name' => 'Node.js',
|
||||
'version' => '2.1.0',
|
||||
'version' => '2.2.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-node',
|
||||
'package' => 'https://www.npmjs.com/package/node-appwrite',
|
||||
'enabled' => true,
|
||||
@@ -195,7 +195,7 @@ return [
|
||||
[
|
||||
'key' => 'deno',
|
||||
'name' => 'Deno',
|
||||
'version' => '0.1.1',
|
||||
'version' => '0.2.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-deno',
|
||||
'package' => 'https://deno.land/x/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -212,7 +212,7 @@ return [
|
||||
[
|
||||
'key' => 'php',
|
||||
'name' => 'PHP',
|
||||
'version' => '2.0.0',
|
||||
'version' => '2.1.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-php',
|
||||
'package' => 'https://packagist.org/packages/appwrite/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -229,7 +229,7 @@ return [
|
||||
[
|
||||
'key' => 'python',
|
||||
'name' => 'Python',
|
||||
'version' => '0.1.1',
|
||||
'version' => '0.2.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-python',
|
||||
'package' => 'https://pypi.org/project/appwrite/',
|
||||
'enabled' => true,
|
||||
@@ -246,7 +246,7 @@ return [
|
||||
[
|
||||
'key' => 'ruby',
|
||||
'name' => 'Ruby',
|
||||
'version' => '2.0.2',
|
||||
'version' => '2.1.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-ruby',
|
||||
'package' => 'https://rubygems.org/gems/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -297,7 +297,7 @@ return [
|
||||
[
|
||||
'key' => 'dotnet',
|
||||
'name' => '.NET',
|
||||
'version' => '0.2.0',
|
||||
'version' => '0.3.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-dotnet',
|
||||
'package' => 'https://www.nuget.org/packages/Appwrite',
|
||||
'enabled' => true,
|
||||
@@ -314,7 +314,7 @@ return [
|
||||
[
|
||||
'key' => 'dart',
|
||||
'name' => 'Dart',
|
||||
'version' => '0.5.0-dev.1',
|
||||
'version' => '0.6.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-dart',
|
||||
'package' => 'https://pub.dev/packages/dart_appwrite',
|
||||
'enabled' => true,
|
||||
@@ -331,7 +331,7 @@ return [
|
||||
[
|
||||
'key' => 'cli',
|
||||
'name' => 'Command Line',
|
||||
'version' => '0.8.0',
|
||||
'version' => '0.9.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-cli',
|
||||
'package' => 'https://github.com/appwrite/sdk-for-cli',
|
||||
'enabled' => true,
|
||||
|
||||
@@ -10,6 +10,6 @@ $runtimes = new Runtimes();
|
||||
|
||||
$allowList = empty(App::getEnv('_APP_FUNCTIONS_RUNTIMES')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_RUNTIMES'));
|
||||
|
||||
$runtimes = $runtimes->getAll(filter: $allowList);
|
||||
$runtimes = $runtimes->getAll(true, $allowList);
|
||||
|
||||
return $runtimes;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -14,6 +14,7 @@ return [
|
||||
'default' => 'production',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_LOCALE',
|
||||
@@ -22,6 +23,7 @@ return [
|
||||
'default' => 'en',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_OPTIONS_ABUSE',
|
||||
@@ -30,6 +32,7 @@ return [
|
||||
'default' => 'enabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_OPTIONS_FORCE_HTTPS',
|
||||
@@ -38,6 +41,7 @@ return [
|
||||
'default' => 'disabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_OPENSSL_KEY_V1',
|
||||
@@ -46,6 +50,7 @@ return [
|
||||
'default' => 'your-secret-key',
|
||||
'required' => true,
|
||||
'question' => 'Choose a secret API key, make sure to make a backup of your key in a secure location',
|
||||
'filter' => 'token'
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DOMAIN',
|
||||
@@ -54,6 +59,7 @@ return [
|
||||
'default' => 'localhost',
|
||||
'required' => true,
|
||||
'question' => 'Enter your Appwrite hostname',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DOMAIN_TARGET',
|
||||
@@ -62,6 +68,7 @@ return [
|
||||
'default' => 'localhost',
|
||||
'required' => true,
|
||||
'question' => 'Enter a DNS A record hostname to serve as a CNAME for your custom domains.\nYou can use the same value as used for the Appwrite hostname.',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_CONSOLE_WHITELIST_ROOT',
|
||||
@@ -70,6 +77,7 @@ return [
|
||||
'default' => 'enabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_CONSOLE_WHITELIST_EMAILS',
|
||||
@@ -78,6 +86,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
// [
|
||||
// 'name' => '_APP_CONSOLE_WHITELIST_DOMAINS',
|
||||
@@ -94,6 +103,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SYSTEM_EMAIL_NAME',
|
||||
@@ -102,6 +112,7 @@ return [
|
||||
'default' => 'Appwrite',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SYSTEM_EMAIL_ADDRESS',
|
||||
@@ -110,6 +121,7 @@ return [
|
||||
'default' => 'team@appwrite.io',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SYSTEM_RESPONSE_FORMAT',
|
||||
@@ -118,6 +130,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SYSTEM_SECURITY_EMAIL_ADDRESS',
|
||||
@@ -126,6 +139,7 @@ return [
|
||||
'default' => 'certs@appwrite.io',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_USAGE_STATS',
|
||||
@@ -134,6 +148,7 @@ return [
|
||||
'default' => 'enabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -148,6 +163,7 @@ return [
|
||||
'default' => 'redis',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_REDIS_PORT',
|
||||
@@ -156,6 +172,7 @@ return [
|
||||
'default' => '6379',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_REDIS_USER',
|
||||
@@ -164,6 +181,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_REDIS_PASS',
|
||||
@@ -172,6 +190,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -186,6 +205,7 @@ return [
|
||||
'default' => 'mariadb',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DB_PORT',
|
||||
@@ -194,6 +214,7 @@ return [
|
||||
'default' => '3306',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DB_SCHEMA',
|
||||
@@ -202,6 +223,7 @@ return [
|
||||
'default' => 'appwrite',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DB_USER',
|
||||
@@ -210,6 +232,7 @@ return [
|
||||
'default' => 'user',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DB_PASS',
|
||||
@@ -218,6 +241,16 @@ return [
|
||||
'default' => 'password',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => 'password'
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DB_ROOT_PASS',
|
||||
'description' => 'MariaDB server root password. Default value is: \'rootsecretpassword\'.',
|
||||
'introduction' => '',
|
||||
'default' => 'rootsecretpassword',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => 'password'
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -232,6 +265,7 @@ return [
|
||||
'default' => 'influxdb',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_INFLUXDB_PORT',
|
||||
@@ -240,6 +274,7 @@ return [
|
||||
'default' => '8086',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -254,6 +289,7 @@ return [
|
||||
'default' => 'telegraf',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_STATSD_PORT',
|
||||
@@ -262,6 +298,7 @@ return [
|
||||
'default' => '8125',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -276,6 +313,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SMTP_PORT',
|
||||
@@ -284,6 +322,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SMTP_SECURE',
|
||||
@@ -292,6 +331,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SMTP_USERNAME',
|
||||
@@ -300,6 +340,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_SMTP_PASSWORD',
|
||||
@@ -308,6 +349,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -322,6 +364,7 @@ return [
|
||||
'default' => '10000000',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_STORAGE_ANTIVIRUS',
|
||||
@@ -330,6 +373,7 @@ return [
|
||||
'default' => 'disabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_STORAGE_ANTIVIRUS_HOST',
|
||||
@@ -338,6 +382,7 @@ return [
|
||||
'default' => 'clamav',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_STORAGE_ANTIVIRUS_PORT',
|
||||
@@ -346,6 +391,7 @@ return [
|
||||
'default' => '3310',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -360,6 +406,7 @@ return [
|
||||
'default' => '900',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_CONTAINERS',
|
||||
@@ -368,6 +415,7 @@ return [
|
||||
'default' => '10',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_CPUS',
|
||||
@@ -376,6 +424,7 @@ return [
|
||||
'default' => '',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_MEMORY',
|
||||
@@ -384,6 +433,7 @@ return [
|
||||
'default' => '256',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_MEMORY_SWAP',
|
||||
@@ -392,6 +442,7 @@ return [
|
||||
'default' => '256',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_RUNTIMES',
|
||||
@@ -400,6 +451,7 @@ return [
|
||||
'default' => 'node-15.5,deno-1.8,php-8.0,python-3.9,ruby-3.0,dotnet-5.0',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_ENVS',
|
||||
@@ -408,6 +460,7 @@ return [
|
||||
'default' => 'node-14.5,deno-1.8,php-7.4,python-3.9,ruby-3.0,dotnet-5.0',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
],
|
||||
[
|
||||
@@ -421,6 +474,7 @@ return [
|
||||
'default' => '86400',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_MAINTENANCE_RETENTION_EXECUTION',
|
||||
@@ -429,6 +483,7 @@ return [
|
||||
'default' => '1209600',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_MAINTENANCE_RETENTION_AUDIT',
|
||||
@@ -437,6 +492,7 @@ return [
|
||||
'default' => '1209600',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_MAINTENANCE_RETENTION_ABUSE',
|
||||
@@ -445,6 +501,7 @@ return [
|
||||
'default' => '86400',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
]
|
||||
],
|
||||
],
|
||||
|
||||
+2
-2
@@ -170,8 +170,8 @@ $register->set('influxdb', function () { // Register DB connection
|
||||
if (empty($host) || empty($port)) {
|
||||
return;
|
||||
}
|
||||
$driver = new InfluxDB\Driver\Curl(dsn: "http://{$host}:{$port}");
|
||||
$client = new InfluxDB\Client(host: $host, port: $port, timeout: 5);
|
||||
$driver = new InfluxDB\Driver\Curl("http://{$host}:{$port}");
|
||||
$client = new InfluxDB\Client($host, $port, '', '', false, false, 5);
|
||||
$client->setDriver($driver);
|
||||
|
||||
return $client;
|
||||
|
||||
+27
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
global $cli;
|
||||
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Docker\Compose;
|
||||
use Appwrite\Docker\Env;
|
||||
use Utopia\Analytics\GoogleAnalytics;
|
||||
@@ -15,8 +16,10 @@ $cli
|
||||
->desc('Install Appwrite')
|
||||
->param('httpPort', '', new Text(4), 'Server HTTP port', true)
|
||||
->param('httpsPort', '', new Text(4), 'Server HTTPS port', true)
|
||||
->param('organization', 'appwrite', new Text(0), 'Docker Registry organization', true)
|
||||
->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true)
|
||||
->param('interactive','Y', new Text(1), 'Run an interactive session', true)
|
||||
->action(function ($httpPort, $httpsPort, $interactive) {
|
||||
->action(function ($httpPort, $httpsPort, $organization, $image, $interactive) {
|
||||
/**
|
||||
* 1. Start - DONE
|
||||
* 2. Check for older setup and get older version - DONE
|
||||
@@ -64,6 +67,9 @@ $cli
|
||||
$data = @file_get_contents($path.'/docker-compose.yml');
|
||||
|
||||
if($data !== false) {
|
||||
$time = \time();
|
||||
Console::info('Compose file found, creating backup: docker-compose.yml.'.$time.'.backup');
|
||||
file_put_contents($path.'/docker-compose.yml.'.$time.'.backup',$data);
|
||||
$compose = new Compose($data);
|
||||
$appwrite = $compose->getService('appwrite');
|
||||
$oldVersion = ($appwrite) ? $appwrite->getImageVersion() : null;
|
||||
@@ -89,6 +95,8 @@ $cli
|
||||
$data = @file_get_contents($path.'/.env');
|
||||
|
||||
if($data !== false) { // Fetch all env vars from previous .env file
|
||||
Console::info('Env file found, creating backup: .env.'.$time.'.backup');
|
||||
file_put_contents($path.'/.env.'.$time.'.backup',$data);
|
||||
$env = new Env($data);
|
||||
|
||||
foreach ($env->list() as $key => $value) {
|
||||
@@ -125,6 +133,22 @@ $cli
|
||||
$input = [];
|
||||
|
||||
foreach($vars as $key => $var) {
|
||||
if(!empty($var['filter']) && ($interactive !== 'Y' || !Console::isInteractive())) {
|
||||
if($data && $var['default'] !== null) {
|
||||
$input[$var['name']] = $var['default'];
|
||||
continue;
|
||||
}
|
||||
|
||||
if($var['filter'] === 'token') {
|
||||
$input[$var['name']] = Auth::tokenGenerator();
|
||||
continue;
|
||||
}
|
||||
|
||||
if($var['filter'] === 'password') {
|
||||
$input[$var['name']] = Auth::passwordGenerator();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(!$var['required'] || !Console::isInteractive() || $interactive !== 'Y') {
|
||||
$input[$var['name']] = $var['default'];
|
||||
continue;
|
||||
@@ -144,6 +168,8 @@ $cli
|
||||
->setParam('httpPort', $httpPort)
|
||||
->setParam('httpsPort', $httpsPort)
|
||||
->setParam('version', APP_VERSION_STABLE)
|
||||
->setParam('organization', $organization)
|
||||
->setParam('image', $image)
|
||||
;
|
||||
|
||||
$templateForEnv
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
$httpPort = $this->getParam('httpPort', '');
|
||||
$httpsPort = $this->getParam('httpsPort', '');
|
||||
$version = $this->getParam('version', '');
|
||||
$organization = $this->getParam('organization', '');
|
||||
$image = $this->getParam('image', '');
|
||||
?>version: '3'
|
||||
|
||||
services:
|
||||
@@ -32,7 +34,7 @@ services:
|
||||
- appwrite
|
||||
|
||||
appwrite:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
container_name: appwrite
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
@@ -98,7 +100,7 @@ services:
|
||||
- _APP_FUNCTIONS_RUNTIMES
|
||||
|
||||
appwrite-worker-usage:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-usage
|
||||
container_name: appwrite-worker-usage
|
||||
restart: unless-stopped
|
||||
@@ -117,7 +119,7 @@ services:
|
||||
- _APP_STATSD_PORT
|
||||
|
||||
appwrite-worker-audits:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-audits
|
||||
container_name: appwrite-worker-audits
|
||||
restart: unless-stopped
|
||||
@@ -139,7 +141,7 @@ services:
|
||||
- _APP_DB_PASS
|
||||
|
||||
appwrite-worker-webhooks:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-webhooks
|
||||
container_name: appwrite-worker-webhooks
|
||||
restart: unless-stopped
|
||||
@@ -162,7 +164,7 @@ services:
|
||||
- _APP_DB_PASS
|
||||
|
||||
appwrite-worker-tasks:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-tasks
|
||||
container_name: appwrite-worker-tasks
|
||||
restart: unless-stopped
|
||||
@@ -185,7 +187,7 @@ services:
|
||||
- _APP_DB_PASS
|
||||
|
||||
appwrite-worker-deletes:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-deletes
|
||||
container_name: appwrite-worker-deletes
|
||||
restart: unless-stopped
|
||||
@@ -211,7 +213,7 @@ services:
|
||||
- _APP_DB_PASS
|
||||
|
||||
appwrite-worker-certificates:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-certificates
|
||||
container_name: appwrite-worker-certificates
|
||||
restart: unless-stopped
|
||||
@@ -238,7 +240,7 @@ services:
|
||||
- _APP_DB_PASS
|
||||
|
||||
appwrite-worker-functions:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-functions
|
||||
container_name: appwrite-worker-functions
|
||||
restart: unless-stopped
|
||||
@@ -271,7 +273,7 @@ services:
|
||||
- _APP_USAGE_STATS
|
||||
|
||||
appwrite-worker-mails:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-mails
|
||||
container_name: appwrite-worker-mails
|
||||
restart: unless-stopped
|
||||
@@ -294,7 +296,7 @@ services:
|
||||
- _APP_SMTP_PASSWORD
|
||||
|
||||
appwrite-maintenance:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: maintenance
|
||||
container_name: appwrite-maintenance
|
||||
restart: unless-stopped
|
||||
@@ -315,7 +317,7 @@ services:
|
||||
|
||||
|
||||
appwrite-schedule:
|
||||
image: appwrite/appwrite:<?php echo $version."\n"; ?>
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: schedule
|
||||
container_name: appwrite-schedule
|
||||
restart: unless-stopped
|
||||
@@ -339,7 +341,7 @@ services:
|
||||
volumes:
|
||||
- appwrite-mariadb:/var/lib/mysql:rw
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=rootsecretpassword
|
||||
- MYSQL_ROOT_PASSWORD=${_APP_DB_ROOT_PASS}
|
||||
- MYSQL_DATABASE=${_APP_DB_SCHEMA}
|
||||
- MYSQL_USER=${_APP_DB_USER}
|
||||
- MYSQL_PASSWORD=${_APP_DB_PASS}
|
||||
|
||||
+1
-7
@@ -62,17 +62,11 @@
|
||||
"slickdeals/statsd": "3.0.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"appwrite/sdk-generator": "dev-feat-preps-for-0.8",
|
||||
"appwrite/sdk-generator": "0.10.0",
|
||||
"swoole/ide-helper": "4.6.6",
|
||||
"phpunit/phpunit": "9.5.4",
|
||||
"vimeo/psalm": "4.7.2"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator"
|
||||
}
|
||||
],
|
||||
"provide": {
|
||||
"ext-phpiredis": "*"
|
||||
},
|
||||
|
||||
Generated
+17
-8
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "407185a7ffb14acda25f4a449cdb5ffb",
|
||||
"content-hash": "12f7991bdbf788150ccfe56732955bd9",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
@@ -2340,11 +2340,17 @@
|
||||
},
|
||||
{
|
||||
"name": "appwrite/sdk-generator",
|
||||
"version": "dev-feat-preps-for-0.8",
|
||||
"version": "0.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "a8d90fd59db39ec04914692bd6ab06e013977b77"
|
||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||
"reference": "fa94c9fec1dda8707d3b77c65f1a8c6115e2e6a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/fa94c9fec1dda8707d3b77c65f1a8c6115e2e6a1",
|
||||
"reference": "fa94c9fec1dda8707d3b77c65f1a8c6115e2e6a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
@@ -2364,6 +2370,7 @@
|
||||
"Appwrite\\Spec\\": "src/Spec"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
@@ -2374,7 +2381,11 @@
|
||||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2021-05-05T12:50:58+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
||||
"source": "https://github.com/appwrite/sdk-generator/tree/0.10.0"
|
||||
},
|
||||
"time": "2021-05-18T18:51:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/package-versions-deprecated",
|
||||
@@ -5924,9 +5935,7 @@
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {
|
||||
"appwrite/sdk-generator": 20
|
||||
},
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
Future result = account.createAnonymousSession();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
Future result = account.createJWT();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
Future result = account.createOAuth2Session(
|
||||
provider: 'amazon',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.createRecovery(
|
||||
email: 'email@example.com',
|
||||
url: 'https://example.com',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
Future result = account.createSession(
|
||||
email: 'email@example.com',
|
||||
password: 'password',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.createVerification(
|
||||
url: 'https://example.com',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
Future result = account.create(
|
||||
email: 'email@example.com',
|
||||
password: 'password',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.deleteSession(
|
||||
sessionId: '[SESSION_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.deleteSessions();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.delete();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.getLogs();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.getPrefs();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.getSessions();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.get();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.updateEmail(
|
||||
email: 'email@example.com',
|
||||
password: 'password',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.updateName(
|
||||
name: '[NAME]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.updatePassword(
|
||||
password: 'password',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.updatePrefs(
|
||||
prefs: {},
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.updateRecovery(
|
||||
userId: '[USER_ID]',
|
||||
secret: '[SECRET]',
|
||||
password: 'password',
|
||||
passwordAgain: 'password',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Account account = Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = account.updateVerification(
|
||||
userId: '[USER_ID]',
|
||||
secret: '[SECRET]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getBrowser(
|
||||
code: 'aa',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getCreditCard(
|
||||
code: 'amex',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getFavicon(
|
||||
url: 'https://example.com',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getFlag(
|
||||
code: 'af',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getImage(
|
||||
url: 'https://example.com',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getInitials(
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Avatars avatars = Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: avatars.getQR(
|
||||
text: '[TEXT]',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Database database = Database(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = database.createDocument(
|
||||
collectionId: '[COLLECTION_ID]',
|
||||
data: {},
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Database database = Database(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = database.deleteDocument(
|
||||
collectionId: '[COLLECTION_ID]',
|
||||
documentId: '[DOCUMENT_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Database database = Database(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = database.getDocument(
|
||||
collectionId: '[COLLECTION_ID]',
|
||||
documentId: '[DOCUMENT_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Database database = Database(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = database.listDocuments(
|
||||
collectionId: '[COLLECTION_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Database database = Database(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = database.updateDocument(
|
||||
collectionId: '[COLLECTION_ID]',
|
||||
documentId: '[DOCUMENT_ID]',
|
||||
data: {},
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Functions functions = Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = functions.createExecution(
|
||||
functionId: '[FUNCTION_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Functions functions = Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = functions.getExecution(
|
||||
functionId: '[FUNCTION_ID]',
|
||||
executionId: '[EXECUTION_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Functions functions = Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = functions.listExecutions(
|
||||
functionId: '[FUNCTION_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.getContinents();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.getCountriesEU();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.getCountriesPhones();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.getCountries();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.getCurrencies();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.getLanguages();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Locale locale = Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = locale.get();
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'dart:io';
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = storage.createFile(
|
||||
file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = storage.deleteFile(
|
||||
fileId: '[FILE_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: storage.getFileDownload(
|
||||
fileId: '[FILE_ID]',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: storage.getFilePreview(
|
||||
fileId: '[FILE_ID]',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
}
|
||||
|
||||
//displaying image
|
||||
FutureBuilder(
|
||||
future: storage.getFileView(
|
||||
fileId: '[FILE_ID]',
|
||||
), //works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(
|
||||
snapshot.data.data,
|
||||
)
|
||||
: CircularProgressIndicator();
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = storage.getFile(
|
||||
fileId: '[FILE_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = storage.listFiles(
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Storage storage = Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = storage.updateFile(
|
||||
fileId: '[FILE_ID]',
|
||||
read: [],
|
||||
write: [],
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.createMembership(
|
||||
teamId: '[TEAM_ID]',
|
||||
email: 'email@example.com',
|
||||
roles: [],
|
||||
url: 'https://example.com',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.create(
|
||||
name: '[NAME]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.deleteMembership(
|
||||
teamId: '[TEAM_ID]',
|
||||
membershipId: '[MEMBERSHIP_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.delete(
|
||||
teamId: '[TEAM_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.getMemberships(
|
||||
teamId: '[TEAM_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.get(
|
||||
teamId: '[TEAM_ID]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.list(
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.updateMembershipRoles(
|
||||
teamId: '[TEAM_ID]',
|
||||
membershipId: '[MEMBERSHIP_ID]',
|
||||
roles: [],
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.updateMembershipStatus(
|
||||
teamId: '[TEAM_ID]',
|
||||
membershipId: '[MEMBERSHIP_ID]',
|
||||
userId: '[USER_ID]',
|
||||
secret: '[SECRET]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
void main() { // Init SDK
|
||||
Client client = Client();
|
||||
Teams teams = Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
Future result = teams.update(
|
||||
teamId: '[TEAM_ID]',
|
||||
name: '[NAME]',
|
||||
);
|
||||
|
||||
result
|
||||
.then((response) {
|
||||
print(response);
|
||||
}).catchError((error) {
|
||||
print(error.response);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.createAnonymousSession();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.createJWT();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
// Go to OAuth provider login page
|
||||
sdk.account.createOAuth2Session('amazon');
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.createRecovery('email@example.com', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.createSession('email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.createVerification('https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.create('email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.deleteSession('[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.deleteSessions();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.delete();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.getLogs();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.getPrefs();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.getSessions();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.get();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.updateEmail('email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.updateName('[NAME]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.updatePassword('password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.updatePrefs({});
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getBrowser('aa');
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getCreditCard('amex');
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getFavicon('https://example.com');
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getFlag('af');
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getImage('https://example.com');
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getInitials();
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,11 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let result = sdk.avatars.getQR('[TEXT]');
|
||||
|
||||
console.log(result); // Resource URL
|
||||
@@ -0,0 +1,15 @@
|
||||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
||||
;
|
||||
|
||||
let promise = sdk.database.createDocument('[COLLECTION_ID]', {});
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user