feat: update console sdk, remove old specs
This commit is contained in:
parent
4f2c46ac36
commit
0123bba1fb
|
@ -162,7 +162,7 @@ return [
|
|||
[
|
||||
'key' => 'web',
|
||||
'name' => 'Console',
|
||||
'version' => '7.0.0-RC2',
|
||||
'version' => '7.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-console',
|
||||
'package' => '',
|
||||
'enabled' => true,
|
||||
|
|
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
1
app/config/specs/open-api3-1.0.0-console.json
Normal file
1
app/config/specs/open-api3-1.0.0-console.json
Normal file
File diff suppressed because one or more lines are too long
1
app/config/specs/open-api3-1.0.0-server.json
Normal file
1
app/config/specs/open-api3-1.0.0-server.json
Normal file
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
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
File diff suppressed because one or more lines are too long
1
app/config/specs/swagger2-1.0.0-console.json
Normal file
1
app/config/specs/swagger2-1.0.0-console.json
Normal file
File diff suppressed because one or more lines are too long
1
app/config/specs/swagger2-1.0.0-server.json
Normal file
1
app/config/specs/swagger2-1.0.0-server.json
Normal file
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
File diff suppressed because one or more lines are too long
|
@ -30,7 +30,7 @@ $cli
|
|||
$production = ($git) ? (Console::confirm('Type "Appwrite" to push code to production git repos') == 'Appwrite') : false;
|
||||
$message = ($git) ? Console::confirm('Please enter your commit message:') : '';
|
||||
|
||||
if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.0-RC1', 'latest'])) {
|
||||
if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.0', 'latest'])) {
|
||||
throw new Exception('Unknown version given');
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
->setTwitter(APP_SOCIAL_TWITTER_HANDLE)
|
||||
->setDiscord(APP_SOCIAL_DISCORD_CHANNEL, APP_SOCIAL_DISCORD)
|
||||
->setDefaultHeaders([
|
||||
'X-Appwrite-Response-Format' => '1.0.0-RC1',
|
||||
'X-Appwrite-Response-Format' => '1.0.0',
|
||||
]);
|
||||
|
||||
try {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createAnonymousSession();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createEmailSession('email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createJWT();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createMagicURLSession('[USER_ID]', 'email@example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
// Go to OAuth provider login page
|
||||
account.createOAuth2Session('amazon');
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createPhoneSession('[USER_ID]', '');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createPhoneVerification();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = 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,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createVerification('https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/account/create.md
Normal file
18
docs/examples/1.0.0/client-web/examples/account/create.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.create('[USER_ID]', 'email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.deleteSession('[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.deleteSessions();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/account/get-logs.md
Normal file
18
docs/examples/1.0.0/client-web/examples/account/get-logs.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.getLogs();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/account/get-prefs.md
Normal file
18
docs/examples/1.0.0/client-web/examples/account/get-prefs.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.getPrefs();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.getSession('[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.getSessions();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/account/get.md
Normal file
18
docs/examples/1.0.0/client-web/examples/account/get.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.get();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateEmail('email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateMagicURLSession('[USER_ID]', '[SECRET]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateName('[NAME]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updatePassword('password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updatePhoneSession('[USER_ID]', '[SECRET]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updatePhone('', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updatePrefs({});
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateSession('[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateStatus();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.updateVerification('[USER_ID]', '[SECRET]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getBrowser('aa');
|
||||
|
||||
console.log(result); // Resource URL
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getCreditCard('amex');
|
||||
|
||||
console.log(result); // Resource URL
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getFavicon('https://example.com');
|
||||
|
||||
console.log(result); // Resource URL
|
14
docs/examples/1.0.0/client-web/examples/avatars/get-flag.md
Normal file
14
docs/examples/1.0.0/client-web/examples/avatars/get-flag.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getFlag('af');
|
||||
|
||||
console.log(result); // Resource URL
|
14
docs/examples/1.0.0/client-web/examples/avatars/get-image.md
Normal file
14
docs/examples/1.0.0/client-web/examples/avatars/get-image.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getImage('https://example.com');
|
||||
|
||||
console.log(result); // Resource URL
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getInitials();
|
||||
|
||||
console.log(result); // Resource URL
|
14
docs/examples/1.0.0/client-web/examples/avatars/get-q-r.md
Normal file
14
docs/examples/1.0.0/client-web/examples/avatars/get-q-r.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { Client, Avatars } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const avatars = new Avatars(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = avatars.getQR('[TEXT]');
|
||||
|
||||
console.log(result); // Resource URL
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Databases } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = databases.createDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]', {});
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Databases } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = databases.deleteDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Databases } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = databases.getDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Databases } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = databases.listDocuments('[DATABASE_ID]', '[COLLECTION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Databases } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = databases.updateDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = functions.createExecution('[FUNCTION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = functions.listExecutions('[FUNCTION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.getContinents();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.getCountriesEU();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.getCountriesPhones();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.getCountries();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.getCurrencies();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.getLanguages();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/locale/get.md
Normal file
18
docs/examples/1.0.0/client-web/examples/locale/get.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Locale } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const locale = new Locale(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = locale.get();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', document.getElementById('uploader').files[0]);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
console.log(result); // Resource URL
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
console.log(result); // Resource URL
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const result = storage.getFileView('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
console.log(result); // Resource URL
|
18
docs/examples/1.0.0/client-web/examples/storage/get-file.md
Normal file
18
docs/examples/1.0.0/client-web/examples/storage/get-file.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = storage.listFiles('[BUCKET_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Storage } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const storage = new Storage(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = storage.updateFile('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/teams/create.md
Normal file
18
docs/examples/1.0.0/client-web/examples/teams/create.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.create('[TEAM_ID]', '[NAME]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/teams/delete.md
Normal file
18
docs/examples/1.0.0/client-web/examples/teams/delete.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.delete('[TEAM_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.getMemberships('[TEAM_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/teams/get.md
Normal file
18
docs/examples/1.0.0/client-web/examples/teams/get.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.get('[TEAM_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.listMemberships('[TEAM_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/teams/list.md
Normal file
18
docs/examples/1.0.0/client-web/examples/teams/list.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.list();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/client-web/examples/teams/update.md
Normal file
18
docs/examples/1.0.0/client-web/examples/teams/update.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Teams } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const teams = new Teams(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = teams.update('[TEAM_ID]', '[NAME]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createAnonymousSession();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createEmailSession('email@example.com', 'password');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createJWT();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createMagicURLSession('[USER_ID]', 'email@example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
// Go to OAuth provider login page
|
||||
account.createOAuth2Session('amazon');
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createPhoneSession('[USER_ID]', '');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createPhoneVerification();
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = 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,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.createVerification('https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
18
docs/examples/1.0.0/console-web/examples/account/create.md
Normal file
18
docs/examples/1.0.0/console-web/examples/account/create.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Client, Account } from "appwrite";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
const account = new Account(client);
|
||||
|
||||
client
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
const promise = account.create('[USER_ID]', 'email@example.com', 'password');
|
||||
|
||||
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