mirror of
https://github.com/appwrite/appwrite
synced 2026-05-06 06:48:22 +00:00
Merge pull request #1157 from appwrite/feat-update-code-examples
Feat update code examples
This commit is contained in:
commit
552c67d9f3
1004 changed files with 15562 additions and 22 deletions
|
|
@ -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
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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": "*"
|
||||
},
|
||||
|
|
|
|||
25
composer.lock
generated
25
composer.lock
generated
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
20
docs/examples/0.8.x/client-flutter/examples/account/get.md
Normal file
20
docs/examples/0.8.x/client-flutter/examples/account/get.md
Normal file
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
20
docs/examples/0.8.x/client-flutter/examples/locale/get.md
Normal file
20
docs/examples/0.8.x/client-flutter/examples/locale/get.md
Normal file
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
22
docs/examples/0.8.x/client-flutter/examples/teams/create.md
Normal file
22
docs/examples/0.8.x/client-flutter/examples/teams/create.md
Normal file
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
22
docs/examples/0.8.x/client-flutter/examples/teams/delete.md
Normal file
22
docs/examples/0.8.x/client-flutter/examples/teams/delete.md
Normal file
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
22
docs/examples/0.8.x/client-flutter/examples/teams/get.md
Normal file
22
docs/examples/0.8.x/client-flutter/examples/teams/get.md
Normal file
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
21
docs/examples/0.8.x/client-flutter/examples/teams/list.md
Normal file
21
docs/examples/0.8.x/client-flutter/examples/teams/list.md
Normal file
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
23
docs/examples/0.8.x/client-flutter/examples/teams/update.md
Normal file
23
docs/examples/0.8.x/client-flutter/examples/teams/update.md
Normal file
|
|
@ -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
|
||||
});
|
||||
14
docs/examples/0.8.x/client-web/examples/account/create.md
Normal file
14
docs/examples/0.8.x/client-web/examples/account/create.md
Normal file
|
|
@ -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
|
||||
});
|
||||
15
docs/examples/0.8.x/client-web/examples/account/delete.md
Normal file
15
docs/examples/0.8.x/client-web/examples/account/delete.md
Normal file
|
|
@ -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
|
||||
});
|
||||
15
docs/examples/0.8.x/client-web/examples/account/get-logs.md
Normal file
15
docs/examples/0.8.x/client-web/examples/account/get-logs.md
Normal file
|
|
@ -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
|
||||
});
|
||||
15
docs/examples/0.8.x/client-web/examples/account/get-prefs.md
Normal file
15
docs/examples/0.8.x/client-web/examples/account/get-prefs.md
Normal file
|
|
@ -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
|
||||
});
|
||||
15
docs/examples/0.8.x/client-web/examples/account/get.md
Normal file
15
docs/examples/0.8.x/client-web/examples/account/get.md
Normal file
|
|
@ -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
|
||||
11
docs/examples/0.8.x/client-web/examples/avatars/get-flag.md
Normal file
11
docs/examples/0.8.x/client-web/examples/avatars/get-flag.md
Normal file
|
|
@ -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
|
||||
11
docs/examples/0.8.x/client-web/examples/avatars/get-image.md
Normal file
11
docs/examples/0.8.x/client-web/examples/avatars/get-image.md
Normal file
|
|
@ -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
|
||||
11
docs/examples/0.8.x/client-web/examples/avatars/get-q-r.md
Normal file
11
docs/examples/0.8.x/client-web/examples/avatars/get-q-r.md
Normal file
|
|
@ -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
|
||||
});
|
||||
|
|
@ -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.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_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.database.getDocument('[COLLECTION_ID]', '[DOCUMENT_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.database.listDocuments('[COLLECTION_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.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_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.functions.createExecution('[FUNCTION_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
Loading…
Reference in a new issue