node-appwrite 6.0.0 → 7.0.2
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 +288 -97
- 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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {});
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
package/docs/examples/{database/create-boolean-attribute.md → databases/create-email-attribute.md}
RENAMED
|
@@ -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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.createEmailAttribute('[COLLECTION_ID]', '', false);
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.createEnumAttribute('[COLLECTION_ID]', '', [], false);
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.createFloatAttribute('[COLLECTION_ID]', '', false);
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.createIndex('[COLLECTION_ID]', '', 'key', []);
|
|
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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.createIntegerAttribute('[COLLECTION_ID]', '', false);
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
package/docs/examples/{database/create-float-attribute.md → databases/create-ip-attribute.md}
RENAMED
|
@@ -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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.createIpAttribute('[COLLECTION_ID]', '', false);
|
|
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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.createStringAttribute('[COLLECTION_ID]', '', 1, false);
|
|
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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.createUrlAttribute('[COLLECTION_ID]', '', false);
|
|
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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.create('[NAME]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.deleteAttribute('[COLLECTION_ID]', '');
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.deleteCollection('[COLLECTION_ID]');
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]');
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.deleteIndex('[COLLECTION_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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.delete();
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.getAttribute('[COLLECTION_ID]', '');
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.getCollection('[COLLECTION_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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.getDocument('[COLLECTION_ID]', '[DOCUMENT_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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.getIndex('[COLLECTION_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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.get();
|
|
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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.listAttributes('[COLLECTION_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.listCollections();
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
});
|
|
@@ -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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.listDocuments('[COLLECTION_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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.listIndexes('[COLLECTION_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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.updateCollection('[COLLECTION_ID]', '[NAME]', 'document');
|
|
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 databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
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 = databases.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
// Init SDK
|
|
4
|
+
const client = new sdk.Client();
|
|
5
|
+
|
|
6
|
+
const databases = new sdk.Databases(client, '[DATABASE_ID]');
|
|
7
|
+
|
|
8
|
+
client
|
|
9
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
10
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const promise = databases.update('[NAME]');
|
|
15
|
+
|
|
16
|
+
promise.then(function (response) {
|
|
17
|
+
console.log(response);
|
|
18
|
+
}, function (error) {
|
|
19
|
+
console.log(error);
|
|
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 functions = new sdk.Functions(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 = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false);
|
|
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 functions = new sdk.Functions(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 = functions.createExecution('[FUNCTION_ID]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|