node-appwrite 11.1.0 → 12.0.0-rc.4
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/LICENSE +1 -1
- package/README.md +2 -2
- package/docs/examples/account/add-authenticator.md +12 -0
- package/docs/examples/account/create-anonymous-session.md +9 -0
- package/docs/examples/account/create-email-password-session.md +12 -0
- package/docs/examples/account/create-email-token.md +13 -0
- package/docs/examples/account/create-j-w-t.md +9 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +14 -0
- package/docs/examples/account/create-o-auth2session.md +15 -0
- package/docs/examples/account/create-phone-token.md +12 -0
- package/docs/examples/account/create-phone-verification.md +4 -14
- package/docs/examples/account/create-recovery.md +7 -14
- package/docs/examples/account/create-session.md +12 -0
- package/docs/examples/account/create-verification.md +6 -14
- package/docs/examples/account/create.md +14 -0
- package/docs/examples/account/create2f-a-challenge.md +11 -0
- package/docs/examples/account/delete-authenticator.md +13 -0
- package/docs/examples/account/delete-identity.md +6 -14
- package/docs/examples/account/delete-session.md +6 -14
- package/docs/examples/account/delete-sessions.md +4 -14
- package/docs/examples/account/get-prefs.md +4 -14
- package/docs/examples/account/get-session.md +6 -14
- package/docs/examples/account/get.md +4 -14
- package/docs/examples/account/list-factors.md +10 -0
- package/docs/examples/account/list-identities.md +6 -14
- package/docs/examples/account/list-logs.md +6 -14
- package/docs/examples/account/list-sessions.md +4 -14
- package/docs/examples/account/update-challenge.md +13 -0
- package/docs/examples/account/update-email.md +7 -14
- package/docs/examples/account/update-m-f-a.md +12 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +12 -0
- package/docs/examples/account/update-name.md +6 -14
- package/docs/examples/account/update-password.md +7 -14
- package/docs/examples/account/update-phone-verification.md +7 -14
- package/docs/examples/account/update-phone.md +7 -14
- package/docs/examples/account/update-prefs.md +6 -14
- package/docs/examples/account/update-recovery.md +8 -14
- package/docs/examples/account/update-session.md +6 -14
- package/docs/examples/account/update-status.md +4 -14
- package/docs/examples/account/update-verification.md +7 -14
- package/docs/examples/account/verify-authenticator.md +13 -0
- package/docs/examples/avatars/get-browser.md +9 -14
- package/docs/examples/avatars/get-credit-card.md +9 -14
- package/docs/examples/avatars/get-favicon.md +6 -14
- package/docs/examples/avatars/get-flag.md +9 -14
- package/docs/examples/avatars/get-image.md +8 -14
- package/docs/examples/avatars/get-initials.md +9 -14
- package/docs/examples/avatars/get-q-r.md +9 -14
- package/docs/examples/databases/create-boolean-attribute.md +11 -14
- package/docs/examples/databases/create-collection.md +11 -14
- package/docs/examples/databases/create-datetime-attribute.md +11 -14
- package/docs/examples/databases/create-document.md +10 -14
- package/docs/examples/databases/create-email-attribute.md +11 -14
- package/docs/examples/databases/create-enum-attribute.md +12 -14
- package/docs/examples/databases/create-float-attribute.md +13 -14
- package/docs/examples/databases/create-index.md +11 -14
- package/docs/examples/databases/create-integer-attribute.md +13 -14
- package/docs/examples/databases/create-ip-attribute.md +11 -14
- package/docs/examples/databases/create-relationship-attribute.md +13 -14
- package/docs/examples/databases/create-string-attribute.md +13 -14
- package/docs/examples/databases/create-url-attribute.md +11 -14
- package/docs/examples/databases/create.md +8 -14
- package/docs/examples/databases/delete-attribute.md +8 -14
- package/docs/examples/databases/delete-collection.md +7 -14
- package/docs/examples/databases/delete-document.md +8 -14
- package/docs/examples/databases/delete-index.md +8 -14
- package/docs/examples/databases/delete.md +6 -14
- package/docs/examples/databases/get-attribute.md +8 -14
- package/docs/examples/databases/get-collection.md +7 -14
- package/docs/examples/databases/get-document.md +9 -14
- package/docs/examples/databases/get-index.md +8 -14
- package/docs/examples/databases/get.md +6 -14
- package/docs/examples/databases/list-attributes.md +8 -14
- package/docs/examples/databases/list-collections.md +8 -14
- package/docs/examples/databases/list-documents.md +8 -14
- package/docs/examples/databases/list-indexes.md +8 -14
- package/docs/examples/databases/list.md +7 -14
- package/docs/examples/databases/update-boolean-attribute.md +10 -14
- package/docs/examples/databases/update-collection.md +11 -14
- package/docs/examples/databases/update-datetime-attribute.md +10 -14
- package/docs/examples/databases/update-document.md +10 -14
- package/docs/examples/databases/update-email-attribute.md +10 -14
- package/docs/examples/databases/update-enum-attribute.md +11 -14
- package/docs/examples/databases/update-float-attribute.md +12 -14
- package/docs/examples/databases/update-integer-attribute.md +12 -14
- package/docs/examples/databases/update-ip-attribute.md +10 -14
- package/docs/examples/databases/update-relationship-attribute.md +9 -14
- package/docs/examples/databases/update-string-attribute.md +10 -14
- package/docs/examples/databases/update-url-attribute.md +10 -14
- package/docs/examples/databases/update.md +8 -14
- package/docs/examples/functions/create-build.md +8 -14
- package/docs/examples/functions/create-deployment.md +10 -14
- package/docs/examples/functions/create-execution.md +11 -14
- package/docs/examples/functions/create-variable.md +8 -14
- package/docs/examples/functions/create.md +25 -14
- package/docs/examples/functions/delete-deployment.md +7 -14
- package/docs/examples/functions/delete-variable.md +7 -14
- package/docs/examples/functions/delete.md +6 -14
- package/docs/examples/functions/download-deployment.md +7 -14
- package/docs/examples/functions/get-deployment.md +7 -14
- package/docs/examples/functions/get-execution.md +7 -14
- package/docs/examples/functions/get-variable.md +7 -14
- package/docs/examples/functions/get.md +6 -14
- package/docs/examples/functions/list-deployments.md +8 -14
- package/docs/examples/functions/list-executions.md +8 -14
- package/docs/examples/functions/list-runtimes.md +4 -14
- package/docs/examples/functions/list-variables.md +6 -14
- package/docs/examples/functions/list.md +7 -14
- package/docs/examples/functions/update-deployment.md +7 -14
- package/docs/examples/functions/update-variable.md +9 -14
- package/docs/examples/functions/update.md +21 -14
- package/docs/examples/graphql/mutation.md +6 -14
- package/docs/examples/graphql/query.md +6 -14
- package/docs/examples/health/get-antivirus.md +4 -14
- package/docs/examples/health/get-cache.md +4 -14
- package/docs/examples/health/get-certificate.md +12 -0
- package/docs/examples/health/get-d-b.md +4 -14
- package/docs/examples/health/get-failed-jobs.md +13 -0
- package/docs/examples/health/get-pub-sub.md +4 -14
- package/docs/examples/health/get-queue-builds.md +6 -14
- package/docs/examples/health/get-queue-certificates.md +6 -14
- package/docs/examples/health/get-queue-databases.md +7 -14
- package/docs/examples/health/get-queue-deletes.md +6 -14
- package/docs/examples/health/get-queue-functions.md +6 -14
- package/docs/examples/health/get-queue-logs.md +6 -14
- package/docs/examples/health/get-queue-mails.md +6 -14
- package/docs/examples/health/get-queue-messaging.md +6 -14
- package/docs/examples/health/get-queue-migrations.md +6 -14
- package/docs/examples/health/get-queue-webhooks.md +6 -14
- package/docs/examples/health/get-queue.md +4 -14
- package/docs/examples/health/get-storage-local.md +4 -14
- package/docs/examples/health/get-time.md +4 -14
- package/docs/examples/health/get.md +4 -14
- package/docs/examples/locale/get.md +4 -14
- package/docs/examples/locale/list-codes.md +4 -14
- package/docs/examples/locale/list-continents.md +4 -14
- package/docs/examples/locale/list-countries-e-u.md +4 -14
- package/docs/examples/locale/list-countries-phones.md +4 -14
- package/docs/examples/locale/list-countries.md +4 -14
- package/docs/examples/locale/list-currencies.md +4 -14
- package/docs/examples/locale/list-languages.md +4 -14
- package/docs/examples/messaging/create-apns-provider.md +18 -0
- package/docs/examples/messaging/create-email.md +23 -0
- package/docs/examples/messaging/create-fcm-provider.md +15 -0
- package/docs/examples/messaging/create-mailgun-provider.md +21 -0
- package/docs/examples/messaging/create-msg91provider.md +17 -0
- package/docs/examples/messaging/create-push.md +27 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +19 -0
- package/docs/examples/messaging/create-sms.md +18 -0
- package/docs/examples/messaging/create-smtp-provider.md +25 -0
- package/docs/examples/messaging/create-subscriber.md +14 -0
- package/docs/examples/messaging/create-telesign-provider.md +17 -0
- package/docs/examples/messaging/create-textmagic-provider.md +17 -0
- package/docs/examples/messaging/create-topic.md +14 -0
- package/docs/examples/messaging/create-twilio-provider.md +17 -0
- package/docs/examples/messaging/create-vonage-provider.md +17 -0
- package/docs/examples/messaging/delete-provider.md +12 -0
- package/docs/examples/messaging/delete-subscriber.md +13 -0
- package/docs/examples/messaging/delete-topic.md +12 -0
- package/docs/examples/messaging/delete.md +12 -0
- package/docs/examples/messaging/get-message.md +12 -0
- package/docs/examples/messaging/get-provider.md +12 -0
- package/docs/examples/messaging/get-subscriber.md +13 -0
- package/docs/examples/messaging/get-topic.md +12 -0
- package/docs/examples/messaging/list-message-logs.md +13 -0
- package/docs/examples/messaging/list-messages.md +13 -0
- package/docs/examples/messaging/list-provider-logs.md +13 -0
- package/docs/examples/messaging/list-providers.md +13 -0
- package/docs/examples/messaging/list-subscriber-logs.md +13 -0
- package/docs/examples/messaging/list-subscribers.md +14 -0
- package/docs/examples/messaging/list-targets.md +13 -0
- package/docs/examples/messaging/list-topic-logs.md +13 -0
- package/docs/examples/messaging/list-topics.md +13 -0
- package/docs/examples/messaging/update-a-p-n-s-provider.md +18 -0
- package/docs/examples/messaging/update-email.md +22 -0
- package/docs/examples/messaging/update-f-c-m-provider.md +15 -0
- package/docs/examples/messaging/update-mailgun-provider.md +21 -0
- package/docs/examples/messaging/update-msg91provider.md +17 -0
- package/docs/examples/messaging/update-push.md +27 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +19 -0
- package/docs/examples/messaging/update-sms.md +18 -0
- package/docs/examples/messaging/update-smtp-provider.md +25 -0
- package/docs/examples/messaging/update-telesign-provider.md +17 -0
- package/docs/examples/messaging/update-textmagic-provider.md +17 -0
- package/docs/examples/messaging/update-topic.md +13 -0
- package/docs/examples/messaging/update-twilio-provider.md +17 -0
- package/docs/examples/messaging/update-vonage-provider.md +17 -0
- package/docs/examples/storage/create-bucket.md +15 -14
- package/docs/examples/storage/create-file.md +9 -14
- package/docs/examples/storage/delete-bucket.md +6 -14
- package/docs/examples/storage/delete-file.md +7 -14
- package/docs/examples/storage/get-bucket.md +6 -14
- package/docs/examples/storage/get-file-download.md +7 -14
- package/docs/examples/storage/get-file-preview.md +18 -14
- package/docs/examples/storage/get-file-view.md +7 -14
- package/docs/examples/storage/get-file.md +7 -14
- package/docs/examples/storage/list-buckets.md +7 -14
- package/docs/examples/storage/list-files.md +8 -14
- package/docs/examples/storage/update-bucket.md +15 -14
- package/docs/examples/storage/update-file.md +9 -14
- package/docs/examples/teams/create-membership.md +12 -14
- package/docs/examples/teams/create.md +8 -14
- package/docs/examples/teams/delete-membership.md +7 -14
- package/docs/examples/teams/delete.md +6 -14
- package/docs/examples/teams/get-membership.md +7 -14
- package/docs/examples/teams/get-prefs.md +6 -14
- package/docs/examples/teams/get.md +6 -14
- package/docs/examples/teams/list-memberships.md +8 -14
- package/docs/examples/teams/list.md +7 -14
- package/docs/examples/teams/update-membership-status.md +9 -14
- package/docs/examples/teams/update-membership.md +8 -14
- package/docs/examples/teams/update-name.md +7 -14
- package/docs/examples/teams/update-prefs.md +7 -14
- package/docs/examples/users/create-argon2user.md +9 -14
- package/docs/examples/users/create-bcrypt-user.md +9 -14
- package/docs/examples/users/create-m-d5user.md +9 -14
- package/docs/examples/users/create-p-h-pass-user.md +9 -14
- package/docs/examples/users/create-s-h-a-user.md +10 -14
- package/docs/examples/users/create-scrypt-modified-user.md +12 -14
- package/docs/examples/users/create-scrypt-user.md +14 -14
- package/docs/examples/users/create-session.md +12 -0
- package/docs/examples/users/create-target.md +17 -0
- package/docs/examples/users/create-token.md +14 -0
- package/docs/examples/users/create.md +10 -14
- package/docs/examples/users/delete-authenticator.md +14 -0
- package/docs/examples/users/delete-identity.md +6 -14
- package/docs/examples/users/delete-session.md +7 -14
- package/docs/examples/users/delete-sessions.md +6 -14
- package/docs/examples/users/delete-target.md +13 -0
- package/docs/examples/users/delete.md +6 -14
- package/docs/examples/users/get-prefs.md +6 -14
- package/docs/examples/users/get-target.md +13 -0
- package/docs/examples/users/get.md +6 -14
- package/docs/examples/users/list-factors.md +12 -0
- package/docs/examples/users/list-identities.md +7 -14
- package/docs/examples/users/list-logs.md +7 -14
- package/docs/examples/users/list-memberships.md +6 -14
- package/docs/examples/users/list-sessions.md +6 -14
- package/docs/examples/users/list-targets.md +13 -0
- package/docs/examples/users/list.md +7 -14
- package/docs/examples/users/update-email-verification.md +7 -14
- package/docs/examples/users/update-email.md +7 -14
- package/docs/examples/users/update-labels.md +7 -14
- package/docs/examples/users/update-mfa.md +13 -0
- package/docs/examples/users/update-name.md +7 -14
- package/docs/examples/users/update-password.md +7 -14
- package/docs/examples/users/update-phone-verification.md +7 -14
- package/docs/examples/users/update-phone.md +7 -14
- package/docs/examples/users/update-prefs.md +7 -14
- package/docs/examples/users/update-status.md +7 -14
- package/docs/examples/users/update-target.md +16 -0
- package/index.d.ts +2026 -138
- package/index.js +40 -0
- package/lib/client.js +122 -65
- package/lib/enums/authentication-factor.js +7 -0
- package/lib/enums/authenticator-type.js +5 -0
- package/lib/enums/browser.js +18 -0
- package/lib/enums/compression.js +7 -0
- package/lib/enums/credit-card.js +20 -0
- package/lib/enums/encryption.js +7 -0
- package/lib/enums/execution-method.js +10 -0
- package/lib/enums/flag.js +198 -0
- package/lib/enums/image-format.js +9 -0
- package/lib/enums/image-gravity.js +13 -0
- package/lib/enums/index-type.js +8 -0
- package/lib/enums/message-status.js +7 -0
- package/lib/enums/messaging-provider-type.js +7 -0
- package/lib/enums/name.js +16 -0
- package/lib/enums/o-auth-provider.js +43 -0
- package/lib/enums/password-hash.js +15 -0
- package/lib/enums/relation-mutate.js +7 -0
- package/lib/enums/relationship-type.js +8 -0
- package/lib/enums/runtime.js +40 -0
- package/lib/inputFile.js +88 -16
- package/lib/query.js +56 -38
- package/lib/services/account.js +605 -16
- package/lib/services/avatars.js +5 -3
- package/lib/services/databases.js +6 -4
- package/lib/services/functions.js +51 -87
- package/lib/services/graphql.js +2 -0
- package/lib/services/health.js +52 -0
- package/lib/services/locale.js +2 -0
- package/lib/services/messaging.js +2198 -0
- package/lib/services/storage.js +52 -88
- package/lib/services/teams.js +2 -0
- package/lib/services/users.js +323 -3
- package/package.json +2 -3
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
|
|
2
2
|
All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Appwrite Node.js SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
8
8
|
|
|
9
|
-
**This SDK is compatible with Appwrite server version 1.
|
|
9
|
+
**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).**
|
|
10
10
|
|
|
11
11
|
> This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code.
|
|
12
12
|
If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
7
|
+
|
|
8
|
+
const account = new sdk.Account(client);
|
|
9
|
+
|
|
10
|
+
const response = await account.addAuthenticator(
|
|
11
|
+
sdk.AuthenticatorType.Totp // type
|
|
12
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createAnonymousSession();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createEmailPasswordSession(
|
|
10
|
+
'email@example.com', // email
|
|
11
|
+
'password' // password
|
|
12
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createEmailToken(
|
|
10
|
+
'[USER_ID]', // userId
|
|
11
|
+
'email@example.com', // email
|
|
12
|
+
false // phrase (optional)
|
|
13
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createJWT();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createMagicURLToken(
|
|
10
|
+
'[USER_ID]', // userId
|
|
11
|
+
'email@example.com', // email
|
|
12
|
+
'https://example.com', // url (optional)
|
|
13
|
+
false // phrase (optional)
|
|
14
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createOAuth2Session(
|
|
10
|
+
sdk.OAuthProvider.Amazon, // provider
|
|
11
|
+
'https://example.com', // success (optional)
|
|
12
|
+
'https://example.com', // failure (optional)
|
|
13
|
+
false, // token (optional)
|
|
14
|
+
[] // scopes (optional)
|
|
15
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createPhoneToken(
|
|
10
|
+
'[USER_ID]', // userId
|
|
11
|
+
'+12065550100' // phone
|
|
12
|
+
);
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
console.log(response);
|
|
18
|
-
}, function (error) {
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.createPhoneVerification();
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
10
|
+
const response = await account.createRecovery(
|
|
11
|
+
'email@example.com', // email
|
|
12
|
+
'https://example.com' // url
|
|
13
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.createSession(
|
|
10
|
+
'[USER_ID]', // userId
|
|
11
|
+
'[SECRET]' // secret
|
|
12
|
+
);
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.createVerification(
|
|
11
|
+
'https://example.com' // url
|
|
12
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.create(
|
|
10
|
+
'[USER_ID]', // userId
|
|
11
|
+
'email@example.com', // email
|
|
12
|
+
'', // password
|
|
13
|
+
'[NAME]' // name (optional)
|
|
14
|
+
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.create2FAChallenge(
|
|
10
|
+
sdk.AuthenticationFactor.Totp // factor
|
|
11
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
7
|
+
|
|
8
|
+
const account = new sdk.Account(client);
|
|
9
|
+
|
|
10
|
+
const response = await account.deleteAuthenticator(
|
|
11
|
+
sdk.AuthenticatorType.Totp, // type
|
|
12
|
+
'[OTP]' // otp
|
|
13
|
+
);
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.deleteIdentity(
|
|
11
|
+
'[IDENTITY_ID]' // identityId
|
|
12
|
+
);
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.deleteSession(
|
|
11
|
+
'[SESSION_ID]' // sessionId
|
|
12
|
+
);
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
console.log(response);
|
|
18
|
-
}, function (error) {
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.deleteSessions();
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
console.log(response);
|
|
18
|
-
}, function (error) {
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.getPrefs();
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.getSession(
|
|
11
|
+
'[SESSION_ID]' // sessionId
|
|
12
|
+
);
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
console.log(response);
|
|
18
|
-
}, function (error) {
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.get();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
7
|
+
|
|
8
|
+
const account = new sdk.Account(client);
|
|
9
|
+
|
|
10
|
+
const response = await account.listFactors();
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.listIdentities(
|
|
11
|
+
[] // queries (optional)
|
|
12
|
+
);
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.listLogs(
|
|
11
|
+
[] // queries (optional)
|
|
12
|
+
);
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
console.log(response);
|
|
18
|
-
}, function (error) {
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.listSessions();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
7
|
+
|
|
8
|
+
const account = new sdk.Account(client);
|
|
9
|
+
|
|
10
|
+
const response = await account.updateChallenge(
|
|
11
|
+
'[CHALLENGE_ID]', // challengeId
|
|
12
|
+
'[OTP]' // otp
|
|
13
|
+
);
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
10
|
+
const response = await account.updateEmail(
|
|
11
|
+
'email@example.com', // email
|
|
12
|
+
'password' // password
|
|
13
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
7
|
+
|
|
8
|
+
const account = new sdk.Account(client);
|
|
9
|
+
|
|
10
|
+
const response = await account.updateMFA(
|
|
11
|
+
false // mfa
|
|
12
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sdk = require('node-appwrite');
|
|
2
|
+
|
|
3
|
+
const client = new sdk.Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new sdk.Account(client);
|
|
8
|
+
|
|
9
|
+
const response = await account.updateMagicURLSession(
|
|
10
|
+
'[USER_ID]', // userId
|
|
11
|
+
'[SECRET]' // secret
|
|
12
|
+
);
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
const sdk = require('node-appwrite');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = new sdk.Client();
|
|
5
|
-
|
|
6
|
-
const account = new sdk.Account(client);
|
|
7
|
-
|
|
8
|
-
client
|
|
3
|
+
const client = new sdk.Client()
|
|
9
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
10
5
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
11
|
-
.
|
|
12
|
-
;
|
|
6
|
+
.setSession(''); // The user session to authenticate with
|
|
13
7
|
|
|
14
|
-
const
|
|
8
|
+
const account = new sdk.Account(client);
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log(error);
|
|
20
|
-
});
|
|
10
|
+
const response = await account.updateName(
|
|
11
|
+
'[NAME]' // name
|
|
12
|
+
);
|