node-appwrite 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/docs/examples/account/create-phone-verification.md +20 -0
- package/docs/examples/account/create-recovery.md +3 -3
- package/docs/examples/account/create-verification.md +3 -3
- package/docs/examples/account/delete-session.md +3 -3
- package/docs/examples/account/delete-sessions.md +3 -3
- package/docs/examples/account/get-logs.md +3 -3
- package/docs/examples/account/get-prefs.md +3 -3
- package/docs/examples/account/get-session.md +3 -3
- package/docs/examples/account/get-sessions.md +3 -3
- package/docs/examples/account/get.md +3 -3
- package/docs/examples/account/update-email.md +3 -3
- package/docs/examples/account/update-name.md +3 -3
- package/docs/examples/account/update-password.md +3 -3
- package/docs/examples/account/update-phone-verification.md +20 -0
- package/docs/examples/{database/create-ip-attribute.md → account/update-phone.md} +4 -4
- package/docs/examples/account/update-prefs.md +3 -3
- package/docs/examples/account/update-recovery.md +3 -3
- package/docs/examples/account/update-session.md +3 -3
- package/docs/examples/account/update-status.md +3 -3
- package/docs/examples/account/update-verification.md +3 -3
- package/docs/examples/avatars/get-browser.md +3 -3
- package/docs/examples/avatars/get-credit-card.md +3 -3
- package/docs/examples/avatars/get-favicon.md +3 -3
- package/docs/examples/avatars/get-flag.md +3 -3
- package/docs/examples/avatars/get-image.md +3 -3
- package/docs/examples/avatars/get-initials.md +3 -3
- package/docs/examples/avatars/get-q-r.md +3 -3
- package/docs/examples/databases/create-boolean-attribute.md +20 -0
- package/docs/examples/{database → databases}/create-collection.md +3 -3
- package/docs/examples/databases/create-document.md +20 -0
- package/docs/examples/{database/create-boolean-attribute.md → databases/create-email-attribute.md} +3 -3
- package/docs/examples/databases/create-enum-attribute.md +20 -0
- package/docs/examples/databases/create-float-attribute.md +20 -0
- package/docs/examples/{database → databases}/create-index.md +3 -3
- package/docs/examples/{database → databases}/create-integer-attribute.md +3 -3
- package/docs/examples/{database/create-float-attribute.md → databases/create-ip-attribute.md} +3 -3
- package/docs/examples/{database → databases}/create-string-attribute.md +3 -3
- package/docs/examples/{database → databases}/create-url-attribute.md +3 -3
- package/docs/examples/{database/delete-attribute.md → databases/create.md} +3 -3
- package/docs/examples/databases/delete-attribute.md +20 -0
- package/docs/examples/databases/delete-collection.md +20 -0
- package/docs/examples/databases/delete-document.md +20 -0
- package/docs/examples/{database/create-email-attribute.md → databases/delete-index.md} +3 -3
- package/docs/examples/{database/delete-index.md → databases/delete.md} +3 -3
- package/docs/examples/databases/get-attribute.md +20 -0
- package/docs/examples/{database → databases}/get-collection.md +3 -3
- package/docs/examples/{database/delete-document.md → databases/get-document.md} +3 -3
- package/docs/examples/{database/create-enum-attribute.md → databases/get-index.md} +3 -3
- package/docs/examples/{database/get-index.md → databases/get.md} +3 -3
- package/docs/examples/{database → databases}/list-attributes.md +3 -3
- package/docs/examples/databases/list-collections.md +20 -0
- package/docs/examples/{database/create-document.md → databases/list-documents.md} +3 -3
- package/docs/examples/{database → databases}/list-indexes.md +3 -3
- package/docs/examples/{database/list-documents.md → databases/list.md} +3 -3
- package/docs/examples/{database → databases}/update-collection.md +3 -3
- package/docs/examples/{database → databases}/update-document.md +3 -3
- package/docs/examples/databases/update.md +20 -0
- package/docs/examples/functions/create-deployment.md +3 -3
- package/docs/examples/functions/create-execution.md +3 -3
- package/docs/examples/functions/create.md +3 -3
- package/docs/examples/functions/delete-deployment.md +3 -3
- package/docs/examples/functions/delete.md +3 -3
- package/docs/examples/functions/get-deployment.md +3 -3
- package/docs/examples/functions/get-execution.md +3 -3
- package/docs/examples/functions/get.md +3 -3
- package/docs/examples/functions/list-deployments.md +3 -3
- package/docs/examples/functions/list-executions.md +3 -3
- package/docs/examples/functions/list-runtimes.md +3 -3
- package/docs/examples/functions/list.md +3 -3
- package/docs/examples/functions/retry-build.md +3 -3
- package/docs/examples/functions/update-deployment.md +3 -3
- package/docs/examples/functions/update.md +3 -3
- package/docs/examples/health/get-antivirus.md +3 -3
- package/docs/examples/health/get-cache.md +3 -3
- package/docs/examples/health/get-d-b.md +3 -3
- package/docs/examples/health/get-queue-certificates.md +3 -3
- package/docs/examples/health/get-queue-functions.md +3 -3
- package/docs/examples/health/get-queue-logs.md +3 -3
- package/docs/examples/health/get-queue-webhooks.md +3 -3
- package/docs/examples/health/get-storage-local.md +3 -3
- package/docs/examples/health/get-time.md +3 -3
- package/docs/examples/health/get.md +3 -3
- package/docs/examples/locale/get-continents.md +3 -3
- package/docs/examples/locale/get-countries-e-u.md +3 -3
- package/docs/examples/locale/get-countries-phones.md +3 -3
- package/docs/examples/locale/get-countries.md +3 -3
- package/docs/examples/locale/get-currencies.md +3 -3
- package/docs/examples/locale/get-languages.md +3 -3
- package/docs/examples/locale/get.md +3 -3
- package/docs/examples/storage/create-bucket.md +3 -3
- package/docs/examples/storage/create-file.md +3 -3
- package/docs/examples/storage/delete-bucket.md +3 -3
- package/docs/examples/storage/delete-file.md +3 -3
- package/docs/examples/storage/get-bucket.md +3 -3
- package/docs/examples/storage/get-file-download.md +3 -3
- package/docs/examples/storage/get-file-preview.md +3 -3
- package/docs/examples/storage/get-file-view.md +3 -3
- package/docs/examples/storage/get-file.md +3 -3
- package/docs/examples/storage/list-buckets.md +3 -3
- package/docs/examples/storage/list-files.md +3 -3
- package/docs/examples/storage/update-bucket.md +3 -3
- package/docs/examples/storage/update-file.md +3 -3
- package/docs/examples/teams/create-membership.md +3 -3
- package/docs/examples/teams/create.md +3 -3
- package/docs/examples/teams/delete-membership.md +3 -3
- package/docs/examples/teams/delete.md +3 -3
- package/docs/examples/teams/get-membership.md +3 -3
- package/docs/examples/teams/get-memberships.md +3 -3
- package/docs/examples/teams/get.md +3 -3
- package/docs/examples/teams/list.md +3 -3
- package/docs/examples/teams/update-membership-roles.md +3 -3
- package/docs/examples/teams/update-membership-status.md +3 -3
- package/docs/examples/teams/update.md +3 -3
- package/docs/examples/users/create.md +3 -3
- package/docs/examples/users/delete-session.md +3 -3
- package/docs/examples/users/delete-sessions.md +3 -3
- package/docs/examples/users/delete.md +3 -3
- package/docs/examples/users/get-logs.md +3 -3
- package/docs/examples/users/get-memberships.md +3 -3
- package/docs/examples/users/get-prefs.md +3 -3
- package/docs/examples/users/get-sessions.md +3 -3
- package/docs/examples/users/get.md +3 -3
- package/docs/examples/users/list.md +3 -3
- package/docs/examples/{database/get-attribute.md → users/update-email-verification.md} +3 -3
- package/docs/examples/users/update-email.md +3 -3
- package/docs/examples/users/update-name.md +3 -3
- package/docs/examples/users/update-password.md +3 -3
- package/docs/examples/{database/delete-collection.md → users/update-phone-verification.md} +3 -3
- package/docs/examples/{database/list-collections.md → users/update-phone.md} +3 -3
- package/docs/examples/users/update-prefs.md +3 -3
- package/docs/examples/users/update-status.md +3 -3
- package/index.d.ts +296 -121
- package/index.js +4 -2
- package/lib/client.js +9 -3
- package/lib/inputFile.js +47 -0
- package/lib/services/account.js +103 -2
- package/lib/services/avatars.js +2 -0
- package/lib/services/{database.js → databases.js} +183 -87
- package/lib/services/functions.js +99 -41
- package/lib/services/health.js +2 -0
- package/lib/services/locale.js +2 -0
- package/lib/services/storage.js +108 -50
- package/lib/services/teams.js +2 -0
- package/lib/services/users.js +65 -1
- package/package.json +1 -1
- package/docs/examples/database/get-document.md +0 -20
- package/docs/examples/users/update-verification.md +0 -20
|
@@ -2,9 +2,9 @@ const sdk = require('node-appwrite');
|
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
|
|
4
4
|
// Init SDK
|
|
5
|
-
|
|
5
|
+
const client = new sdk.Client();
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const storage = new sdk.Storage(client);
|
|
8
8
|
|
|
9
9
|
client
|
|
10
10
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -12,7 +12,7 @@ client
|
|
|
12
12
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
13
13
|
;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png');
|
|
16
16
|
|
|
17
17
|
promise.then(function (response) {
|
|
18
18
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.deleteBucket('[BUCKET_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.getBucket('[BUCKET_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.getFileView('[BUCKET_ID]', '[FILE_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.listBuckets();
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.listFiles('[BUCKET_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.updateBucket('[BUCKET_ID]', '[NAME]', 'file');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const storage = new sdk.Storage(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = storage.updateFile('[BUCKET_ID]', '[FILE_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.create('[TEAM_ID]', '[NAME]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.delete('[TEAM_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.getMemberships('[TEAM_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.get('[TEAM_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.list();
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []);
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const teams = new sdk.Teams(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = teams.update('[TEAM_ID]', '[NAME]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.create('[USER_ID]', 'email@example.com', 'password');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.deleteSession('[USER_ID]', '[SESSION_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.deleteSessions('[USER_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.delete('[USER_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.getLogs('[USER_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.getMemberships('[USER_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
3
|
// Init SDK
|
|
4
|
-
|
|
4
|
+
const client = new sdk.Client();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const users = new sdk.Users(client);
|
|
7
7
|
|
|
8
8
|
client
|
|
9
9
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const promise = users.getPrefs('[USER_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|